diff --git a/newbga b/newbga index 110f8d9..0d43248 100755 --- a/newbga +++ b/newbga @@ -10,6 +10,7 @@ base="/home/shockrah/Pictures/VPapes" # Pic two random video papes pape1=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1` pape2=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1` +echo while "$pape1" = "$pape2" do pape2=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1` @@ -29,6 +30,7 @@ mpv="mpv --wid WID --no-config --keepaspect=no --loop \ # First monitor xwinwrap -g 1920x1080 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape1" & > /dev/null 2>&1 & echo $! > ${HOME}/.cache/mpvbg.pid +echo "$pape1" > $HOME/.cache/newbga_img # Quick check if we even have a second monitor at all c=`xrandr | grep ' connected' | wc -l` @@ -39,5 +41,4 @@ fi # Second monitor xwinwrap -g 1920x1080+1920+0 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape2" & > /dev/null 2>&1 & echo $! >> ${HOME}/.cache/mpvbg.pid - - +echo "$pape1" >> $HOME/.cache/newbga_img diff --git a/usm b/usm index 2f6c33d..67d979c 100755 --- a/usm +++ b/usm @@ -15,6 +15,14 @@ if [ -z "$dev" ]; then exit; fi # Check if it's already mounted / something was even picked if grep -qs "$dev" /proc/mounts; then + # unmount the drive + umount "$HOME/.mounts/$name" + rm -d "$HOME/.mounts/$name" + # check if we still need the .mounts directory or nah + if [ "`ls ~/.mounts/`" ] + then + rm -d ~/.mounts/ + fi umount $dev rm -d "$mntpnt/$name" else