helm/bin/zzz
Henrik Lissner 899b76576e
Remove macos-isms from scripts
I don't use mac anymore.

Also installs bc when you use bin/since
2020-04-12 16:09:31 -04:00

24 lines
498 B
Bash
Executable file

#!/usr/bin/env bash
# If -f, then put computer to sleep.
# Otherwise, lock screen and turn off monitor.
if [[ $1 == -h ]]; then
bin=${0##*/}
echo "Usage: $bin [-f]"
echo
echo " $bin # put display to sleep"
echo " $bin -f # put computer to sleep"
elif [[ $1 == -f ]]; then
echo "Going to sleep..."
systemctl suspend
else
echo "Shutting my eyes..."
if command -v slock >/dev/null; then
pgrep slock >/dev/null || slock &
fi
sleep 1
xset dpms force off
;;
fi