Compare commits

...

2 Commits

Author SHA1 Message Date
Ceda EI 50cca6f641 Add xkb_swapper.sh. 2019-07-28 14:48:02 +05:30
Ceda EI cf7d531261 Add xkb layouts. 2019-07-28 14:47:15 +05:30
3 changed files with 3845 additions and 0 deletions

1907
.xkb/insert.xkb Normal file

File diff suppressed because it is too large Load Diff

1907
.xkb/normal.xkb Normal file

File diff suppressed because it is too large Load Diff

31
xkb_swapper.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
function set_layout() {
echo "Setting layout to $1"
xkbcomp ~/.xkb/$1.xkb $DISPLAY
echo $1 > ~/.cache/xkb-curr-$DISPLAY
}
layouts=(insert normal)
current_layout=$(cat ~/.cache/xkb-curr-$DISPLAY || echo "")
if [[ $current_layout == "" ]]; then
echo "No current layout found!"
set_layout ${layouts[0]}
fi
i=0
while [[ $i -lt ${#layouts[@]} ]]; do
if [[ $current_layout == ${layouts[$i]} ]]; then
new_idx=$(($i+1))
if [[ $new_idx -eq ${#layouts[@]} ]]; then
set_layout ${layouts[0]}
else
set_layout ${layouts[$new_idx]}
fi
exit
fi
((i++))
done
echo "Current Layout doesn't exist!"
set_layout ${layouts[0]}