From dc5cd96f974036f563ffd6c70b75ddd242d56fa1 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 25 Aug 2019 21:03:36 -0700 Subject: [PATCH] added safety to newga and sleep delay to distro script --- distro | 2 +- newbga | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/distro b/distro index 55f5ae7..fa64336 100755 --- a/distro +++ b/distro @@ -37,5 +37,5 @@ o88888"888"88o. "8888"".88 .oo888oo.. echo "Distro: ${green}`uname -v | awk '{print $3}'`${nc} Kernel: ${white}`uname -o`${nc}" echo "=|:^) Art: https://www.asciiart.eu/plants/flowers =|:^)" -scrot +sleep 1 diff --git a/newbga b/newbga index fb49c59..110f8d9 100755 --- a/newbga +++ b/newbga @@ -29,6 +29,13 @@ 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 + +# Quick check if we even have a second monitor at all +c=`xrandr | grep ' connected' | wc -l` +if $c = "1" +then + exit +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