From 8ee7bc65ae0e7824d6be701eea3a4c94be800b08 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Nov 2020 18:37:23 +0100 Subject: dmpc done --- .local/bin/dmpc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to '.local/bin/dmpc') diff --git a/.local/bin/dmpc b/.local/bin/dmpc index afec53f..0e3f826 100755 --- a/.local/bin/dmpc +++ b/.local/bin/dmpc @@ -2,6 +2,21 @@ sub main { + my $action; + my $current; + my $prompt; + + $current = `mpc`; + if ($current =~ /volume: n\/a/) { + $current = "Current: Stopped"; + } + else { + $current =~ /$\.+/d; + $current = "Current: " . $current; + } + $prompt = "toggle\nstop\nnext\nprev\n$current\n"; + $action = `printf '$prompt' | dmenu`; + system("mpc " . $action); return; } -- cgit v1.2.3