Now using dotter
This commit is contained in:
26
i3/i3blocks/keyboard
Executable file
26
i3/i3blocks/keyboard
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
get_current_layout () {
|
||||
setxkbmap -print | grep -q dvorak
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo dvorak
|
||||
else
|
||||
echo qwertz
|
||||
fi
|
||||
}
|
||||
|
||||
case "$BLOCK_BUTTON" in
|
||||
1|2|3)
|
||||
# Switch layout
|
||||
current_layout=$(get_current_layout)
|
||||
if [ $current_layout == dvorak ]; then
|
||||
setxkbmap -layout de
|
||||
else
|
||||
setxkbmap -layout de -variant dvorak
|
||||
fi
|
||||
esac
|
||||
|
||||
current_layout=$(get_current_layout)
|
||||
|
||||
echo "$LABEL $current_layout"
|
||||
echo "$LABEL $current_layout"
|
Reference in New Issue
Block a user