summaryrefslogtreecommitdiffstats
path: root/.local/bin/dmpc
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-11-06 18:37:23 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-11-06 18:37:23 +0100
commit8ee7bc65ae0e7824d6be701eea3a4c94be800b08 (patch)
treed3a7c3ba528004a5b534c21947eb429b7e076398 /.local/bin/dmpc
parentMaking a script to control mpd fromdmenu (diff)
downloaddotfiles-bsd-8ee7bc65ae0e7824d6be701eea3a4c94be800b08.tar.gz
dotfiles-bsd-8ee7bc65ae0e7824d6be701eea3a4c94be800b08.tar.bz2
dotfiles-bsd-8ee7bc65ae0e7824d6be701eea3a4c94be800b08.tar.xz
dotfiles-bsd-8ee7bc65ae0e7824d6be701eea3a4c94be800b08.tar.zst
dotfiles-bsd-8ee7bc65ae0e7824d6be701eea3a4c94be800b08.zip
dmpc done
Diffstat (limited to '.local/bin/dmpc')
-rwxr-xr-x.local/bin/dmpc15
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;
}