From d88ddd46aeaecd10946be3752a2cd4f16b425249 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Thu, 23 Nov 2023 14:52:20 +0900 Subject: [PATCH 1/5] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9419f09..90f644a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@
+### Some preview +https://github.com/JaKooLit/Hyprland-Dots/assets/85185940/4c98fa74-0190-4a1d-96d6-2df304ed1aa2 + ## 👁️‍🗨️ My Hyprland install Scripts 👁️‍🗨️ - You can install Hyprland using Scripts below: From 61bbe3b7d94387ede06353e626465f2987932afe Mon Sep 17 00:00:00 2001 From: Daniel <48409433+darkeddie@users.noreply.github.com> Date: Fri, 24 Nov 2023 22:44:52 +1100 Subject: [PATCH 2/5] Rofi style power menu --- config-powermenu.rasi | 123 ++++++++++++++++++++++++++++++++++++++++++ rofipower.sh | 61 +++++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 config-powermenu.rasi create mode 100644 rofipower.sh diff --git a/config-powermenu.rasi b/config-powermenu.rasi new file mode 100644 index 0000000..9126a32 --- /dev/null +++ b/config-powermenu.rasi @@ -0,0 +1,123 @@ +/* --- Configuration for Rofi Power ---- */ + +/* ---- Configuration ---- */ +configuration { + show-icons: false; +} + +/* ---- Load pywal colors (custom wal template) ---- */ +@import "~/.config/rofi/pywal-color/pywal-theme.rasi" + +/* ---- Global Properties ---- */ +* { + font: "JetBrains Mono Nerd Font 14"; +} + +/* ---- Main Window ---- */ +window { + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 25%; + height: 25%; + x-offset: 0px; + y-offset: 0px; + padding: 0px; + border: 1px solid; + border-radius: 15px; + border-color: @active-background; + cursor: "default"; + background-color: @background-color; +} + +/* ---- Main Box ---- */ +mainbox { + enabled: true; + spacing: 0px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + background-image: url("~/.config/rofi/.current_wallpaper", width); + border-color: @active-background; + background-color: @background-color; + children: [ "inputbar", "listview", "message" ]; +} + +/* ---- Inputbar ---- */ +inputbar { + enabled: true; + padding: 2px 4%; + background-color: transparent; + orientation: vertical; + children: ["prompt"]; +} + +prompt { + enabled: true; + padding: 2% 5%; + border-radius: 100% 100% 100% 100%; + border-color: @foreground; + background-color: @background-color; + text-color: @foreground; + cursor: text; +} + +/* ---- Listview ---- */ +listview { + enabled: true; + columns: 5; + lines: 1; + cycle: true; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + spacing: 30px; + padding: 4% 30px; + background-color: transparent; + cursor: "default"; + border: 0px; +} + +/* ---- Elements ---- */ +element { + enabled: true; + padding: 20px; + border-radius: 40px; + background-color: transparent; + text-color: @foreground; + cursor: pointer; +} +element-text { + font: "JetBrains Mono Nerd Font 32"; + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.5; +} +element selected.normal { + background-color: @selected-normal-background; + text-color: @background; +} + +/* ---- Message ---- */ +message { + enabled: true; + margin: 0px; + padding: 15px; + border-radius: 0px; + background-color: transparent; + text-color: @foreground; + border: 0px; +} +textbox { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; + horizontal-align: 0.5; +} \ No newline at end of file diff --git a/rofipower.sh b/rofipower.sh new file mode 100644 index 0000000..435f1ee --- /dev/null +++ b/rofipower.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +# Swayconfig +SWAYCONFIG="$HOME/.config/swaylock/config" + +# CMDs +uptime="`uptime -p | sed -e 's/up //g'`" +host=`hostnamectl hostname` + +# Options +shutdown='' +reboot='' +lock='' +suspend='' +logout='' + +# Rofi CMD +rofi_cmd() { + rofi -dmenu -p " $USER@$host" -mesg " Uptime: $uptime" -theme ~/.config/rofi/config-powermenu.rasi +} + +# Pass variables to rofi dmenu +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 +} + +# Execute Command +run_cmd() { + if [[ $1 == '--shutdown' ]]; then + systemctl poweroff + elif [[ $1 == '--reboot' ]]; then + systemctl reboot + elif [[ $1 == '--suspend' ]]; then + systemctl suspend + elif [[ $1 == '--logout' ]]; then + hyprctl dispatch exit 0 + fi +} + +# Actions +chosen="$(run_rofi)" +case ${chosen} in + $shutdown) + run_cmd --shutdown + ;; + $reboot) + run_cmd --reboot + ;; + $hibernate) + run_cmd --hibernate + ;; + $lock) + sleep 0.5s; swaylock --config ${SWAYCONFIG} & disown + ;; + $suspend) + run_cmd --suspend + ;; + $logout) + run_cmd --logout + ;; +esac \ No newline at end of file From d5b06a4c6301befd1e5e4e9efa189a71aee51e27 Mon Sep 17 00:00:00 2001 From: darkeddie Date: Sat, 25 Nov 2023 09:26:40 +1100 Subject: [PATCH 3/5] Implementation of Rofipower --- config/hypr/configs/Keybinds.conf | 2 +- .../hypr/scripts/rofipower.sh | 20 ++++++++++------ .../rofi/config-powermenu.rasi | 24 +++++++++---------- config/waybar/modules | 6 ++--- 4 files changed, 29 insertions(+), 23 deletions(-) rename rofipower.sh => config/hypr/scripts/rofipower.sh (63%) mode change 100644 => 100755 rename config-powermenu.rasi => config/rofi/config-powermenu.rasi (86%) diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index c072b4d..8ad5651 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -30,7 +30,7 @@ bind = $mainMod, Q, killactive, bind = $mainMod, Return, exec, $term bind = $mainMod, T, exec, $files 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 ALT, E, exec, $scriptsDir/RofiEmoji.sh bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh diff --git a/rofipower.sh b/config/hypr/scripts/rofipower.sh old mode 100644 new mode 100755 similarity index 63% rename from rofipower.sh rename to config/hypr/scripts/rofipower.sh index 435f1ee..7bb70e9 --- a/rofipower.sh +++ b/config/hypr/scripts/rofipower.sh @@ -8,20 +8,21 @@ uptime="`uptime -p | sed -e 's/up //g'`" host=`hostnamectl hostname` # Options -shutdown='' -reboot='' -lock='' -suspend='' -logout='' +shutdown=' Shutdown' +reboot=' Reboot' +lock=' Lock' +suspend=' Suspend' +logout=' Logout' +hibernate=' Hibernate' # 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 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 @@ -34,6 +35,8 @@ run_cmd() { systemctl suspend elif [[ $1 == '--logout' ]]; then hyprctl dispatch exit 0 + elif [[ $1 == '--hibernate' ]]; then + systemctl hibernate fi } @@ -58,4 +61,7 @@ case ${chosen} in $logout) run_cmd --logout ;; + $hibernate) + run_cmd --hibernate + ;; esac \ No newline at end of file diff --git a/config-powermenu.rasi b/config/rofi/config-powermenu.rasi similarity index 86% rename from config-powermenu.rasi rename to config/rofi/config-powermenu.rasi index 9126a32..61d7262 100644 --- a/config-powermenu.rasi +++ b/config/rofi/config-powermenu.rasi @@ -2,7 +2,7 @@ /* ---- Configuration ---- */ configuration { - show-icons: false; + show-icons: false; } /* ---- Load pywal colors (custom wal template) ---- */ @@ -10,7 +10,7 @@ configuration { /* ---- Global Properties ---- */ * { - font: "JetBrains Mono Nerd Font 14"; + font: "JetBrains Mono Nerd Font 14"; } /* ---- Main Window ---- */ @@ -24,7 +24,7 @@ window { x-offset: 0px; y-offset: 0px; padding: 0px; - border: 1px solid; + border: 2px solid; border-radius: 15px; border-color: @active-background; cursor: "default"; @@ -48,7 +48,7 @@ mainbox { /* ---- Inputbar ---- */ inputbar { enabled: true; - padding: 2px 4%; + padding: 10px 6.5%; background-color: transparent; orientation: vertical; children: ["prompt"]; @@ -56,7 +56,7 @@ inputbar { prompt { enabled: true; - padding: 2% 5%; + padding: 1% 2.5%; border-radius: 100% 100% 100% 100%; border-color: @foreground; background-color: @background-color; @@ -67,8 +67,8 @@ prompt { /* ---- Listview ---- */ listview { enabled: true; - columns: 5; - lines: 1; + columns: 3; + lines: 2; cycle: true; dynamic: true; scrollbar: false; @@ -76,8 +76,8 @@ listview { reverse: false; fixed-height: true; fixed-columns: true; - spacing: 30px; - padding: 4% 30px; + spacing: 20px; + padding: 1% 30px; background-color: transparent; cursor: "default"; border: 0px; @@ -86,14 +86,14 @@ listview { /* ---- Elements ---- */ element { enabled: true; - padding: 20px; - border-radius: 40px; + padding: 10px; + border-radius: 30px; background-color: transparent; text-color: @foreground; cursor: pointer; } element-text { - font: "JetBrains Mono Nerd Font 32"; + font: "JetBrains Mono Nerd Font 18"; background-color: transparent; text-color: inherit; cursor: inherit; diff --git a/config/waybar/modules b/config/waybar/modules index b7b41d7..45668c3 100644 --- a/config/waybar/modules +++ b/config/waybar/modules @@ -199,7 +199,7 @@ "tooltip": true, "tooltip-format": "{timeTo} {power}w", "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": { @@ -497,7 +497,7 @@ "custom/power": { "format": "⏻ ", "tooltip": false, - "on-click": "~/.config/hypr/scripts/Wlogout.sh", + "on-click": "~/.config/hypr/scripts/rofipower.sh", "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", }, @@ -652,7 +652,7 @@ "custom/power_vertical": { "format": "⏻", "tooltip": false, - "on-click": "~/.config/hypr/scripts/Wlogout.sh", + "on-click": "~/.config/hypr/scripts/rofipower.sh", "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", }, From 62a7a2bceca6967b885ee01f2f5e7f5c8aa989f7 Mon Sep 17 00:00:00 2001 From: darkeddie Date: Sat, 25 Nov 2023 16:41:55 +1100 Subject: [PATCH 4/5] Update with Ja Suggestions --- config/hypr/configs/Keybinds.conf | 2 +- config/hypr/scripts/RofiPower.sh | 67 +++++++++++++++++++++++++++++++ config/hypr/scripts/rofipower.sh | 67 ------------------------------- config/rofi/config-powermenu.rasi | 36 ++++++++--------- config/waybar/modules | 6 +-- 5 files changed, 89 insertions(+), 89 deletions(-) create mode 100755 config/hypr/scripts/RofiPower.sh delete mode 100755 config/hypr/scripts/rofipower.sh diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 8ad5651..26a32f5 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -30,7 +30,7 @@ bind = $mainMod, Q, killactive, bind = $mainMod, Return, exec, $term bind = $mainMod, T, exec, $files bind = CTRL ALT, L, exec, $scriptsDir/LockScreen.sh -bind = CTRL ALT, P, exec, $scriptsDir/rofipower.sh +bind = CTRL ALT, P, exec, $scriptsDir/RofiPower.sh bind = $mainMod CTRL, S, exec, $scriptsDir/RofiBeats.sh bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh diff --git a/config/hypr/scripts/RofiPower.sh b/config/hypr/scripts/RofiPower.sh new file mode 100755 index 0000000..824cffa --- /dev/null +++ b/config/hypr/scripts/RofiPower.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +SwayLock=$HOME/.config/hypr/scripts/LockScreen.sh + +# CMDs +uptime_info=$(uptime -p | sed -e 's/up //g') +host=$(hostnamectl hostname) + +# Options with Icons and Text +options=("Lock" "Suspend" "Logout" "Reboot" "Shutdown" "Hibernate") +icons=("" "" "󰿅" "󱄌" "" "󰒲") + +# Rofi CMD +rofi_cmd() { + options_with_icons=() + for ((i = 0; i < ${#options[@]}; i++)); do + options_with_icons+=("${icons[$i]} ${options[$i]}") + done + + chosen_option=$(printf "%s\n" "${options_with_icons[@]}" | \ + rofi -dmenu -i -p " $USER@$host" -mesg " Uptime: $uptime_info" \ + -kb-select-1 "l" \ + -kb-select-2 "u" \ + -kb-select-3 "e" \ + -kb-select-4 "r" \ + -kb-select-5 "s" \ + -kb-select-6 "h" \ + -theme ~/.config/rofi/config-powermenu.rasi | awk '{print $1}') + echo "$chosen_option" +} + +# Pass variables to rofi dmenu +run_rofi() { + chosen_option=$(rofi_cmd) + echo "$chosen_option" +} + +# Execute Command +run_cmd() { + case $1 in + "") + $SwayLock & + ;; + "") + systemctl suspend + ;; + "󰿅") + hyprctl dispatch exit 0 + ;; + "󱄌") + systemctl reboot + ;; + "") + systemctl poweroff + ;; + "󰒲") + systemctl hibernate + ;; + *) + echo "choose: $1" + ;; + esac +} + +# Actions +chosen_option=$(run_rofi) +run_cmd "${chosen_option% *}" \ No newline at end of file diff --git a/config/hypr/scripts/rofipower.sh b/config/hypr/scripts/rofipower.sh deleted file mode 100755 index 7bb70e9..0000000 --- a/config/hypr/scripts/rofipower.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -# Swayconfig -SWAYCONFIG="$HOME/.config/swaylock/config" - -# CMDs -uptime="`uptime -p | sed -e 's/up //g'`" -host=`hostnamectl hostname` - -# Options -shutdown=' Shutdown' -reboot=' Reboot' -lock=' Lock' -suspend=' Suspend' -logout=' Logout' -hibernate=' Hibernate' - -# Rofi CMD -rofi_cmd() { - rofi -dmenu -p " $USER@$host" -mesg " Uptime: $uptime" -sep '|' -eh 2 -theme ~/.config/rofi/config-powermenu.rasi -} - -# Pass variables to rofi dmenu -run_rofi() { - echo -e "$lock\0meta\x1fl|$suspend\0meta\x1fu|$logout\0meta\x1fe|$reboot\0meta\x1fr|$shutdown\0meta\x1fs|$hibernate\0meta\x1fh" | rofi_cmd -} - -# Execute Command -run_cmd() { - if [[ $1 == '--shutdown' ]]; then - systemctl poweroff - elif [[ $1 == '--reboot' ]]; then - systemctl reboot - elif [[ $1 == '--suspend' ]]; then - systemctl suspend - elif [[ $1 == '--logout' ]]; then - hyprctl dispatch exit 0 - elif [[ $1 == '--hibernate' ]]; then - systemctl hibernate - fi -} - -# Actions -chosen="$(run_rofi)" -case ${chosen} in - $shutdown) - run_cmd --shutdown - ;; - $reboot) - run_cmd --reboot - ;; - $hibernate) - run_cmd --hibernate - ;; - $lock) - sleep 0.5s; swaylock --config ${SWAYCONFIG} & disown - ;; - $suspend) - run_cmd --suspend - ;; - $logout) - run_cmd --logout - ;; - $hibernate) - run_cmd --hibernate - ;; -esac \ No newline at end of file diff --git a/config/rofi/config-powermenu.rasi b/config/rofi/config-powermenu.rasi index 61d7262..a3babe6 100644 --- a/config/rofi/config-powermenu.rasi +++ b/config/rofi/config-powermenu.rasi @@ -3,6 +3,7 @@ /* ---- Configuration ---- */ configuration { show-icons: false; + auto-select: true; } /* ---- Load pywal colors (custom wal template) ---- */ @@ -10,21 +11,20 @@ configuration { /* ---- Global Properties ---- */ * { - font: "JetBrains Mono Nerd Font 14"; + font: "Fira Code Medium 12"; } /* ---- Main Window ---- */ window { - transparency: "real"; location: center; anchor: center; fullscreen: false; - width: 25%; - height: 25%; + width: 38%; + /*height: 30%;*/ x-offset: 0px; y-offset: 0px; padding: 0px; - border: 2px solid; + border: 2px; border-radius: 15px; border-color: @active-background; cursor: "default"; @@ -48,20 +48,21 @@ mainbox { /* ---- Inputbar ---- */ inputbar { enabled: true; - padding: 10px 6.5%; + padding: 10px; background-color: transparent; - orientation: vertical; + orientation: horizontal; children: ["prompt"]; } prompt { enabled: true; - padding: 1% 2.5%; - border-radius: 100% 100% 100% 100%; + padding: 10px; + border-radius: 15px; border-color: @foreground; background-color: @background-color; text-color: @foreground; cursor: text; + } /* ---- Listview ---- */ @@ -74,10 +75,10 @@ listview { scrollbar: false; layout: vertical; reverse: false; - fixed-height: true; + fixed-height: false; fixed-columns: true; - spacing: 20px; - padding: 1% 30px; + spacing: 30px; + padding: 2% 30px; background-color: transparent; cursor: "default"; border: 0px; @@ -86,14 +87,14 @@ listview { /* ---- Elements ---- */ element { enabled: true; - padding: 10px; + padding: 20px; border-radius: 30px; background-color: transparent; text-color: @foreground; cursor: pointer; } element-text { - font: "JetBrains Mono Nerd Font 18"; + font: "Fira Code SemiBold 16"; background-color: transparent; text-color: inherit; cursor: inherit; @@ -109,15 +110,14 @@ element selected.normal { message { enabled: true; margin: 0px; - padding: 15px; - border-radius: 0px; background-color: transparent; text-color: @foreground; border: 0px; } textbox { - background-color: inherit; - text-color: inherit; + font: "Fira Code SemiBold 8"; + background-color: @background; + text-color: @foreground; vertical-align: 0.5; horizontal-align: 0.5; } \ No newline at end of file diff --git a/config/waybar/modules b/config/waybar/modules index 45668c3..43a6bab 100644 --- a/config/waybar/modules +++ b/config/waybar/modules @@ -199,7 +199,7 @@ "tooltip": true, "tooltip-format": "{timeTo} {power}w", "on-click-middle": "~/.config/hypr/scripts/ChangeBlur.sh", - "on-click-right": "~/.config/hypr/scripts/rofipower.sh", + "on-click-right": "~/.config/hypr/scripts/RofiPower.sh", }, "bluetooth": { @@ -497,7 +497,7 @@ "custom/power": { "format": "⏻ ", "tooltip": false, - "on-click": "~/.config/hypr/scripts/rofipower.sh", + "on-click": "~/.config/hypr/scripts/RofiPower.sh", "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", }, @@ -652,7 +652,7 @@ "custom/power_vertical": { "format": "⏻", "tooltip": false, - "on-click": "~/.config/hypr/scripts/rofipower.sh", + "on-click": "~/.config/hypr/scripts/RofiPower.sh", "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", }, From 2ad7b840f7f2b06992c875b6e3d5089ec0e86490 Mon Sep 17 00:00:00 2001 From: darkeddie Date: Sat, 25 Nov 2023 20:08:41 +1100 Subject: [PATCH 5/5] Update with shortcuts on rofipower --- config/hypr/scripts/RofiPower.sh | 2 +- config/rofi/config-powermenu.rasi | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/hypr/scripts/RofiPower.sh b/config/hypr/scripts/RofiPower.sh index 824cffa..84d8643 100755 --- a/config/hypr/scripts/RofiPower.sh +++ b/config/hypr/scripts/RofiPower.sh @@ -7,7 +7,7 @@ uptime_info=$(uptime -p | sed -e 's/up //g') host=$(hostnamectl hostname) # Options with Icons and Text -options=("Lock" "Suspend" "Logout" "Reboot" "Shutdown" "Hibernate") +options=("Lock(l)" "Suspend(u)" "Logout(e)" "Reboot(r)" "Shutdown(s)" "Hibernate(h)") icons=("" "" "󰿅" "󱄌" "" "󰒲") # Rofi CMD diff --git a/config/rofi/config-powermenu.rasi b/config/rofi/config-powermenu.rasi index a3babe6..cf0592f 100644 --- a/config/rofi/config-powermenu.rasi +++ b/config/rofi/config-powermenu.rasi @@ -3,7 +3,6 @@ /* ---- Configuration ---- */ configuration { show-icons: false; - auto-select: true; } /* ---- Load pywal colors (custom wal template) ---- */ @@ -19,8 +18,8 @@ window { location: center; anchor: center; fullscreen: false; - width: 38%; - /*height: 30%;*/ + width: 900px; + height: 400px; x-offset: 0px; y-offset: 0px; padding: 0px; @@ -48,7 +47,7 @@ mainbox { /* ---- Inputbar ---- */ inputbar { enabled: true; - padding: 10px; + padding: 20px; background-color: transparent; orientation: horizontal; children: ["prompt"]; @@ -77,11 +76,12 @@ listview { reverse: false; fixed-height: false; fixed-columns: true; - spacing: 30px; - padding: 2% 30px; + spacing: 40px; + padding: 4% 40px; background-color: transparent; cursor: "default"; border: 0px; + border-color: @active-background; } /* ---- Elements ---- */