nixos/nate/dotfiles/waybar/scripts/keyboard_layout.sh

17 lines
464 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2023-12-14 17:23:01 -07:00
entries="Default Colemak"
selected=$(printf '%s\n' $entries | wofi --conf=$HOME/.config/wofi/config.power --style=$HOME/.config/wofi/style.widgets.css | awk '{print tolower($1)}')
case $selected in
default)
swaymsg input type:keyboard xkb_layout "us"
swaymsg input type:keyboard xkb_variant '""'
;;
colemak)
swaymsg input type:keyboard xkb_layout "us"
swaymsg input type:keyboard xkb_variant "colemak_dh"
;;
esac