Krolyxon
Commit 85cd1bc

Branches

Refs →

aurora.localbinsysact

23 lines · 704 B · Bourne Again Shell (bash)

1#!/bin/sh
2
3export WM="Hyprland"
4case "$(readlink -f /sbin/init)" in
5 *systemd*) ctl='systemctl' ;;
6 *) ctl='loginctl' ;;
7esac
8
9wmpid(){ # Get Hyprland process PID
10 pgrep -o hyprland
11}
12
13case "$(printf " lock\n󰠚 leave $WM\n renew $WM\n󱣻 hibernate\n reboot\n shutdown\n sleep\n display off" | fuzzel -d -i -l 15 -p 'Action: ')" in
14 ' lock') hyprlock ;;
15 "󰠚 leave $WM") kill -TERM "$(wmpid)" ;;
16 " renew $WM") hyprctl reload ;;
17 '󱣻 hibernate') $ctl hibernate -i ;;
18 ' sleep') $ctl suspend -i ;;
19 ' reboot') $ctl reboot -i ;;
20 ' shutdown') $ctl poweroff -i ;;
21 ' display off') hyprctl dispatch dpms off ;;
22 *) exit 1 ;;
23esac