aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Keys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-01-13 13:55:48 -0700
committerJosh Rahm <rahm@google.com>2022-01-13 13:55:48 -0700
commit0bde08d5180d08ef102d3d5bff0f50f2e7533e4e (patch)
treefa1fa85e175badf5e12632094889deb8ba3a6611 /src/Internal/Keys.hs
parentbda81bc101bff7caf76d9a27aa31fccd24dcec84 (diff)
downloadrde-0bde08d5180d08ef102d3d5bff0f50f2e7533e4e.tar.gz
rde-0bde08d5180d08ef102d3d5bff0f50f2e7533e4e.tar.bz2
rde-0bde08d5180d08ef102d3d5bff0f50f2e7533e4e.zip
Added ability to control volume with <C-v>hhhh* and <C-v><C-llll*
Diffstat (limited to 'src/Internal/Keys.hs')
-rw-r--r--src/Internal/Keys.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs
index 936b12a..27315cd 100644
--- a/src/Internal/Keys.hs
+++ b/src/Internal/Keys.hs
@@ -1,6 +1,7 @@
{-# LANGUAGE RankNTypes #-}
module Internal.Keys (applyKeys) where
+import Control.Monad.Fix (fix)
import Graphics.X11.ExtraTypes.XF86;
import Internal.KeysM
import Internal.SwapMaster (swapMaster)
@@ -206,6 +207,23 @@ keymap = runKeys $ do
shiftMod $ withFocused $ windows . W.sink
altMod $ spawn (terminal config ++ " -t Floating\\ Term")
+ bind xK_v $
+ -- Allows repeated strokes of M-h and M-l to reduce and increase volume
+ -- respectively.
+ justMod $ fix $ \recur -> subkeys $ do
+ bind xK_h $ do
+ justMod $ do
+ spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%"
+ recur
+
+ bind xK_l $ do
+ justMod $ do
+ spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%"
+ recur
+
+ bind xK_v $ do
+ justMod $ recur
+
bind xK_w $ do
justMod windowJump