Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quickshell/Common/SessionData.qml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Singleton {
property string wallpaperCyclingMode: "interval"
property int wallpaperCyclingInterval: 300
property string wallpaperCyclingTime: "06:00"
property string wallpaperCyclingFolderPath: ""
property var monitorCyclingSettings: ({})

property bool nightModeEnabled: false
Expand Down
1 change: 1 addition & 0 deletions quickshell/Common/settings/SessionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var SPEC = {
wallpaperCyclingMode: { def: "interval" },
wallpaperCyclingInterval: { def: 300 },
wallpaperCyclingTime: { def: "06:00" },
wallpaperCyclingFolderPath: { def: "" },
monitorCyclingSettings: { def: {} },

nightModeEnabled: { def: false },
Expand Down
45 changes: 45 additions & 0 deletions quickshell/Modules/Settings/WallpaperTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ Item {
}
}

Rectangle {
width: 32
height: 32
radius: 16
color: Qt.rgba(255, 255, 255, 0.9)

DankIcon {
anchors.centerIn: parent
name: "create_new_folder"
size: 18
color: "black"
}

MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.openFolderWallpaperBrowser()
}
}

Rectangle {
width: 32
height: 32
Expand Down Expand Up @@ -1308,6 +1328,12 @@ Item {
mainWallpaperBrowserLoader.item.open();
}

function openFolderWallpaperBrowser() {
folderWallpaperBrowserLoader.active = true;
if (folderWallpaperBrowserLoader.item)
folderWallpaperBrowserLoader.item.open();
}

function openLightWallpaperBrowser() {
lightWallpaperBrowserLoader.active = true;
if (lightWallpaperBrowserLoader.item)
Expand Down Expand Up @@ -1342,6 +1368,25 @@ Item {
}
}

LazyLoader {
id: folderWallpaperBrowserLoader
active: false

FileBrowserModal {
parentModal: root.parentModal
browserTitle: I18n.tr("Select Wallpaper Folder", "wallpaper folder file browser title")
browserIcon: "folder"
browserType: "wallpaper"
folderMode: true
showHiddenFiles: true
onFileSelected: path => {
var targetMonitor = SessionData.perMonitorWallpaper ? selectedMonitorName : "";
WallpaperCyclingService.cycleFromFolder(targetMonitor, path);
close();
}
}
}

LazyLoader {
id: lightWallpaperBrowserLoader
active: false
Expand Down
27 changes: 26 additions & 1 deletion quickshell/Services/WallpaperCyclingService.qml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,31 @@ Singleton {
cycle(screenName, wallpaperPath, true);
}

function cycleFromFolder(screenName, folderPath) {
if (!folderPath)
return;

SessionData.wallpaperCyclingFolderPath = folderPath;
SessionData.saveSettings();

if (screenName && monitorProcessComponent.status === Component.Ready) {
var process = monitorProcessFor(screenName);
process.command = findCommand(folderPath);
process.targetScreenName = screenName;
process.currentWallpaper = "";
process.goToPrevious = false;
process.running = true;
return;
}

var globalProcess = cyclingProcess;
globalProcess.command = findCommand(folderPath);
globalProcess.targetScreenName = screenName || "";
globalProcess.currentWallpaper = "";
globalProcess.goToPrevious = false;
globalProcess.running = true;
}

function resetScheduleAfterManual() {
if (!serverSchedulingAvailable)
return;
Expand Down Expand Up @@ -224,7 +249,7 @@ Singleton {
if (!text || !text.trim())
return;
const files = text.trim().split('\n').filter(file => file.length > 0);
if (files.length <= 1)
if (files.length < 1)
return;
const wallpaperList = files.sort();
let currentIndex = wallpaperList.findIndex(path => path === currentPath);
Expand Down