mirror of
https://github.com/ksyasuda/rice.git
synced 2026-02-07 08:53:15 -08:00
add mpd mdule locally and update config
This commit is contained in:
17
polybar-themes/sblocks/scripts/mpd-controls.sh
Executable file
17
polybar-themes/sblocks/scripts/mpd-controls.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
checkRunning="$(mpc current)"
|
||||
if [[ $checkRunning == '' ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
arg=$1
|
||||
if [[ $arg == 'next' ]] || [[ "$arg" == "-n" ]]; then
|
||||
echo "怜"
|
||||
elif [[ $arg == 'prev' ]] || [[ "$arg" == "-p" ]]; then
|
||||
echo "玲"
|
||||
elif [[ "$arg" == 'icon' ]] || [[ "$arg" == "-i" ]]; then
|
||||
echo ""
|
||||
fi
|
||||
18
polybar-themes/sblocks/scripts/show-music.sh
Executable file
18
polybar-themes/sblocks/scripts/show-music.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## display currently playing/paused song with zscroll
|
||||
## no output when mpd is stopped
|
||||
|
||||
if ! mpc >/dev/null 2>&1; then
|
||||
exit 1
|
||||
else
|
||||
(
|
||||
mpc current | zscroll -l 30 --delay 0.3 \
|
||||
--match-command "mpc status" \
|
||||
--match-text "playing" "--before-text ' '" \
|
||||
--match-text "paused" "--before-text '契 ' --scroll 0" \
|
||||
--update-check true "mpc current" &
|
||||
) &
|
||||
fi
|
||||
|
||||
mpc idle >/dev/null
|
||||
Reference in New Issue
Block a user