eww: better lyrics

This commit is contained in:
2025-06-26 03:37:36 +02:00
parent 5517c99370
commit e2e150c95c
18 changed files with 134 additions and 56 deletions

View File

@@ -1,5 +1,14 @@
things installed:
things I have installed:
full KDE Plasma 6 setup # not essential for sure
which can provide:
SDDM theme # Breeze is enough
kcalc/kalc # calculator(s)
kcolorchooser # works smoothly on hyprland
pipewire & friends
...
# hypr*
hyprland
hyprpaper
hypridle
@@ -8,10 +17,17 @@ hyprshot
hyprlicker # kcolorchooser also works though
hyprland-plugin-hyprexpo # scale workspaces and put them in a grid
# xdg-desktop-portal*
xdg-desktop-portal
xdg-desktop-portal-hyprland # not working with my Intel iGPU, but fine with NVIDIA dGPU
xdg-desktop-portal-gnome # not necessary maybe, but just in case
xdg-desktop-portal-gtk # required by nautilus for file picker
# terminal emulator(s)
kitty # normal terminal
ghostty # floating terminal, for btop for example#
# under surface
mako # notification daemon
gnome-keyring # --password-store=gnome-libsecret
wl-clipboard
@@ -20,32 +36,35 @@ network-manager-applet # nm-applet
slurp # region selector
wf-recorder # screen recorder
brightnessctl
playerctl
pamixer
qt5ct
qt6ct
spicetify # spotify tweaks
spicetify-maketplace # spotify themes
# GUI
waybar
eww
wlogout
fuzzel
mpv
blueman # bluetooth GUI & applet
pavucontrol
nautilus # file manager and file picker
sushi # "Quicklook" for nautilus
gnome-text-editor # or kwrite, just notepad replacement
btop # system monitor
activate-linux # :/
polkit-gnome # polkit authentication agent
# fonts & themes
maplemonol-nf-cn
ttf-font-awesome
meslo font # I installed manually
meslo font # I installed it manually
spicetify # spotify tweaks
spicetify-maketplace # spotify themes
nwg-look # theme of GTK apps
catppuccin-gtk-theme-mocha # theme of GTK apps
polkit-gnome # polkit authentication agent
kitty # normal terminal
ghostty # floating terminal, for btop for example#
# utils
bc
jq

View File

@@ -10,8 +10,11 @@ if [ -z "$LYRICS" ] && [ -z "$LYRICS_SINGLE" ]; then
# only lyrics is open
elif [ -n "$LYRICS" ] && [ -z "$LYRICS_SINGLE" ]; then
eww close lyrics
sleep 0.5
eww open lyrics-single
# if waybar is running, open lyrics-single
if pgrep -x "waybar" > /dev/null; then
sleep 0.5
eww open lyrics-single
fi
# only lyrics-single is open
elif [ -z "$LYRICS" ] && [ -n "$LYRICS_SINGLE" ]; then

View File

