more updates

This commit is contained in:
randomuser 2021-02-15 17:16:23 -06:00
parent 5dd0007c04
commit 1abf6914e9
2 changed files with 14 additions and 2 deletions

View File

@ -4,6 +4,16 @@ exists() {
xrandr | grep ' connected' | grep "${1}" | wc -l 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 # usual setup: thinkpad x220 on dock connected to external
# monitor # monitor
@ -23,7 +33,7 @@ exists() {
[ $(exists "HDMI2") -eq 0 ] && \ [ $(exists "HDMI2") -eq 0 ] && \
[ $(exists "LVDS1") -gt 0 ] && \ [ $(exists "LVDS1") -gt 0 ] && \
xrandr --output LVDS1 --auto && \ xrandr --output HDMI2 --off && \
exit 0 || exit 1 exit 0 || exit 1
exit 1 exit 1

View File

@ -1,11 +1,13 @@
#!/bin/sh #!/bin/sh
WALLDIR="${HOME}/.share/wallpapers" WALLDIR="${HOME}/.share/wallpapers"
TEEFILE="${WALLDIR}/hist"
BASECMD="feh --bg-fill" BASECMD="feh --bg-fill"
generate_wall () { generate_wall () {
GENWALL=$( \ GENWALL=$( \
ls $WALLDIR | \ ls $WALLDIR | \
grep "." | \
shuf -n 1 shuf -n 1
) )
GENWALL="${WALLDIR}/${GENWALL}" GENWALL="${WALLDIR}/${GENWALL}"
@ -30,7 +32,7 @@ if check "xrandr"; then
for i in $(seq 1 $displays); do for i in $(seq 1 $displays); do
wall ${tmp} wall ${tmp}
tmp=${GENWALL} tmp=${GENWALL}
echo ${GENWALL} ${i} echo ${GENWALL} ${i} | tee $TEEFILE
cmd="${cmd} ${GENWALL}" cmd="${cmd} ${GENWALL}"
done done
eval ${BASECMD} ${cmd} eval ${BASECMD} ${cmd}