aboutsummaryrefslogtreecommitdiffstats
path: root/appearance/Icons.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-29 11:56:15 +0200
committerDanilo M. <danix@danix.xyz>2026-09-29 11:56:15 +0200
commit2d7b18d52ee7e7f1aac132180b7eb3b951735668 (patch)
tree735e3a35be639b987800c9ab5e6646504ae3b0cf /appearance/Icons.qml
parent9b83656e3e3d164fc75bbf679cf32357375660c4 (diff)
downloadquickshell-2d7b18d52ee7e7f1aac132180b7eb3b951735668.tar.gz
quickshell-2d7b18d52ee7e7f1aac132180b7eb3b951735668.zip
feat(appearance): steps window, icon regen, cursor out of hypr-theme
StepsWindow shows unified-desktop-theme's pending manual steps, one tab per consumer, centred on DP-3 on the top layer with on-demand focus so it can stay open while commands are pasted elsewhere. udt-steps writes the files and calls the new `steps` IPC verb; indented lines become command blocks with a copy button. The Theme tab pipes install.sh's output into it. The icon switch now also reruns udt-accent (SDDM power icons) and waybar-theme-udt's install.sh (taskbar theme, module icons), chained after the gsettings write both read. Cursor changes write ~/.config/udt/cursor.lua instead of editing hypr-theme's tracked environment.lua. The theme notice and the Udt.qml comment claimed install.sh reloads nothing; it reloads Hyprland, waybar, kitty and conky now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'appearance/Icons.qml')
-rw-r--r--appearance/Icons.qml43
1 files changed, 27 insertions, 16 deletions
diff --git a/appearance/Icons.qml b/appearance/Icons.qml
index 2149f6f..2c4c403 100644
--- a/appearance/Icons.qml
+++ b/appearance/Icons.qml
@@ -259,7 +259,14 @@ for name in sys.argv[2:]:
// preloaded because setText on an unloaded FileView would write empty.
FileView { id: qt6File; path: `${root.home}/.config/qt6ct/qt6ct.conf`; blockLoading: true }
FileView { id: qt5File; path: `${root.home}/.config/qt5ct/qt5ct.conf`; blockLoading: true }
- FileView { id: envFile; path: `${root.home}/.config/hypr/sections/environment.lua`; blockLoading: true }
+ // The cursor lives in its own file, not in hypr-theme's environment.lua:
+ // which cursor a machine runs is local state, and editing a tracked file
+ // left hypr-theme dirty after every switch. environment.lua dofile()s it.
+ // Written whole, so it needs no preload.
+ FileView { id: cursorFile; path: `${root.home}/.config/udt/cursor.lua` }
+ function writeCursor() {
+ cursorFile.setText(`return { theme = ${JSON.stringify(root.currentCursor)}, size = ${root.cursorSize} }\n`);
+ }
// GTK3 and GTK4 read their own settings.ini, with the theme names written
// out; gsettings alone does not switch them.
FileView { id: gtk3File; path: `${root.home}/.config/gtk-3.0/settings.ini`; blockLoading: true }
@@ -283,8 +290,20 @@ for name in sys.argv[2:]:
}
Process { id: gsetProc }
+ // Two consumers resolve icons by name from gsettings when they are
+ // generated, not when they run: the SDDM power icons (udt-accent) and
+ // waybar's taskbar theme and module icons (its install.sh). So they are
+ // regenerated here, chained after the gsettings write they read.
+ readonly property string udtRepo: `${root.home}/Programming/GIT/unified-desktop-theme`
+ readonly property string waybarRepo: `${root.home}/Programming/GIT/waybar-theme-udt`
+
function applyIcon(name) {
- root.gsettingsSet("icon-theme", name);
+ Quickshell.execDetached(["sh", "-c",
+ `gsettings set org.gnome.desktop.interface icon-theme "$1" || exit; ` +
+ `[ -e ~/.cache/udt/wpaper ] && ${JSON.stringify(root.udtRepo)}/bin/udt-accent ~/.cache/udt/wpaper; ` +
+ `[ -x ${JSON.stringify(root.waybarRepo)}/install.sh ] && ${JSON.stringify(root.waybarRepo)}/install.sh && ` +
+ `killall -SIGUSR2 waybar`,
+ "sh", name]);
const files = [qt6File, qt5File];
for (let i = 0; i < files.length; i++) {
const text = files[i].text();
@@ -292,23 +311,18 @@ for name in sys.argv[2:]:
}
root.rewriteGtk("gtk-icon-theme-name", name);
root.currentIcon = name;
- root.notice = `${name} set. Restart apps to see it.`;
+ root.notice = `${name} set. Waybar and the SDDM icons follow; restart other apps to see it.`;
}
function applyCursor(name) {
// Live switch first, then persistence.
Quickshell.execDetached(["hyprctl", "setcursor", name, String(root.cursorSize)]);
root.gsettingsSet("cursor-theme", name);
- const text = envFile.text();
- // Matches both XCURSOR_THEME and HYPRCURSOR_THEME: both end in
- // CURSOR_THEME", ".
- if (text !== "")
- envFile.setText(text.replace(/(CURSOR_THEME", ")[^"]*/g, (m, p1) => p1 + name)
- .replace(/(CURSOR_SIZE", ")[^"]*/g, (m, p1) => p1 + root.cursorSize));
+ root.currentCursor = name;
+ root.writeCursor();
root.rewriteGtk("gtk-cursor-theme-name", name);
root.rewriteGtk("gtk-cursor-theme-size", root.cursorSize);
- root.currentCursor = name;
- root.notice = `${name} set live at ${root.cursorSize}px. environment.lua updated for next login.`;
+ root.notice = `${name} set live at ${root.cursorSize}px. cursor.lua updated for next login.`;
}
function setCursorSize(size) {
@@ -316,11 +330,8 @@ for name in sys.argv[2:]:
// Live on the current theme, then GTK and the next login's env.
Quickshell.execDetached(["hyprctl", "setcursor", root.currentCursor, String(size)]);
root.gsettingsSet("cursor-size", String(size));
- const text = envFile.text();
- // Matches both XCURSOR_SIZE and HYPRCURSOR_SIZE.
- if (text !== "")
- envFile.setText(text.replace(/(CURSOR_SIZE", ")[^"]*/g, (m, p1) => p1 + size));
+ root.writeCursor();
root.rewriteGtk("gtk-cursor-theme-size", size);
- root.notice = `cursor size ${size}px. environment.lua updated for next login.`;
+ root.notice = `cursor size ${size}px. cursor.lua updated for next login.`;
}
}