aurora28d213d
aurora: keep the wallpaper record in ~/.local/state, not hyprpaper.conf
+10 −13
2 files changed
- M .config/quickshell/aurora/Wall.qml +9 −12
- M .local/bin/setwall +1 −1
| @@ -4,8 +4,8 @@ import Quickshell | |||
| 4 | 4 | import Quickshell.Io | |
| 5 | 5 | ||
| 6 | 6 | // Wallpapers: folder listing, cached thumbnails, and applying them. aurora owns the wallpaper and draws it itself | |
| 7 | − | // (Back.qml / WallView.qml, look = Settings.wallLook): apply() records the path in hyprpaper.conf (only as the record, | |
| 8 | − | // hyprpaper isn't run any more) and runs matugen (all colours, terminal included; Theme then recolours itself). recolor() re-runs just matugen when the scheme/contrast setting changes. | |
| 7 | + | // (Back.qml / WallView.qml, look = Settings.wallLook): apply() records the path in ~/.local/state/aurora/wallpaper | |
| 8 | + | // and runs matugen (all colours, terminal included; Theme then recolours itself). recolor() re-runs just matugen when the scheme/contrast setting changes. | |
| 9 | 9 | // ~/.local/bin/setwall is only a CLI front-end for the IPC calls (wallrandom / wall / wallset). | |
| 10 | 10 | Singleton { | |
| 11 | 11 | id: root | |
| @@ -13,7 +13,7 @@ Singleton { | |||
| 13 | 13 | readonly property string home: Quickshell.env("HOME") | |
| 14 | 14 | property string rootDir: home + "/pix/wallpapers" | |
| 15 | 15 | property string folder: Settings.wallFolder // default dusky-dark | |
| 16 | − | readonly property string conf: home + "/.config/hypr/hyprpaper.conf" | |
| 16 | + | readonly property string record: home + "/.local/state/aurora/wallpaper" // the current wallpaper's path | |
| 17 | 17 | readonly property string thumbDir: home + "/.cache/aurora/thumbs" | |
| 18 | 18 | ||
| 19 | 19 | property var folders: [] // subfolder names; "" = everything under rootDir | |
| @@ -41,16 +41,13 @@ Singleton { | |||
| 41 | 41 | "-regextype", "posix-extended", "-iregex", ".*\\.(png|jpe?g|webp)"] | |
| 42 | 42 | listProc.running = true | |
| 43 | 43 | } | |
| 44 | − | // hyprpaper.conf is the record of the current wallpaper (kept in hyprpaper's format, so it still works if | |
| 45 | − | // hyprpaper is ever started again) | |
| 46 | 44 | readonly property string applyJob: | |
| 47 | − | 'p="$1"; c="$2"; ' + | |
| 48 | − | 'printf "splash = false\\nwallpaper {\\n monitor =\\n path = %s\\n}\\n" "$p" > "$c"; ' + | |
| 45 | + | 'p="$1"; c="$2"; mkdir -p "${c%/*}"; printf "%s\\n" "$p" > "$c"; ' + | |
| 49 | 46 | 'matugen image "$p" -m dark -t "$3" --contrast="$4" --prefer saturation -q' | |
| 50 | 47 | function apply(path) { | |
| 51 | 48 | if (!path) return | |
| 52 | 49 | current = path | |
| 53 | − | Quickshell.execDetached(["sh", "-c", applyJob, "sh", path, conf, Settings.matuScheme, String(Settings.matuContrast)]) | |
| 50 | + | Quickshell.execDetached(["sh", "-c", applyJob, "sh", path, record, Settings.matuScheme, String(Settings.matuContrast)]) | |
| 54 | 51 | } | |
| 55 | 52 | ||
| 56 | 53 | // matugen only. --prefer: v4 otherwise asks on stdin when the image has several source colours. | |
| @@ -149,15 +146,15 @@ Singleton { | |||
| 149 | 146 | } | |
| 150 | 147 | } | |
| 151 | 148 | ||
| 152 | − | // current wallpaper, from its record in hyprpaper.conf. None yet (fresh install): pick a random one. | |
| 149 | + | // current wallpaper, from its record. None yet (fresh install): pick a random one. | |
| 153 | 150 | FileView { | |
| 154 | − | path: root.conf | |
| 151 | + | path: root.record | |
| 155 | 152 | watchChanges: true | |
| 156 | 153 | onFileChanged: reload() | |
| 157 | 154 | onLoadFailed: root.random() | |
| 158 | 155 | onLoaded: { | |
| 159 | − | var m = text().match(/^\s*path\s*=\s*(.+)$/m) | |
| 160 | − | if (m) root.current = m[1].trim() | |
| 156 | + | var p = text().trim() | |
| 157 | + | if (p) root.current = p | |
| 161 | 158 | if (!root.checkedColours) { root.checkedColours = true; root.recolor(true) } | |
| 162 | 159 | } | |
| 163 | 160 | } | |
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/sh | |
| 2 | 2 | # Set the wallpaper through aurora. aurora owns the wallpaper: it draws it itself (mono dots, colour dots or photo, | |
| 3 | − | # see its settings), records it in hyprpaper.conf and runs matugen (colours). This is just the CLI front-end for its IPC. | |
| 3 | + | # see its settings), records it in ~/.local/state/aurora/wallpaper and runs matugen (colours). This is just the CLI front-end for its IPC. | |
| 4 | 4 | # | |
| 5 | 5 | # setwall random wallpaper from the folder selected in aurora's picker | |
| 6 | 6 | # setwall -m open (toggle) aurora's wallpaper picker | |