File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1111# This script will print the correct layout even if layout is set per window.
1212# Exit if platform is not linux as this script is dependant on X11
1313
14+ TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON_DEFAULT=" ⌨ "
15+
16+ generate_segmentrc () {
17+ read -d ' ' rccontents << EORC
18+ # Keyboard icon
19+ export TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON="${TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON_DEFAULT} "
20+ EORC
21+ echo " $rccontents "
22+ }
23+
24+
1425run_segment () {
26+ __process_settings
27+
1528 if ! shell_is_linux; then
1629 return 1
1730 fi
@@ -25,8 +38,14 @@ run_segment() {
2538 cur_layout_nbr=$(( $(./ xkb_layout)+ 1 )) ;
2639 cur_layout=$( setxkbmap -query | grep layout | sed ' s/layout:\s\+//g' | \
2740 awk -F ' ,' ' {print $' $( echo " $cur_layout_nbr " ) ' }' )
28- echo " ⌨ $cur_layout "
41+ echo " $TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON $cur_layout "
2942 else
3043 return 1
3144 fi
3245}
46+
47+ __process_settings () {
48+ if [ -z " $TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON " ]; then
49+ export TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON=" ${TMUX_POWERLINE_SEG_XKB_LAYOUT_ICON_DEFAULT} "
50+ fi
51+ }
You can’t perform that action at this time.
0 commit comments