feat(hyprlock): update

This commit is contained in:
2026-02-25 01:35:25 +01:00
parent 566513de78
commit 74dda82f24
10 changed files with 115 additions and 24 deletions

View File

@@ -13,6 +13,7 @@ exec-once = swww-daemon
exec-once = swaync
exec-once = sh -c "/home/stereov/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox %u & sleep 6 && hyprctl dispatch closewindow class:jetbrains-toolbox"
exec-once = "/home/stereov/Developer/antistereov/randrwall/randrwall.py reload"
exec-once = ~/.config/hypr/scripts/cover-listener.sh
exec-once = gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
exec-once = gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

View File

@@ -51,7 +51,7 @@ label {
# BATTERY
label {
monitor =
text = cmd[update:1000] echo "$(~/.config/waybar/scripts/battery.sh)"
text = cmd[update:1000] echo "$(~/.config/hypr/scripts/battery.sh)"
font_family = lexend
font_size = 14
position = -100, 100
@@ -59,9 +59,10 @@ label {
valign = bottom
}
# WEATHER
label {
monitor =
text = cmd[update:600000] echo "$(~/.config/waybar/scripts/weather.sh | jq -r .text)"
text = cmd[update:600000] echo "$(~/.config/hypr/scripts/weather.sh | jq -r .text)"
font_family = lexend
font_size = 14
position = -200, 100
@@ -69,6 +70,41 @@ label {
valign = bottom
}
# NOW PLAYING
image {
monitor =
path = ~/.cache/nowplaying-cover.jpg
size = 250
rounding = 20
position = 0, -120
halign = center
valign = center
border_size = 0
reload_time = 1
}
label {
monitor =
text = cmd[update:1000] playerctl metadata artist
color = rgba(242, 243, 244, 0.8)
font_size = 14
font_family = Lexend Bold
position = 0, -300
halign = center
valign = center
}
label {
monitor =
text = cmd[update:1000] playerctl metadata title
color = rgba(242, 243, 244, 0.8)
font_size = 14
font_family = Lexend
position = 0, -270
halign = center
valign = center
}
input-field {
monitor =
size = 300, 50
@@ -88,7 +124,7 @@ input-field {
check_color = $check_color
fail_text = <i>$FAIL ($ATTEMPTS)</i>
rounding = 60
rounding = 15
shadow_passes = 0
fade_on_empty = false
}

5
hypr/scripts/cover-listener.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
playerctl metadata --follow --format "{{mpris:artUrl}}" | while read -r _; do
~/.config/hypr/scripts/cover.sh
done

15
hypr/scripts/cover.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
CACHE="$HOME/.cache/nowplaying-cover.jpg"
url=$(playerctl metadata mpris:artUrl 2>/dev/null)
# Kein Player aktiv
[ -z "$url" ] && exit 0
# file:// prefix entfernen (Spotify lokal)
if [[ "$url" == file://* ]]; then
cp "${url#file://}" "$CACHE"
else
curl -sL "$url" -o "$CACHE"
fi

11
hypr/scripts/nowplaying.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
status=$(playerctl status 2>/dev/null)
if [ "$status" = "Playing" ]; then
artist=$(playerctl metadata artist)
title=$(playerctl metadata title)
echo "$artist - $title"
else
echo ""
fi

View File

@@ -8,7 +8,6 @@
"passthrough": false,
"fixed-center": true,
"modules-left": ["hyprland/workspaces", "hyprland/window"],
"modules-center": ["mpris"],
"modules-right": [
"cpu",
"memory",
@@ -21,27 +20,12 @@
"battery",
"tray",
"custom/notification",
"custom/power"
"custom/power",
],
"custom/spotify": {
"format": " {}",
"return-type": "json",
"on-click": "playerctl -p spotify play-pause",
"on-click-right": "spotifatius toggle-liked",
"on-click-middle": "playerctl -p spotify next",
"exec": "spotifatius monitor",
},
"mpris": {
"player": "spotify",
"dynamic-order": ["artist", "title"],
"format": "{player_icon} {dynamic}",
"format-paused": "{status_icon} <i>{dynamic}</i>",
"status-icons": {
"paused": "",
},
"player-icons": {
"default": "",
},
"format": "{cover_art} {artist} - {title}",
"icon-size": 20,
"max-length": 40
},
"hyprland/workspaces": {
"on-click": "activate",
@@ -138,6 +122,12 @@
"on-click": "wlogout -p layer-shell &",
"format": "⏻",
},
"custom/nowplaying": {
"exec": "~/.config/waybar/scripts/nowplaying.sh",
"interval": 2,
"return-type": "json",
"on-click": "playerctl play-pause"
},
"custom/notification": {
"escape": true,
"exec": "swaync-client -swb",
@@ -157,7 +147,7 @@
"custom/weather": {
"format": "{}",
"interval": 600,
"exec": "~/.config/waybar/scripts/weather.sh", // or your dotfiles folder if you use stow
"exec": "~/.config/hypr/scripts/weather.sh", // or your dotfiles folder if you use stow
"return-type": "json",
"on-click": "gnome-weather"
},

24
waybar/scripts/nowplaying.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
CACHE="$HOME/.cache/waybar-cover.jpg"
TMP="$HOME/.cache/waybar-cover.tmp.jpg"
status=$(playerctl status 2>/dev/null)
if [ "$status" = "Playing" ]; then
artist=$(playerctl metadata artist)
title=$(playerctl metadata title)
url=$(playerctl metadata mpris:artUrl)
if [[ "$url" == file://* ]]; then
cp "${url#file://}" "$TMP"
else
curl -sL "$url" -o "$TMP"
fi
mv -f "$TMP" "$CACHE"
echo "{\"text\": \"$artist - $title\", \"tooltip\": \"$artist - $title\", \"class\": \"playing\", \"alt\": \"$CACHE\"}"
else
echo "{\"text\": \"󰐎 \", \"class\": \"stopped\"}"
fi

View File

@@ -74,6 +74,7 @@ window#waybar {
#clock,
#pulseaudio,
#custom-nowplaying,
#custom-logo,
#custom-power,
#custom-spotify,
@@ -95,6 +96,14 @@ window#waybar {
margin-right: 3px;
}
#custom-nowplaying {
padding-left: 40px;
background-size: 30px 30px;
background-repeat: no-repeat;
background-position: left center;
background-image: url('/home/stereov/.cache/nowplaying-cover.jpg')
}
#mpris.playing {
color: #a6e3a1;
}