aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/swaykbd
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-04-03 02:16:35 +0300
committerYaroslav <contact@yaroslavps.com>2020-04-03 02:16:35 +0300
commitd001819487e0545ecc0c5b40b70793b8d5828a70 (patch)
tree424c1c17901219babb4d3824bd411d7ea3d0ab76 /dotfiles/.local/bin/swaykbd
parentafb5f74cccf20d38a7170349e173d658178b51ad (diff)
downloadswayrice-d001819487e0545ecc0c5b40b70793b8d5828a70.tar.gz
swayrice-d001819487e0545ecc0c5b40b70793b8d5828a70.zip
even better kbd layout script
Diffstat (limited to 'dotfiles/.local/bin/swaykbd')
-rwxr-xr-xdotfiles/.local/bin/swaykbd11
1 files changed, 6 insertions, 5 deletions
diff --git a/dotfiles/.local/bin/swaykbd b/dotfiles/.local/bin/swaykbd
index b0fc34a..d90f78c 100755
--- a/dotfiles/.local/bin/swaykbd
+++ b/dotfiles/.local/bin/swaykbd
@@ -1,6 +1,9 @@
#!/bin/sh
-swaymsg -r -t get_inputs | grep "xkb_active_layout_name" | awk -F '"' '{print $4}' | sed 's/ (US)//g'
+swaymsg -r -t get_inputs | \
+ grep "xkb_active_layout_name" | \
+ awk -F '"' '{print $4}' | \
+ sed 's/English (US)/🇺🇸 English/g;s/Spanish/🇲🇽 Español/g;s/Russian/🇷🇺 Русский/g' | head -1
swaymsg \
--type subscribe \
@@ -13,8 +16,6 @@ swaymsg \
select(.change == "xkb_layout") |
.input.xkb_active_layout_name |
sub(" \\(US\\)"; "")
- '
+ ' | \
+ sed --unbuffered 's/English/🇺🇸 English/g;s/Spanish/🇲🇽 Español/g;s/Russian/🇷🇺 Русский/g'
-case $BLOCK_BUTTON in
- 1) echo "TO-DO" ;;
-esac;