aboutsummaryrefslogtreecommitdiff
path: root/src/Internal
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-01-13 13:55:48 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commitd0b1689dbf020035cec362556394a6ba58cba5ad (patch)
tree73518e32a1b78aedeedbae4b596d04713c5908e0 /src/Internal
parente45fb0f5e97973e13d1bdbe1eef60628d602580b (diff)
downloadrde-d0b1689dbf020035cec362556394a6ba58cba5ad.tar.gz
rde-d0b1689dbf020035cec362556394a6ba58cba5ad.tar.bz2
rde-d0b1689dbf020035cec362556394a6ba58cba5ad.zip
Added ability to control volume with <C-v>hhhh* and <C-v><C-llll*
Diffstat (limited to 'src/Internal')
-rw-r--r--src/Internal/DMenu.hs2
-rw-r--r--src/Internal/Keys.hs18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/Internal/DMenu.hs b/src/Internal/DMenu.hs
index b611d87..0ec7927 100644
--- a/src/Internal/DMenu.hs
+++ b/src/Internal/DMenu.hs
@@ -17,7 +17,7 @@ data Colors =
} | DefaultColors
menuCommand :: [String]
-menuCommand = ["rofi", "-monitor", "-4", "-dmenu"]
+menuCommand = ["rofi", "-monitor", "-4", "-dmenu", "-sort", "-levenshtein-sort"]
menuCommandString :: String
menuCommandString = unwords menuCommand
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