made music status truncate song and artist separately

main
The_miro 2024-11-28 10:10:43 +01:00
parent acdd695047
commit e72e03b557
4 changed files with 24 additions and 11 deletions

View File

@ -86,7 +86,7 @@
"scripts/getvol") "scripts/getvol")
(defpoll time :interval "1s" (defpoll time :interval "1s"
"date '+%H:%M:%S | %d.%m.%Y'") "date '+%H:%M:%S|%d.%m.%Y'")
(defwidget clock [] (defwidget clock []
(box :class "clock" (box :class "clock"

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
trunc=23 trunc=16
sample=$(hyprctl activewindow | grep title: | awk -F: '{print $2}') sample=$(hyprctl activewindow | grep title: | awk -F: '{print $2}')
#echo ${sample} #echo ${sample}

View File

@ -1,18 +1,31 @@
#!/bin/bash #!/bin/bash
trunc=30 truncs=13
sample=$(playerctl metadata --format '{{ title }} - {{ artist }}') trunca=10
song=$(playerctl metadata --format '{{ title }}')
artist=$(playerctl metadata --format '{{ artist }}')
#echo ${sample} #echo ${sample}
if [ ${#sample} -gt $trunc ]; then if [ ${#song} -gt $truncs ]; then
echo $sample | head -c $trunc | sed 's/$/.../' songt=$(echo $song | head -c $truncs | sed 's/$/.../')
else else
if [ ${#sample} -ne 0 ]; then if [ ${#song} -ne 0 ]; then
echo ${sample} songt=$(echo ${song})
else else
echo None songt=$(echo None)
fi fi
fi fi
if [ ${#artist} -gt $trunca ]; then
artistt=$(echo $artist | head -c $trunca | sed 's/$/.../')
else
if [ ${#artist} -ne 0 ]; then
artistt=$(echo ${artist})
else
artistt=$(echo None)
fi
fi
echo "${songt}|${artistt}"
#hyprctl activewindow | grep title: | awk -F: '{print $2}' | head -c $trunc | sed 's/$/.../' #hyprctl activewindow | grep title: | awk -F: '{print $2}' | head -c $trunc | sed 's/$/.../'

View File

@ -1,7 +1,7 @@
#install components #install components
echo "Installing required Packages" echo "Installing required Packages"
sudo pacman -S alsa-utils base base-devel btop btrfs-progs curl dolphin dunst fastfetch firefox flatpak gcc git gnu-netcat greetd-tuigreet grim grub gst-plugin-pipewire htop hyfetch hyprland imagemagick iwd jq kitty ldns libpulse linux linux-firmware micro nano networkmanager nmap openssh nerd-fonts otf-font-awesome pipewire pipewire-alsa pipewire-jack pipewire-pulse polkit-kde-agent qt5-wayland qt6-wayland slurp smartmontools swww ttf-jetbrains-mono unzip vim waybar wget wireless_tools wireplumber wireshark-qt wofi wpa_supplicant xdg-desktop-portal-hyprland xdg-utils xf86-video-amdgpu xf86-video-ati xf86-video-nouveau xf86-video-vmware xorg-server xorg-xinit yazi zip zram-generator zsh sudo pacman -S alsa-utils base base-devel btop btrfs-progs curl dolphin dunst fastfetch firefox flatpak gcc git gnu-netcat greetd-tuigreet grim grub gst-plugin-pipewire htop hyfetch hyprland imagemagick iwd jq kitty ldns libpulse linux linux-firmware micro nano networkmanager nmap openssh nerd-fonts otf-font-awesome pipewire pipewire-alsa pipewire-jack pipewire-pulse polkit-kde-agent qt5-wayland qt6-wayland slurp smartmontools swww ttf-jetbrains-mono unzip vim waybar wget wireless_tools wireplumber wireshark-qt wofi wpa_supplicant wl-clipboard xdg-desktop-portal-hyprland xdg-utils xf86-video-amdgpu xf86-video-ati xf86-video-nouveau xf86-video-vmware xorg-server xorg-xinit yazi zip zram-generator zsh
#aur/yay setup #aur/yay setup
echo "Installing yay" echo "Installing yay"