feat: Add new wallpaper script to disable auto changes

This commit is contained in:
2025-04-20 14:17:42 +10:00
parent 1d84fd110f
commit bee7c8fef8
14 changed files with 128 additions and 594 deletions

View File

@@ -9,4 +9,21 @@ export function setWallpaper(wallpaperPath) {
OS.exec(["hyprctl", "-q", "hyprpaper unload all"]);
OS.exec(["hyprctl", "-q", `hyprpaper preload ${wallpaperPath}`]);
OS.exec(["hyprctl", "-q", `hyprpaper wallpaper ,${wallpaperPath}`]);
// SYMLINK
// Extract directory and extension
const lastSlashIndex = wallpaperPath.lastIndexOf('/');
const directory = wallpaperPath.substring(0, lastSlashIndex + 1);
const lastDotIndex = wallpaperPath.lastIndexOf('.');
const extension = lastDotIndex > lastSlashIndex ? wallpaperPath.substring(lastDotIndex) : '';
// Create lockpaper path with same extension
const lockpaperPath = `${directory}lockpaper${extension}`;
// DELETE ANY OLD IMAGES
OS.exec(["zsh", "-c", `rm ${directory}lockpaper*`]);
// Create symlink from wallpaper to lockpaper
OS.exec(["zsh", "-c", `ln -s ${wallpaperPath} ${lockpaperPath}`]);
OS.exec(["zsh", "-c", `ln -sf ${wallpaperPath} /home/nathan/.config/lockpaper`]);
}