ADD sound for volume controls
This commit is contained in:
parent
c65f14902b
commit
cb44b17d72
|
@ -88,14 +88,17 @@ runNextTrack = spawnCmd myMultimediaCtl ["next"]
|
|||
runStopPlay :: X ()
|
||||
runStopPlay = spawnCmd myMultimediaCtl ["stop"]
|
||||
|
||||
volumeChangeSound :: FilePath
|
||||
volumeChangeSound = "smb_fireball.wav"
|
||||
|
||||
runVolumeDown :: X ()
|
||||
runVolumeDown = void (lowerVolume 2)
|
||||
runVolumeDown = void (lowerVolume 2) >> spawnSound volumeChangeSound
|
||||
|
||||
runVolumeUp :: X ()
|
||||
runVolumeUp = void (raiseVolume 2)
|
||||
runVolumeUp = void (raiseVolume 2) >> spawnSound volumeChangeSound
|
||||
|
||||
runVolumeMute :: X ()
|
||||
runVolumeMute = void toggleMute
|
||||
runVolumeMute = void toggleMute >> spawnSound volumeChangeSound
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- | System commands
|
||||
|
|
|
@ -4,12 +4,15 @@
|
|||
module XMonad.Internal.Shell
|
||||
( fmtCmd
|
||||
, spawnCmd
|
||||
, spawnSound
|
||||
, (#!&&)
|
||||
, (#!||)
|
||||
, (#!>>)
|
||||
) where
|
||||
|
||||
import XMonad.Core (X)
|
||||
import System.FilePath.Posix
|
||||
|
||||
import XMonad.Core (X, getXMonadDir)
|
||||
import XMonad.Internal.Process
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -18,6 +21,17 @@ import XMonad.Internal.Process
|
|||
spawnCmd :: String -> [String] -> X ()
|
||||
spawnCmd cmd args = spawn $ fmtCmd cmd args
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- | Playing sound
|
||||
|
||||
soundDir :: FilePath
|
||||
soundDir = "sound"
|
||||
|
||||
spawnSound :: FilePath -> X ()
|
||||
spawnSound file = do
|
||||
path <- (</> soundDir </> file) <$> getXMonadDir
|
||||
spawnCmd "aplay" [path]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- | Formatting commands
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue