From 605b23ba3955f72966bd9a22ea4d1babf5c32eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 7 Apr 2026 07:02:00 +0300 Subject: [PATCH] feat: wallpaper picker, wallust theming, waybar improvements - Add rofi wallpaper picker with thumbnail grid (Super+W) - Integrate wallust for wallpaper-based color theming - Add collapsible tray with hamburger menu - Update hyprland config: split workspaces, monitor variables, tearing support - Improve song_detail with sticky player preference to prevent flickering - Add toggle_monitors and wallust_run scripts --- .config/hypr/hyprland.conf | 74 ++++++++++++-------- .config/hypr/hyprpaper.conf | 7 +- .config/scripts/hyprland/toggle_monitors.sh | 32 +++++++++ .config/scripts/hyprland/wallpaper_picker.sh | 71 +++++++++++++++++++ .config/scripts/shared/song_detail.sh | 65 +++++++++++------ .config/scripts/shared/wallust_run.sh | 35 +++++++++ .config/waybar/config | 19 ++++- .config/waybar/style.css | 32 +++------ 8 files changed, 254 insertions(+), 81 deletions(-) create mode 100755 .config/scripts/hyprland/toggle_monitors.sh create mode 100755 .config/scripts/hyprland/wallpaper_picker.sh create mode 100755 .config/scripts/shared/wallust_run.sh diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 59a0bee..b98fd3b 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -4,6 +4,7 @@ monitor = DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10 monitor = HDMI-A-1, 1920x1080@75, 2560x0, 1, bitdepth, 10 # monitor = eDP-1, disable # monitor = HDMI-A-1, disable +# monitor = DP-1, disable bindl = , switch:on:Lid Switch, exec, hyprctl keyword monitor "eDP-1, disable" bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, enable" bindl = , switch:on:Lid Switch, exec, hyprctl keyword input:touchdevice:enabled false @@ -11,6 +12,7 @@ bindl = , switch:off:Lid Switch, exec, hyprctl keyword input:touchdevice:enabled bindl = , switch:off:Lid Switch, exec, hyprctl reload && hyprctl keyword input:touchdevice:enabled false # bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, 2880x1800@90, 0x1080, 2" monitor = HDMI-A-1, disable +exec-once = hyprpm reload -n exec-once = sleep 1 && /usr/libexec/polkit-mate-authentication-agent-1 exec-once = sleep 1 && waybar # exec-once = sleep 1 && eww daemon @@ -53,6 +55,8 @@ $signal = flatpak run org.signal.Signal $deezer = mullvad-exclude flatpak run io.github.ungoogled_software.ungoogled_chromium --no-first-run --app="https://deezer.com/" --class=chrome-deezer.com__-Default --name=chrome-deezer.com__-Default --user-data-dir=/home/tahinli/.var/app/io.github.ungoogled_software.ungoogled_chromium/data/web-app-hub/profiles/VjW8vTQ3 $mainMod = SUPER $my_trigger = Alt +$monitor_left = DP-1 +$monitor_right = HDMI-A-1 # bind = $my_trigger, 0, exec, bluetoothctl disconnect 00:00:00:00:00:00 && bluetoothctl connect 00:00:00:00:00:00 # bind = $my_trigger, 1, exec, playerctl previous @@ -75,6 +79,9 @@ bind = $my_trigger SHIFT, F, exec, $browser_unsafe bind = Shift, Print, exec, $screenshot_with_area_selector bind = $mainMod, L, exec, hyprlock bind = $mainMod, Escape, exec, $power_menu +bind = $mainMod, W, exec, ~/.config/scripts/hyprland/wallpaper_picker.sh +bind = $mainMod, M, exec, ~/.config/scripts/hyprland/toggle_monitors.sh +bindl = $mainMod SHIFT, M, exec, ~/.config/scripts/hyprland/toggle_monitors.sh on $discord = flatpak run dev.vencord.Vesktop $youtube = mullvad-exclude flatpak run io.freetubeapp.FreeTube @@ -121,47 +128,48 @@ binds { } bindr = $mainMod, Tab, bringactivetotop binde = $mainMod, Tab, cyclenext -bind = Alt, Tab, workspace, previous -bind = $mainMod SHIFT, Tab, swapactiveworkspaces, DP-1 HDMI-A-1 +bind = Alt, Tab, workspace, previous_per_monitor +bind = $mainMod SHIFT, Tab, split:swapactiveworkspaces, $monitor_left $monitor_right bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, F, togglefloating, -bind = $mainMod, Q, focusmonitor, l -bind = $mainMod, E, focusmonitor, r -bind = $mainMod SHIFT, Q, movewindow, mon:l -bind = $mainMod SHIFT, E, movewindow, mon:r +bind = $mainMod, Q, focusmonitor, $monitor_left +bind = $mainMod, E, focusmonitor, $monitor_right +bind = $mainMod SHIFT, Q, movewindow, mon:$monitor_left +bind = $mainMod SHIFT, E, movewindow, mon:$monitor_right +bind = $mainMod, I, split:grabroguewindows, bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 +bind = $mainMod, 1, split:workspace, 1 +bind = $mainMod, 2, split:workspace, 2 +bind = $mainMod, 3, split:workspace, 3 +bind = $mainMod, 4, split:workspace, 4 +bind = $mainMod, 5, split:workspace, 5 +bind = $mainMod, 6, split:workspace, 6 +bind = $mainMod, 7, split:workspace, 7 +bind = $mainMod, 8, split:workspace, 8 +bind = $mainMod, 9, split:workspace, 9 +bind = $mainMod, 0, split:workspace, 10 + +bind = $mainMod SHIFT, 1, split:movetoworkspace, 1 +bind = $mainMod SHIFT, 2, split:movetoworkspace, 2 +bind = $mainMod SHIFT, 3, split:movetoworkspace, 3 +bind = $mainMod SHIFT, 4, split:movetoworkspace, 4 +bind = $mainMod SHIFT, 5, split:movetoworkspace, 5 +bind = $mainMod SHIFT, 6, split:movetoworkspace, 6 +bind = $mainMod SHIFT, 7, split:movetoworkspace, 7 +bind = $mainMod SHIFT, 8, split:movetoworkspace, 8 +bind = $mainMod SHIFT, 9, split:movetoworkspace, 9 +bind = $mainMod SHIFT, 0, split:movetoworkspace, 10 bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 +bind = $mainMod, mouse_down, split:workspace, e+1 +bind = $mainMod, mouse_up, split:workspace, e-1 bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow @@ -190,6 +198,9 @@ windowrule = match:class kitty, opacity 0.8 windowrule = match:class .*wezterm.*, opacity 0.8 windowrule = match:class .*dev.heppen.webapps.*, tile on +# Gaming: enable tearing for fullscreen games +windowrule = match:fullscreen 1, immediate on + general { gaps_in = 3 gaps_out = 10 @@ -207,7 +218,8 @@ general { } render { - cm_fs_passthrough = 2 + cm_fs_passthrough = 0 + direct_scanout = 0 } decoration { @@ -251,6 +263,7 @@ misc { force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( vrr = 0 + mouse_move_focuses_monitor = false } # =================================== @@ -269,6 +282,7 @@ input { kb_rules = follow_mouse = 0 + mouse_refocus = false sensitivity = 0 # -1.0 - 1.0, 0 means no modification. diff --git a/.config/hypr/hyprpaper.conf b/.config/hypr/hyprpaper.conf index 28bea19..c9f3890 100644 --- a/.config/hypr/hyprpaper.conf +++ b/.config/hypr/hyprpaper.conf @@ -1,12 +1,7 @@ -# $location = ~/Pictures/andrew-ruiz-RbIQ3YvUREw-unsplash.jpg -# preload = $location -# wallpaper = eDP-1,$location -# wallpaper = HDMI-A-1,$location splash = false wallpaper { monitor = - # path = ~/Pictures/andrew-ruiz-RbIQ3YvUREw-unsplash.jpg - path = ~/Pictures/ryunosuke-kikuno-VXp-9HwN1eg-unsplash.jpg + path = /home/tahinli/Pictures/Wallpapers/josh-hild-RR7j6oX_3lk-unsplash.jpg fit_mode = cover } diff --git a/.config/scripts/hyprland/toggle_monitors.sh b/.config/scripts/hyprland/toggle_monitors.sh new file mode 100755 index 0000000..fd2a0af --- /dev/null +++ b/.config/scripts/hyprland/toggle_monitors.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Toggle monitors off via rofi, re-enable with keybinding + +DP1_CONFIG="DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10" +HDMI_CONFIG="HDMI-A-1, 1920x1080@75, 2560x0, 1, bitdepth, 10" + +case "${1:-menu}" in + menu) + menu=$(echo -e "🖥️ All Monitors Off\n🖥️ DP-1 Off\n🖥️ HDMI-A-1 Off\n❌ Cancel" | rofi -dmenu -p "Monitors" -i) + + case "$menu" in + "🖥️ All Monitors Off") + hyprctl keyword monitor "HDMI-A-1, disable" + sleep 0.5 + hyprctl dispatch dpms off DP-1 + ;; + "🖥️ DP-1 Off") + hyprctl dispatch dpms off DP-1 + ;; + "🖥️ HDMI-A-1 Off") + hyprctl dispatch dpms off HDMI-A-1 + ;; + "❌ Cancel") + ;; + esac + ;; + on) + hyprctl dispatch dpms on DP-1 + hyprctl keyword monitor "$HDMI_CONFIG" + ;; +esac diff --git a/.config/scripts/hyprland/wallpaper_picker.sh b/.config/scripts/hyprland/wallpaper_picker.sh new file mode 100755 index 0000000..0fa6e2d --- /dev/null +++ b/.config/scripts/hyprland/wallpaper_picker.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# Rofi wallpaper picker — updates hyprpaper, wallust, and waybar + +WALLPAPER_DIR="$HOME/Pictures/Wallpapers" +HYPRPAPER_CONF="$HOME/.config/hypr/hyprpaper.conf" +THUMB_DIR="$HOME/.cache/wallpaper_thumbs" + +# Generate thumbnail cache (only for new/changed images) +mkdir -p "$THUMB_DIR" + +# Remove orphan thumbnails for deleted wallpapers +for thumb in "$THUMB_DIR"/*.png; do + [ -f "$thumb" ] || continue + name=$(basename "$thumb" .png) + if ! find "$WALLPAPER_DIR" -maxdepth 1 -name "$name" -print -quit | grep -q .; then + rm -f "$thumb" + fi +done + +# Generate thumbnails for new/changed wallpapers +find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do + name=$(basename "$img") + thumb="$THUMB_DIR/$name.png" + if [ ! -f "$thumb" ] || [ "$img" -nt "$thumb" ]; then + magick "$img" -thumbnail 128x80 "$thumb" & + fi +done +wait + +# List image files with cached thumbnails in a grid rofi +SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | while read -r img; do + name=$(basename "$img") + echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n" +done | rofi -dmenu -p "Wallpaper" -i -show-icons \ + -theme-str 'listview { columns: 4; lines: 3; flow: horizontal; }' \ + -theme-str 'element { orientation: vertical; }' \ + -theme-str 'element-icon { size: 100px; }' \ + -theme-str 'element-text { horizontal-align: 0.5; }') + +if [ -z "$SELECTED" ]; then + exit 0 +fi + +WALLPAPER="$WALLPAPER_DIR/$SELECTED" + +if [ ! -f "$WALLPAPER" ]; then + notify-send "Wallpaper Picker" "File not found: $WALLPAPER" + exit 1 +fi + +# Update hyprpaper config and kill both processes +cat > "$HYPRPAPER_CONF" << EOF +splash = false + +wallpaper { + monitor = + path = $WALLPAPER + fit_mode = cover +} +EOF + +pkill hyprpaper +killall waybar 2>/dev/null + +# Run hyprpaper and wallust in parallel +hyprpaper &disown +wallust run -q "$WALLPAPER" & +wait + +waybar &disown +notify-send "Wallpaper Picker" "Applied: $SELECTED" diff --git a/.config/scripts/shared/song_detail.sh b/.config/scripts/shared/song_detail.sh index 4583621..7f74854 100755 --- a/.config/scripts/shared/song_detail.sh +++ b/.config/scripts/shared/song_detail.sh @@ -1,10 +1,9 @@ #!/bin/bash -# Get current playing song from playerctl, prioritizing the most recently active player +# Get current playing song from playerctl with sticky player preference if command -v playerctl &> /dev/null; then # Check if any player is running if playerctl status &> /dev/null; then - # Get list of all players and find the one with most recent activity player_list=$(playerctl -l 2>/dev/null) if [[ -z "$player_list" ]]; then @@ -12,37 +11,57 @@ if command -v playerctl &> /dev/null; then exit 0 fi - # Track which player has the most recent activity - most_recent_player="" - most_recent_time=0 + PREFERRED_FILE="/tmp/playerctl_preferred_player" + # Find first Playing and first Paused player + best_playing="" + best_paused="" while IFS= read -r player; do player_status=$(playerctl -p "$player" status 2>/dev/null) - - # Only consider players that are Playing or Paused - if [[ "$player_status" == "Playing" ]] || [[ "$player_status" == "Paused" ]]; then - # Get the last activity time for this player - activity_cache="/tmp/playerctl_activity_${player}" - current_time=$(date +%s) - - # Always update timestamp for any Playing or Paused player - # This ensures we track when a player was last active (Playing or just paused) - echo "$current_time" > "$activity_cache" - - # Compare timestamps to find most recent - if [[ $current_time -gt $most_recent_time ]]; then - most_recent_time=$current_time - most_recent_player="$player" - fi + if [[ "$player_status" == "Playing" && -z "$best_playing" ]]; then + best_playing="$player" + elif [[ "$player_status" == "Paused" && -z "$best_paused" ]]; then + best_paused="$player" fi done <<< "$player_list" - # If no active player found, exit - if [[ -z "$most_recent_player" ]]; then + # Sticky player logic: prefer current player to avoid flickering + preferred="" + if [[ -f "$PREFERRED_FILE" ]]; then + preferred=$(cat "$PREFERRED_FILE") + pref_status=$(playerctl -p "$preferred" status 2>/dev/null) + # Drop preferred if it's gone or stopped + if [[ "$pref_status" != "Playing" && "$pref_status" != "Paused" ]]; then + preferred="" + fi + fi + + # Choose player: + # - If preferred is still Playing, keep it (prevents flickering) + # - If preferred is Paused but something else is Playing, switch + # - Otherwise fall back to best available + chosen="" + if [[ -n "$preferred" ]]; then + pref_status=$(playerctl -p "$preferred" status 2>/dev/null) + if [[ "$pref_status" == "Playing" ]]; then + chosen="$preferred" + elif [[ -n "$best_playing" ]]; then + chosen="$best_playing" + else + chosen="$preferred" + fi + else + chosen="${best_playing:-$best_paused}" + fi + + if [[ -z "$chosen" ]]; then echo "" exit 0 fi + echo "$chosen" > "$PREFERRED_FILE" + + most_recent_player="$chosen" status=$(playerctl -p "$most_recent_player" status 2>/dev/null) # Exit if media is stopped diff --git a/.config/scripts/shared/wallust_run.sh b/.config/scripts/shared/wallust_run.sh new file mode 100755 index 0000000..4f3f974 --- /dev/null +++ b/.config/scripts/shared/wallust_run.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Runs wallust and adjusts waybar transparency based on wallpaper top strip brightness + +if [ -z "$1" ]; then + echo "Usage: wallust_run.sh " + exit 1 +fi + +# Run wallust to generate colors +wallust run "$1" + +# Read the generated background color from style.css +BG=$(grep -oP 'alpha\(#\K[0-9A-Fa-f]{6}' ~/.config/waybar/style.css | head -1) + +if [ -z "$BG" ]; then + exit 0 +fi + +# Analyze the TOP STRIP of the wallpaper (top 5%) where waybar actually sits +# Crop top strip, scale to 1x1 pixel, get average brightness +TOP_BRIGHTNESS=$(magick "$1" -gravity North -crop 100%x5%+0+0 -resize 1x1! -format "%[fx:round((0.299*r + 0.587*g + 0.114*b) * 255)]" info:) + +# Map brightness to alpha: +# Dark top area (0) -> low alpha (0.2) = more transparent +# Light top area (255) -> high alpha (0.75) = more opaque, keep text readable +ALPHA=$(awk "BEGIN { printf \"%.2f\", 0.45 + ($TOP_BRIGHTNESS / 255.0) * 0.45 }") + +# Replace the alpha value in style.css +sed -i "s/alpha(#${BG}, [0-9.]*)/alpha(#${BG}, ${ALPHA})/" ~/.config/waybar/style.css + +# Restart waybar +killall waybar 2>/dev/null +waybar &disown + +echo "Top strip brightness: ${TOP_BRIGHTNESS}/255 | Alpha: ${ALPHA}" diff --git a/.config/waybar/config b/.config/waybar/config index 4011ec0..56b3b2a 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -5,7 +5,7 @@ "spacing": 16, "modules-left": ["hyprland/workspaces", "custom/music"], "modules-center": ["clock"], - "modules-right": ["privacy", "cpu", "memory", "wireplumber", "tray", "battery"], + "modules-right": ["privacy", "cpu", "memory", "wireplumber", "group/tray", "battery"], "cava": { "framerate": 30, @@ -161,6 +161,23 @@ "on-click-right": "pavucontrol", "format-muted": "\uf00d {volume}%" }, + "group/tray": { + "orientation": "horizontal", + "drawer": { + "transition-duration": 300, + "transition-left-to-right": false + }, + "modules": [ + "custom/tray-toggle", + "tray" + ] + }, + + "custom/tray-toggle": { + "format": "\uf0c9", + "tooltip": false + }, + "tray": { "icon-size": 20, "spacing": 10 diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 1d1c18d..174eb1a 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -1,12 +1,11 @@ #waybar { color: #ffffff; - background-color: #000000; - /* opacity: 1; */ + background-color: alpha(#020503, 0.8); border-radius: 1px; } #idle_inhibitor.activated { - background-color: #285577; + background-color: #B33625; } * { @@ -14,26 +13,12 @@ font-size: 14px; } -#pulseaudio-slider slider { - min-height: 0px; - min-width: 0px; - opacity: 0; - background-image: none; - border: none; - box-shadow: none; -} - -#pulseaudio-slider trough { - min-height: 10px; - min-width: 80px; - border-radius: 5px; - background-color: black; +#workspaces button { + color: #ffffff; } -#pulseaudio-slider highlight { - min-width: 10px; - border-radius: 5px; - background-color: white; +#workspaces button.active { + color: #ffffff; } #custom-music { @@ -45,6 +30,11 @@ box-shadow: none; } +#custom-tray-toggle { + color: #ffffff; + padding: 0 6px; +} + #custom-camera { color: #ffffff; margin: 0;