#!/bin/sh mapdir="${KEYMAPS_DIR:-$HOME/.local/bin/keymaps}" xset r rate 300 50 killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape' xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock eval "$mapdir/$(ls "$mapdir" | dmenu -i -p 'Mapping: ')"