~scriptsdisplay
10 itemsDownload ./*

10 itemsDownload ./*

..
ana-wall-login.sh
ana-wall-next.sh
ana-wall-refresh.sh
ana-wall.sh
brightness.sh
brightness_change
keep-on.sh
screen-dim
screenshot.sh
xorient.sh


displaykeep-on.sh
2 612•  3 months ago•  DownloadRawClose
3 months ago•  2 612

{}
#!/bin/bash
#
#   Author:         Twily                                                        2015
#   Description:    Waits for the monitor 'off' state to turn back on and dim instead
#                   (use ~/scripts/screen-dim to toggle lights back up)
#   Require:        xset, xbacklight
#

export DISPLAY=:0

function keepon() {
    xset dpms force on
    xset dpms 0 0 0 && xset -dpms && xset s off
    #xbacklight -set 0
}

echo -e "keep-on: \033[1;33mWaiting for monitor 'off' state...\033[0m"

CLOGIN=0
while true; do
    MON=$(xset -q|grep 'Monitor is')

    if [[ $MON == *Off* ]]; then
        keepon
        echo -e "keep-on: \033[1;32mMonitor turned back on...\033[0m"
        echo -e "keep-on: \033[1;32mDimming backlight to 0...\033[0m"
    fi

    CTEST=$( cat ~/ana-wall-login.log )
    if [ "$CTEST" != "$CLOGIN" ] && [ "$CLOGIN" != "0" ]; then
        CLOGIN=$CTEST

        echo "exec ana-wall-refresh"
        ./scripts/display/ana-wall-refresh.sh
    elif [ "$CLOGIN" == "0" ]; then
        echo "setup clogin ready"

        CLOGIN=$CTEST
    fi
    #~/scripts/display/battery_check.sh


    echo "loop 1"
    sleep 1
done

exit 0

Top
©twily.info 2013 - 2024
twily at twily dot info



2 139 586 visits
... ^ v