View previous topic :: View next topic |
Author |
Message |
jasu n00b
Joined: 23 May 2022 Posts: 53
|
Posted: Sun Apr 09, 2023 11:36 am Post subject: Way to remap keys in Wayland with package(s) found in repos |
|
|
Hi,
I have a need to remap two keys:
- caps lock should act as esc when tapped but ctrl when hold
- spacebar should act as a space when tapped but shift when hold
It seems like interception-tools and its plugins (https://gitlab.com/interception/linux/tools) would be a perfect solution but it is not available in the repos and it has many parts/tools so I would not like to manually keep those updated etc. Apparently there are some other tools for the job as well like kmonad and hawck but those are also no in the repos.
I would greatly appreciate any suggestions how I could achieve those remappings, preferably with something that is available in the repos.
I am using Hyprland as window manager. |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1659
|
Posted: Sun Apr 09, 2023 4:37 pm Post subject: |
|
|
Here are your ebuilds. When a new version comes, if you need it, just copy the files with the new version. All the rest is done by portage. I only had to change the source dir location...
sys-apps/interception-tools-0.6.8.ebuild:
// an ebuild with fixed dependencies can be found two posts below.
sys-apps/caps2esc-0.3.2.ebuild
Code: | # Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Makes CAPSLOCK CTRL when key-chording and ESC when pressed alone"
HOMEPAGE="https://gitlab.com/interception/linux/plugins/caps2esc"
SRC_URI="https://gitlab.com/interception/linux/plugins/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.gz"
inherit cmake
LICENSE="GPLv3"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="sys-apps/interception-tools"
RDEPEND="${DEPEND}"
BDEPEND=""
S="${WORKDIR}/${PN}-v${PV}"
CMAKE_BUILD_TYPE="Release"
|
Just put them in your local repo.
If you need the other listed tools, it looks like you need to just copy and modify the ebuilds slightly.
Best Regards,
Georgi
Last edited by logrusx on Sat May 13, 2023 6:41 am; edited 2 times in total |
|
Back to top |
|
|
jasu n00b
Joined: 23 May 2022 Posts: 53
|
Posted: Thu May 11, 2023 9:14 pm Post subject: |
|
|
Thanks a lot! Those worked pretty much out of the box and solved my issues related to this. |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1659
|
Posted: Sat May 13, 2023 5:51 am Post subject: |
|
|
jasu wrote: | Thanks a lot! Those worked pretty much out of the box and solved my issues related to this. |
Happy to help. Now that I revisited the thread, I think interception-tools ebuild might be missing some dependencies.
Here's a better version with that fixed:
sys-apps/interception-tools-0.6.8.ebuild
//ebuild in the post below because it was missing systemd and openrc services installation.
Best Regards,
Georgi
Last edited by logrusx on Mon May 22, 2023 2:47 pm; edited 1 time in total |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1659
|
Posted: Mon May 22, 2023 2:46 pm Post subject: |
|
|
And because I'm not the brightest bulb, there's a version that installs systemd and operc services:
sys-apps/interception-tools-0.6.8.ebuild
Code: | # Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit systemd cmake
DESCRIPTION="A small set of utilities for operating on input events of evdev devices"
HOMEPAGE="https://gitlab.com/interception/linux/tools/-/tree/master/"
SRC_URI="https://gitlab.com/interception/linux/tools/-/archive/v${PV}/tools-v${PV}.tar.gz"
LICENSE="GPLv3"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="virtual/libudev:=
dev-libs/libevdev
dev-cpp/yaml-cpp:="
RDEPEND="${DEPEND}"
BDEPEND="dev-libs/boost
virtual/libc"
S="${WORKDIR}/tools-v${PV}"
CMAKE_BUILD_TYPE="Release"
src_install() {
cmake_src_install
systemd_dounit udevmon.service
doinitd udevmon.init
}
|
Best Regards,
Georgi |
|
Back to top |
|
|
|