Files
.config
.emacs.d
.gkrellm2
.local
bin
Chatty
Checking-repo
Logc
Logs
Update
Update-kernel
backupSynology
backupSynologyMac
bin-cp
browser-x
chardetect
chatty-run
cleaner
cleanertmp
cmus-control
cmus-shell
cpumhz
debugger
dmenumount
dmenuumount
dmenuunicode
docker-start
dwmstatusbar
eix-repos-sync
epylint
euscan
ext
f2py
f2py3
f2py3.6
f2py3.7
f2py3.8
flask
futurize
gentoo-test
geoip
get-meraki-network-list
getforecast
gfetch
gfg
git-delete-branch
git-init-folder
haruhi-dl
iptables-restart
iptables-update
isort
jupyter-note
mailsync
minecraft-launcher
mouse-set
night
notify-program
password-manager
pasteurize
pwiz.py
pylint
pyreverse
rasp
rcon
record
remove-kernel
runJava
saver-off
sb-battery
sb-clock
sb-cpu
sb-mail
sb-mem
sb-music
sb-network
sb-temp
sb-volume
sb-weather
screen-switcher
screenshot
screenshot-area
set-wallpaper
shut-sup-rest
speedtest-cli
ssh-permissions
stream
suspend-at-time
symilar
tea
temp
term-wmi
terraform-ls
tester-ebuild
tester-ubuntu
tmux-display-fix
trans
twitch
video-convert
volume
welcomer
welcomer-serwer
wheel
wsl-notify
wylaczoff
yatqa
yt-mp3
yt-video
Library
.alacritty.yml
.gitignore
.markdownlint.json
.signature
.skhdrc
.tmux.conf
.vimrc-def
.wall.jpg
.xinitrc
.yabairc
.zshrc
myhome/.local/bin/sb-music
Marcin Woźniak c18381a3c6 Added programs
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2021-03-22 21:27:54 +01:00

30 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
print_music(){
# Source: https://github.com/joestandring/dwm-bar
# A dwm_bar function that shows the current artist, track, position, duration, and status from cmus
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: cmus
if ps -C cmus > /dev/null; then
ARTIST=$(cmus-remote -Q | grep -a '^tag artist' | awk '{gsub("tag artist ", "");print}')
TRACK=$(cmus-remote -Q | grep -a '^tag title' | awk '{gsub("tag title ", "");print}')
POSITION=$(cmus-remote -Q | grep -a '^position' | awk '{gsub("position ", "");print}')
DURATION=$(cmus-remote -Q | grep -a '^duration' | awk '{gsub("duration ", "");print}')
STATUS=$(cmus-remote -Q | grep -a '^status' | awk '{gsub("status ", "");print}')
SHUFFLE=$(cmus-remote -Q | grep -a '^set shuffle' | awk '{gsub("set shuffle ", "");print}')
if [ "$STATUS" = "playing" ]; then
STATUS="▶"
else
STATUS="⏸"
fi
#printf "%s%s %s - %s " "$STATUS" "$ARTIST" "$TRACK"
printf "%s" "$STATUS"
#printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60))
#printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60))
#printf "%s\n"
fi
}
print_music