-
Notifications
You must be signed in to change notification settings - Fork 16
/
.lxqtSetup
36 lines (29 loc) · 1.19 KB
/
.lxqtSetup
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
#!/bin/sh
# curl https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/.lxqtSetup | sh
wget -N https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/.__KEY_REPEAT_SETTINGS__ -P ~/
. ~/.__KEY_REPEAT_SETTINGS__
CONFIG="${HOME}/.config/lxqt/session.conf"
TEMP="/tmp/__LXQT_SESSION__.conf"
if [ "$(grep '\[Keyboard\]' ${CONFIG})" ]; then
# Grab block of text starting with '[Keyboard]' and store it in a separate file:
sed -n '/\[Keyboard\]/,/^$/p' ${CONFIG} > ${TEMP}
# Replace delay and interval with my preferred settings:
sed -i "s/delay=.*/delay=${KEY_REPEAT_DELAY}/" ${TEMP}
sed -i "s/interval=.*/interval=${KEY_REPEAT_RATE}/" ${TEMP}
# Delete 'Keyboard' section from original config:
sed -i '/\[Keyboard\]/,/^$/d' ${CONFIG}
# Put new config into original file:
echo >> ${CONFIG}
cat ${TEMP} >> ${CONFIG}
else
echo >> ${CONFIG}
echo '[Keyboard]' >> ${CONFIG}
echo "delay=${KEY_REPEAT_DELAY}" >> ${CONFIG}
echo "interval=${KEY_REPEAT_RATE}" >> ${CONFIG}
echo >> ${CONFIG}
fi
# Squeeze blank lines, since our process
# can create a few extra ones. This keeps
# the file tidy.
cat -s ${CONFIG} > ${TEMP}
cat ${TEMP} > ${CONFIG}