]> git.draconx.ca Git - fvwmconf.git/commitdiff
Use mpdexec for key bindings. master
authorNick Bowler <nbowler@draconx.ca>
Fri, 11 Aug 2023 00:56:40 +0000 (20:56 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 11 Aug 2023 00:58:51 +0000 (20:58 -0400)
We have a perfectly good script to implement these key bindings
that does not depend on external programs.

common/bindings
config
global/mpdkeys [new file with mode: 0644]

index ff0d4e766dc0f20606b701e684f3e99ac5137a7f..ccfaa785e7ffaca17ae5d8dfdf78eb3754bc1479 100644 (file)
@@ -1,14 +1,3 @@
-# MPD shortcuts
-Key Page_Up   A CM Exec exec mpc prev
-Key Page_Down A CM Exec exec mpc next
-Key End       A CM Exec exec mpc stop
-Key Home      A CM Exec exec mpc pause
-Key Insert    A CM Exec exec mpc play
-Key Page_Down A CM Exec exec mpc next
-
-Mouse 4 A CM Exec exec mpc prev
-Mouse 5 A CM Exec exec mpc next
-
 # Window management
 Key F4 A M  Close
 
diff --git a/config b/config
index c96d3f4a47d09e62a0ab8363577776f3442f0346..de9ce4368abf7763ef8796d168c6f523b705aa4c 100644 (file)
--- a/config
+++ b/config
@@ -20,6 +20,7 @@ SetEnv GTK2_RC_FILES $[FVWM_USERDIR]/gtk2rc
 Read global/multiscreen
 Read global/fullscreen
 Read global/appspecific
+Read global/mpdkeys
 
 # Machine-specific features
 PipeRead "[ -f '$[FVWM_USERDIR]/$[HOST]/config' ] \
diff --git a/global/mpdkeys b/global/mpdkeys
new file mode 100644 (file)
index 0000000..897706b
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright © 2023 Nick Bowler
+#
+# Misc MPD key bindings.
+#
+# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+# This is free software: you are free to do what the fuck you want to.
+# There is NO WARRANTY, to the extent permitted by law.
+
+Key Page_Up   A CM Exec exec $[infostore.mpdexec_cmd] previous
+Key Page_Down A CM Exec exec $[infostore.mpdexec_cmd] next
+Key End       A CM Exec exec $[infostore.mpdexec_cmd] stop
+Key Home      A CM Exec exec $[infostore.mpdexec_cmd] pause 1
+Key Insert    A CM Exec exec $[infostore.mpdexec_cmd] play
+
+Mouse 4 A CM Exec exec $[infostore.mpdexec_cmd] previous
+Mouse 5 A CM Exec exec $[infostore.mpdexec_cmd] next
+
+Test (!EnvMatch infostore.mpdexec_cmd *?) \
+  InfoStoreAdd mpdexec_cmd "$[FVWM_USERDIR]/gitmodules/mpdhacks/mpdexec.pl"