-
Notifications
You must be signed in to change notification settings - Fork 0
/
kde-configure
executable file
·95 lines (74 loc) · 4.29 KB
/
kde-configure
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
87
88
89
90
91
92
93
94
95
#!/usr/bin/env sh
breezeFile=~/.config/breezerc
dolphinFile=~/.config/dolphinrc
globalsFile=~/.config/kdeglobals
inputFile=~/.config/kcminputrc
keyboardFile=~/.config/kxkbrc
kaccessrc=~/.config/kaccessrc
powerFile=~/.config/powerdevilrc
runnerFile=~/.config/krunnerrc
sessionFile=~/.config/ksmserverrc
shortcutFile=~/.config/kglobalshortcutsrc
winFile=~/.config/kwinrc
# There seems to be a bug in kwriteconfig6. Regardless of whether you provide
# "\\t" or "\t" as a part of the value, you end up with a double slash getting
# saved instead of a single one. This fixes those double tabs.
fixTabs() {
sed -i 's/\\\\t/\\t/' "$1"
}
# Make backups
if [ ! -f $shortcutFile.bak ]; then
cp $shortcutFile $shortcutFile.bak
fi
if [ -f $inputFile ] && [ ! -f $inputFile.bak ]; then
cp $inputFile $inputFile.bak
fi
# Globals
kwriteconfig6 --file $globalsFile --group KDE --key SingleClick true
# Session
kwriteconfig6 --file $sessionFile --group General --key loginMode emptySession
# Key bindings
kwriteconfig6 --file $shortcutFile --group kwin --key 'Expose' 'none,,Toggle Present Windows (Current desktop)'
kwriteconfig6 --file $shortcutFile --group kwin --key 'ExposeAll' 'none,,Toggle Present Windows (All desktops)'
kwriteconfig6 --file $shortcutFile --group kwin --key 'ExposeClass' 'none,,Toggle Present Windows (Window class)'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Switch to Desktop 1' 'none,,Switch to Desktop 1'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Switch to Desktop 2' 'none,,Switch to Desktop 2'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Switch to Desktop 3' 'none,,Switch to Desktop 3'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Switch to Desktop 4' 'none,,Switch to Desktop 4'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Window Minimize' 'Meta+H,,Minimize Window'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Window Move Center' 'Meta+Home,,Move Window to the Center'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Window Operations Menu' 'none,,Window Operations Menu'
kwriteconfig6 --file $shortcutFile --group kwin --key 'Window Close' 'Alt+F4\tMeta+Q,Alt+F4,Close Window'
kwriteconfig6 --file $shortcutFile --group ksmserver --key 'Shut Down' 'Meta+Shift+Q,,Shut Down'
kwriteconfig6 --file $shortcutFile --group plasmashell --key 'manage activities' 'none,Meta+Q,Show Activity Switcher'
kwriteconfig6 --file $shortcutFile --group services --group org.kde.krunner.desktop --key '_launch' 'Meta+Space\tSearch'
kwriteconfig6 --file $shortcutFile --group services --group org.kde.spectacle.desktop --key FullScreenScreenShot 'Print'
kwriteconfig6 --file $shortcutFile --group services --group org.kde.spectacle.desktop --key _launch 'Shift+Print'
fixTabs $shortcutFile
# Window manager
kwriteconfig6 --file $winFile --group TabBox --key DelayTime 0 # Default is 90
kwriteconfig6 --file $winFile --group TabBox --key LayoutName compact
kwriteconfig6 --file $winFile --group TabBox --key HighlightWindows false
kwriteconfig6 --file $winFile --group ElectricBorders --key TopLeft --delete
kwriteconfig6 --file $winFile --group Effect-overview --key BorderActivate 9
#kwriteconfig6 --file kwinrc --group ModifierOnlyShortcuts --key Meta "org.kde.kglobalaccel,/component/kwin,,invokeShortcut,Overview"
qdbus org.kde.KWin /KWin reconfigure
# Keyboard
kwriteconfig6 --file $inputFile --group Keyboard --key RepeatDelay 200
kwriteconfig6 --file $inputFile --group Keyboard --key RepeatRate 35
# File browser
kwriteconfig6 --file $dolphinFile --group General --key GlobalViewProps false
kwriteconfig6 --file $dolphinFile --group General --key RememberOpenedTabs false
# Runner
kwriteconfig6 --file $runnerFile --group General --key FreeFloating true
kwriteconfig6 --file $runnerFile --group Plugins --key krunner_shellEnabled false
# Keyboard
kwriteconfig6 --file $keyboardFile --group Layout --key Options 'caps:escape'
kwriteconfig6 --file $keyboardFile --group Layout --key ResetOldOptions true
# Power
kwriteconfig6 --file $powerFile --group AC --group SuspendAndShutdown --key PowerButtonAction 1
# Breeze
kwriteconfig6 --file $breezeFile --group Common --key OutlineCloseButton true
kwriteconfig6 --file $breezeFile --group Windeco --key DrawBorderOnMaximizedWindows true
# Accessibility
kwriteconfig6 --file $kaccessrc --group Bell --key SystemBell false