1
0
Fork 0
dotfiles/.local/bin/remaps

18 lines
461 B
Bash
Executable File

#!/bin/sh
DISPLAY=:0
XKBDIR="${XDG_CONFIG_HOME:-$HOME/.config}/X11/xkb"
XKBMAPFILE="$XKBDIR/keymap/$(hostname --fqdn)"
[ -r "$XKBMAPFILE" ] || XKBMAPFILE="$XKBDIR/keymap/default"
xkbcomp -I"$XKBDIR" "$XKBMAPFILE" "${DISPLAY%%.*}" 1>/dev/null 2>&1
unset XKBDIR XKBMAPFILE
xset r rate 300 50
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock
killall xcape 2>/dev/null
xcape -e 'Super_L=Escape'
sleep 0.03
[ "$1" != "-n" ] && pkill -RTMIN+15 dwmblocks