diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-01-23 23:59:26 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-01-23 23:59:26 +0200 |
| commit | ac41f0502ed649e11c67025b4a58577213b273c8 (patch) | |
| tree | a3737f50d18dc11f82a5455b21ab1eb2db5af39d /.config/eww | |
| parent | 15e69d5debeb4d2317ad8baa412beb94fbb02595 (diff) | |
| download | dotfiles-ac41f0502ed649e11c67025b4a58577213b273c8.tar.gz dotfiles-ac41f0502ed649e11c67025b4a58577213b273c8.zip | |
Removed music_info script
Diffstat (limited to '.config/eww')
| -rwxr-xr-x | .config/eww/scripts/music_info | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/.config/eww/scripts/music_info b/.config/eww/scripts/music_info deleted file mode 100755 index efa3a24..0000000 --- a/.config/eww/scripts/music_info +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash -# scripts by adi1090x - -## Get data -STATUS="$(mpc status)" -COVER="/tmp/.music_cover.png" -MUSIC_DIR="$HOME/music/playlist-1" - -## Get status -get_status() { - if [[ $STATUS == *"[playing]"* ]]; then - echo "" - else - echo "奈" - fi -} - -## Get song -get_song() { - song=$(mpc -f %title% current) - if [[ -z "$song" ]]; then - echo "Offline" - else - echo "$song" - fi -} - -## Get artist -get_artist() { - artist=$(mpc -f %artist% current) - if [[ -z "$artist" ]]; then - echo "" - else - echo "$artist" - fi -} - -## Get time -get_time() { - time=$(mpc status | grep "%)" | awk '{print $4}' | tr -d '(%)') - if [[ -z "$time" ]]; then - echo "0" - else - echo "$time" - fi -} -get_ctime() { - ctime=$(mpc status | grep "#" | awk '{print $3}' | sed 's|/.*||g') - if [[ -z "$ctime" ]]; then - echo "0:00" - else - echo "$ctime" - fi -} -get_ttime() { - ttime=$(mpc -f %time% current) - if [[ -z "$ttime" ]]; then - echo "0:00" - else - echo "$ttime" - fi -} - -## Get cover -get_cover() { - ffmpeg -i "${MUSIC_DIR}/$(mpc current -f %file%)" "$COVER" -y &>/dev/null - STATUS=$? - - # Check if the file has a embbeded album art - if [ "$STATUS" -eq 0 ]; then - echo "$COVER" - else - echo "images/music.png" - fi -} - -## Execute accordingly -if [[ "$1" == "--song" ]]; then - get_song -elif [[ "$1" == "--artist" ]]; then - get_artist -elif [[ "$1" == "--status" ]]; then - get_status -elif [[ "$1" == "--time" ]]; then - get_time -elif [[ "$1" == "--ctime" ]]; then - get_ctime -elif [[ "$1" == "--ttime" ]]; then - get_ttime -elif [[ "$1" == "--cover" ]]; then - get_cover -elif [[ "$1" == "--toggle" ]]; then - mpc -q toggle -elif [[ "$1" == "--next" ]]; then - { - mpc -q next - get_cover - } -elif [[ "$1" == "--prev" ]]; then - { - mpc -q prev - get_cover - } -fi |
