feat(hyprlock): update
This commit is contained in:
@@ -18,4 +18,6 @@ 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 gtk-theme 'adw-gtk3-dark'
|
||||||
exec-once = gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
exec-once = gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||||
|
|
||||||
|
exec-once = curl -s https://zenquotes.io/api/random > ~/.cache/quote.json
|
||||||
|
|
||||||
exec-once = seafile-applet
|
exec-once = seafile-applet
|
||||||
|
|||||||
@@ -85,22 +85,22 @@ image {
|
|||||||
|
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = cmd[update:1000] playerctl metadata artist
|
text = cmd[update:1000] playerctl metadata title || jq -r '.[0].q' ~/.cache/quote.json
|
||||||
color = rgba(242, 243, 244, 0.8)
|
color = rgba(242, 243, 244, 0.8)
|
||||||
font_size = 14
|
font_size = 14
|
||||||
font_family = Lexend Bold
|
font_family = Lexend
|
||||||
position = 0, -300
|
position = 0, -270
|
||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = cmd[update:1000] playerctl metadata title
|
text = cmd[update:1000] playerctl metadata artist || jq -r '.[0].a' ~/.cache/quote.json
|
||||||
color = rgba(242, 243, 244, 0.8)
|
color = rgba(242, 243, 244, 0.8)
|
||||||
font_size = 14
|
font_size = 14
|
||||||
font_family = Lexend
|
font_family = Lexend Bold
|
||||||
position = 0, -270
|
position = 0, -300
|
||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CACHE="$HOME/.cache/nowplaying-cover.jpg"
|
CACHE="$HOME/.cache/nowplaying-cover.jpg"
|
||||||
|
TMP="$HOME/.cache/nowplaying-cover.tmp.jpg"
|
||||||
|
|
||||||
url=$(playerctl metadata mpris:artUrl 2>/dev/null)
|
status=$(playerctl status 2>/dev/null)
|
||||||
|
|
||||||
# Kein Player aktiv
|
if [ "$status" != "Playing" ]; then
|
||||||
[ -z "$url" ] && exit 0
|
rm -f "$CACHE"
|
||||||
|
exit 0
|
||||||
# file:// prefix entfernen (Spotify lokal)
|
|
||||||
if [[ "$url" == file://* ]]; then
|
|
||||||
cp "${url#file://}" "$CACHE"
|
|
||||||
else
|
|
||||||
curl -sL "$url" -o "$CACHE"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
url=$(playerctl metadata mpris:artUrl)
|
||||||
|
|
||||||
|
[ -z "$url" ] && rm -f "$CACHE" && exit 0
|
||||||
|
|
||||||
|
if [[ "$url" == file://* ]]; then
|
||||||
|
cp "${url#file://}" "$TMP"
|
||||||
|
else
|
||||||
|
curl -sL "$url" -o "$TMP"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv -f "$TMP" "$CACHE"
|
||||||
|
|||||||
Reference in New Issue
Block a user