From 05549329707b4f8ae14f718e50cdd7c41d15ed4a Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 4 Jan 2025 15:37:44 +0000 Subject: backup script performs notify-send <=> X display is available --- Scripts/.local/scripts/do_backup | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Scripts') diff --git a/Scripts/.local/scripts/do_backup b/Scripts/.local/scripts/do_backup index de2db42..3f795ae 100755 --- a/Scripts/.local/scripts/do_backup +++ b/Scripts/.local/scripts/do_backup @@ -7,10 +7,22 @@ folders="$HOME/Dotfiles $HOME/Downloads $HOME/Media $HOME/Pictures $HOME/Project mkdir -p $dir -notify-send "do_backup: Starting backup (stored at $dir)" +if ! xset -q &> /dev/null +then + echo "do_backup: Starting backup (stored at $dir)" +else + notify-send "do_backup: Starting backup (stored at $dir)" +fi + for name in $folders do out_name=$dir/$(basename $name).tar.xz XZ_OPT='-T0 -9' tar -Jcvf $out_name -C $name . done -notify-send "do_backup: Finished backup" + +if ! xset -q &> /dev/null +then + echo "do_backup: Finished backup" +else + notify-send "do_backup: Finished backup" +fi -- cgit v1.2.3-13-gbd6f