Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Way to remap keys in Wayland with package(s) found in repos
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jasu
n00b
n00b


Joined: 23 May 2022
Posts: 53

PostPosted: Sun Apr 09, 2023 11:36 am    Post subject: Way to remap keys in Wayland with package(s) found in repos Reply with quote

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
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1584

PostPosted: Sun Apr 09, 2023 4:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
jasu
n00b
n00b


Joined: 23 May 2022
Posts: 53

PostPosted: Thu May 11, 2023 9:14 pm    Post subject: Reply with quote

Thanks a lot! Those worked pretty much out of the box and solved my issues related to this.
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1584

PostPosted: Sat May 13, 2023 5:51 am    Post subject: Reply with quote

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
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1584

PostPosted: Mon May 22, 2023 2:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum