diff options
Diffstat (limited to '.local/bin/dmpc')
-rwxr-xr-x | .local/bin/dmpc | 15 |
1 files changed, 15 insertions, 0 deletions
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; } |