mirror of
https://github.com/ksyasuda/rice.git
synced 2025-07-31 08:36:12 -07:00
updates
This commit is contained in:
@@ -4,40 +4,40 @@ m() { rofi -theme -dmenu -config ~/SudacodeRice/rofi/dracula.rasi -l 24 -i "$@";
|
||||
mb() { rofi -dmenu -config ~/SudacodeRice/rofi/dracula.rasi -l 24 -i -kb-custom-1 "Alt+q" "$@"; }
|
||||
|
||||
artist() {
|
||||
lines="$(mpc list artist | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list artist | sort -f | m -p "Artists" -l $lines
|
||||
lines="$(mpc list artist | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list artist | sort -f | m -p "Artists" -l $lines
|
||||
}
|
||||
|
||||
a_album() {
|
||||
artist="$1"
|
||||
lines="$(mpc list album artist "$artist" | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list album artist "$artist" | sort -f | mb -p "Albums" -l $lines
|
||||
artist="$1"
|
||||
lines="$(mpc list album artist "$artist" | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list album artist "$artist" | sort -f | mb -p "Albums" -l $lines
|
||||
}
|
||||
|
||||
album() {
|
||||
lines="$(mpc list album | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list album | sort -f | mb -p "Album" -l $lines
|
||||
lines="$(mpc list album | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list album | sort -f | mb -p "Album" -l $lines
|
||||
}
|
||||
|
||||
song() {
|
||||
lines="$(mpc list title | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list title | sort -f | mb -p "Song" -l 30
|
||||
lines="$(mpc list title | wc -l)"
|
||||
[ "$lines" -gt 30 ] && lines=30
|
||||
mpc list title | sort -f | mb -p "Song" -l 30
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
-l | --library) mode=Library ;;
|
||||
-A | --album) mode=Album ;;
|
||||
-s | --song) mode=Song ;;
|
||||
-a | --ask)
|
||||
MODE=$(printf "Library\nAlbum\nSong" | m -p "Choose mode" -l 3)
|
||||
mode=$MODE
|
||||
;;
|
||||
-h | --help)
|
||||
echo "
|
||||
-l | --library) mode=Library ;;
|
||||
-A | --album) mode=Album ;;
|
||||
-s | --song) mode=Song ;;
|
||||
-a | --ask)
|
||||
MODE=$(printf "Library\nAlbum\nSong" | m -p "Choose mode" -l 3)
|
||||
mode=$MODE
|
||||
;;
|
||||
-h | --help)
|
||||
echo "
|
||||
usage: rofi-mpd [-h] [-l] [-s] [-a]
|
||||
|
||||
arguments:
|
||||
@@ -51,35 +51,35 @@ case "$1" in
|
||||
enter play song/album now
|
||||
Alt+q add song/album to queue
|
||||
"
|
||||
exit
|
||||
;;
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$mode" in
|
||||
Library)
|
||||
artist=$(artist)
|
||||
[ ! "$artist" ] && exit
|
||||
album=$(a_album "$artist")
|
||||
cod=$?
|
||||
[ ! "$album" ] && exit
|
||||
[ "$cod" -eq 10 ] || mpc clear
|
||||
mpc find artist "$artist" album "$album" | mpc add
|
||||
mpc play >/dev/null
|
||||
;;
|
||||
Song)
|
||||
song=$(song)
|
||||
cod=$?
|
||||
[ ! "$song" ] && exit
|
||||
[ "$cod" -eq 10 ] || mpc clear
|
||||
mpc search "(title==\"$song\")" | mpc add
|
||||
mpc play >/dev/null
|
||||
;;
|
||||
Album)
|
||||
album=$(album)
|
||||
cod=$?
|
||||
[ ! "$album" ] && exit
|
||||
[ "$cod" -eq 10 ] || mpc clear
|
||||
mpc find album "$album" | mpc add
|
||||
mpc play >/dev/null
|
||||
;;
|
||||
Library)
|
||||
artist=$(artist)
|
||||
[ ! "$artist" ] && exit
|
||||
album=$(a_album "$artist")
|
||||
cod=$?
|
||||
[ ! "$album" ] && exit
|
||||
[ "$cod" -eq 10 ] || mpc clear
|
||||
mpc find artist "$artist" album "$album" | mpc add
|
||||
mpc play > /dev/null
|
||||
;;
|
||||
Song)
|
||||
song=$(song)
|
||||
cod=$?
|
||||
[ ! "$song" ] && exit
|
||||
[ "$cod" -eq 10 ] || mpc clear
|
||||
mpc search "(title==\"$song\")" | mpc add
|
||||
mpc play > /dev/null
|
||||
;;
|
||||
Album)
|
||||
album=$(album)
|
||||
cod=$?
|
||||
[ ! "$album" ] && exit
|
||||
[ "$cod" -eq 10 ] || mpc clear
|
||||
mpc find album "$album" | mpc add
|
||||
mpc play > /dev/null
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user