nixpkgs/overlays/dmenu-custom-scripts/system.sh
Daniel Siepmann 9de6cdb3eb
Migrate custom dmenu scripts to writeShellApplication
No longer have all of them as files and apply sed.
Instead define dependencies via nix expression.
Also allow to write the scripts within nix expression.

Some are still large and separate .sh files, but loaded within
expression.
Also only the main file is exposed as others are only dependencies.
Still all can now be installed as all are separate derivations.

The new writeShellApplication also executes shellcheck as another
benefit. And it makes script executable.
2022-02-08 21:45:11 +01:00

44 lines
1.2 KiB
Bash

#!/bin/bash
# i3lock -i /home/daniels/Pictures/urknall.png
# TODO: Stop all software before logout
# https://faq.i3wm.org/question/239/how-do-i-suspendlockscreen-and-logout.1.html#post-id-1927
chosen=$(echo -e "lock\nsuspend\nlogout" | dmenu -i)
case "$chosen" in
"lock")
# See: https://faq.i3wm.org/question/5654/how-can-i-disable-notifications-when-the-screen-locks-and-enable-them-again-when-unlocking/index.html#post-id-5655
# suspend message display
pkill -u "$USER" -USR1 dunst
# guess i3lock via nix points to other PAM and therefore does not identify by password
i3lock -c '#2E3436'
# i3lock \
# --clock \
# --indicator \
# --pass-media-keys \
# --color=#2E3436 \
# --timecolor=#9CD9F0FF \
# --datecolor=#9CD9F0FF \
# --insidecolor=#2E3436FF \
# --ringcolor=#9CD9F0FF \
# --insidevercolor=#9CD9F0FF \
# --ringvercolor=#72B3CCFF \
# --veriftext="checking"
# resume message display
pkill -u "$USER" -USR2 dunst
;;
"suspend")
systemctl suspend
;;
"logout")
i3-msg exit
;;
# "hibernate")
# i3lock -c 2E3436
# systemctl hibernate
# ;;
*)
exit 0
;;
esac