aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2021-03-07 21:55:34 +0100
committerPatrick Spek <p.spek@tyil.nl>2021-08-14 12:01:15 +0200
commitc7ca442194c69c2ba0843ca8952328129e806ed8 (patch)
tree24e2916d9dbd682a7a56467e79c6633c8d4462bb /.local
parent5bd947c9a39bbd392aa8cc1d608cec2c832ba387 (diff)
Even more logging for chwp
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/chwp21
1 files changed, 19 insertions, 2 deletions
diff --git a/.local/bin/chwp b/.local/bin/chwp
index 60a673b..f2d0d18 100755
--- a/.local/bin/chwp
+++ b/.local/bin/chwp
@@ -55,7 +55,7 @@ set_papes()
log set_papes "Setting wallpaper to $pape"
- feh --bg-fill "$pape"
+ feh --bg-fill "$pape" 2>&1 | log_pipe "feh"
log set_papes "Cleaning up temporary wallpaper image"
@@ -113,7 +113,9 @@ make_pape()
# shellcheck disable=SC2046
# shellcheck disable=SC2086
- eval convert +append $(cat $imagelist) "$output"
+ log make_pape "Combine all resolutions into a single image"
+
+ eval convert +append $(cat $imagelist) "$output" 2>&1 | log_pipe "convert"
printf "%s" "$output"
@@ -136,4 +138,19 @@ log()
printf "[%s] %s: %s\n" "$(date +%FT%T)" "$1" "$2" >&2
}
+log_pipe()
+{
+ pipe_log="$(mktemp)"
+
+ cat - > "$pipe_log"
+
+ while read -r line
+ do
+ log "$1" "$line"
+ done < "$pipe_log"
+
+ rm -fr -- "$pipe_log"
+ unset pipe_log
+}
+
main "$@"