diff options
author | Cody Hiar <codyfh@gmail.com> | 2017-04-20 19:37:10 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2017-04-20 19:37:10 -0600 |
commit | 2dd809781527976307b47a598887062047e202c9 (patch) | |
tree | 8b29daba2c1ef072f380ef530b7e7d9256e43eb3 /segments/xkb_layout.sh | |
parent | baeb698bb006193559fc5aa1901180a3ccc73b7a (diff) |
Making tmux configuration much easier to manage
Diffstat (limited to 'segments/xkb_layout.sh')
-rwxr-xr-x | segments/xkb_layout.sh | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/segments/xkb_layout.sh b/segments/xkb_layout.sh deleted file mode 100755 index c8f38c1..0000000 --- a/segments/xkb_layout.sh +++ /dev/null @@ -1,32 +0,0 @@ -# Print the currently used keyboard layout -# This depends on a specifically developed program which prints the group id of -# the currently used layout. -# I developed the simple program myself with some guidance as I was unable to -# find anything already developed. -# Some people might suggest: -# $ setxkbmod -query -v | awk -F "+" '{print $2}' -# this will only work if you have set up XKB with a single layout which is true -# for some. - -# This script will print the correct layout even if layout is set per window. -# Exit if platform is not linux as this script is dependant on X11 - -run_segment() { - if ! shell_is_linux; then - return 1 - fi - - cd "$TMUX_POWERLINE_DIR_SEGMENTS" - if [ ! -x "xkb_layout" ]; then - make clean xkb_layout &>/dev/null - fi - - if [ -x ./xkb_layout ]; then - cur_layout_nbr=$(($(./xkb_layout)+1)); - cur_layout=$(setxkbmap -query | grep layout | sed 's/layout:\s\+//g' | \ - awk -F ',' '{print $'$(echo "$cur_layout_nbr")'}') - echo "⌨ $cur_layout" - else - return 1 - fi -} |