all repos — zenUtils @ d1f1546a0daff6fe1793abc204df9b062426cd13

misc utilities for computing zen

simple logout script for the kwin+tint2+xfdesktop session
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAl+CnyIACgkQO3+8IhRO
Y5gXNg//XF3s0MHOdcmSWRcRyWwxiswKM7e8935Tb8V/9ZCsxOEevFSTlQ8A1uM0
hYB0haW5EnaxT/3YEY2Kyhsw6lSG3Qz4CQEr8TA9q/v4SS7+mpFCj6o0xhgK3jSk
lAdbuOWkpKMTKXa0jop5eTMu8uJ9bbodmKmdEU5mYcvV5vt6uyHuO9b5W5vq6nxp
QVLHhvtj93mQWDePnCFogA2lnNoCfyDFJc7CDalwne7JecqAq5WKxJaRwOBjyqJn
g2LuwSDZV190awOgtCCbR3EAhnJy96oNNv4q9V18MNq2X1pYcaDCOOwVYAUlrIPm
qJJoGhCLfA0hi2QetIoO/RelFIi4lrMWEje/LX0w3G0aYs+n1aFmt4Wv3sp14w2b
BLU8fhyAS0epQqRdUkDNNLQJbmLlE9DhjfwuKIwqww3C3wjfWG2jp26RUC+BsMvf
/Cq1ox5VvD7Gu9FJ36TMeotUfMKYkLHMT3Uribw6njd+IjI9N7sh+M7P4QL+NLjR
VF+C8hCk9cYWaQjEZ4wNfIiU4SKNRuDVhzgdFZxFoVhYDAGMct06KzbFYUb1EVWd
HTyj25pKYZjTSy8iidAYVKW94ObGzWbdnKpI/+PAK4TI60xTiXF9Y7D7yHuhAKJ9
VrDRmlTaeiPLIvfn8juh/II9PLdeiuxYMGiKfH0LXXtoj5REAkY=
=qcbW
-----END PGP SIGNATURE-----
commit

d1f1546a0daff6fe1793abc204df9b062426cd13

parent

421f271e86822e08ce1b5999fcf684c7a62415f0

1 files changed, 49 insertions(+), 0 deletions(-)

jump to
A logout.sh

@@ -0,0 +1,49 @@

+#!/bin/sh + +# logout.sh +# logout dialogue in three parts to be used with a tint2 executor +# without arguments displays the power symbol in the executor +# -w calls the terminal window with another instance using... +# -p to draw and process the prompt +# use a sudoers rule with NOPASSWD to bypass password entry when using -p +# (c) 2020 Derek Stevens <drkste@zoho.com> +# MIT License -- do whatever you want + +logoutPrompt() { + echo "Power and session controls:" + echo "[s] shutdown" + echo "[r] reboot" + echo "[h] hibernate" + echo "[l] logout" + read operation + case ${operation} in + s|S|shutdown|Shutdown|SHUTDOWN) + poweroff + ;; + r|R|reboot|Reboot|REBOOT) + reboot + ;; + h|H|hibernate|Hibernate|HIBERNATE) + zzz + ;; + l|L|logout|Logout|LOGOUT) + pkill -9 -P $(pgrep .kwin-session) + ;; + *) + clear + logoutPromopt + ;; + esac +} + +if [ -z $1 ]; then + echo "" + +elif [ "$1" = "-w" ]; then + if ! wmctrl -l | grep "Session Control"; then + exec alacritty -d 30 5 -t "Session Control" -e sudo ${HOME}/src/zenUtils/logout.sh -p & + fi + +elif [ "$1" = "-p" ]; then + logoutPrompt +fi