From ac2b144f97dee69a9cd094d15eb75cdea15566d0 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 20 Feb 2024 22:24:39 +0700 Subject: [PATCH] adopt hypridle and hyprlock; byebye swayidle and swaylock --- .../scripts/color_generation/applycolor.sh | 30 ++++++-- .../templates/hypr/{ => hyprland}/colors.conf | 0 .../ags/scripts/templates/hypr/hyprlock.conf | 69 +++++++++++++++++++ .config/hypr/colors.conf | 44 ------------ .config/hypr/hypridle.conf | 21 ++++++ .config/hypr/hyprland.conf | 14 ++-- .config/hypr/hyprland/colors.conf | 34 +++++++++ .config/hypr/{ => hyprland}/env.conf | 0 .config/hypr/{ => hyprland}/execs.conf | 3 +- .config/hypr/{ => hyprland}/keybinds.conf | 4 +- .config/hypr/{ => hyprland}/rules.conf | 0 .config/hypr/hyprlock.conf | 69 +++++++++++++++++++ scriptdata/dependencies.conf | 2 +- 13 files changed, 228 insertions(+), 62 deletions(-) rename .config/ags/scripts/templates/hypr/{ => hyprland}/colors.conf (100%) create mode 100644 .config/ags/scripts/templates/hypr/hyprlock.conf delete mode 100644 .config/hypr/colors.conf create mode 100644 .config/hypr/hypridle.conf create mode 100644 .config/hypr/hyprland/colors.conf rename .config/hypr/{ => hyprland}/env.conf (100%) rename .config/hypr/{ => hyprland}/execs.conf (82%) rename .config/hypr/{ => hyprland}/keybinds.conf (99%) rename .config/hypr/{ => hyprland}/rules.conf (100%) create mode 100644 .config/hypr/hyprlock.conf diff --git a/.config/ags/scripts/color_generation/applycolor.sh b/.config/ags/scripts/color_generation/applycolor.sh index 28501c474..ef8a4e59a 100755 --- a/.config/ags/scripts/color_generation/applycolor.sh +++ b/.config/ags/scripts/color_generation/applycolor.sh @@ -120,20 +120,37 @@ apply_term() { } apply_hyprland() { - # Check if scripts/templates/hypr/colors.conf exists - if [ ! -f "scripts/templates/hypr/colors.conf" ]; then + # Check if scripts/templates/hypr/hyprland/colors.conf exists + if [ ! -f "scripts/templates/hypr/hyprland/colors.conf" ]; then echo "Template file not found for Hyprland colors. Skipping that." return fi # Copy template - mkdir -p "$HOME"/.cache/ags/user/generated/hypr - cp "scripts/templates/hypr/colors.conf" "$HOME"/.cache/ags/user/generated/hypr/colors.conf + mkdir -p "$HOME"/.cache/ags/user/generated/hypr/hyprland + cp "scripts/templates/hypr/hyprland/colors.conf" "$HOME"/.cache/ags/user/generated/hypr/hyprland/colors.conf # Apply colors for i in "${!colorlist[@]}"; do - sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$HOME"/.cache/ags/user/generated/hypr/colors.conf + sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$HOME"/.cache/ags/user/generated/hypr/hyprland/colors.conf done - cp "$HOME"/.cache/ags/user/generated/hypr/colors.conf "$HOME"/.config/hypr/colors.conf + cp "$HOME"/.cache/ags/user/generated/hypr/hyprland/colors.conf "$HOME"/.config/hypr/hyprland/colors.conf +} + +apply_hyprlock() { + # Check if scripts/templates/hypr/hyprlock.conf exists + if [ ! -f "scripts/templates/hypr/hyprlock.conf" ]; then + echo "Template file not found for hyprlock. Skipping that." + return + fi + # Copy template + mkdir -p "$HOME"/.cache/ags/user/generated/hypr/ + cp "scripts/templates/hypr/hyprlock.conf" "$HOME"/.cache/ags/user/generated/hypr/hyprlock.conf + # Apply colors + for i in "${!colorlist[@]}"; do + sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$HOME"/.cache/ags/user/generated/hypr/hyprlock.conf + done + + cp "$HOME"/.cache/ags/user/generated/hypr/hyprlock.conf "$HOME"/.config/hypr/hyprlock.conf } apply_gtk() { # Using gradience-cli @@ -171,6 +188,7 @@ apply_ags() { apply_ags & apply_hyprland & +apply_hyprlock & apply_gtk & apply_foot & apply_gtklock & diff --git a/.config/ags/scripts/templates/hypr/colors.conf b/.config/ags/scripts/templates/hypr/hyprland/colors.conf similarity index 100% rename from .config/ags/scripts/templates/hypr/colors.conf rename to .config/ags/scripts/templates/hypr/hyprland/colors.conf diff --git a/.config/ags/scripts/templates/hypr/hyprlock.conf b/.config/ags/scripts/templates/hypr/hyprlock.conf new file mode 100644 index 000000000..bab9aeced --- /dev/null +++ b/.config/ags/scripts/templates/hypr/hyprlock.conf @@ -0,0 +1,69 @@ +$text_color = rgba({{ $onBackground }}FF) +$entry_background_color = rgba({{ $background }}FF) +$entry_border_color = rgba({{ $outline }}44) +$entry_color = rgba({{ $onSurfaceVariant }}FF) +$font_family = Gabarito +$font_family_clock = Gabarito +$font_material_symbols = Material Symbols Rounded + +background { + color = rgba({{ $background }}BB) +} +input-field { + monitor = + size = 200, 50 + outline_thickness = 1 + outer_color = $entry_border_color + inner_color = $entry_background_color + font_color = $entry_color + # fade_on_empty = true + + position = 0, 20 + halign = center + valign = center +} + +label { # Clock + monitor = + text = $TIME + color = $text_color + font_size = 65 + font_family = $font_family_clock + + position = 0, 300 + halign = center + valign = center +} +label { + monitor = + text = hi $USER + color = $text_color + font_size = 20 + font_family = $font_family + + position = 0, 240 + halign = center + valign = center +} +label { + monitor = + text = lock + color = $text_color + font_size = 21 + font_family = $font_material_symbols + + position = 0, 65 + halign = center + valign = bottom +} +label { + monitor = + text = locked + color = $text_color + font_size = 14 + font_family = $font_family + + position = 0, 50 + halign = center + valign = bottom +} \ No newline at end of file diff --git a/.config/hypr/colors.conf b/.config/hypr/colors.conf deleted file mode 100644 index d576a058c..000000000 --- a/.config/hypr/colors.conf +++ /dev/null @@ -1,44 +0,0 @@ -$SLURP_COMMAND="$(slurp -d -c eedcf5BB -b 4f425644 -s 00000000)" - -general { - col.active_border = rgba(471868FF) - col.inactive_border = rgba(4f4256CC) -} - -plugin { - droidbars { # This is my hyprbars mod that broke :( - # example config - bar_height = 30 - background_color = rgba(111012FF) - # background_color_active = rgba(4b454dFF) # Not added yet - text_color = rgba(eedcf5FF) - font_family = Rubik, Geist, AR One Sans, Reddit Sans, Inter, Roboto, Ubuntu, Noto Sans, sans-serif - button_font_fmily = JetBrainsMono NF - - # example buttons (R -> L) - # droidbars-button = [0]isLeft(0/1), [1]color, [2]color2, [3]width, [4]height, [5]icon, [6]buttonType, [7]on-click - droidbars-button = 0, rgba(eedcf5FF), rgba(e4b5ffFF), 42, 16,‎ 󰖭, normal, hyprctl dispatch killactive - droidbars-button = 0, rgba(eedcf5FF), rgba(e4b5ffFF), 42, 16,‎ , normal, hyprctl dispatch fullscreen 1 - droidbars-button = 1, rgba(eedcf5FF), rgba(e4b5ffFF), 16, 16,‎󰐃, pin, hyprctl dispatch pin - droidbars-button = 1, rgba(eedcf5FF), rgba(e4b5ffFF), 16, 16,󰗘, float, hyprctl dispatch togglefloating - } - hyprbars { - # Honestly idk if it works like css, but well, why not - bar_text_font = Rubik, Geist, AR One Sans, Reddit Sans, Inter, Roboto, Ubuntu, Noto Sans, sans-serif - bar_height = 30 - bar_padding = 10 - bar_button_padding = 5 - bar_precedence_over_border = true - bar_part_of_window = true - - bar_color = rgb(111012) - col.text = rgb(e7e0e5) - - - # example buttons (R -> L) - # hyprbars-button = color, size, on-click - hyprbars-button = rgb(e7e0e5), 13, 󰖭, hyprctl dispatch killactive - hyprbars-button = rgb(e7e0e5), 13, 󰖯, hyprctl dispatch fullscreen 1 - hyprbars-button = rgb(e7e0e5), 13, 󰖰, hyprctl dispatch movetoworkspacesilent special - } -} diff --git a/.config/hypr/hypridle.conf b/.config/hypr/hypridle.conf new file mode 100644 index 000000000..6b2852514 --- /dev/null +++ b/.config/hypr/hypridle.conf @@ -0,0 +1,21 @@ +$lock_cmd = pidof hyprlock || hyprlock +$suspend_cmd = systemctl suspend + +general { + lock_cmd = $lock_cmd + # unlock_cmd + before_sleep_cmd = $lock_cmd + # after_sleep_cmd +} + +listener { + timeout = 300 + on-timeout = $lock_cmd + # on-resume +} + +listener { + timeout = 450 + on-timeout = $suspend_cmd + # on-resume +} diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index b3b559772..4843a0a2d 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -4,7 +4,7 @@ # For Auto-run stuff see execs.conf # For Window/layer rules see rules.conf -source=~/.config/hypr/env.conf +source=~/.config/hypr/hyprland/env.conf # MONITOR CONFIG monitor=,preferred,auto,1 @@ -13,7 +13,7 @@ monitor=,addreserved, 0, 0, 0, 0 # monitor=HDMI-A-1,1920x1080@60,1920x0,1,mirror,eDP-1 # Startup executions -source=~/.config/hypr/execs.conf +source=~/.config/hypr/hyprland/execs.conf input { # Keyboard: Add a layout and uncomment kb_options for Win+Space switching shortcut @@ -150,20 +150,20 @@ misc { } debug { - # overlay = true - # damage_tracking = 0 + # overlay = true + # damage_tracking = 0 # damage_blink = yes } # Window and layer rules layerrule = noanim, selection -source=~/.config/hypr/rules.conf +source=~/.config/hypr/hyprland/rules.conf # Dynamic colors -source=~/.config/hypr/colors.conf +source=~/.config/hypr/hyprland/colors.conf # Keybinds -source=~/.config/hypr/keybinds.conf +source=~/.config/hypr/hyprland/keybinds.conf windowrulev2=rounding 20, onworkspace:1 diff --git a/.config/hypr/hyprland/colors.conf b/.config/hypr/hyprland/colors.conf new file mode 100644 index 000000000..f63192c8c --- /dev/null +++ b/.config/hypr/hyprland/colors.conf @@ -0,0 +1,34 @@ +$SLURP_COMMAND="$(slurp -d -c f8daeeBB -b 55405044 -s 00000000)" + +general { + col.active_border = rgba(eae0e445) + col.inactive_border = rgba(9a8d9533) +} + +misc { + background_color = rgba(1f1a1dFF) +} + +plugin { + hyprbars { + # Honestly idk if it works like css, but well, why not + bar_text_font = Rubik, Geist, AR One Sans, Reddit Sans, Inter, Roboto, Ubuntu, Noto Sans, sans-serif + bar_height = 30 + bar_padding = 10 + bar_button_padding = 5 + bar_precedence_over_border = true + bar_part_of_window = true + + bar_color = rgba(120F11FF) + col.text = rgba(eae0e4FF) + + + # example buttons (R -> L) + # hyprbars-button = color, size, on-click + hyprbars-button = rgb(eae0e4), 13, 󰖭, hyprctl dispatch killactive + hyprbars-button = rgb(eae0e4), 13, 󰖯, hyprctl dispatch fullscreen 1 + hyprbars-button = rgb(eae0e4), 13, 󰖰, hyprctl dispatch movetoworkspacesilent special + } +} + +windowrulev2 = bordercolor rgba(ffabf1AA) rgba(ffabf177),pinned:1 \ No newline at end of file diff --git a/.config/hypr/env.conf b/.config/hypr/hyprland/env.conf similarity index 100% rename from .config/hypr/env.conf rename to .config/hypr/hyprland/env.conf diff --git a/.config/hypr/execs.conf b/.config/hypr/hyprland/execs.conf similarity index 82% rename from .config/hypr/execs.conf rename to .config/hypr/hyprland/execs.conf index 44af973ea..50273e124 100644 --- a/.config/hypr/execs.conf +++ b/.config/hypr/hyprland/execs.conf @@ -8,8 +8,7 @@ exec-once = fcitx5 # Core components (authentication, lock screen, notification daemon) exec-once = gnome-keyring-daemon --start --components=secrets & exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & -exec-once = swayidle -w timeout 300 'swaylock -f' before-sleep 'swaylock -f' & -exec-once = swayidle -w timeout 450 'pidof java || systemctl suspend' & +exec-once = hypridle & exec-once = dbus-update-activation-environment --all & exec-once = sleep 1 && dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # Some fix idk diff --git a/.config/hypr/keybinds.conf b/.config/hypr/hyprland/keybinds.conf similarity index 99% rename from .config/hypr/keybinds.conf rename to .config/hypr/hyprland/keybinds.conf index dfb664f45..c160e96bb 100644 --- a/.config/hypr/keybinds.conf +++ b/.config/hypr/hyprland/keybinds.conf @@ -63,8 +63,8 @@ bindl= Super+Shift, P, exec, playerctl play-pause bindl= ,XF86AudioPlay, exec, playerctl play-pause #Lock screen | blur: --effect-blur=20x202 -bind = Super, L, exec, swaylock -bind = Super+Shift, L, exec, swaylock +bind = Super, L, exec, hyprlock +bind = Super+Shift, L, exec, hyprlock bindl = Super+Shift, L, exec, sleep 0.1 && systemctl suspend # App launcher diff --git a/.config/hypr/rules.conf b/.config/hypr/hyprland/rules.conf similarity index 100% rename from .config/hypr/rules.conf rename to .config/hypr/hyprland/rules.conf diff --git a/.config/hypr/hyprlock.conf b/.config/hypr/hyprlock.conf new file mode 100644 index 000000000..31ebbdcb8 --- /dev/null +++ b/.config/hypr/hyprlock.conf @@ -0,0 +1,69 @@ +$text_color = rgba(eae0e4FF) +$entry_background_color = rgba(120F11FF) +$entry_border_color = rgba(9a8d9544) +$entry_color = rgba(d1c2cbFF) +$font_family = Gabarito +$font_family_clock = Gabarito +$font_material_symbols = Material Symbols Rounded + +background { + color = rgba(120F11BB) +} +input-field { + monitor = + size = 200, 50 + outline_thickness = 1 + outer_color = $entry_border_color + inner_color = $entry_background_color + font_color = $entry_color + # fade_on_empty = true + + position = 0, 20 + halign = center + valign = center +} + +label { # Clock + monitor = + text = $TIME + color = $text_color + font_size = 65 + font_family = $font_family_clock + + position = 0, 300 + halign = center + valign = center +} +label { + monitor = + text = hi $USER + color = $text_color + font_size = 20 + font_family = $font_family + + position = 0, 240 + halign = center + valign = center +} +label { + monitor = + text = lock + color = $text_color + font_size = 21 + font_family = $font_material_symbols + + position = 0, 65 + halign = center + valign = bottom +} +label { + monitor = + text = locked + color = $text_color + font_size = 14 + font_family = $font_family + + position = 0, 50 + halign = center + valign = bottom +} \ No newline at end of file diff --git a/scriptdata/dependencies.conf b/scriptdata/dependencies.conf index c2c02d370..eff05caab 100644 --- a/scriptdata/dependencies.conf +++ b/scriptdata/dependencies.conf @@ -23,7 +23,7 @@ polkit-gnome gnome-keyring gnome-control-center blueberry networkmanager brightn ### Widgets # wayland-idle-inhibitor-git : providing `wayland-idle-inhibitor.py' used by the `Keep system awake' button in `.config/ags/widgets/sideright/quicktoggles.js'. -wayland-idle-inhibitor-git swayidle swaylock-effects-git wlogout wl-clipboard hyprpicker-git grim tesseract slurp anyrun-git +wayland-idle-inhibitor-git hypridle-git hyprlock-git wlogout wl-clipboard hyprpicker-git grim tesseract slurp anyrun-git ### Fonts and Themes adw-gtk3-git qt5ct gradience-git fontconfig lexend-fonts-git ttf-jetbrains-mono-nerd ttf-material-symbols-variable-git ttf-space-mono-nerd fish foot starship