diff options
-rwxr-xr-x | manmenu | 6 | ||||
-rwxr-xr-x | power-menu | 31 |
2 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,6 @@ +#!/bin/sh +MANPAGE="$(man -k . | sed 's/\s\+-\s\+.*$//' | tofi -c ~/.config/tofi/themes/dmenu_vertical --prompt-text "Man Page")" +MANPROG="${MANPAGE% (*)}" +MANNUM="${MANPAGE#* (}" +MANNUM="${MANNUM%)}" +man -Tpdf "$MANNUM" "$MANPROG" | zathura - diff --git a/power-menu b/power-menu new file mode 100755 index 0000000..c615c43 --- /dev/null +++ b/power-menu @@ -0,0 +1,31 @@ +#!/bin/sh +LIST="$(cat <<EOF +shutdown +reboot +lock +suspend +hibernate +logout +EOF +)" + +type systemctl >/dev/null && SYSTEMCTL="systemctl" +SYSTEMCTL="${SYSTEMCTL:-loginctl}" + +COMMAND="$(echo "${LIST}" | dmenu -r)" + +case "${COMMAND}" in + "shutdown") ${SYSTEMCTL} poweroff ;; + "reboot") + ${SYSTEMCTL} reboot ;; + "lock") loginctl lock-session ;; + "suspend") ${SYSTEMCTL} suspend ;; + "hibernate") ${SYSTEMCTL} hibernate ;; + "logout") + if pgrep -x Hyprland; then + hyprctl dispatch exit + else + loginctl terminate-session + fi + ;; +esac |