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}