Merge branch 'master' of gitlab.com:shockrah/shell-scripts

This commit is contained in:
shockrahwow 2019-09-09 16:31:32 -07:00
commit 33766c95e9
2 changed files with 11 additions and 2 deletions

5
newbga
View File

@ -10,6 +10,7 @@ base="/home/shockrah/Pictures/VPapes"
# Pic two random video papes # Pic two random video papes
pape1=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1` pape1=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1`
pape2=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1` pape2=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1`
echo
while "$pape1" = "$pape2" while "$pape1" = "$pape2"
do do
pape2=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1` pape2=`ls "${HOME}/Pictures/VPapes" | shuf | head -n 1`
@ -29,6 +30,7 @@ mpv="mpv --wid WID --no-config --keepaspect=no --loop \
# First monitor # First monitor
xwinwrap -g 1920x1080 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape1" & > /dev/null 2>&1 & xwinwrap -g 1920x1080 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape1" & > /dev/null 2>&1 &
echo $! > ${HOME}/.cache/mpvbg.pid echo $! > ${HOME}/.cache/mpvbg.pid
echo "$pape1" > $HOME/.cache/newbga_img
# Quick check if we even have a second monitor at all # Quick check if we even have a second monitor at all
c=`xrandr | grep ' connected' | wc -l` c=`xrandr | grep ' connected' | wc -l`
@ -39,5 +41,4 @@ fi
# Second monitor # Second monitor
xwinwrap -g 1920x1080+1920+0 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape2" & > /dev/null 2>&1 & 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 $! >> ${HOME}/.cache/mpvbg.pid
echo "$pape1" >> $HOME/.cache/newbga_img

8
usm
View File

@ -15,6 +15,14 @@ if [ -z "$dev" ]; then exit; fi
# Check if it's already mounted / something was even picked # Check if it's already mounted / something was even picked
if grep -qs "$dev" /proc/mounts; if grep -qs "$dev" /proc/mounts;
then 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 umount $dev
rm -d "$mntpnt/$name" rm -d "$mntpnt/$name"
else else