mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Add keyboard toggle script
This commit is contained in:
parent
3f7c08a0fd
commit
d08637f5b7
10
.config/i3/blocks/keyboard
Executable file
10
.config/i3/blocks/keyboard
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[[ $BLOCK_BUTTON -eq 1 ]] && `$DOTFILES/scripts/togglekeyboard`
|
||||||
|
|
||||||
|
layout=$(setxkbmap -query | grep 'layout:' | awk '{print $2}')
|
||||||
|
variant=$(setxkbmap -query | grep 'variant:' | awk '{print $2}')
|
||||||
|
|
||||||
|
short=`([ "$variant" ] && echo $variant || echo $layout) | cut -c1-2`
|
||||||
|
|
||||||
|
echo -e "$short\n$short" | awk '{print toupper($0)}'
|
@ -92,7 +92,11 @@ interval=5
|
|||||||
#label=
|
#label=
|
||||||
#interval=5
|
#interval=5
|
||||||
|
|
||||||
#[separator]
|
[keyboard]
|
||||||
|
label=
|
||||||
|
interval=30
|
||||||
|
|
||||||
|
[separator]
|
||||||
|
|
||||||
[clock]
|
[clock]
|
||||||
interval=5
|
interval=5
|
||||||
|
4
scripts/togglekeyboard
Executable file
4
scripts/togglekeyboard
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
variant=$(setxkbmap -query | grep 'variant:' | awk '{print $2}')
|
||||||
|
[ "$variant" == "dvorak" ] && setxkbmap gb || setxkbmap gb dvorak
|
Loading…
Reference in New Issue
Block a user