fastfetch: colorful output

This commit is contained in:
2025-08-12 03:27:29 +02:00
parent 994329f9fa
commit 09dacd3654
8 changed files with 48 additions and 70 deletions

1
eww/.gitignore vendored
View File

@@ -1 +0,0 @@
*.log

View File

@@ -24,7 +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 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 6")

View File

@@ -1,2 +0,0 @@
temp*
cache.conf

View File

@@ -1,68 +1,45 @@
#!/bin/bash
tmp_dir="$HOME/.config/eww/Main/images"
tmp_temp_path=$tmp_dir/temp.png
tmp_blur_path="$tmp_dir/temp-blur.png"
tmp_dir="$HOME/.cache/eww/music-art"
art_path=$tmp_dir/temp.png
art_blur_path="$tmp_dir/temp-blur.png"
cache_path="$tmp_dir/cache.conf"
default_path="$tmp_dir/default-music.svg"
default_blur_path="$tmp_dir/default-music-blur.png"
cache_blur_path="$tmp_dir/cache-blur.conf"
log_path="$tmp_dir/log.txt"
default_path="$HOME/.config/eww/Main/images/default-music.svg"
default_blur_path="$HOME/.config/eww/Main/images/default-music-blur.png"
mkdir -p "$tmp_dir"
artlink="$(playerctl metadata mpris:artUrl)"
[ -f "$cache_path" ] && . "$cache_path"
# if [[ "$artlink" =~ ^https?:// ]]; then
# # avoid unnecessary downloads
# if [[ "$cached" != "$artlink" ]]; then
# echo "$artlink" > "$cache_path"
# curl -s "$artlink" --output "$tmp_temp_path" || exit 1
# outputUrl="$tmp_temp_path"
# magick "$tmp_temp_path" -blur 0x8 "$tmp_blur_path"
# else
# 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"
art_path="$default_path"
art_blur_path="$default_blur_path"
elif [[ "$cachedlink" != "$artlink" ]]; then
echo "cachedlink=$artlink" > "$cache_path"
echo "cachedlink=\"$artlink\"" > "$cache_path"
echo "Updating music art: $artlink" >> "$log_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
magick "$local_file_path" "$art_path" || exit 1
fi
magick "$art_path" -blur 0x8 "$art_blur_path"
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
curl -s "$artlink" --output "$art_path"_orig || exit 1
magick "$art_path"_orig "$art_path" || exit 1
magick "$art_path" -blur 0x8 "$art_blur_path"
else
echo "Unknown art link format: $artlink" >> "$log_path"
art_path="$default_path"
art_blur_path="$default_blur_path"
fi
outputUrl="$tmp_temp_path"
magick "$tmp_temp_path" -blur 0x8 "$tmp_blur_path"
fi
if [[ $1 == "--blur" ]]; then
echo "$tmp_blur_path"
else
echo "$tmp_temp_path"
fi
echo "path=\"$art_blur_path\"" > "$cache_blur_path"
echo "$art_path"

View File

@@ -0,0 +1,8 @@
#!/bin/bash
tmp_dir="$HOME/.cache/eww/music-art"
cache_blur_path="$tmp_dir/cache-blur.conf"
. "$cache_blur_path"
echo "$path"

View File

@@ -1,25 +1,19 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"display": {
"key": {
"width": 13
}
},
"modules": [
{ "format": " ╔══════════════════════════════════", "type": "custom", "outputColor": "keys" },
{ "format": " ║ {user-name}@{host-name}", "type": "title", "outputColor": "keys" },
{ "format": " ║ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌", "type": "custom", "outputColor": "keys" },
{ "key": " ║ os", "type": "os" },
{ "key": " ║ kernel", "type": "kernel" },
{ "format": "┌─╨─────────────────────────────────────", "type": "custom", "outputColor": "keys" },
{ "key": "│ host", "type": "host", "keyWidth": 9 },
{ "key": " cpu", "type": "cpu", "format": "{name}", "keyWidth": 9 },
{ "key": "│ gpu", "type": "gpu", "format": "{vendor} {name}", "keyWidth": 9 },
{ "format": "└─╥─────────────────────────────────────", "type": "custom", "outputColor": "keys" },
{ "key": " ║ shell", "type": "shell" },
{ "key": " ║ wm", "type": "wm" },
{ "key": " ║ de", "type": "de" },
{ "key": " ║ uptime", "type": "uptime" },
{ "format": " ╚══════════════════════════════════", "type": "custom", "outputColor": "keys" }
{ "type": "title", "outputColor": "keys" },
{ "type": "separator" },
{ "key": " os", "type": "os", "outputColor": "#f5e0dc", "keyColor": "#f5e0dc" },
{ "key": "└ kernel", "type": "kernel", "outputColor": "#f2cdcd", "keyColor": "#f2cdcd" },
{ "type": "separator" },
{ "key": " host", "type": "host", "outputColor": "#eba0ac", "keyColor": "#eba0ac" },
{ "key": "├ gpu", "type": "gpu", "outputColor": "#f9e2af", "keyColor": "#f9e2af", "format": "{vendor} {name}" },
{ "key": "└ cpu", "type": "cpu", "outputColor": "#fab387", "keyColor": "#fab387", "format": "{name}" },
{ "type": "separator" },
{ "key": " shell", "type": "shell", "outputColor": "#89dceb", "keyColor": "#89dceb" },
{ "key": "├ wm", "type": "wm", "outputColor": "#74c7ec", "keyColor": "#74c7ec" },
{ "key": "├󰇄 de", "type": "de", "outputColor": "#89b4fa", "keyColor": "#89b4fa" },
{ "key": "└ up", "type": "uptime", "outputColor": "#b4befe", "keyColor": "#b4befe" },
{ "type": "break" }
]
}

View File

@@ -15,4 +15,4 @@ end
if type -q trash
alias rm="echo \"use 'trash' instead :)\" && sh -c \"exit 42\""
end
end

View File

@@ -31,6 +31,8 @@ if ! ping -c 1 -W 2 1.1.1.1 >/dev/null 2>&1; then
[ -z "$CACHED_IP" ] && CACHED_IP="N/A"
[ -z "$CACHED_CODE" ] && CACHED_CODE="N/A"
echo "$(date +%Y-%m-%dT%H:%M:%S) - Waiting for network" >>"$time_log"
jq -n --unbuffered --compact-output \
--arg ip "$CACHED_IP" \
--arg country "$CACHED_CODE" \