-
Notifications
You must be signed in to change notification settings - Fork 0
/
belxkb.sh
executable file
·66 lines (57 loc) · 1.21 KB
/
belxkb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env sh
EVDEV_PATH=/usr/share/X11/xkb/rules/evdev.xml
SYMBOLS_PATH=/usr/share/X11/xkb/symbols/by
help()
{
cat << EOM
This script adds extra configurations for belarusian keyboard layouts in xkb.
USAGE:
./belxkb [OPTIONS]
OPTIONS:
--help -h Help.
--install -i Installs 3 new belarusian keyboard layouts:
1. Belarusian Typo (cyrillic)
2. Belarusian alt. Typo (russian chars first)
3. Belarusian Latin typo
--backup -b Restores config files from backup
--flag -f Replaces BSSR-style flag to the national flag of Belarus.
EOM
}
create_backup()
{
sudo rm -rf ./backup
mkdir ./backup
sudo cp -rf $EVDEV_PATH ./backup/evdev.xml
sudo cp -rf $SYMBOLS_PATH ./backup/by
}
install()
{
sudo cp -rf ./evdev.xml $EVDEV_PATH
sudo cp -rf ./by $SYMBOLS_PATH
}
xfce4_flag()
{
mkdir -p ~/.local/share/xfce4/xkb/flags/
cp ./by.svg ~/.local/share/xfce4/xkb/flags/
}
backup()
{
sudo cp -rf ./backup/evdev.xml $EVDEV_PATH
sudo cp -rf ./backup/by $SYMBOLS_PATH
}
case "$1" in
--install | -i)
create_backup
install
;;
--flag | -f)
xfce4_flag
;;
--backup | -b)
backup
;;
*)
help
;;
esac
exit 0