From 32a896ffdff7c61da10a81b669e0c1aff9a6ea99 Mon Sep 17 00:00:00 2001 From: snailed Date: Mon, 6 Feb 2023 21:11:01 +0000 Subject: [PATCH 1/2] Make xprofile automatically start remapd --- .config/x11/xprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/x11/xprofile b/.config/x11/xprofile index 0e22628..affa8de 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -8,7 +8,7 @@ setbg & # set the background with the `setbg` script #xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup remaps & # run the remaps script, switching caps/esc and more; check it for more info -autostart="mpd xcompmgr dunst unclutter pipewire" +autostart="mpd xcompmgr dunst unclutter pipewire remapd" for program in $autostart; do pidof -s "$program" || "$program" & From 53a66c6254c7a5d6000eee2b3a6b02d340d5511e Mon Sep 17 00:00:00 2001 From: snailed Date: Mon, 6 Feb 2023 21:15:02 +0000 Subject: [PATCH 2/2] Create remapd This script will automatically run remaps when it detects a line in dmesg that contains "input:" --- .local/bin/remapd | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .local/bin/remapd diff --git a/.local/bin/remapd b/.local/bin/remapd new file mode 100644 index 0000000..93a23f6 --- /dev/null +++ b/.local/bin/remapd @@ -0,0 +1,6 @@ +#!/bin/sh +while : ; do + dmesg -W -f kern | grep "input:" -q + sleep 1 + remaps +done