summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-05-02 17:36:16 +0200
committermakefu <github@syntax-fehler.de>2016-05-02 17:36:16 +0200
commite4251e63ac983885466c5c5ebfb71e071e8bcfc4 (patch)
tree3d52d8895519db40cacaadd714d6b5d18c1c3ead
parentdf8b7fffb1d8f117e364129619e35dc61d6f565c (diff)
k 3 fetchWallpaper: move only if exists
-rw-r--r--krebs/3modules/fetchWallpaper.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix
index 53fe0839d..bd3d6d3b2 100644
--- a/krebs/3modules/fetchWallpaper.nix
+++ b/krebs/3modules/fetchWallpaper.nix
@@ -42,9 +42,11 @@ let
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
#! ${pkgs.bash}/bin/bash
+ set -euf
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
'';