dotfiles/.i3blocks/bepo
2021-08-12 20:26:12 +02:00

14 lines
491 B
Bash
Executable file

#!/bin/bash
{
runtime="${XDG_RUNTIME_DIR}/i3blocks"
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
[[ ! -f "$runtime/keyboard" ]] && [[ -z "$button" ]] && button=1
case $button in
1) swaymsg input "type:keyboard" xkb_variant bepo_afnor; echo "bépo" > "$runtime/keyboard";;
2) swaymsg input "type:keyboard" xkb_variant oss; echo "oss " > "$runtime/keyboard";;
3) swaymsg input "type:keyboard" xkb_variant us; echo "qwer" > "$runtime/keyboard";;
esac
} &>/dev/null
cat "$runtime/keyboard"