Browse Source

Implementation of Rofipower

pull/32/head
darkeddie 2 years ago
parent
commit
d5b06a4c63
  1. 2
      config/hypr/configs/Keybinds.conf
  2. 20
      config/hypr/scripts/rofipower.sh
  3. 24
      config/rofi/config-powermenu.rasi
  4. 6
      config/waybar/modules

2
config/hypr/configs/Keybinds.conf

@ -30,7 +30,7 @@ bind = $mainMod, Q, killactive,
bind = $mainMod, Return, exec, $term bind = $mainMod, Return, exec, $term
bind = $mainMod, T, exec, $files bind = $mainMod, T, exec, $files
bind = CTRL ALT, L, exec, $scriptsDir/LockScreen.sh bind = CTRL ALT, L, exec, $scriptsDir/LockScreen.sh
bind = CTRL ALT, P, exec, $scriptsDir/Wlogout.sh bind = CTRL ALT, P, exec, $scriptsDir/rofipower.sh
bind = $mainMod CTRL, S, exec, $scriptsDir/RofiBeats.sh bind = $mainMod CTRL, S, exec, $scriptsDir/RofiBeats.sh
bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh
bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh

20
rofipower.sh → config/hypr/scripts/rofipower.sh

@ -8,20 +8,21 @@ uptime="`uptime -p | sed -e 's/up //g'`"
host=`hostnamectl hostname` host=`hostnamectl hostname`
# Options # Options
shutdown='' shutdown=' Shutdown'
reboot='' reboot=' Reboot'
lock='' lock=' Lock'
suspend='' suspend=' Suspend'
logout='' logout=' Logout'
hibernate=' Hibernate'
# Rofi CMD # Rofi CMD
rofi_cmd() { rofi_cmd() {
rofi -dmenu -p " $USER@$host" -mesg " Uptime: $uptime" -theme ~/.config/rofi/config-powermenu.rasi rofi -dmenu -p " $USER@$host" -mesg " Uptime: $uptime" -sep '|' -eh 2 -theme ~/.config/rofi/config-powermenu.rasi
} }
# Pass variables to rofi dmenu # Pass variables to rofi dmenu
run_rofi() { run_rofi() {
echo -e "$lock\0meta\x1fl\n$suspend\0meta\x1fu\n$logout\0meta\x1fe\n$reboot\0meta\x1fr\n$shutdown\0meta\x1fs" | rofi_cmd echo -e "$lock\0meta\x1fl|$suspend\0meta\x1fu|$logout\0meta\x1fe|$reboot\0meta\x1fr|$shutdown\0meta\x1fs|$hibernate\0meta\x1fh" | rofi_cmd
} }
# Execute Command # Execute Command
@ -34,6 +35,8 @@ run_cmd() {
systemctl suspend systemctl suspend
elif [[ $1 == '--logout' ]]; then elif [[ $1 == '--logout' ]]; then
hyprctl dispatch exit 0 hyprctl dispatch exit 0
elif [[ $1 == '--hibernate' ]]; then
systemctl hibernate
fi fi
} }
@ -58,4 +61,7 @@ case ${chosen} in
$logout) $logout)
run_cmd --logout run_cmd --logout
;; ;;
$hibernate)
run_cmd --hibernate
;;
esac esac

24
config-powermenu.rasi → config/rofi/config-powermenu.rasi

@ -2,7 +2,7 @@
/* ---- Configuration ---- */ /* ---- Configuration ---- */
configuration { configuration {
show-icons: false; show-icons: false;
} }
/* ---- Load pywal colors (custom wal template) ---- */ /* ---- Load pywal colors (custom wal template) ---- */
@ -10,7 +10,7 @@ configuration {
/* ---- Global Properties ---- */ /* ---- Global Properties ---- */
* { * {
font: "JetBrains Mono Nerd Font 14"; font: "JetBrains Mono Nerd Font 14";
} }
/* ---- Main Window ---- */ /* ---- Main Window ---- */
@ -24,7 +24,7 @@ window {
x-offset: 0px; x-offset: 0px;
y-offset: 0px; y-offset: 0px;
padding: 0px; padding: 0px;
border: 1px solid; border: 2px solid;
border-radius: 15px; border-radius: 15px;
border-color: @active-background; border-color: @active-background;
cursor: "default"; cursor: "default";
@ -48,7 +48,7 @@ mainbox {
/* ---- Inputbar ---- */ /* ---- Inputbar ---- */
inputbar { inputbar {
enabled: true; enabled: true;
padding: 2px 4%; padding: 10px 6.5%;
background-color: transparent; background-color: transparent;
orientation: vertical; orientation: vertical;
children: ["prompt"]; children: ["prompt"];
@ -56,7 +56,7 @@ inputbar {
prompt { prompt {
enabled: true; enabled: true;
padding: 2% 5%; padding: 1% 2.5%;
border-radius: 100% 100% 100% 100%; border-radius: 100% 100% 100% 100%;
border-color: @foreground; border-color: @foreground;
background-color: @background-color; background-color: @background-color;
@ -67,8 +67,8 @@ prompt {
/* ---- Listview ---- */ /* ---- Listview ---- */
listview { listview {
enabled: true; enabled: true;
columns: 5; columns: 3;
lines: 1; lines: 2;
cycle: true; cycle: true;
dynamic: true; dynamic: true;
scrollbar: false; scrollbar: false;
@ -76,8 +76,8 @@ listview {
reverse: false; reverse: false;
fixed-height: true; fixed-height: true;
fixed-columns: true; fixed-columns: true;
spacing: 30px; spacing: 20px;
padding: 4% 30px; padding: 1% 30px;
background-color: transparent; background-color: transparent;
cursor: "default"; cursor: "default";
border: 0px; border: 0px;
@ -86,14 +86,14 @@ listview {
/* ---- Elements ---- */ /* ---- Elements ---- */
element { element {
enabled: true; enabled: true;
padding: 20px; padding: 10px;
border-radius: 40px; border-radius: 30px;
background-color: transparent; background-color: transparent;
text-color: @foreground; text-color: @foreground;
cursor: pointer; cursor: pointer;
} }
element-text { element-text {
font: "JetBrains Mono Nerd Font 32"; font: "JetBrains Mono Nerd Font 18";
background-color: transparent; background-color: transparent;
text-color: inherit; text-color: inherit;
cursor: inherit; cursor: inherit;

6
config/waybar/modules

@ -199,7 +199,7 @@
"tooltip": true, "tooltip": true,
"tooltip-format": "{timeTo} {power}w", "tooltip-format": "{timeTo} {power}w",
"on-click-middle": "~/.config/hypr/scripts/ChangeBlur.sh", "on-click-middle": "~/.config/hypr/scripts/ChangeBlur.sh",
"on-click-right": "~/.config/hypr/scripts/Wlogout.sh", "on-click-right": "~/.config/hypr/scripts/rofipower.sh",
}, },
"bluetooth": { "bluetooth": {
@ -497,7 +497,7 @@
"custom/power": { "custom/power": {
"format": "⏻ ", "format": "⏻ ",
"tooltip": false, "tooltip": false,
"on-click": "~/.config/hypr/scripts/Wlogout.sh", "on-click": "~/.config/hypr/scripts/rofipower.sh",
"on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh",
}, },
@ -652,7 +652,7 @@
"custom/power_vertical": { "custom/power_vertical": {
"format": "⏻", "format": "⏻",
"tooltip": false, "tooltip": false,
"on-click": "~/.config/hypr/scripts/Wlogout.sh", "on-click": "~/.config/hypr/scripts/rofipower.sh",
"on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh",
}, },

Loading…
Cancel
Save