-
Notifications
You must be signed in to change notification settings - Fork 3
/
xfconf-settings
executable file
·195 lines (138 loc) · 4.55 KB
/
xfconf-settings
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
# dependencies /////////////////////////////////////////////////////////////////
if [ -f "${HOME}"/.local/bin/frobulator ]
then
rm -r -f "${HOME}"/.local/bin/frobulator
fi
if [[ -z $(command -v frobulator) ]]
then
if [[ $(id -u -n) = "root" ]]
then
SUDO_HOME=/root
USER="${SUDO_USER}"
HOME=/home/"${USER}"
fi
if [[ -z $(command -v curl) ]]
then
yes | apt-get install curl
fi
if [ ! -d "${HOME}"/.local/bin ]
then
mkdir -p "${HOME}"/.local/bin
fi
curl -s -L get.frbltr.app > "${HOME}"/.local/bin/frobulator
chmod +x "${HOME}"/.local/bin/frobulator
fi
. "${HOME}"/.local/bin/frobulator
# superuser ////////////////////////////////////////////////////////////////////
# script ///////////////////////////////////////////////////////////////////////
script=$(basename -- "${BASH_SOURCE[0]}")
# version //////////////////////////////////////////////////////////////////////
version="09-23-2022"
# usage ////////////////////////////////////////////////////////////////////////
settings_file="${1}"
if [[ $# -lt 1 ]]
then
echo
echo "Usage: ${script} [SETTINGS FILE] | [OPTION]"
echo
exit 1
fi
# variables ////////////////////////////////////////////////////////////////////
stamp=$(date +"%m-%d-%Y-%H-%M-%S")
# defaults /////////////////////////////////////////////////////////////////////
list=(
xfconf-query
)
frobulator.require ${list[@]}
list=()
# functions ////////////////////////////////////////////////////////////////////
# read settings
frobulator.inf "Generating" "[ ${settings_file} ]"
echo
xfconf-query -l | sed '/Channel.*/d' | while read channel
do
xfconf-query -l -v -c "${channel}" | while read property setting
do
# provide data type:
# needs to be researched before making a new .xfconf file
# “bool” - boolean value: either 'true'or 'false'
# “int” - 32-bit signed integer value, in the range from -2·147·483·648 through 2·147·483·647
# “uint” - 32-bit unsigned integer value, in the range from 0 through 4·294·967·295
# “int64” - 64-bit signed integer value, in the range from -9·223·372·036·854·775·808 through 9·223·372·036·854·775·807
# “uint64” - 64-bit unsigned integer value, in the range from 0 through 18·446·744·073·709·551·615
# “double” - presumably a double-precision floating-point value, even though it will be stored as a fixed-point value instead, with six decimal places following the decimal point
# “string” - character string
# parse data types
if [[ ${setting} = true ]] || [[ ${setting} = false ]]
then
type=bool
elif [[ ${setting} =~ ^[-+]?[0-9]+\.[0-9]*$ ]]
then
type=double
elif [[ ${setting} =~ ^[0-9]+$ ]]
then
type=int
else
type=string
fi
if [[ ${channel} = "displays" ]] || \
[[ ${channel} = "xfce4-session" ]] || \
[[ ${channel} = "xfce4-settings-editor" ]] || \
[[ ${channel} = "xfce4-settings-manager" ]]
then
:
else
echo "xfconf-query --create -c '${channel}' -p '${property}' -t ${type} -s '${setting}'"
fi
done
done > "${settings_file}"
# fix 'UNSUPPORTED' values:
# write essential values back into settings file
# add 'xfce4-appfinder' actions string
echo "xfconf-query --create -c 'xfce4-appfinder' -p '/actions' -t string -s ''" >> "${settings_file}"
# add workspace background settings
for rgba_number in {1..2}
do
for workspace_number in {0..8}
do
value="1.0"
r="${value}"
g="${value}"
b="${value}"
a="${value}"
unset command
command+="xfconf-query --create"
command+=" -c 'xfce4-desktop'"
command+=" -p '/backdrop/screen0/monitorVNC-0/workspace${workspace_number}/rgba${rgba_number}'"
command+=" -t double -s '${r}'"
command+=" -t double -s '${g}'"
command+=" -t double -s '${b}'"
command+=" -t double -s '${a}'"
echo ${command} >> "${settings_file}"
done
done
# add workspace name settings
unset command
command+="xfconf-query --create"
command+=" -c 'xfwm4'"
command+=" -p '/general/workspace_names'"
for workspace_number in {1..9}
do
command+=" -t string -s 'Workspace 0${workspace_number}'"
done
echo ${command} >> "${settings_file}"
# add keyboard-shortcut providers
unset command
command+="xfconf-query --create"
command+=" -c 'xfce4-keyboard-shortcuts'"
command+=" -p '/providers'"
command+=" -t string -s 'xfwm4'"
command+=" -t string -s 'commands'"
echo ${command} >> "${settings_file}"
echo "bash -c 'xfwm4 --replace & > /dev/null 2>&1'" >> "${settings_file}"
frobulator.scs "Done."
echo
frobulator.msg "Use newly generated settings file as follows:"
frobulator.msg "'bash <settings_file>'"
echo