From 2f05a92a22b5fa0b10989c245e3926fe25e3890e Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Fri, 26 Jan 2024 13:25:17 +0100 Subject: [PATCH] remaps improvements --- .local/bin/remaps | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.local/bin/remaps b/.local/bin/remaps index 70794c050..e60172db5 100755 --- a/.local/bin/remaps +++ b/.local/bin/remaps @@ -16,7 +16,7 @@ rotate() { } setmap() { - current="$(readlink keymap)" + current=${1:-$(readlink keymap)} xkbcomp "$current" "$DISPLAY" >/dev/null 2>&1 || return 1 xset r rate 300 50 xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock @@ -28,12 +28,17 @@ setmap() { cd "$MAP_DIR" || return 1 notifier="notify-send" -while getopts dqQ flag; do - case "$flag" in + +while + case "$1" in q) notifier=":" ;; d) setmap; return ;; + s) setmap "$2"; return ;; + l) ls "$MAP_DIR" | grep -i keymap ;; *) ;; esac -done + shift +do :; done + rotate setmap