-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.sh
executable file
·64 lines (57 loc) · 2.02 KB
/
install.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
#!/bin/bash
NAME="delicious"
DIR="/usr/share/sddm/themes/$NAME/"
CFG="/etc/sddm.conf"
function changeCurrentTheme {
sudo sed -i "s/^Current=.*/Current=$NAME/" $CFG
echo "Current theme changed to $NAME"
}
function disableVirtualKeyboard {
if ! grep -wq "InputMethod=" $CFG; then
echo -e "\nDo you want to disable the virtual on-screen keyboard in SDDM? Select yes if you have a physical keyboard"
select sel in "Yes" "No"; do
case $sel in
Yes )
if grep -q "^InputMethod=qtvirtualkeyboard" $CFG; then
sudo sed -i "s/^InputMethod=qtvirtualkeyboard/InputMethod=/" $CFG;
echo "Virtual keyboard disabled (modified InputMethod entry)";
elif ! grep -q "^InputMethod=" $CFG; then
sudo sed -i 's/^\[General\]/\[General\]\nInputMethod=/' $CFG;
echo "Virtual keyboard disabled (created empty InputMethod entry)";
fi
break;;
No ) break;;
esac
done
fi
}
function testTheme {
echo -e "\nDo you want to test the theme now?"
select sel in "Yes" "No"; do
case $sel in
Yes ) sddm-greeter --test-mode --theme $DIR; break;;
No ) exit;;
esac
done
}
function createConfig {
sddm --example-config | sudo tee $CFG > /dev/null
echo "Configuration file created in $CFG"
}
if sudo cp -R . $DIR; then
echo "Theme installed in $DIR"
else
echo "Errors occurred during installation, exiting"
exit;
fi
if [ ! -f $CFG ]; then
echo -e "\nSDDM configuration file $CFG does not exist, do you want to create it based on current configuration?"
select sel in "Yes" "No"; do
case $sel in
Yes ) createConfig; changeCurrentTheme; disableVirtualKeyboard; testTheme; break;;
No ) echo "Theme installed in $DIR but configuration not changed."; testTheme; break;;
esac
done
else
changeCurrentTheme; disableVirtualKeyboard; testTheme;
fi