Configurable music toggle

This commit is contained in:
Mats Rauhala 2019-05-13 08:48:06 +03:00
parent dbd3024d98
commit 7c27571ca7
2 changed files with 5 additions and 5 deletions

View File

@ -59,9 +59,9 @@ import XMonad.Hooks.DynamicLog (statusBar)
import qualified Data.Set as S import qualified Data.Set as S
spotify :: XConfig l -> NamedAction spotify :: ExtraConfig -> XConfig l -> NamedAction
spotify conf = submapName . mkNamedKeymap conf $ spotify extraConf conf = submapName . mkNamedKeymap conf $
[ ("M-p", addName "Play" $ spawn "sp play") ] [ ("M-p", addName "Play" $ spawn (musicToggle . applications $ extraConf)) ]
scratchpads :: [NamedScratchpad] scratchpads :: [NamedScratchpad]
scratchpads = [ scratchpads = [
@ -178,9 +178,8 @@ myKeys extraConfig conf =
, ("<XF86AudioLowerVolume>", addName "Decrease volume" $ spawn "amixer set Master 2%-") , ("<XF86AudioLowerVolume>", addName "Decrease volume" $ spawn "amixer set Master 2%-")
, ("M-<plus>", addName "Increase volume" $ spawn "amixer set Master 2+") , ("M-<plus>", addName "Increase volume" $ spawn "amixer set Master 2+")
, ("M-<minus>", addName "Decrease volume" $ spawn "amixer set Master 2-") , ("M-<minus>", addName "Decrease volume" $ spawn "amixer set Master 2-")
-- , ("<XF86AudioPlay>", addName "Play/pause spotify" $ spawn "/home/masse/.local/bin/sp play")
, ("<XF86AudioPlay>", addName "Play/pause mopidy" $ spawn "mpc toggle") , ("<XF86AudioPlay>", addName "Play/pause mopidy" $ spawn "mpc toggle")
, ("M-m", spotify conf) , ("M-m", spotify extraConfig conf)
, ("M-S-<Space>", addName "Swap screens" swapNextScreen) , ("M-S-<Space>", addName "Swap screens" swapNextScreen)
, ("M-<Backspace>", addName "Kill window" kill) , ("M-<Backspace>", addName "Kill window" kill)
-- scrot requires `unGrab` -- scrot requires `unGrab`

View File

@ -10,6 +10,7 @@ data Applications =
, prompt :: FilePath , prompt :: FilePath
, screenshot :: FilePath , screenshot :: FilePath
, urxvt :: FilePath , urxvt :: FilePath
, musicToggle :: FilePath
} deriving (Show, Generic) } deriving (Show, Generic)
data TopicRule = data TopicRule =