@@ -7,6 +7,11 @@ function close() {
# Wait until the processes have been shut down
while pgrep -x waybar >/dev/null; do sleep 1; done
fi
# Also close the lyrics widget if open
if eww active-windows | grep -q "lyrics-single"; then
eww close lyrics-single
fi
}
function open() {

View File

@@ -27,7 +27,7 @@
.lyrics-box-single {
margin: 5px 0px 5px 10px;
min-width: 634px;
min-width: 740px;
}
.lyrics-text {

View File

@@ -3,7 +3,8 @@
(defpoll position :interval "1s" "~/.local/bin/spotify-lyrics position")
(defpoll length :interval "1s" "~/.local/bin/spotify-lyrics length")
(defpoll offset :interval "1s" "cat $HOME/.local/state/eww/lyrics/offset")
(defpoll play-button :interval "1s" "if ~/.local/bin/spotify-lyrics status; then echo \"󰏤\"; else echo \"󰐊\"; fi")(defvar hover false)
(defpoll play-button :interval "1s" "if ~/.local/bin/spotify-lyrics status; then echo \"󰏤\"; else echo \"󰐊\"; fi")
(defvar hover false)
(defwidget lyrics []
(box :class "lyrics-window" :space-evenly "false" :orientation "v"
@@ -22,7 +23,7 @@
)
(box :class "control-row-1" :space-evenly "false" :orientation "h"
(button :class "offset-reset" :onclick "Lyrics/scripts/lyric-offset.py" "󰾅")
(button :class "offset-clear" :onclick "Lyrics/scripts/lyric-clear.sh" "󰑙")
(button :class "offset-clear" :onclick "Lyrics/scripts/lyric-clear.sh $(~/.local/bin/spotify-lyrics trackid)" "󰑙")
)
)
)

View File

@@ -1,6 +1,9 @@
#!/bin/sh
killall spotify-lyrics
sleep 0.1
"$HOME/.local/bin/spotify-lyrics" clear
notify-send -a "spotify-lyrics" "Cache Cleared" "The lyrics cache have been cleared."
if [ -z $1 ]; then
"$HOME/.local/bin/spotify-lyrics" clear
notify-send -a "spotify-lyrics" "Cache Cleared" "Lyrics cache have been cleared."
else
"$HOME/.local/bin/spotify-lyrics" clear "$1"
notify-send -a "spotify-lyrics" "Cache Cleared" "Lyrics cache for track $1 have been cleared."
fi

View File

@@ -142,7 +142,7 @@
background-size: cover;
background-repeat: no-repeat;
min-width: 455px;
min-height: 200px;
min-height: 240px;
border-radius: 17px;
background-position: center;
margin: 20px 0px 0px 20px;
@@ -170,9 +170,9 @@
}
.music-stuff-box {
min-height: 200px;
border-radius: 15px;
background: linear-gradient(to right, $bg-alt, transparent);
min-height: 240px;
}
.player-cover-box {
@@ -213,7 +213,7 @@
.cavabar {
font-size: 14px;
color: $lavender;
color: $blue;
}
.music-controls-box {

View File

@@ -1,6 +1,6 @@
;; variables
(defvar window false)
(defpoll time :interval "1s" "date '+%I %M'")
(defpoll time :interval "1s" "date '+%H %M'")
(defpoll date :interval "1s" "date '+%A, %B %d'")
(deflisten notifications-cards "Main/scripts/logger.zsh subscribe")
(defpoll notifications-crits :interval "1s" "Main/scripts/logger.zsh crits")
@@ -24,6 +24,7 @@
(defpoll music-pp :interval "1s" "Main/scripts/music-title --icon")
(defpoll music-artist :interval "1s" "Main/scripts/music-artist")
(defpoll music-art :interval "1s" "Main/scripts/music-art")
(defpoll music-art-blur :interval "1s" "Main/scripts/music-art --blur")
(defpoll volume :interval "1s" "Main/scripts/system --vol")
(defpoll brightness :interval "1s" "Main/scripts/system --bri")
(defpoll fortune :interval "1h" "Main/scripts/fortune-split 32 9")
@@ -32,7 +33,8 @@
(defpoll artist :interval "1s" "Main/scripts/player --artist")
(defpoll album :interval "1s" "Main/scripts/player --album")
(defpoll length-info :interval "1s" "Main/scripts/player --length-info")
(defpoll art :interval "1s" "Main/scripts/player --cover")
(defvar volume-hover false)
(defvar brightness-hover false)
;; widgets
(defwidget main []
@@ -51,10 +53,27 @@
(label :class "stats-header" :halign "start" :text "Stats")
(box :class "volume-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${volume}%" :class "volume-icon" :text "󰕾")
(scale :min 0 :max 101 :active false :value {volume == "" ? 0 : volume} :class "volume-scale" :width 150))
(eventbox :class "volume-eventbox"
:onhover "eww update volume-hover=true"
:onhoverlost "eww update volume-hover=false"
:cursor "pointer"
:space-evenly "false"
(scale :min 0 :max 101 :class "volume-scale" :width 150
:value {volume == "" ? 0 : volume}
:round-digits 0
:onchange { volume-hover ? "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ {}%" : "" }
)))
(box :class "brightness-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${brightness}%" :class "brightness-icon" :text "󰃠")
(scale :min 0 :max 101 :active false :value {brightness == "" ? 0 : brightness} :class "brightness-scale" :width 150))
(eventbox :class "brightness-eventbox"
:onhover "eww update brightness-hover=true"
:onhoverlost "eww update brightness-hover=false"
:cursor "pointer"
:space-evenly "false"
(scale :min 0 :max 101 :class "brightness-scale" :width 150
:value {brightness == "" ? 0 : brightness}
:round-digits 0
:onchange { brightness-hover ? "brightnessctl set {}\% -d $DISPLAY_DEVICE" : "" })))
(box :class "cpu-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
(label :tooltip "${cpu}%" :class "cpu-icon" :text "󰘚")
(scale :min 0 :max 101 :active false :value {cpu == "" ? 0 : cpu} :class "cpu-scale" :width 150))
@@ -65,7 +84,7 @@
(label :class "fortune-header" :halign "start" :text "Fortune")
(label :class "fortune-text" :halign "start" :text fortune :show-truncated true :wrap true)))
(box :class "third-row" :orientation "h" :space-evenly "false"
(box :class "music-art-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false" :style "background-image: url(\"${music-art}\");"
(box :class "music-art-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false" :style "background-image: url(\"${music-art-blur}\");"
(box :class "music-stuff-box" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "v"
(box :class "player-box" :hexpand "false" :vexpand "false" :space-evenly "true"
(box :class "player-info-box" :hexpand "false" :vexpand "false" :space-evenly "false" :orientation "v" :spacing 15
@@ -73,12 +92,10 @@
(label :class "player-info-artist" :text "󰠃 Artist: ${artist}" :halign "start" :limit-width 30 :tooltip "${artist}")
(label :class "player-info-album" :text "󰀥 Album: ${album}" :halign "start" :limit-width 30 :tooltip "${album}")
(label :class "player-info-length" :text "󰦚 Length: ${length-info}" :halign "start" :tooltip "${length-info}"))
(box :class "player-cover-box" :hexpand "false" :halign "end" :vexpand "false" :space-evenly "false" :style "background-image: url('${art}');"))
(box :class "cava-box" :hexpand "false" :vexpand "false"
(label :vexpand "false" :hexpand "false" :space-evenly "false"
:class "cavabar"
:text cava
))))
(box :class "player-cover-box" :hexpand "false" :halign "end" :vexpand "false" :space-evenly "false" :style "background-image: url(\"${music-art}\");"))
(label :vexpand "true" :hexpand "false" :space-evenly "false" :valign "end"
:class "cavabar"
:text cava)))
(box :class "music-controls-box" :space-evenly "true" :hexpand "true" :vexpand "false" :orientation "v"
(button :class "music-previous" :halign "center" :onclick "playerctl previous" "󰒮")
(button :class "music-pp" :halign "center" :onclick "playerctl play-pause" "${music-pp}")

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svgjs="http://svgjs.com/svgjs" xmlns:xlink="http://www.w3.org/1999/xlink" id="SvgjsSvg1016" width="288" height="288" version="1.1"><g id="SvgjsG1018"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 512 512"><path fill="none" d="M416,512H96A96,96,0,0,1,0,416V96A96,96,0,0,1,96,0H416a96,96,0,0,1,96,96V416A96,96,0,0,1,416,512Zm0,0" data-name="Path 144"/><path fill="#7aa2f7" d="M234.672,384a40.052,40.052,0,0,0,39.184-32H195.473A40.069,40.069,0,0,0,234.672,384Zm0,0" class="colorffe777 svgShape" data-name="Path 145"/><path fill="#7aa2f7" d="M312,266.672H264a8.024,8.024,0,0,1-7.09-4.289,7.944,7.944,0,0,1,.516-8.254l39.293-56.785H264a8,8,0,1,1,0-16h48a8.024,8.024,0,0,1,7.09,4.289,7.944,7.944,0,0,1-.516,8.254l-39.293,56.785H312a8,8,0,0,1,0,16Zm0,0" class="colorffe777 svgShape" data-name="Path 146"/><g fill="#e0af68" class="color000 svgShape" data-name="Group 14"><path fill="#e0af68" d="M376,192H349.328a7.989,7.989,0,0,1-6.512-12.641l17.633-24.687H349.328a8,8,0,0,1,0-16H376a7.989,7.989,0,0,1,6.512,12.641L364.879,176H376a8,8,0,0,1,0,16Zm0,0" class="colorffd200 svgShape" data-name="Path 147"/><path fill="#e0af68" d="M334.7,308.4a71.3,71.3,0,0,1-19.344-26.078,23.138,23.138,0,0,1-3.359.336H264a23.993,23.993,0,0,1-19.711-37.664l21.918-31.664H264a24,24,0,0,1,0-48h16.656a74.56,74.56,0,0,0-35.312-15.152v-11.52a10.672,10.672,0,0,0-21.344.016v11.52A74.708,74.708,0,0,0,160,224v29.742A71.54,71.54,0,0,1,134.527,308.5a18.667,18.667,0,0,0,12.145,32.848h176A18.668,18.668,0,0,0,334.7,308.4Zm0,0" class="colorffd200 svgShape" data-name="Path 148"/></g></svg></g></svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -23,7 +23,7 @@ mkfifo $pipe
config_file="/tmp/waybar_cava_config"
echo "
[general]
bars = 33
bars = 31
[output]
method = raw
raw_target = $pipe

View File

@@ -1,8 +1,11 @@
#!/bin/bash
tmp_dir="$HOME/.config/eww/Main/images"
tmp_cover_path=$tmp_dir/cover.png
tmp_temp_path=$tmp_dir/temp.png
tmp_blur_path="$tmp_dir/temp-blur.png"
cache_path="$tmp_dir/temp.txt"
default_path="$tmp_dir/default-music.svg"
default_blur_path="$tmp_dir/default-music-blur.png"
if [ ! -d $tmp_dir ]; then
mkdir -p $tmp_dir
@@ -10,13 +13,34 @@ fi
artlink="$(playerctl -p spotify,$any,mpd,firefox,chromium,brave metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')"
artFromBrowser=$(playerctl metadata mpris:artUrl | sed 's/file:\/\///g')
cached=$(cat $cache_path 2>/dev/null)
if [ $(playerctl -p spotify,%any,firefox,chromium,brave,mpd metadata mpris:artUrl) ]; then
curl -s "$artlink" --output $tmp_temp_path
echo $tmp_temp_path
# avoid unnecessary downloads
if [[ $cached != $artlink ]]; then
echo $artlink > $cache_path
curl -s "$artlink" --output $tmp_temp_path
outputUrl=$tmp_temp_path
magick $tmp_temp_path -blur 0x8 $tmp_blur_path
else
outputUrl=$cached
fi
elif [[ -n $artFromBrowser ]]; then
cp $artFromBrowser $tmp_temp_path
echo $tmp_temp_path
if [[ §cached != $artFromBrowser ]]; then
echo $artFromBrowser > $cache_path
cp $artFromBrowser $tmp_temp_path
magick $tmp_temp_path -blur 0x8 $tmp_blur_path
outputUrl=$tmp_temp_path
else
outputUrl=$cached
fi
else
echo Main/images/default-music.svg
outputUrl=$default_path
tmp_blur_path=$default_blur_path
fi
if [[ $1 == "--blur" ]]; then
echo $tmp_blur_path
else
echo $outputUrl
fi

View File

@@ -51,7 +51,11 @@ get_vol() {
## Get Brightness
get_brightness() {
brightnessctl i --machine-readable -d intel_backlight | tr ',' ' ' | awk '{print $4}' | tr -d '%'
if [ -z "$DISPLAY_DEVICE" ]; then
brightnessctl i --machine-readable | tr ',' ' ' | awk '{print $4}' | tr -d '%'
else
brightnessctl i -d $DISPLAY_DEVICE --machine-readable | tr ',' ' ' | awk '{print $4}' | tr -d '%'
fi
}
## Execute accordingly

View File

@@ -9,7 +9,7 @@ env = INPUT_METHOD, fcitx
# ############ Themes #############
env = QT_QPA_PLATFORM, wayland
env = QT_QPA_PLATFORMTHEME, qt5ct
env = QT_QPA_PLATFORMTHEME, qt6ct
env = QT_STYLE_OVERRIDE, kvantum
# env = WLR_NO_HARDWARE_CURSORS, 1
@@ -24,3 +24,4 @@ env = NVD_BACKEND,direct
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
env = ELECTRON_OZONE_PLATFORM_HINT,auto
env = DISPLAY_DEVICE,intel_backlight # or nvidia_0

View File

@@ -8,16 +8,18 @@ bind = Super, E, exec, nautilus --new-window # Launch Dolphin (file manager)
bind = Super, W, exec, firefox --new-window # Launch Firefox
bind = Super, X, exec, gnome-text-editor --new-window # Launch GNOME Text Editor
bind = Super, B, exec, killall btop || ghostty -e btop # Launch btop (system monitor)
bind = Ctrl+Super, V, exec, pavucontrol # Launch pavucontrol (volume mixer)
bind = Ctrl+Super+Shift, V, exec, easyeffects # Launch EasyEffects (equalizer & other audio effects)
bind = Super, Space, exec, eww open main --toggle # Launch dashboard (eww)
bind = Super+Shift, V, exec, pavucontrol # Launch pavucontrol (volume mixer)
bind = Super+Shift, K, exec, waybar-toggle.sh close || waybar-toggle.sh open # Toggle waybar
bind = Super+Shift, L, exec, ~/.scripts/lyrics-widgets.sh # Toggle lyrics player
#!
##! Essentials
bind = Super, T, exec, kitty # Launch kitty (terminal)
bind = Super, Return, exec, kitty # [hidden]
bind = Super+Shift, Return, exec, ghostty # [hidden]
bind = Super, Super_L, exec, eww open main --toggle # Launch dashboard (eww)
bind = Alt, Space, exec, pkill fuzzel || fuzzel # [hidden] Launch fuzzel (app launcher)
bind = Super, Super_L, exec, pkill fuzzel || fuzzel # [hidden] Launch fuzzel (app launcher)
# bind = , mouse:276, exec, pkill fuzzel || fuzzel # [hidden] Launch fuzzel (app launcher)
bind = Super, R, exec, pkill fuzzel || fuzzel -d -l 0 | xargs -r -I{} bash -c '{}' # Launch fuzzel (command launcher)
@@ -26,8 +28,9 @@ bind = Super, R, exec, pkill fuzzel || fuzzel -d -l 0 | xargs -r -I{} bash -c '{
bind = Super, V, exec, pkill fuzzel || cliphist list | fuzzel --match-mode fzf --dmenu | cliphist decode | wl-copy # Clipboard history >> clipboard
bind = Super, Period, exec, pkill fuzzel || ~/.scripts/fuzzel-emoji # Pick emoji >> clipboard
bind = Ctrl+Alt, Delete, exec, pkill wlogout || wlogout -p layer-shell # [hidden]
bind = Super+Shift, S, exec, hyprshot -m region # Screen snip
bind = , Print, exec, hyprshot -m region # Screen snip
bind = Super+Shift, S, exec, hyprshot -z -m region # Screen snip
bind = Super+Ctrl+Shift, S, exec, hyprshot -z -m window # Screen snip (window)
bind = , Print, exec, hyprshot -z -m output -s -m eDP-2 # Screen snip (whole screen)
# Color picker
bind = Super+Shift, C, exec, hyprpicker -a # Pick color (Hex) >> clipboard
# Fullscreen screenshot
@@ -61,12 +64,12 @@ bindl= ,XF86AudioPause, exec, playerctl play-pause # [hidden]
#!
##! Sound & Brightness
bindl = ,XF86AudioMute, exec, pamixer --toggle-mute # [hidden]
bindl = Super+Shift,M, exec, pamixer --toggle-mute # [hidden]
bindl = Super+Shift, M, exec, pamixer --toggle-mute # [hidden]
bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && wp-vol # [hidden]
bindle=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && wp-vol # [hidden]
bindle=, XF86MonBrightnessUp, exec, brightnessctl -d intel_backlight set 5%+ # [hidden]
bindle=, XF86MonBrightnessDown, exec, brightnessctl -d intel_backlight set 5%- # [hidden]
bindle=, XF86MonBrightnessUp, exec, brightnessctl -d $DISPLAY_DEVICE set 5%+ # [hidden]
bindle=, XF86MonBrightnessDown, exec, brightnessctl -d $DISPLAY_DEVICE set 5%- # [hidden]
#!
##! Window management
@@ -157,10 +160,8 @@ bind = Super+Alt, Page_Down, movetoworkspace, +1 # [hidden]
bind = Super+Alt, Page_Up, movetoworkspace, -1 # [hidden]
bind = Super+Shift, Page_Down, movetoworkspace, +1 # [hidden]
bind = Super+Shift, Page_Up, movetoworkspace, -1 # [hidden]
bind = Super+Alt, S, movetoworkspace, special:s
bind = Super+Alt, S, movetoworkspacesilent, special:s
bind = Super, P, pin
bind = Alt, Tab, cyclenext
bind = Super, Tab, hyprexpo:expo, toggle # can be: toggle, select, off/disable or on/enable
bind = Super+Ctrl, T, exec, ~/.scripts/workspace-new.sh # Create new workspace
bind = Super+Shift, K, exec, waybar-toggle.sh close || waybar-toggle.sh open # Toggle waybar visibility
bind = Super+Shift, L, exec, ~/.scripts/lyrics-widgets.sh # Toggle waybar visibility

View File

@@ -26,6 +26,7 @@ windowrulev2 = float, class:^(Waydroid)$
windowrulev2 = float, class:^(org.kde.kcalc)$
windowrulev2 = float, class:^(org.kde.kalk)$
windowrulev2 = float, class:^(org.gnome.NautilusPreviewer)$ # Sushi in Nautilus
windowrulev2 = float, class:^(coin)$
# Picture-in-Picture
windowrulev2 = float, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$

View File

@@ -1,2 +1,2 @@
preload = /home/kolkas/config/backgrounds/arona_desks.jpg
preload = /home/kolkas/.config/backgrounds/arona_desks.jpg
wallpaper = , /home/kolkas/.config/backgrounds/arona_desks.jpg

View File

@@ -182,14 +182,14 @@
"min-length": 7
},
"backlight": {
"device": "intel_backlight",
"device": "$DISPLAY_DEVICE",
"format": "{icon} {percent}%",
"format-alt": "{percent}% {icon}",
"format-alt-click": "click-right",
//"format-icons": ["", ""],
"format-icons": [""],
"on-scroll-down": "brightnessctl -d intel_backlight set 5%-",
"on-scroll-up": "brightnessctl -d intel_backlight set +5%",
"on-scroll-down": "brightnessctl -d $DISPLAY_DEVICE set 5%-",
"on-scroll-up": "brightnessctl -d $DISPLAY_DEVICE set +5%",
"max-length": 7,
"min-length": 7
},