getopts for more control like volume pausing and playing
This commit is contained in:
parent
02b1d7194a
commit
fcc666fbfd
29
music
29
music
@ -1,10 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
choice=`find "$HOME"/Music/ -maxdepth 1 -type d | dmenu -i -l 25 -p "Pick an Album"`
|
||||
# TODO: what
|
||||
if [ ! $1 = "" ]; then
|
||||
echo Args: $@
|
||||
# start X pause volume_set
|
||||
while getopts ":s:pv:" options; do
|
||||
case $options in
|
||||
# start directory playlist
|
||||
s)
|
||||
if [ $2 = "" ];then
|
||||
echo Usage: music -s "Some Directory - Album" > /dev/stderr
|
||||
else
|
||||
ls -1 "$2"/*.mp3 | xargs --delimiter='\n' mocp --playit
|
||||
fi
|
||||
;;
|
||||
p) mocp --pause;;
|
||||
v) mocp --volume "$2";;
|
||||
esac
|
||||
done
|
||||
|
||||
echo Playing: $choice
|
||||
|
||||
if [ ! -z "$choice" ];then
|
||||
else
|
||||
choice=`find "$HOME"/Music/ -maxdepth 1 -type d | dmenu -i -l 25 -p "Pick an Album"`
|
||||
if [ ! -z "$choice" ];then
|
||||
echo Playing: $choice
|
||||
ls -1 "$choice"/*.mp3 | xargs --delimiter='\n' mocp --playit
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user