From b566e0bdcba4ae9339def0e4b0991ed1ba27e0c9 Mon Sep 17 00:00:00 2001 From: Sem Date: Mon, 30 Mar 2026 00:00:04 +0200 Subject: [PATCH] put randomwallpaper in services folder --- quickshell/RandomWallpaper.qml | 57 ---------------------------------- quickshell/shell.qml | 1 + 2 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 quickshell/RandomWallpaper.qml diff --git a/quickshell/RandomWallpaper.qml b/quickshell/RandomWallpaper.qml deleted file mode 100644 index 8cb1fc6..0000000 --- a/quickshell/RandomWallpaper.qml +++ /dev/null @@ -1,57 +0,0 @@ -import Quickshell -import Quickshell.Io -import QtQuick - -Item { - id: wallpaperHolder - - // Store all wallpapers - property var wallpapers: [] - property string wallpaperDir: Qt.resolvedUrl("file:///home/sem/Pictures/wallpapers") - - // process to run the command to change the wallpaper - Process { - id: wallpaperProcess - } - - // Load wallpaper list once at startup - Process { - id: loadWallpapers - command: ["bash", "-c", "find ~/Pictures/wallpapers -type f"] - - stdout: StdioCollector { - onStreamFinished: { - console.log("wallpapers loaded!"); - wallpaperHolder.wallpapers = this.text.trim().split("\n"); - wallpaperHolder.setRandomWallpaper(); - } - } - } - - function setRandomWallpaper() { - if (wallpapers.length === 0) { - console.log("No wallpapers found"); - return; - } - - var index = Math.floor(Math.random() * wallpapers.length); - var path = wallpapers[index]; - - // console.log("wallpaper set to " + path); - - wallpaperProcess.command = ["awww", "img", path, "--transition-type", "grow", "--transition-fps", "60", "--transition-duration", "0.6"]; - - wallpaperProcess.running = true; - } - - Timer { - interval: 60000 - running: true - repeat: true - onTriggered: wallpaperHolder.setRandomWallpaper() - } - - Component.onCompleted: { - loadWallpapers.running = true; // start loading wallpapers - } -} diff --git a/quickshell/shell.qml b/quickshell/shell.qml index d0fc8ef..423ff00 100644 --- a/quickshell/shell.qml +++ b/quickshell/shell.qml @@ -8,6 +8,7 @@ import QtQuick.Layouts import "." import "constants" import "ui" +import "services" // qmllint disable uncreatable-type PanelWindow {