aboutsummaryrefslogtreecommitdiff
path: root/xmonad/xmonad.hs
diff options
context:
space:
mode:
Diffstat (limited to 'xmonad/xmonad.hs')
-rw-r--r--xmonad/xmonad.hs87
1 files changed, 54 insertions, 33 deletions
diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs
index bde627c..0c55e5c 100644
--- a/xmonad/xmonad.hs
+++ b/xmonad/xmonad.hs
@@ -1,21 +1,29 @@
import XMonad
-import System.Exit (exitSuccess)
+
+import XMonad.Actions.UpdatePointer
+import XMonad.Actions.CycleWS
+import XMonad.Actions.DwmPromote
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar
import XMonad.Hooks.EwmhDesktops
-import XMonad.Util.Cursor
+import XMonad.Hooks.ManageDocks
+import XMonad.Hooks.WindowSwallowing
+import XMonad.Layout.ThreeColumns
+import XMonad.Layout.Spacing
+import XMonad.Layout.NoBorders
+import XMonad.Layout.Renamed
+import XMonad.Layout.Accordion
+import XMonad.Layout.Grid
+
+import XMonad.Util.Cursor
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.Ungrab
-import XMonad.Layout.ThreeColumns
-import XMonad.Layout.Spacing
-import XMonad.Actions.CycleWS
-import XMonad.Layout.Renamed
-import XMonad.Layout.Spacing
+import System.Exit (exitSuccess)
main :: IO ()
main = xmonad
@@ -26,68 +34,80 @@ main = xmonad
myConfig = def
{ modMask = mod4Mask -- Rebind Mod to the Super key
- , layoutHook = myLayout
- , manageHook = myManageHook
- , startupHook = setDefaultCursor xC_left_ptr
- , workspaces = myWorkspaces
+ , layoutHook = lessBorders OnlyFloat $ avoidStruts $ myLayout -- layouts
+ , manageHook = myManageHook -- float/swallow rules
+ , startupHook = setDefaultCursor xC_left_ptr -- sets the cursor
+ , handleEventHook = swallowEventHook (className =? "Alacritty") (return True) -- make alacritty swallowable
+ , workspaces = myWorkspaces -- workspace names
+ , logHook = updatePointer (0.5, 0.5) (0, 0) -- warp pointer to center of window on focus
, borderWidth = 2
, normalBorderColor = "#3c3836"
, focusedBorderColor = "#928374"
}
`additionalKeysP`
- [ ("M-S-<Escape>", spawn "slock")
- , ("M-<PrintScreen>", unGrab *> spawn "screenshot" )
- , ("M-S-f", spawn "librewolf-bin" )
- , ("M-S-k", spawn "keepassxc" )
- , ("M-S-<Return>", spawn "spawn-alacritty")
- , ("M-p", spawn "dmenu_run_history" )
+ [ -- executables
+ ("M-S-<Escape>", spawn "slock")
+ , ("M-S-f", spawn "librewolf-bin")
+ , ("M-S-k", spawn "keepassxc")
, ("M-<F1>", spawn "volmute")
, ("M-<F2>", spawn "voldown")
, ("M-<F3>", spawn "volup")
, ("M-<F7>", spawn "brightness-down")
, ("M-<F8>", spawn "brightness-up")
, ("M-<F11>", spawn "screenshot")
+ , ("M-p", spawn "dmenu_run_history -fn 'JetBrains Mono NF:style=medium:size=11' -nb '#3c3836' -nf '#ebdbb2' -sb '#504945' -sf '#ebdbb2'")
+ , ("M-S-<Return>", spawn "spawn-alacritty")
+ -- XMonad calls
, ("M-<Tab>", toggleWS)
+ , ("M-<Return>", dwmpromote)
+ -- layout jumps
+ , ("M-t", sendMessage $ JumpToLayout "Normal")
+ -- rebound quit call
, ("M-S-<Backspace>", io exitSuccess)
- , ("M-S-q", spawn "true")
+ ]
+ `removeKeysP`
+ [ -- default quit keybind, as moved to M-S-<Backspace>
+ ("M-S-q")
]
+myWorkspaces :: [String]
myWorkspaces = [ "!", "@", "#", "$", "%", "^", "&", "*", "(" ]
-myLayout = tiled ||| full ||| threeCol
+myLayout = tiled ||| full ||| threeCol ||| accordion ||| grid
where
- threeCol = renamed [Replace "ThreeCol"] $ spacing 2 $ ThreeColMid nmaster delta ratio
- tiled = renamed [Replace "Tall"] $ spacing 2 $ Tall nmaster delta ratio
- full = renamed [Replace "Full"] $ spacing 2 $ Full
- nmaster = 1 -- Default number of windows in the master pane
- ratio = 6/10 -- Default proportion of screen occupied by master pane
- delta = 2/100 -- Percent of screen to increment by when resizing panes
+ tiled = renamed [Replace "Normal"] $ spaced $ Tall nmaster delta ratio
+ full = renamed [Replace "Full"] $ spaced $ Full
+ threeCol = renamed [Replace "ThreeCol"] $ spaced $ ThreeColMid nmaster delta ratio
+ accordion = renamed [Replace "Accrdin"] $ spaced $ Accordion
+ grid = renamed [Replace "Grid"] $ spaced $ Grid
+ nmaster = 1 -- Default number of windows in the master pane
+ ratio = 6/10 -- Default proportion of screen occupied by master pane
+ delta = 2/100 -- Percent of screen to increment by when resizing panes
+ spaced = spacing 2
myManageHook :: ManageHook
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
, isDialog --> doFloat
- ]
+ ]
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = magenta " • "
, ppTitleSanitize = xmobarStrip
- , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
- , ppHidden = white . wrap " " ""
- , ppHiddenNoWindows = lowWhite . wrap " " ""
+ , ppCurrent = wrap "" "" . xmobarBorder "Top" "#8be9fd" 2
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
- formatFocused = wrap (white "[") (white "]") . green . ppWindow
- formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . lowWhite . ppWindow
+ formatFocused = wrap (white "{") (white "}") . aqua . ppWindow . shorten 80
+ formatUnfocused = wrap (lowWhite "<") (lowWhite ">") . lowWhite . ppWindow . shorten 40
-- | Windows should have *some* title, which should not not exceed a
-- sane length.
ppWindow :: String -> String
- ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 80
+ ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w)
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#d3869b" ""
@@ -96,4 +116,5 @@ myXmobarPP = def
yellow = xmobarColor "#fabd2f" ""
red = xmobarColor "#fb4934" ""
green = xmobarColor "#b8bb26" ""
- lowWhite = xmobarColor "#a89984" "" \ No newline at end of file
+ lowWhite = xmobarColor "#a89984" ""
+ aqua = xmobarColor "#8ec07c" "" \ No newline at end of file