From 74945d45e92890cac22964e23ec6d6e126cb1684 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Thu, 2 Apr 2026 13:46:16 +0200 Subject: [PATCH] updated hyprlock --- hypr/hyprlock.conf | 149 ++++++++++++++++++++++++------------ hypr/scripts/album_art.sh | 11 +++ hypr/scripts/songdetail.sh | 13 ++++ hypr/scripts/status_info.sh | 14 ++++ 4 files changed, 140 insertions(+), 47 deletions(-) create mode 100755 hypr/scripts/album_art.sh create mode 100755 hypr/scripts/songdetail.sh create mode 100755 hypr/scripts/status_info.sh diff --git a/hypr/hyprlock.conf b/hypr/hyprlock.conf index befc2ae..8f3f25f 100644 --- a/hypr/hyprlock.conf +++ b/hypr/hyprlock.conf @@ -7,38 +7,35 @@ $font = JetBrainsMono Nerd Font # GENERAL general { hide_cursor = true + no_fade_in = false + grace = 0 + disable_loading_bar = true } # BACKGROUND background { monitor = path = $HOME/Pictures/reze/reze.png - blur_passes = 2 + blur_passes = 3 + blur_size = 7 + noise = 0.0117 + contrast = 0.8916 + brightness = 0.8172 + vibrancy = 0.1696 + vibrancy_darkness = 0.0 color = $base } -# LAYOUT -label { - monitor = - text = Layout: $LAYOUT - color = $text - font_size = 25 - font_family = $font - position = 30, -30 - halign = left - valign = top -} - # TIME label { monitor = text = $TIME color = $text - font_size = 90 + font_size = 120 font_family = $font - position = -30, 0 - halign = right - valign = top + position = 0, 300 + halign = center + valign = center } # DATE @@ -46,46 +43,34 @@ label { monitor = text = cmd[update:43200000] date +"%A, %d %B %Y" color = $text - font_size = 25 + font_size = 30 font_family = $font - position = -30, -150 - halign = right - valign = top -} - -# FINGERPRINT -{ - monitor = ""; - text = "$FPRINTPROMPT"; - color = "$text"; - font_size = 14; - font_family = $font; - position = "0, -107"; - halign = "center"; - valign = "center"; -} - -# USER AVATAR -image { - monitor = - path = $HOME/.face - size = 100 - border_color = $accent - position = 0, 75 + position = 0, 200 halign = center valign = center } -# INPUT FIELD +# USER AVATAR (Center) +image { + monitor = + path = $HOME/.face + size = 120 + border_color = rgba(255, 255, 255, 0.1) + position = 0, 50 + halign = center + valign = center +} + +# INPUT FIELD (Center) input-field { monitor = size = 300, 60 - outline_thickness = 4 + outline_thickness = 2 dots_size = 0.2 dots_spacing = 0.2 dots_center = true - outer_color = $accent - inner_color = $surface0 + outer_color = rgba(255, 255, 255, 0.1) + inner_color = rgba(0, 0, 0, 0.2) font_color = $text fade_on_empty = false placeholder_text = 󰌾 Logged in as $USER @@ -94,7 +79,77 @@ input-field { fail_color = $red fail_text = $FAIL ($ATTEMPTS) capslock_color = $yellow - position = 0, -47 + position = 0, -60 halign = center valign = center } + +# --- MUSIC DASHBOARD (TOP RIGHT) --- + +# ALBUM ART (At the very top right, 80px high, adjusted -3px for perfect alignment) +image { + monitor = + path = /tmp/hyprlock_art.png + size = 80 + rounding = 15 + border_color = rgba(255, 255, 255, 0.1) + reload_time = 2 + reload_cmd = ~/.config/hypr/scripts/album_art.sh + position = -20, -17 + halign = right + valign = top +} + +# MUSIC TEXT BOX (To the left of the image, same height) +shape { + monitor = + size = 300, 80 + color = rgba(0, 0, 0, 0.3) + rounding = 15 + border_size = 1 + border_color = rgba(255, 255, 255, 0.1) + position = -110, -20 + halign = right + valign = top +} + +# MUSIC TEXT (Right aligned and vertically centered inside the 80px box) +label { + monitor = + text = cmd[update:1000] ~/.config/hypr/scripts/songdetail.sh + color = $text + font_size = 14 + font_family = $font + position = -125, -37 + halign = right + valign = top + text_align = right +} + +# --- STATUS DASHBOARD (BOTTOM RIGHT) --- + +# SYSTEM INFO BOX (Vertical stack container) +shape { + monitor = + size = 300, 100 + color = rgba(0, 0, 0, 0.3) + rounding = 15 + border_size = 1 + border_color = rgba(255, 255, 255, 0.1) + position = -20, 20 + halign = right + valign = bottom +} + +# SYSTEM INFO TEXT (3 lines, top of each other, right aligned) +label { + monitor = + text = cmd[update:5000] ~/.config/hypr/scripts/status_info.sh + color = $text + font_size = 14 + font_family = $font + position = -35, 35 + halign = right + valign = bottom + text_align = right +} diff --git a/hypr/scripts/album_art.sh b/hypr/scripts/album_art.sh new file mode 100755 index 0000000..eaa6a77 --- /dev/null +++ b/hypr/scripts/album_art.sh @@ -0,0 +1,11 @@ +#!/bin/bash +url=$(playerctl metadata mpris:artUrl 2>/dev/null) +if [[ "$url" == file://* ]]; then + cp "${url#file://}" /tmp/hyprlock_art.png + echo "/tmp/hyprlock_art.png" +elif [[ "$url" == http* ]]; then + curl -s "$url" -o /tmp/hyprlock_art.png + echo "/tmp/hyprlock_art.png" +else + echo "$HOME/.config/hypr/catppuccin-hyprland/assets/mocha.webp" +fi diff --git a/hypr/scripts/songdetail.sh b/hypr/scripts/songdetail.sh new file mode 100755 index 0000000..2d0e5a5 --- /dev/null +++ b/hypr/scripts/songdetail.sh @@ -0,0 +1,13 @@ +#!/bin/bash +status=$(playerctl status 2>/dev/null) +if [ "$status" = "Playing" ] || [ "$status" = "Paused" ]; then + title=$(playerctl metadata title | sed 's/&/\&/g; s//\>/g') + artist=$(playerctl metadata artist | sed 's/&/\&/g; s//\>/g') + if [ ${#title} -gt 25 ]; then title="${title:0:22}..."; fi + if [ ${#artist} -gt 25 ]; then artist="${artist:0:22}..."; fi + echo "$title" + echo "$artist" +else + echo "No Media" + echo "Idling" +fi diff --git a/hypr/scripts/status_info.sh b/hypr/scripts/status_info.sh new file mode 100755 index 0000000..01761a7 --- /dev/null +++ b/hypr/scripts/status_info.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# 1. Network +net=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2 || echo 'Offline') +if [ ${#net} -gt 15 ]; then net="${net:0:12}..."; fi +# 2. Battery +bat_cap=$(cat /sys/class/power_supply/BAT0/capacity) +bat_stat=$(cat /sys/class/power_supply/BAT0/status) +if [ "$bat_stat" = "Charging" ]; then icon="󰂄"; else icon="󰁹"; fi +# 3. Load +cpu=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}' | cut -d. -f1) +# Output 3 lines for the vertical stack +echo "󰖩 $net" +echo "$icon $bat_cap% ($bat_stat)" +echo "󰍛 Load: $cpu%"