-
Notifications
You must be signed in to change notification settings - Fork 1
/
rofi-powermenu
executable file
·56 lines (47 loc) · 1.59 KB
/
rofi-powermenu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# .-----.-----.--.--.--.-----.----.--------.-----.-----.--.--.
# | _ | _ | | | | -__| _| | -__| | | |
# | __|_____|________|_____|__| |__|__|__|_____|__|__|_____|
# |__|
# Author: Dilip Chauhan
# Github: https://github/TechnicalDC
USE_ICONS=false
if [[USE_ICONS]]; then
option1=""
option2=""
option3=""
option4=""
yes=" Ok"
no=" Cancel"
else
option1="Lock"
option2="Logout"
option3="Restart"
option4="Shutdown"
yes="Ok"
no="Cancel"
fi
options="$option1\n"
options="$options$option2\n"
options="$options$option3\n$option4"
choice=$(echo -e "$options" | rofi -dmenu -p ' Power ' -theme ~/.config/rofi/themes/$THEME/catppuccin-mocha-powermenu.rasi -i -no-show-icons -lines 4)
yes=$choice
case $choice in
$option1)
hyprlock -c $HOME/.config/hypr/themes/$THEME/hyprlock.conf ;;
$option2)
choice=$(echo "$yes|$no" | rofi -dmenu -sep "|" -theme ~/.config/rofi/themes/$THEME/catppuccin-mocha-dialog.rasi -mesg "Are you sure?")
if [[ $choice == $yes ]]; then
bspc quit || i3-msg exit || herbstclient quit || hyprctl dispatch exit
fi ;;
$option3)
choice=$(echo "$yes|$no" | rofi -dmenu -sep "|" -theme ~/.config/rofi/themes/$THEME/catppuccin-mocha-dialog.rasi -mesg "Are you sure?")
if [[ $choice == $yes ]]; then
systemctl reboot
fi ;;
$option4)
choice=$(echo "$yes|$no" | rofi -dmenu -sep "|" -theme ~/.config/rofi/themes/$THEME/catppuccin-mocha-dialog.rasi -mesg "Are you sure?")
if [[ $choice == $yes ]]; then
systemctl poweroff
fi ;;
esac