From 1abf6914e977a872a89bf49369ce67d05a444c15 Mon Sep 17 00:00:00 2001 From: randomuser Date: Mon, 15 Feb 2021 17:16:23 -0600 Subject: [PATCH] more updates --- scripts/disp | 12 +++++++++++- scripts/wall | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/disp b/scripts/disp index c78563f..cce2c71 100755 --- a/scripts/disp +++ b/scripts/disp @@ -4,6 +4,16 @@ exists() { xrandr | grep ' connected' | grep "${1}" | wc -l } +# commands + +[ "$1" = "big" ] && \ + xrandr --output LVDS1 --off && \ + exit 0 || exit 1 + +[ "$1" = "small" ] && \ + xrandr --output HDMI2 --off && \ + exit 0 || exit 1 + # usual setup: thinkpad x220 on dock connected to external # monitor @@ -23,7 +33,7 @@ exists() { [ $(exists "HDMI2") -eq 0 ] && \ [ $(exists "LVDS1") -gt 0 ] && \ - xrandr --output LVDS1 --auto && \ + xrandr --output HDMI2 --off && \ exit 0 || exit 1 exit 1 diff --git a/scripts/wall b/scripts/wall index bb16c60..a32eebe 100755 --- a/scripts/wall +++ b/scripts/wall @@ -1,11 +1,13 @@ #!/bin/sh WALLDIR="${HOME}/.share/wallpapers" +TEEFILE="${WALLDIR}/hist" BASECMD="feh --bg-fill" generate_wall () { GENWALL=$( \ ls $WALLDIR | \ + grep "." | \ shuf -n 1 ) GENWALL="${WALLDIR}/${GENWALL}" @@ -30,7 +32,7 @@ if check "xrandr"; then for i in $(seq 1 $displays); do wall ${tmp} tmp=${GENWALL} - echo ${GENWALL} ${i} + echo ${GENWALL} ${i} | tee $TEEFILE cmd="${cmd} ${GENWALL}" done eval ${BASECMD} ${cmd}