feat: Add new wallpaper script to disable auto changes
This commit is contained in:
@@ -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`]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user