i needed one, and here it is

This commit is contained in:
yigid balaban 2024-06-26 19:07:42 +03:00
parent d9236e3c30
commit ee846ef9e7
Signed by: fyb
GPG Key ID: E21FEB2C244CB7EB

17
keylay.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/bash
current_layout=$( hyprctl devices -j |
jq -r '.keyboards[] | .layout' |
head -n1 |
cut -c1-2 |
tr 'a-z' 'A-Z'
)
layout="us"
if [ $current_layout == "US" ]; then
layout="tr"
fi
hyprctl keyword input:kb_layout $layout
notify-send --urgency=low --expire-time=1000 --icon="/media/yigid/share/shoka/pictures/506 icon packs/cp.png" "Keyboard layout changed" "You are now on $layout"