From efc529eb5159bfce5fcfeabd4ca5e4d61ca1ee60 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 10 Aug 2023 20:56:40 -0400 Subject: [PATCH] Use mpdexec for key bindings. We have a perfectly good script to implement these key bindings that does not depend on external programs. --- common/bindings | 11 ----------- config | 1 + global/mpdkeys | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 global/mpdkeys diff --git a/common/bindings b/common/bindings index ff0d4e7..ccfaa78 100644 --- a/common/bindings +++ b/common/bindings @@ -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 c96d3f4..de9ce43 100644 --- 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 index 0000000..897706b --- /dev/null +++ b/global/mpdkeys @@ -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" -- 2.43.0