summaryrefslogtreecommitdiff
path: root/raveos-plasma-theme/raveos-plasma-first-login.sh
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-plasma-theme/raveos-plasma-first-login.sh')
-rwxr-xr-xraveos-plasma-theme/raveos-plasma-first-login.sh44
1 files changed, 23 insertions, 21 deletions
diff --git a/raveos-plasma-theme/raveos-plasma-first-login.sh b/raveos-plasma-theme/raveos-plasma-first-login.sh
index ce3561d..f16f43d 100755
--- a/raveos-plasma-theme/raveos-plasma-first-login.sh
+++ b/raveos-plasma-theme/raveos-plasma-first-login.sh
@@ -42,28 +42,30 @@ if [[ -n "$QDBUS" ]]; then
d[i].writeConfig('FillMode', 2);
}
}
- if ('${kickoff_image}' !== '') {
- function setKickoff(applet, path) {
- var g = [['Configuration', 'General'], ['General']];
- for (var i = 0; i < g.length; i++) {
- applet.currentConfigGroup = g[i];
- applet.writeConfig('useCustomButtonImage', 'true');
- applet.writeConfig('customButtonImage', 'file://' + path);
- applet.writeConfig('icon', path);
- }
- }
- var p = panels();
- for (var i = 0; i < p.length; i++) {
- var a = p[i].applets;
- for (var j = 0; j < a.length; j++) {
- var pl = a[j].pluginName;
- if (pl === 'org.kde.plasma.kickoff' || pl === 'org.kde.plasma.kicker' || pl === 'org.kde.plasma.simplemenu' || pl === 'org.kde.plasma.kickoffdashboard') {
- setKickoff(a[j], '${kickoff_image}');
- }
- }
- }
- }
" >/dev/null 2>&1 || true
fi
+if [[ -f "${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc" ]] && command -v kwriteconfig6 >/dev/null 2>&1; then
+ while IFS=: read -r containment applet; do
+ [[ -n "${containment}" && -n "${applet}" ]] || continue
+ kwriteconfig6 --file "${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc" \
+ --group Containments --group "${containment}" --group Applets \
+ --group "${applet}" --group Configuration --group General \
+ --key useCustomButtonImage true
+ kwriteconfig6 --file "${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc" \
+ --group Containments --group "${containment}" --group Applets \
+ --group "${applet}" --group Configuration --group General \
+ --key customButtonImage "file://${kickoff_image}"
+ kwriteconfig6 --file "${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc" \
+ --group Containments --group "${containment}" --group Applets \
+ --group "${applet}" --group Configuration --group General \
+ --key icon "${kickoff_image}"
+ done < <(
+ awk '
+ match($0, /^\[Containments\]\[([0-9]+)\]\[Applets\]\[([0-9]+)\]$/, m) { c=m[1]; a=m[2]; next }
+ /^plugin=org\.kde\.plasma\.(kickoff|kicker|simplemenu|kickoffdashboard)$/ && c != "" && a != "" { print c ":" a }
+ ' "${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc" | sort -u
+ )
+fi
+
touch "${marker_file}"