eww: fix: music-art
This commit is contained in:
1
eww/Main/images/.gitignore
vendored
1
eww/Main/images/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
temp*
|
temp*
|
||||||
|
cache.conf
|
||||||
@@ -3,44 +3,66 @@
|
|||||||
tmp_dir="$HOME/.config/eww/Main/images"
|
tmp_dir="$HOME/.config/eww/Main/images"
|
||||||
tmp_temp_path=$tmp_dir/temp.png
|
tmp_temp_path=$tmp_dir/temp.png
|
||||||
tmp_blur_path="$tmp_dir/temp-blur.png"
|
tmp_blur_path="$tmp_dir/temp-blur.png"
|
||||||
cache_path="$tmp_dir/temp.txt"
|
cache_path="$tmp_dir/cache.conf"
|
||||||
default_path="$tmp_dir/default-music.svg"
|
default_path="$tmp_dir/default-music.svg"
|
||||||
default_blur_path="$tmp_dir/default-music-blur.png"
|
default_blur_path="$tmp_dir/default-music-blur.png"
|
||||||
|
|
||||||
if [ ! -d $tmp_dir ]; then
|
mkdir -p "$tmp_dir"
|
||||||
mkdir -p $tmp_dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
artlink="$(playerctl -p spotify,$any,mpd,firefox,chromium,brave metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')"
|
artlink="$(playerctl metadata mpris:artUrl)"
|
||||||
artFromBrowser=$(playerctl metadata mpris:artUrl | sed 's/file:\/\///g')
|
[ -f "$cache_path" ] && . "$cache_path"
|
||||||
cached=$(cat $cache_path 2>/dev/null)
|
|
||||||
|
|
||||||
if [ $(playerctl -p spotify,%any,firefox,chromium,brave,mpd metadata mpris:artUrl) ]; then
|
# if [[ "$artlink" =~ ^https?:// ]]; then
|
||||||
# avoid unnecessary downloads
|
# # avoid unnecessary downloads
|
||||||
if [[ $cached != $artlink ]]; then
|
# if [[ "$cached" != "$artlink" ]]; then
|
||||||
echo $artlink > $cache_path
|
# echo "$artlink" > "$cache_path"
|
||||||
curl -s "$artlink" --output $tmp_temp_path
|
# curl -s "$artlink" --output "$tmp_temp_path" || exit 1
|
||||||
outputUrl=$tmp_temp_path
|
# outputUrl="$tmp_temp_path"
|
||||||
magick $tmp_temp_path -blur 0x8 $tmp_blur_path
|
# magick "$tmp_temp_path" -blur 0x8 "$tmp_blur_path"
|
||||||
else
|
# else
|
||||||
outputUrl=$cached
|
# outputUrl="$cached"
|
||||||
|
# fi
|
||||||
|
# elif [[ "$artlink" =~ ^file:// ]]; then
|
||||||
|
# if [[ §cached != "$artlink" ]]; then
|
||||||
|
# echo "$artlink" > "$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
|
||||||
|
# outputUrl="$default_path"
|
||||||
|
# tmp_blur_path="$default_blur_path"
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# avoid unnecessary downloads
|
||||||
|
if [ -z "$artlink" ]; then
|
||||||
|
# No art URL, use default
|
||||||
|
outputUrl="$default_path"
|
||||||
|
tmp_blur_path="$default_blur_path"
|
||||||
|
echo "$outputUrl" > "$cache_path"
|
||||||
|
elif [[ "$cachedlink" != "$artlink" ]]; then
|
||||||
|
echo "cachedlink=$artlink" > "$cache_path"
|
||||||
|
|
||||||
|
if [[ "$artlink" == "file://"* ]]; then
|
||||||
|
# Handle local file URLs
|
||||||
|
local_file_path="${artlink#file://}"
|
||||||
|
if [[ -f "$local_file_path" ]]; then
|
||||||
|
magick "$local_file_path" "$tmp_temp_path" || exit 1
|
||||||
|
fi
|
||||||
|
elif [[ "$artlink" =~ ^https?:// ]]; then
|
||||||
|
# Handle HTTP/HTTPS URLs
|
||||||
|
curl -s "$artlink" --output "$tmp_temp_path"_orig || exit 1
|
||||||
|
magick "$tmp_temp_path"_orig "$tmp_temp_path" || exit 1
|
||||||
fi
|
fi
|
||||||
elif [[ -n $artFromBrowser ]]; then
|
|
||||||
if [[ §cached != $artFromBrowser ]]; then
|
outputUrl="$tmp_temp_path"
|
||||||
echo $artFromBrowser > $cache_path
|
magick "$tmp_temp_path" -blur 0x8 "$tmp_blur_path"
|
||||||
cp $artFromBrowser $tmp_temp_path
|
|
||||||
magick $tmp_temp_path -blur 0x8 $tmp_blur_path
|
|
||||||
outputUrl=$tmp_temp_path
|
|
||||||
else
|
|
||||||
outputUrl=$cached
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
outputUrl=$default_path
|
|
||||||
tmp_blur_path=$default_blur_path
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "--blur" ]]; then
|
if [[ $1 == "--blur" ]]; then
|
||||||
echo $tmp_blur_path
|
echo "$tmp_blur_path"
|
||||||
else
|
else
|
||||||
echo $outputUrl
|
echo "$tmp_temp_path"
|
||||||
fi
|
fi
|
||||||
@@ -9,7 +9,7 @@ env = INPUT_METHOD, fcitx
|
|||||||
|
|
||||||
# ############ Themes #############
|
# ############ Themes #############
|
||||||
env = QT_QPA_PLATFORM, wayland
|
env = QT_QPA_PLATFORM, wayland
|
||||||
env = QT_QPA_PLATFORMTHEME, qt6ct
|
env = QT_QPA_PLATFORMTHEME, kde
|
||||||
env = QT_STYLE_OVERRIDE, kvantum
|
env = QT_STYLE_OVERRIDE, kvantum
|
||||||
# env = WLR_NO_HARDWARE_CURSORS, 1
|
# env = WLR_NO_HARDWARE_CURSORS, 1
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ gestures {
|
|||||||
workspace_swipe = true
|
workspace_swipe = true
|
||||||
workspace_swipe_distance = 700
|
workspace_swipe_distance = 700
|
||||||
workspace_swipe_fingers = 4
|
workspace_swipe_fingers = 4
|
||||||
|
workspace_swipe_min_fingers = true
|
||||||
workspace_swipe_cancel_ratio = 0.2
|
workspace_swipe_cancel_ratio = 0.2
|
||||||
workspace_swipe_min_speed_to_force = 5
|
workspace_swipe_min_speed_to_force = 5
|
||||||
workspace_swipe_direction_lock = true
|
workspace_swipe_direction_lock = true
|
||||||
@@ -57,17 +58,20 @@ general {
|
|||||||
|
|
||||||
#focus_to_other_workspaces = true # ahhhh i still haven't properly implemented this
|
#focus_to_other_workspaces = true # ahhhh i still haven't properly implemented this
|
||||||
allow_tearing = true # This just allows the `immediate` window rule to work
|
allow_tearing = true # This just allows the `immediate` window rule to work
|
||||||
|
|
||||||
|
snap {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dwindle {
|
dwindle {
|
||||||
preserve_split = true
|
preserve_split = true
|
||||||
# no_gaps_when_only = 1
|
|
||||||
smart_split = false
|
smart_split = false
|
||||||
smart_resizing = false
|
smart_resizing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
decoration {
|
decoration {
|
||||||
rounding = 20
|
rounding = 14
|
||||||
|
|
||||||
blur {
|
blur {
|
||||||
enabled = true
|
enabled = true
|
||||||
@@ -81,6 +85,8 @@ decoration {
|
|||||||
contrast = 1
|
contrast = 1
|
||||||
popups = true
|
popups = true
|
||||||
popups_ignorealpha = 0.6
|
popups_ignorealpha = 0.6
|
||||||
|
input_methods = true
|
||||||
|
input_methods_ignorealpha = 0.8
|
||||||
}
|
}
|
||||||
|
|
||||||
# Shadow
|
# Shadow
|
||||||
@@ -93,10 +99,6 @@ decoration {
|
|||||||
color = rgba(0000002A)
|
color = rgba(0000002A)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Shader
|
|
||||||
# screen_shader = ~/.config/hypr/shaders/nothing.frag
|
|
||||||
# screen_shader = ~/.config/hypr/shaders/vibrance.frag
|
|
||||||
|
|
||||||
# Dim
|
# Dim
|
||||||
dim_inactive = false
|
dim_inactive = false
|
||||||
dim_strength = 0.1
|
dim_strength = 0.1
|
||||||
@@ -143,7 +145,9 @@ animations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
misc {
|
misc {
|
||||||
vfr = 1
|
vfr = true
|
||||||
|
mouse_move_enables_dpms = true
|
||||||
|
key_press_enables_dpms = true
|
||||||
animate_manual_resizes = false
|
animate_manual_resizes = false
|
||||||
animate_mouse_windowdragging = false
|
animate_mouse_windowdragging = false
|
||||||
enable_swallow = false
|
enable_swallow = false
|
||||||
@@ -155,20 +159,20 @@ misc {
|
|||||||
allow_session_lock_restore = true
|
allow_session_lock_restore = true
|
||||||
|
|
||||||
initial_workspace_tracking = false
|
initial_workspace_tracking = false
|
||||||
|
# focus_on_activate = true
|
||||||
|
|
||||||
middle_click_paste = false
|
middle_click_paste = false
|
||||||
}
|
}
|
||||||
|
|
||||||
# Overview
|
|
||||||
plugin {
|
plugin {
|
||||||
hyprexpo {
|
hyprexpo {
|
||||||
columns = 3
|
columns = 3
|
||||||
gap_size = 5
|
gap_size = 5
|
||||||
bg_col = rgb(000000)
|
bg_col = rgb(181825)
|
||||||
workspace_method = first 1 # [center/first] [workspace] e.g. first 1 or center m+1
|
workspace_method = first 1 # [center/first] [workspace] e.g. first 1 or center m+1
|
||||||
|
|
||||||
enable_gesture = true # laptop touchpad, 4 fingers
|
enable_gesture = true # laptop touchpad, 4 fingers
|
||||||
gesture_distance = 300 # how far is the "max"
|
gesture_distance = 200 # how far is the "max"
|
||||||
gesture_positive = false
|
gesture_positive = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#!
|
#!
|
||||||
##! Apps
|
##! Apps
|
||||||
bind = Super, C, exec, code --password-store=gnome-libsecret # Launch VSCode (editor)
|
bind = Super, C, exec, code --password-store=gnome-libsecret # Launch VSCode (editor)
|
||||||
bind = Super, E, exec, nautilus --new-window # Launch file manager
|
bind = Super, E, exec, dolphin --new-window # Launch file manager
|
||||||
bind = Super, W, exec, zen --new-window # Launch Browser
|
bind = Super, W, exec, zen --new-window # Launch Browser
|
||||||
bind = Super, X, exec, gnome-text-editor # Launch Text Editor
|
bind = Super, X, exec, gnome-text-editor # Launch Text Editor
|
||||||
bind = Super, B, exec, killall btop || ghostty -e btop # Launch btop (system monitor)
|
bind = Super, B, exec, killall btop || ghostty -e btop # Launch btop (system monitor)
|
||||||
|
|||||||
Reference in New Issue
Block a user