k 3 fetchWallpaper: move only if exists
This commit is contained in:
parent
df8b7fffb1
commit
e4251e63ac
@ -42,9 +42,11 @@ let
|
|||||||
|
|
||||||
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
|
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
|
set -euf
|
||||||
|
|
||||||
mkdir -p ${shell.escape cfg.stateDir}
|
mkdir -p ${shell.escape cfg.stateDir}
|
||||||
curl -s -o ${shell.escape cfg.stateDir}/wallpaper -z ${shell.escape cfg.stateDir}/wallpaper ${shell.escape cfg.url}
|
cd ${shell.escape cfg.stateDir}
|
||||||
|
curl -s -o wallpaper.tmp -z wallpaper ${shell.escape cfg.url} && mv wallpaper.tmp wallpaper
|
||||||
feh --no-fehbg --bg-scale ${shell.escape cfg.stateDir}/wallpaper
|
feh --no-fehbg --bg-scale ${shell.escape cfg.stateDir}/wallpaper
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user