From a344407b615f272b8eba943b3a36c40dae0b2cb8 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 13 Jan 2022 08:53:35 +0100 Subject: added custom keyboard layout indicator script for polybar --- .config/i3/autostart | 1 + .config/polybar/config | 8 +++++++- .local/share/bin/kbindicator | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 .local/share/bin/kbindicator diff --git a/.config/i3/autostart b/.config/i3/autostart index 7d4bd3c..3f5d744 100644 --- a/.config/i3/autostart +++ b/.config/i3/autostart @@ -10,6 +10,7 @@ dunst & flashfocus & xset r rate 250 40 autocutsel & +ibus-daemon -drxR & # bw unlock --raw | keyctl padd user bw_session @u sh ~/.config/i3/unlock_bitwarden & diff --git a/.config/polybar/config b/.config/polybar/config index 5a04b16..7ad54e1 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -45,7 +45,7 @@ font-4 = "Noto Sans KR:pixelsize=9:weight=bold:size=0;2" modules-left = time date modules-center = weather mpd -modules-right = alsa whoami +modules-right = keyboard alsa whoami separator = @@ -156,4 +156,10 @@ exec = echo "%{T2}$(whoami)%{T-}@%{T2}$(hostname)%{T-}" interval = 9999999 label-font = 2 +[module/keyboard] +type = custom/script +exec = ~/.local/share/bin/kbindicator +interval = 5 +label-font = 1 + ; vim:ft=dosini diff --git a/.local/share/bin/kbindicator b/.local/share/bin/kbindicator new file mode 100755 index 0000000..fec586c --- /dev/null +++ b/.local/share/bin/kbindicator @@ -0,0 +1,9 @@ +#!/bin/sh +ENGINE="$(ibus engine)" + +case $ENGINE in + "anthy") echo "jp" ;; + "xkb:us::eng") echo "us" ;; + "xkb:us:intl:eng") echo "us-intl" ;; +*) ;; +esac -- cgit v1.2.3