-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset-keys.sh
executable file
·86 lines (62 loc) · 2.88 KB
/
set-keys.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
CWD=$(pwd)
LWD=$HOME/.local/share/powertoys
LBD=$HOME/.local/bin
sudo apt update
if ! [ -x "$(which fortune)" ]; then
sudo apt install fortunes
fi
if ! [ -x "$(which jq)" ]; then
sudo apt install jq
fi
if ! [ -x "$(which xclip)" ]; then
sudo apt install xclip
fi
if ! [ -x "$(which zenity)" ]; then
sudo apt install zenity
fi
# Lock Screen
KEY_LG=$(gsettings get org.cinnamon.desktop.keybindings looking-glass-keybinding | grep -i "<super>l" | wc -l)
sudo cp -f $CWD/scripts/lock-screen.py /usr/bin/lock-screen
sudo cp -f $CWD/scripts/lock-screen-blur.py /usr/bin/lock-screen-blur
sudo cp -f $CWD/scripts/show-clip.sh /usr/bin/show-clip
sudo chmod a+x /usr/bin/lock-screen
sudo chmod a+x /usr/bin/lock-screen-blur
sudo chmod a+x /usr/bin/show-clip
if [[ $KEY_LG == "1" ]]; then
echo "[i] Setting Super L to lock screen"
gsettings set org.cinnamon.settings-daemon.plugins.power lock-on-suspend "true"
gsettings set org.cinnamon.desktop.screensaver allow-keyboard-shortcuts "true"
gsettings set org.cinnamon.desktop.screensaver show-album-art "false"
gsettings set org.cinnamon.desktop.screensaver show-info-panel "true"
gsettings set org.cinnamon.desktop.lockdown disable-lock-screen "false"
gsettings set org.cinnamon.desktop.screensaver allow-keyboard-shortcuts "true"
gsettings set org.cinnamon.desktop.keybindings looking-glass-keybinding "['<Ctrl><Alt>l']"
gsettings set org.cinnamon.settings-daemon.plugins.media-keys screensaver "['<Super>l']"
fi
# Show Desktop
KEY_SD=$(gsettings get org.cinnamon.desktop.keybindings.wm show-desktop | grep -i "<super>d" | wc -l)
if [[ $KEY_SD == "1" ]]; then
gsettings set org.cinnamon.desktop.keybindings.wm show-desktop "['<super>m']"
fi
# Assign workspace switcher to super
cp $HOME/.config/cinnamon/spices/grouped-window-list@cinnamon.org/2.json $HOME/.config/cinnamon/spices/grouped-window-list@cinnamon.org/2.json.orig
jq '."super-num-hotkeys".value = false' $HOME/.config/cinnamon/spices/grouped-window-list@cinnamon.org/2.json > /tmp/temp.json && mv /tmp/temp.json $HOME/.config/cinnamon/spices/grouped-window-list@cinnamon.org/2.json
# Backup from dconf and reset
if [ ! -f $PWD/scripts/dconf-keys.orig ]
then
dconf dump /org/cinnamon/desktop/keybindings/ > scripts/dconf-keys.orig
else
dconf load /org/cinnamon/desktop/keybindings/ < scripts/dconf-keys.conf
fi
dconf load /org/cinnamon/desktop/keybindings/ < scripts/dconf-keys.conf
#Power Options
gsettings set org.cinnamon.settings-daemon.plugins.power lid-close-ac-action "nothing"
gsettings set org.cinnamon.settings-daemon.plugins.power sleep-inactive-ac-timeout "0"
gsettings set org.cinnamon.settings-daemon.plugins.power button-power "blank"
gsettings set org.cinnamon.settings-daemon.plugins.power critical-battery-action "shutdown"
# Install rofi
if ! [ -x "$(which rofi)" ]; then
sudo apt update && sudo apt install rofi
fi
$CWD/install-menus.sh