Skip to content

Instantly share code, notes, and snippets.

@heywoodlh
Last active May 31, 2022 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heywoodlh/acff340879a19e2e13141e99dcb5dc94 to your computer and use it in GitHub Desktop.
Save heywoodlh/acff340879a19e2e13141e99dcb5dc94 to your computer and use it in GitHub Desktop.
Caffeine shell script (reddit source in comments)
#!/usr/bin/env bash
if uname | grep -i linux
then
status=`xset -q | grep 'DPMS is' | awk '{ print $3 }'`
if [ $status == 'Enabled' ]
then
xset -dpms && \
notify-send 'Screen suspend is disabled.'
else
xset +dpms && \
notify-send 'Screen suspend is enabled.'
fi
fi
## Taken from: https://www.reddit.com/r/i3wm/comments/baefko/comment/ekaz6wh/?utm_source=share&utm_medium=web2x&context=3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment