nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

langmenu (410B)


      1 #!/bin/bash
      2 set -euo pipefail
      3 
      4 choice=$(echo -e "en\nsk" | dmenu "$@")
      5 [ -z "$choice" ] && exit 0
      6 
      7 case "$choice" in
      8 en)
      9 	if [ -n "${WAYLAND_DISPLAY:-}" ]; then
     10 		riverctl keyboard-layout us
     11 	else
     12 		setxkbmap us
     13 	fi
     14 	;;
     15 sk)
     16 	if [ -n "${WAYLAND_DISPLAY:-}" ]; then
     17 		riverctl keyboard-layout -variant qwerty sk
     18 	else
     19 		setxkbmap sk qwerty
     20 	fi
     21 	;;
     22 *)
     23 	echo "Error: Unknown layout '$choice'" >&2
     24 	exit 1
     25 	;;
     26 esac