updated hyprlock
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
url=$(playerctl metadata mpris:artUrl 2>/dev/null)
|
||||
if [[ "$url" == file://* ]]; then
|
||||
cp "${url#file://}" /tmp/hyprlock_art.png
|
||||
echo "/tmp/hyprlock_art.png"
|
||||
elif [[ "$url" == http* ]]; then
|
||||
curl -s "$url" -o /tmp/hyprlock_art.png
|
||||
echo "/tmp/hyprlock_art.png"
|
||||
else
|
||||
echo "$HOME/.config/hypr/catppuccin-hyprland/assets/mocha.webp"
|
||||
fi
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
status=$(playerctl status 2>/dev/null)
|
||||
if [ "$status" = "Playing" ] || [ "$status" = "Paused" ]; then
|
||||
title=$(playerctl metadata title | sed 's/&/\&/g; s/</\</g; s/>/\>/g')
|
||||
artist=$(playerctl metadata artist | sed 's/&/\&/g; s/</\</g; s/>/\>/g')
|
||||
if [ ${#title} -gt 25 ]; then title="${title:0:22}..."; fi
|
||||
if [ ${#artist} -gt 25 ]; then artist="${artist:0:22}..."; fi
|
||||
echo "<span weight='bold' foreground='#cba6f7'>$title</span>"
|
||||
echo "<span foreground='#bac2de' size='small'>$artist</span>"
|
||||
else
|
||||
echo "<span weight='bold' foreground='#cdd6f4'>No Media</span>"
|
||||
echo "<span size='small' foreground='#a6adc8'>Idling</span>"
|
||||
fi
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# 1. Network
|
||||
net=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2 || echo 'Offline')
|
||||
if [ ${#net} -gt 15 ]; then net="${net:0:12}..."; fi
|
||||
# 2. Battery
|
||||
bat_cap=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
bat_stat=$(cat /sys/class/power_supply/BAT0/status)
|
||||
if [ "$bat_stat" = "Charging" ]; then icon=""; else icon=""; fi
|
||||
# 3. Load
|
||||
cpu=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}' | cut -d. -f1)
|
||||
# Output 3 lines for the vertical stack
|
||||
echo " $net"
|
||||
echo "$icon $bat_cap% ($bat_stat)"
|
||||
echo " Load: $cpu%"
|
||||
Reference in New Issue
Block a user