[IDEA] Power presentation toggle

That’s exactly the idea. :sunglasses:

Also, as you already have the most important value (i.e, 600) stored in DMPS_delay you can use it directly in the conditional instead of counting.

Taking advantage of Bash’s magnificent powers allows to optimize your code further down to simply:

DMPS_delay="$(xset -q | awk '!/^[[:space:]]/ {i++}; i==6 {getline; print $2; exit}')"
[ "$DMPS_delay" -ne 600 ] && Sleep_time=600 || Sleep_time=250
xset dpms "$Sleep_time" 700 900
xset -dpms
notify-send -i computer -t 5000 "Sleep time set to ${Sleep_time}"
2 Likes

I mostly start complicated (readable for me), and slowly if i manage :slight_smile: , simplify the script.

This one is a new one for me. …

:bird: