wallpapers: use CAELESTIA_WALLPAPERS_DIR env
Env var overrides config option
This commit is contained in:
parent
a1ac25c665
commit
9659130fdb
3 changed files with 6 additions and 4 deletions
|
|
@ -137,7 +137,7 @@ Item {
|
|||
}
|
||||
|
||||
StyledText {
|
||||
text: root.state === "wallpapers" && Wallpapers.list.length === 0 ? qsTr("Try putting some wallpapers in %1").arg(Paths.shortenHome(Config.paths.wallpaperDir)) : qsTr("Try searching for something else")
|
||||
text: root.state === "wallpapers" && Wallpapers.list.length === 0 ? qsTr("Try putting some wallpapers in %1").arg(Paths.shortenHome(Paths.wallsdir)) : qsTr("Try searching for something else")
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ Searcher {
|
|||
id: getWallsProc
|
||||
|
||||
running: true
|
||||
command: ["find", "-L", Paths.expandTilde(Config.paths.wallpaperDir), "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"]
|
||||
command: ["find", "-L", Paths.expandTilde(Paths.wallsdir), "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: wallpapers.model = text.trim().split("\n").filter(w => Images.isValidImageByName(w)).sort()
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ Searcher {
|
|||
id: watchWallsProc
|
||||
|
||||
running: true
|
||||
command: ["inotifywait", "-r", "-e", "close_write,moved_to,create", "-m", Paths.expandTilde(Config.paths.wallpaperDir)]
|
||||
command: ["inotifywait", "-r", "-e", "close_write,moved_to,create", "-m", Paths.expandTilde(Paths.wallsdir)]
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
if (Images.isValidImageByName(data))
|
||||
|
|
@ -125,6 +125,6 @@ Searcher {
|
|||
component Wallpaper: QtObject {
|
||||
required property string modelData
|
||||
readonly property string path: modelData
|
||||
readonly property string name: path.slice(Paths.expandTilde(Config.paths.wallpaperDir).length + 1, path.lastIndexOf("."))
|
||||
readonly property string name: path.slice(Paths.expandTilde(Paths.wallsdir).length + 1, path.lastIndexOf("."))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
pragma Singleton
|
||||
|
||||
import qs.config
|
||||
import Quickshell
|
||||
import Qt.labs.platform
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ Singleton {
|
|||
readonly property url config: `${StandardPaths.standardLocations(StandardPaths.GenericConfigLocation)[0]}/caelestia`
|
||||
|
||||
readonly property url imagecache: `${cache}/imagecache`
|
||||
readonly property string wallsdir: Quickshell.env("CAELESTIA_WALLPAPERS_DIR") || Config.paths.wallpaperDir
|
||||
readonly property string libdir: Quickshell.env("CAELESTIA_LIB_DIR") || "/usr/lib/caelestia"
|
||||
|
||||
function stringify(path: url): string {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue