summaryrefslogtreecommitdiff
path: root/lib/xmonad.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xmonad.hs')
-rw-r--r--lib/xmonad.hs37
1 files changed, 29 insertions, 8 deletions
diff --git a/lib/xmonad.hs b/lib/xmonad.hs
index 047dd83..79c0491 100644
--- a/lib/xmonad.hs
+++ b/lib/xmonad.hs
@@ -22,6 +22,7 @@ import Data.List (intercalate, isPrefixOf)
import Graphics.X11.ExtraTypes.XF86
import XMonad
import XMonad.Actions.CopyWindow
+import XMonad.Actions.WindowBringer (gotoMenu, bringMenu)
import XMonad.Config
import XMonad.Config.Desktop
import XMonad.Hooks.EwmhDesktops (ewmh)
@@ -40,7 +41,6 @@ import XMonad.Layout.TwoPane
import qualified XMonad.StackSet as W
import XMonad.Util.CustomKeys (customKeys)
import XMonad.Util.EZConfig (additionalKeys)
-import XMonad.Util.Scratchpad
import XMonad.Util.NamedScratchpad
-- Colors
@@ -90,19 +90,26 @@ shouldFloat = do
return (fs && not (shouldntFloat name))
-- RationalRect is x y w h
-scratchHook = scratchpadManageHook (W.RationalRect 0.125 0.125 0.75 0.75)
+scratchHook = namedScratchpadManageHook scratchpads --
myManageHook = manageDocks <+> scratchHook <+> (shouldFloat --> doFullFloat) <+> manageHook def
-- todo: use urxvtc with daemon
termName = "/home/ben/.nix-profile/bin/urxvt"
-transparentTerm = termName <> " -depth 32 -bg rgba:0000/0000/0000/4444"
+
+centerFloat = customFloating (W.RationalRect 0.125 0.125 0.75 0.75)
scratchpads = [
- NS "pavucontrol" "pavucontrol" (className =? "Pavucontrol")
- (customFloating $ W.RationalRect (1/4) (1/4) (2/4) (2/4))
+ -- run htop in xterm, find it by title
+ NS "htop" "urxvt -e htop" (title =? "htop") centerFloat,
+ NS "gotop" "urxvt -e gotop" (title =? "gotop") centerFloat,
+
+ NS "nvtop" "urxvt -e nvtop" (title =? "nvtop") centerFloat,
+
+ NS "pavucontrol" "pavucontrol" (className =? "Pavucontrol") centerFloat
]
+
insKeys :: XConfig l -> [((KeyMask, KeySym), X ())]
insKeys conf@(XConfig {modMask = modMask}) =
[ ((modMask, xK_y), spawn "passmenu"),
@@ -110,9 +117,19 @@ insKeys conf@(XConfig {modMask = modMask}) =
((modMask, xK_o), spawn "rofi -sidebar-mode -show run"),
((modMask, xK_n), spawn "rofi -sidebar-mode -show window"),
((modMask, xK_u), spawn "rofi -show calc -modi calc -no-show-match -no-sort"),
- ((modMask, xK_s), scratchpadSpawnActionTerminal transparentTerm),
- ((modMask .|. shiftMask, xK_p), namedScratchpadAction scratchpads "pavucontrol"),
- -- ((modMask, xK_h), spawn transparentTerm),
+
+ -- scratchpads
+ ((meh, xK_h), namedScratchpadAction scratchpads "htop"),
+ ((meh, xK_n), namedScratchpadAction scratchpads "nvtop"),
+ ((meh, xK_p), namedScratchpadAction scratchpads "pavucontrol"),
+
+ -- dmenu shortcuts
+ ((meh, xK_g), gotoMenu),
+ ((meh, xK_b), bringMenu),
+
+ -- run my script ~/bin/open-webui-ask
+ ((meh, xK_a), spawn "open-webui-ask"),
+
-- refresh display via autorandr
( (modMask, xK_r),
spawn $ "autorandr --cycle"
@@ -132,6 +149,10 @@ insKeys conf@(XConfig {modMask = modMask}) =
((0, xF86XK_AudioLowerVolume), amixer "2%-"),
((0, xF86XK_AudioRaiseVolume), amixer "2%+")
]
+ where
+ -- meh key is alt + shift + control
+ meh :: KeyMask
+ meh = altMask .|. shiftMask .|. controlMask
amixer :: String -> X ()
amixer cmd = spawn $ "amixer -q sset Master " <> cmd