~scripts
40 itemsDownload ./*


..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
battery-monitor
checkit
cleverbot.py
clock
color-gen
colors-hex
compton
dailywall
dmenu
importw
indexer
keep-on
mp3ogg
orage
pipes
pipes.x
rain
randwall
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptskeep-on
2 years agoDownloadRawClose


#!/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
#

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"

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

    sleep 1
done

exit 0

Top
twily at openmailbox dot org
©twily.info 2013 - 2017



744 050 visits
... ^ v