diff --git a/qt6ct/qt6ct.conf b/qt6ct/qt6ct.conf index 1b7d949..8ff8fe5 100644 --- a/qt6ct/qt6ct.conf +++ b/qt6ct/qt6ct.conf @@ -3,6 +3,3 @@ color_scheme_path=/home/nico/.config/qt6ct/colors/aether-rice.conf custom_palette=true icon_theme=Papirus-Dark style=Fusion - -[SettingsWindow] -geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\r4\0\0\x1\xe8\0\0\n\0\0\0\0\0\0\0\v\x90\0\0\x1\xe8\0\0\0\0\x2\0\0\0\x6\x90\0\0\n\0\0\0\0\0\0\0\r4\0\0\x1\xe8) diff --git a/quickshell/default/Bar.qml b/quickshell/default/Bar.qml index 438fbee..781ca87 100644 --- a/quickshell/default/Bar.qml +++ b/quickshell/default/Bar.qml @@ -12,6 +12,8 @@ Variants { model: Quickshell.screens readonly property bool isGerman: Qt.locale().name.startsWith("de") + readonly property string themeDir: Quickshell.env("HOME") + "/.config/theme" + readonly property string scriptsDir: Quickshell.shellDir + "/scripts" readonly property string logoutLabel: isGerman ? "Abmelden" : "Logout" readonly property string restartLabel: isGerman ? "Neustart" : "Restart" readonly property string shutdownLabel: isGerman ? "Herunterfahren" : "Shutdown" @@ -210,7 +212,7 @@ Variants { sourceComponent: Item { Process { id: themeDump - command: ["python3", "/home/nico/.config/theme/render.py", "--dump"] + command: ["python3", root.themeDir + "/render.py", "--dump"] stdout: StdioCollector { id: themeDumpCollector } onExited: { try { @@ -308,7 +310,7 @@ Variants { Process { id: statsProc - command: ["bash", "/home/nico/.config/quickshell/default/scripts/stats.sh"] + command: ["bash", root.scriptsDir + "/stats.sh"] stdout: StdioCollector { id: statsCollector } onExited: { var p = statsCollector.text.trim().split("|") @@ -397,7 +399,7 @@ Variants { // ---- notification panel (mako history minus what was marked read) ---- Process { id: notifProc - command: ["python3", "/home/nico/.config/quickshell/default/scripts/notifs.py"] + command: ["python3", root.scriptsDir + "/notifs.py"] stdout: StdioCollector { id: notifCollector } onExited: { try { bar.notifList = JSON.parse(notifCollector.text) } catch (e) {} @@ -413,7 +415,7 @@ Variants { var gone = {} keys.forEach(function (k) { gone[k] = true }) notifList = notifList.filter(function (n) { return !gone[n.key] }) - notifReadProc.command = ["python3", "/home/nico/.config/quickshell/default/scripts/notifs.py", "read"].concat(keys) + notifReadProc.command = ["python3", root.scriptsDir + "/notifs.py", "read"].concat(keys) notifReadProc.running = true } @@ -477,7 +479,7 @@ Variants { Process { id: volumeProc - command: ["bash", "/home/nico/.config/quickshell/default/scripts/volume.sh"] + command: ["bash", root.scriptsDir + "/volume.sh"] stdout: StdioCollector { id: volumeCollector } onExited: { var parts = volumeCollector.text.trim().split("|") diff --git a/quickshell/default/ThemeWidget.qml b/quickshell/default/ThemeWidget.qml index e0b3fe8..4030fcd 100644 --- a/quickshell/default/ThemeWidget.qml +++ b/quickshell/default/ThemeWidget.qml @@ -25,7 +25,7 @@ PanelWindow { WlrLayershell.layer: WlrLayer.Bottom readonly property bool isGerman: Qt.locale().name.startsWith("de") - readonly property string themeDir: "/home/nico/.config/theme" + readonly property string themeDir: Quickshell.env("HOME") + "/.config/theme" property bool wallpaperOpen: false property bool colorsOpen: false diff --git a/theme/render.py b/theme/render.py index e0c1299..1f1dc8a 100755 --- a/theme/render.py +++ b/theme/render.py @@ -46,9 +46,16 @@ def hex_to_rgb(hex_color): def substitute(text, colors): def repl(m): key, fmt, arg = m.group(1), m.group(2), m.group(3) - if key not in colors: + if key == "home": + # Not a palette color - always available, for templates (qt6ct.conf) that + # need an absolute path baked in. Without this, that path would hardcode + # whoever last ran render.py's home directory into the template output, + # breaking it for any other user with their own copy of this repo. + value = os.path.expanduser("~") + elif key not in colors: sys.exit(f"render.py: unknown color key '{key}' in template") - value = colors[key] + else: + value = colors[key] if fmt is None: return str(value) if not isinstance(value, str): diff --git a/theme/templates/qt6ct-conf/config.json b/theme/templates/qt6ct-conf/config.json new file mode 100644 index 0000000..5a2a09f --- /dev/null +++ b/theme/templates/qt6ct-conf/config.json @@ -0,0 +1,4 @@ +{ + "template": "qt6ct.conf", + "destination": "~/.config/qt6ct/qt6ct.conf" +} diff --git a/theme/templates/qt6ct-conf/qt6ct.conf b/theme/templates/qt6ct-conf/qt6ct.conf new file mode 100644 index 0000000..f15ebb9 --- /dev/null +++ b/theme/templates/qt6ct-conf/qt6ct.conf @@ -0,0 +1,5 @@ +[Appearance] +color_scheme_path={home}/.config/qt6ct/colors/aether-rice.conf +custom_palette=true +icon_theme=Papirus-Dark +style=Fusion