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
|
|
|
|
2022-02-26 22:43:20 +01:00
|
|
|
#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
|
2020-12-31 11:14:20 +01:00
|
|
|
case $button in
|
2023-11-04 02:40:02 +01:00
|
|
|
1) setxkbmap fr bepo_afnor; echo "bépo" > "$runtime/keyboard";;
|
|
|
|
#1) xmodmap ~/.Xmodmap; echo "bépo" > "$runtime/keyboard";;
|
2024-05-16 16:42:12 +02:00
|
|
|
2) setxkbmap fr us; echo "qwer" > "$runtime/keyboard";;
|
|
|
|
3) setxkbmap fr oss; echo "oss " > "$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"
|