From 6b77a0ab0e43d8ddcb3a359dcf3b5651cd0d5df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dias?= Date: Sun, 18 Aug 2024 17:38:57 -0300 Subject: [PATCH] :sparkles: feat: wallpaper menu, blue colors on waybar with blur --- apply.sh | 3 ++ hyprland/bindings.conf | 6 +-- hyprland/environment.conf | 2 + hyprland/rules.conf | 10 ++--- hyprland/scripts/change-wallpaper.sh | 20 +++++++++ hyprpaper/hyprpaper.conf | 8 ++-- swaync/config.json | 9 +++- swaync/style.css | 5 ++- waybar/_colors.css | 14 +++---- waybar/config.jsonc | 24 ++++------- waybar/style.css | 63 ++++++++++++++-------------- wlogout/style.css | 2 +- wofi/style.css | 6 +-- 13 files changed, 98 insertions(+), 74 deletions(-) create mode 100644 hyprland/scripts/change-wallpaper.sh diff --git a/apply.sh b/apply.sh index b187b86..79e7afb 100755 --- a/apply.sh +++ b/apply.sh @@ -90,6 +90,9 @@ function Apply_dotfiles { cp -f ./hyprlock/* $CONFIG_DIR/hypr cp -f ./hypridle/* $CONFIG_DIR/hypr + echo "-> Installing scripts in ~/.config/hypr/scripts" + cp -r ./hyprland/scripts $CONFIG_DIR/hypr + echo "-> Installing Wofi" mkdir -p $CONFIG_DIR/wofi cp -f ./wofi/* $CONFIG_DIR/wofi diff --git a/hyprland/bindings.conf b/hyprland/bindings.conf index 66ffd15..f764c4c 100644 --- a/hyprland/bindings.conf +++ b/hyprland/bindings.conf @@ -6,7 +6,7 @@ $terminal = kitty $fileManager = nautilus -$menu = wofi +$menu = anyrun $mainMod = SUPER $lockscreen = hyprlock $screenshotDir = "$HOME/Screenshots" @@ -40,7 +40,7 @@ bind = $mainMod, K, exec, $terminal bind = $mainMod, Q, killactive bind = $mainMod, E, exec, $fileManager bind = $mainMod, F, togglefloating -bind = $mainMod, SPACE, exec, $menu -S drun +bind = $mainMod, SPACE, exec, $menu bind = $mainMod, P, pseudo, bind = $mainMod, J, togglesplit bind = $mainMod, F11, fullscreen @@ -62,7 +62,7 @@ bind = , Print, exec, $screenshotSelect bind = $mainMod, Print, exec, $screenshotFull # Open wofi clipboard -bind = $mainMod, V, exec, cliphist list | $menu -S dmenu | cliphist decode | wl-copy +bind = $mainMod, V, exec, cliphist list | wofi -S dmenu | cliphist decode | wl-copy # Reloading Components # Waybar diff --git a/hyprland/environment.conf b/hyprland/environment.conf index d4fb66c..0229637 100644 --- a/hyprland/environment.conf +++ b/hyprland/environment.conf @@ -9,3 +9,5 @@ env = QT_QPA_PLATFORM, wayland env = QT_QPA_PLATFORMTHEME, qt6ct env = XDG_CURRENT_DESKTOP, Hyprland env = ADW_DISABLE_PORTAL, 1 + +env = AQ_DRM_DEVICES, /dev/dri/card0:/dev/dri/card1 diff --git a/hyprland/rules.conf b/hyprland/rules.conf index 2a929e9..fe5f0eb 100644 --- a/hyprland/rules.conf +++ b/hyprland/rules.conf @@ -12,13 +12,10 @@ windowrulev2 = float, class:xdg-desktop-portal* windowrulev2 = float, class:org.pulseaudio.pavucontrol # Resize -windowrulev2 = size 50% 50%, class:org.pulseaudio.pavucontrol +windowrulev2 = size 70% 65%, class:org.pulseaudio.pavucontrol -# Moving -windowrulev2 = move 49.27% 7.28%, class:org.pulseaudio.pavucontrol - -# Maximize -windowrulev2 = tile, title:^(Resources)$ +# Center +windowrulev2 = center, class:org.pulseaudio.pavucontrol # Animations windowrulev2 = animation slide right, class:org.pulseaudio.pavucontrol @@ -36,5 +33,6 @@ windowrulev2 = opacity , class:kitty # Blur blurls = logout_dialog blurls = kitty +blurls = waybar windowrulev2 = suppressevent maximize, class:.* diff --git a/hyprland/scripts/change-wallpaper.sh b/hyprland/scripts/change-wallpaper.sh new file mode 100644 index 0000000..e22647e --- /dev/null +++ b/hyprland/scripts/change-wallpaper.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf" +SET_WALLPAPER=$(find $HOME/wallpapers/ | wofi --dmenu --allow-images true) + +echo "" > $HYPRPAPER_FILE # Cleans hyprpaper file + +echo "\$wallpaper = $SET_WALLPAPER" >> $HYPRPAPER_FILE +echo "" >> $HYPRPAPER_FILE +echo "splash = true" >> $HYPRPAPER_FILE +echo "preload = \$wallpaper" >> $HYPRPAPER_FILE +echo "wallpaper = , \$wallpaper" >> $HYPRPAPER_FILE + +if ! [[ $SET_WALLPAPER == "" ]] && ! [[ $SET_WALLPAPER == " " ]] +then + killall -q hyprpaper + exec hyprpaper & +fi + +exit 0 diff --git a/hyprpaper/hyprpaper.conf b/hyprpaper/hyprpaper.conf index 7f6c866..7521763 100644 --- a/hyprpaper/hyprpaper.conf +++ b/hyprpaper/hyprpaper.conf @@ -1,4 +1,6 @@ -splash = true -preload = ~/wallpapers/nijika-ijichi-bocchi-the-rock.jpg -wallpaper = , ~/wallpapers/nijika-ijichi-bocchi-the-rock.jpg # use ´contain:´ before wallpaper to preserve original size +$wallpaper = + +splash = true +preload = $wallpaper +wallpaper = , $wallpaper diff --git a/swaync/config.json b/swaync/config.json index 3aa3fc8..ab78b10 100644 --- a/swaync/config.json +++ b/swaync/config.json @@ -93,8 +93,13 @@ { "label": "󰒲 Do Not Disturb", "type": "toggle", - "command": "swaync-client -d -sw", - "update-command": "sh -c '[[ $(swaync-client -D) == \"true\"]] && echo true || echo false'" + "command": "swaync-client -d", + "update-command": "swaync-client -D" + }, + { + "label": "Change Wallpaper", + "type": "normal", + "command": "bash -c '$(swaync-client -cp; bash $HOME/.config/hypr/scripts/change-wallpaper.sh)'" } ] } diff --git a/swaync/style.css b/swaync/style.css index 606c66e..fb24a54 100644 --- a/swaync/style.css +++ b/swaync/style.css @@ -268,12 +268,12 @@ tooltip { .widget-buttons-grid { margin-top: 2px; - margin-left: 75px; + margin-left: 5px; } .widget-buttons-grid button { background: @button-bg; - padding: 10px; + padding: 12px; border-radius: 16px; margin: 2px; } @@ -293,6 +293,7 @@ tooltip { .widget-buttons-grid button label { font-size: 0.95rem; color: black; + font-weight: 500; } .widget-volume trough, diff --git a/waybar/_colors.css b/waybar/_colors.css index 60dd4ec..bca8776 100644 --- a/waybar/_colors.css +++ b/waybar/_colors.css @@ -5,14 +5,13 @@ @define-color red #f38ba8; @define-color maroon #eba0ac; @define-color peach #fab387; -@define-color yellow alpha(#f9e2af, .8); +@define-color yellow #f9e2af; @define-color green #a6e3a1; @define-color teal #94e2d5; @define-color sky #89dceb; @define-color sapphire #74c7ec; @define-color blue #89b4fa; @define-color lavender #b4befe; -@define-color text #cdd6f4; @define-color subtext1 #bac2de; @define-color subtext0 #a6adc8; @define-color overlay2 #9399b2; @@ -25,8 +24,9 @@ @define-color mantle #181825; @define-color crust #11111b; -@define-color background alpha(@base, .6); -@define-color bar shade(@yellow, .2); -@define-color hover shade(@yellow, .5); -@define-color active shade(@yellow, .55); -@define-color highlight shade(@yellow, .4); +@define-color highlight shade(@blue, .67); +@define-color bar alpha(shade(@highlight, .8), .3); +@define-color hover shade(@highlight, .6); +@define-color active shade(@highlight, .58); +@define-color text rgb(245, 245, 245); +@define-color text_dark rgb(30, 30, 30); diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 5c6e92d..e5ca5df 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -1,11 +1,6 @@ -// -*- mode: jsonc -*- { - // "layer": "top", // Waybar at top layer - // "position": "bottom", // Waybar position (top|bottom|left|right) - // "height": 32, // Waybar height (to be removed for auto height) - // "width": 1280, // Waybar width - "spacing": 4, // Gaps between modules (4px) - // Choose the order of the modules + "spacing": 4, + "margin": 5, "modules-left": [ "custom/logo", "hyprland/workspaces", @@ -20,7 +15,7 @@ "pulseaudio", "custom/notifications" ], - // Modules configuration + "hyprland/workspaces": { "disable-scroll": false, "all-outputs": true, @@ -74,7 +69,7 @@ "format": "", // Change to desired logo "tooltip": false, "escape": true, - "on-click": "wofi --show drun -I -a -b" // Change to desired action + "on-click": "wofi -s drun" // Change to desired action }, "custom/notifications": { "tooltip": false, @@ -174,10 +169,7 @@ "format-good": "{capacity}% {icon}", "format-full": "", "format-icons": ["", "", "", "", ""] - }, - "battery#bat2": { - "bat": "BAT2" - }, + }, "power-profiles-daemon": { "format": "{icon}", "tooltip-format": "Power profile: {profile}\nDriver: {driver}", @@ -225,9 +217,9 @@ "spotube": " ", "default": "󰎇" }, - "on-scroll-down": "playerctl --player spotify previous", - "on-scroll-up": "playerctl --player spotify next", + "on-scroll-down": "playerctl previous", + "on-scroll-up": "playerctl next", "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null", // Script in resources folder - "on-click": "playerctl --player spotify play-pause" // Change "spotify to your preferred player" + "on-click": "playerctl play-pause" // Change "spotify to your preferred player" } } diff --git a/waybar/style.css b/waybar/style.css index cc27614..cc0903d 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -4,26 +4,22 @@ * { color: @text; border-radius: 14px; + transition: 120ms ease-in; } window { - font-family: "0xProto Nerd Font Regular", "Font Awesome", sans-serif; + font-family: "Cantarell", "Font Awesome", sans-serif; font-size: 12px; color: @text; border-radius: 16px; } -/* Manage "floating" waybar position with paddings */ window > * { - margin-top: 5px; - margin-left: 4px; - margin-right: 4px; padding: 2px; - background: @bar; } window#waybar { - background-color: transparent; + background: @bar; } window#waybar.hidden { @@ -40,24 +36,6 @@ button:hover { background-color: @hover; } -widget > * { - padding-top: 1px; - padding-bottom: 1px; - transition: 100ms ease-in; -} - -widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) { - background: @hover; -} - -#custom-logo { - padding-left: 12px; - padding-right: 18px; - font-size: 15.2px; - transition: 110ms ease-in; - margin-right: 6px; -} - #workspaces { border-radius: 16px; padding-left: 2px; @@ -92,10 +70,13 @@ widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) { background-color: alpha(shade(@orange, 0.6), .3); } -#custom-notifications { - font-size: 16px; - padding-left: 10px; - padding-right: 12px; +widget > * { + padding-top: 1px; + padding-bottom: 1px; +} + +widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) { + background: @hover; } #clock, @@ -113,10 +94,13 @@ widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) { #mode, #idle_inhibitor, #scratchpad, +#window, #power-profiles-daemon, +#custom-notifications, +#custom-logo, #mpd { padding: 0 10px; - color: @text; + font-weight: 500; } /* @@ -131,6 +115,20 @@ widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) { } } +#custom-logo { + padding-left: 12px; + padding-right: 18px; + font-size: 15.2px; + transition: 110ms ease-in; + margin-right: 6px; +} + +#custom-notifications { + font-size: 16px; + padding-left: 10px; + padding-right: 12px; +} + #battery.charging, #battery.plugged { color: @text; background-color: alpha(@base, .3); @@ -152,10 +150,13 @@ widget > *:hover:not(#window):not(#workspaces):not(#tray):not(#custom-media) { } #custom-media { - background: @highlight; + border: 2px solid @highlight; + font-weight: 500; + transition: 200ms ease-in; } #custom-media:hover { + border: 2px solid transparent; background: @hover; } diff --git a/wlogout/style.css b/wlogout/style.css index 9ccca08..4a7b103 100644 --- a/wlogout/style.css +++ b/wlogout/style.css @@ -9,7 +9,7 @@ } window { - background-color: alpha(shade(@background, .6), 0.9); + background-color: alpha(shade(@background, .6), .6); } button { diff --git a/wofi/style.css b/wofi/style.css index c00c64d..668e164 100644 --- a/wofi/style.css +++ b/wofi/style.css @@ -1,7 +1,7 @@ /* background -> #312D23 - * selected -> #AC8A3D - * highlight-low(not-selected) -> #726037 + * highlight -> #AC8A3D + * mark(not-selected) -> #726037 */ * { @@ -33,7 +33,7 @@ #input { border: 2px solid shade(#AC8A3D, .8); border-radius: 14px; - margin: 4px; + margin: 8px; background-color: shade(#726037, .7); box-shadow: none; }