Skip to content
Merged
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
4 changes: 2 additions & 2 deletions modules/launcher/WallpaperList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PathView {
id: root

required property StyledTextField search
required property PersistentProperties visibilities
required property var visibilities
required property var panels
required property var content

Expand All @@ -27,7 +27,7 @@ PathView {
let outerMargins = 0;
if (panels.popouts.hasCurrent && panels.popouts.currentCenter + panels.popouts.nonAnimHeight / 2 > screen.height - content.implicitHeight - Config.border.thickness * 2)
outerMargins = panels.popouts.nonAnimWidth;
if (visibilities.utilities && panels.utilities.implicitWidth > outerMargins)
if ((visibilities.utilities || visibilities.sidebar) && panels.utilities.implicitWidth > outerMargins)
outerMargins = panels.utilities.implicitWidth;
const maxWidth = screen.width - Config.border.rounding * 4 - (barMargins + outerMargins) * 2;

Expand Down
5 changes: 4 additions & 1 deletion plugin/src/Caelestia/cutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) co
}

if (overwrite) {
QFile::remove(target.toLocalFile());
if (!QFile::remove(target.toLocalFile())) {
qWarning() << "CUtils::copyFile: overwrite was specified but failed to remove" << target.toLocalFile();
return false;
}
}

return QFile::copy(source.toLocalFile(), target.toLocalFile());
Expand Down
8 changes: 4 additions & 4 deletions services/Notifs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ Singleton {
name: "clearNotifs"
description: "Clear all notifications"
onPressed: {
for (const notif of root.list)
notif.popup = false;
for (const notif of root.list.slice())
notif.close();
}
}

IpcHandler {
target: "notifs"

function clear(): void {
for (const notif of root.list)
notif.popup = false;
for (const notif of root.list.slice())
notif.close();
}

function isDndEnabled(): bool {
Expand Down
56 changes: 54 additions & 2 deletions services/Wallpapers.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,26 @@ Searcher {

function setWallpaper(path: string): void {
actualCurrent = path;
Quickshell.execDetached(["caelestia", "wallpaper", "-f", path, ...smartArg]);

const isGif = path.toLowerCase().endsWith(".gif");

if (isGif) {
// Bypass CLI and write directly to path.txt for GIFs
writeGifPathProc.command = ["sh", "-c", `echo '${path}' > '${currentNamePath}'`];
writeGifPathProc.running = true;

if (Colours.scheme === "dynamic") {
setGifColoursProc.command = ["caelestia", "wallpaper", "-p", path, ...smartArg];
setGifColoursProc.running = true;
}
} else {
Quickshell.execDetached(["caelestia", "wallpaper", "-f", path, ...smartArg]);
}
}

function preview(path: string): void {
previewPath = path;
showPreview = true;

if (Colours.scheme === "dynamic")
getPreviewColoursProc.running = true;
}
Expand Down Expand Up @@ -90,4 +103,43 @@ Searcher {
}
}
}

Process {
id: writeGifPathProc
// Command is set dynamically in setWallpaper()
// Writes GIF path directly to path.txt since CLI doesn't support GIFs
}

Process {
id: setGifColoursProc
stdout: StdioCollector {
onStreamFinished: {
const scheme = JSON.parse(text);

Colours.load(text, false);

// Persist the scheme JSON directly to file
const schemePath = `${Paths.state}/scheme.json`;
saveGifSchemeProc.command = ["sh", "-c", `echo '${text}' > '${schemePath}'`];
saveGifSchemeProc.schemeData = scheme;
saveGifSchemeProc.running = true;
}
}
}

Process {
id: saveGifSchemeProc
property var schemeData: null

// Saves the GIF color scheme to the persistent scheme.json file
onExited: {
if (schemeData) {
Quickshell.execDetached([
"caelestia", "scheme", "set",
"-m", schemeData.mode,
"-v", schemeData.variant
]);
}
}
}
}