made wallpaper settable with xdg config
This commit is contained in:
@@ -5,6 +5,7 @@ import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
|
||||
import "../../colors"
|
||||
import "../../states/wallpaperdir" as Global
|
||||
|
||||
Variants {
|
||||
id: root
|
||||
@@ -32,6 +33,7 @@ Variants {
|
||||
Keys.onPressed: event => {
|
||||
if (event.key == Qt.Key_Escape) {
|
||||
console.log("Pressed Escape, closing Wallpaper Picker")
|
||||
console.log("Wallpaper Dir:", Global.WallpaperState.wallpaperDir)
|
||||
wlogoutLoader.active = false
|
||||
} else {
|
||||
for (let i = 0; i < buttons.length; i++) {
|
||||
@@ -51,16 +53,17 @@ Variants {
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: Quickshell.env("HOME") + "/Pictures/Wallpapers/Static/blurred.jpg"
|
||||
source: Global.WallpaperState.wallpaperDir + "/Static/blurred.jpg"
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
console.log("Pressed Escape, closing Wallpaper Picker")
|
||||
console.log("clicked ???, closing Wallpaper Picker")
|
||||
wlogoutLoader.active = false
|
||||
}
|
||||
GridLayout {
|
||||
|
||||
@@ -3,14 +3,32 @@ import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
|
||||
import "../../states/wallpaper" as Global
|
||||
|
||||
|
||||
Item { // container, invisible
|
||||
id: wlLoader
|
||||
|
||||
Process {
|
||||
id: getWallpaper
|
||||
command: ["sh", "-c", Quickshell.env("HOME") + "/.config/quickshell/scripts/wallpaper_dir.sh"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: function() {
|
||||
console.log("getWallpaper: " + this.text)
|
||||
|
||||
Global.WallpaperState.wallpaperDir = this.text.trim()
|
||||
|
||||
wlogoutLoader.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: wlogoutLoader
|
||||
active: false
|
||||
sourceComponent: Wlogout { id: wLogout }
|
||||
sourceComponent: Wlogout {
|
||||
id: wLogout
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
@@ -19,7 +37,8 @@ Item { // container, invisible
|
||||
|
||||
onPressed: {
|
||||
console.log("Pressed Meta+Shift+W (Hyprland global shortcut)")
|
||||
wlogoutLoader.active = !wlogoutLoader.active
|
||||
getWallpaper.running = true
|
||||
// wlogoutLoader.active = !wlogoutLoader.active
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user