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

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

View File

@ -1,18 +1,31 @@
#!/bin/bash
trunc=30
sample=$(playerctl metadata --format '{{ title }} - {{ artist }}')
truncs=13
trunca=10
song=$(playerctl metadata --format '{{ title }}')
artist=$(playerctl metadata --format '{{ artist }}')
#echo ${sample}
if [ ${#sample} -gt $trunc ]; then
echo $sample | head -c $trunc | sed 's/$/.../'
if [ ${#song} -gt $truncs ]; then
songt=$(echo $song | head -c $truncs | sed 's/$/.../')
else
if [ ${#sample} -ne 0 ]; then
echo ${sample}
if [ ${#song} -ne 0 ]; then
songt=$(echo ${song})
else
echo None
songt=$(echo None)
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/$/.../'

View File

@ -1,7 +1,7 @@
#install components
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
echo "Installing yay"