dotfiles/.i3blocks/bepo

15 lines
491 B
Text
Raw Normal View History

2020-09-15 02:50:48 +02:00
#!/bin/bash
2021-08-12 20:26:12 +02:00
{
2020-09-15 02:50:48 +02:00
runtime="${XDG_RUNTIME_DIR}/i3blocks"
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
2021-01-15 21:59:21 +01:00
[[ ! -f "$runtime/keyboard" ]] && [[ -z "$button" ]] && button=1
2020-09-15 02:50:48 +02:00
2020-12-31 11:14:20 +01:00
case $button in
2021-08-12 20:26:12 +02:00
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";;
2020-12-31 11:14:20 +01:00
esac
2021-08-12 20:26:12 +02:00
} &>/dev/null
2020-12-31 11:14:20 +01:00
cat "$runtime/keyboard"