~scripts
55 itemsDownload ./*

55 itemsDownload ./*

..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
ana-wall.sh
battery-monitor
brightness.sh
checkit
cleverbot.py
clock
color-gen
colors-hex
colorscheme.sh
compton
dailywall
dmenu
ffthumb
grid
gridmacro
gridmacro.kde
help
importw
indexer
install-all.sh
install-twily.sh
installng
keep-on
mp3ogg
orage
pipes
pipes.x
pipewire_bt.sh
ports
rain
randwall
rotate.sh
scan.sh
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptskeep-on
2 462•  8 years ago•  DownloadRawClose
8 years ago•  2 462

{}
#!/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.info 2013 - 2024
twily at twily dot info



2 032 851 visits
... ^ v