-
Notifications
You must be signed in to change notification settings - Fork 16
/
.gnome3Setup
46 lines (41 loc) · 2.33 KB
/
.gnome3Setup
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
#!/bin/bash
## curl https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/.gnome3Setup | bash
wget -N https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/.__KEY_REPEAT_SETTINGS__ -P ~/
. ~/.__KEY_REPEAT_SETTINGS__
## Thanks to @fmuellner.
## Variables for gsettings:
KEYS_SCHEMA=org.gnome.settings-daemon.plugins.media-keys
CUSTOM_SCHEMA=${KEYS_SCHEMA}.custom-keybinding
CUSTOM_PATH=/${CUSTOM_SCHEMA//.//}s/custom0/
## Set the terminal shortcut to Ctrl+Alt+T:
gsettings set $CUSTOM_SCHEMA:$CUSTOM_PATH name 'Terminal'
gsettings set $CUSTOM_SCHEMA:$CUSTOM_PATH command 'gnome-terminal'
gsettings set $CUSTOM_SCHEMA:$CUSTOM_PATH binding '<Control><Alt>t'
gsettings set $KEYS_SCHEMA custom-keybindings "[\"$CUSTOM_PATH\"]"
echo
echo "****************************"
echo "DETERMINING GSETTINGS PATHS:"
echo "..."
## Depending on the version of gnome this can vary:
if [ "$(gsettings get org.gnome.desktop.peripherals.keyboard repeat)" ]; then
INPUT_DEVICES_PATH=org.gnome.desktop.peripherals
elif [ "$(gsettings get org.gnome.settings-daemon.peripherals.keyboard repeat)" ]; then
INPUT_DEVICES_PATH=org.gnome.settings-daemon.peripherals
fi
echo "..."
echo "PATH DETERMINED."
echo "****************************"
echo
## Make the keyboard crazy fast:
gsettings set ${INPUT_DEVICES_PATH}.keyboard repeat true
gsettings set ${INPUT_DEVICES_PATH}.keyboard delay ${KEY_REPEAT_DELAY}
gsettings set ${INPUT_DEVICES_PATH}.keyboard repeat-interval ${KEY_REPEAT_RATE}
## Sensible touchpad defaults [these may already be set, but it cannot hurt]:
gsettings set ${INPUT_DEVICES_PATH}.touchpad scroll-method 'two-finger-scrolling'
gsettings set ${INPUT_DEVICES_PATH}.touchpad horiz-scroll-enabled true
gsettings set ${INPUT_DEVICES_PATH}.touchpad tap-to-click false
# Map Caps Lock to Ctrl.
XKB_OPTIONS="$(gsettings get org.gnome.desktop.input-sources xkb-options)"
[ "$(echo ${XKB_OPTIONS} | grep -v '\[\]')" ] && gsettings set org.gnome.desktop.input-sources xkb-options "$(echo ${XKB_OPTIONS} | sed "s/\[\]/['ctrl:nocaps']/")"
[ "$(echo ${XKB_OPTIONS} | grep -v 'ctrl:nocaps')" ] && gsettings set org.gnome.desktop.input-sources xkb-options "$(echo ${XKB_OPTIONS} | sed "s/\]/, 'ctrl:nocaps']/")"
[ "$(echo ${XKB_OPTIONS} | grep -v 'ctrl:nocaps')" ] && gsettings set org.gnome.desktop.input-sources xkb-options "$(echo ${XKB_OPTIONS} | sed "s/\]/'ctrl:nocaps']/")"