Add mpc status: show current song from mpd via mpc client

This commit is contained in:
Elan Ruusamäe 2019-11-16 22:45:04 +02:00
commit f5a91aa87b
2 changed files with 36 additions and 1 deletions

View file

@ -1,3 +1,3 @@
libdirdir = $(prefix)/lib/@PACKAGE@ libdirdir = $(prefix)/lib/@PACKAGE@
libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp color custom date disk disk_io distro entropy fan_speed hostname ip_address load_average logo mail memory menu network processes raid reboot_required release services session swap time time_binary time_utc trash updates_available uptime users whoami wifi_quality libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp color custom date disk disk_io distro entropy fan_speed hostname ip_address load_average logo mail memory menu mpc network processes raid reboot_required release services session swap time time_binary time_utc trash updates_available uptime users whoami wifi_quality

35
usr/lib/byobu/mpc Executable file
View file

@ -0,0 +1,35 @@
#!/bin/sh -e
#
# mpc: print current mpd song via mpc
#
# Copyright (C) 2008 Canonical Ltd.
# Copyright (C) 2011-2014 Dustin Kirkland
#
# Authors: Elan Ruusamäe <glen@pld-linux.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__mpc_detail() {
uname -a
}
__mpc_playing() {
mpc status -f '' | grep -qF '[playing]'
}
__mpc() {
__mpc_playing || return 0
printf "%s " $(mpc current -f '[[%artist% - ]%title%]|[%file%]')
}
# vi: syntax=sh ts=4 noexpandtab