Compare commits

..

No commits in common. "64ca36c4174c09821d3774de3816fba964ce2de4" and "2f21a5ac514ab44dcabbd1fa21bb938c2d458d91" have entirely different histories.

3 changed files with 52 additions and 73 deletions

2
xmonad

@ -1 +1 @@
Subproject commit f4a5b88e64b2e9b80ddf81a0ba178ec4d005cfa8 Subproject commit e25d090112f2a76364a10b88a729b8586c18145b

@ -1 +1 @@
Subproject commit ee3ea2402dee7876eccb32fc8a83bb2f3d3198bc Subproject commit 28d86f3a28ad36cf47de3421c201523f6021c6aa

121
xmonad.hs
View File

@ -30,35 +30,26 @@ import XMonad
terminal, terminal,
workspaces workspaces
), ),
button1,
button3,
className, className,
composeAll, composeAll,
doF, doF,
doFloat, doFloat,
doIgnore, doIgnore,
doShift, doShift,
focus,
handleEventHook, handleEventHook,
mod4Mask, mod4Mask,
mouseMoveWindow,
mouseResizeWindow,
resource, resource,
sendMessage, sendMessage,
shiftMask,
spawn, spawn,
title, title,
withWindowSet, withWindowSet,
xmonad, xmonad,
(-->), (-->),
(.|.),
(<&&>), (<&&>),
(<+>), (<+>),
(=?), (=?),
(|||), (|||),
) )
import XMonad.Actions.FloatSnap
import XMonad.Actions.Navigation2D (windowGo, withNavigation2DConfig)
import XMonad.Actions.WindowGo (raise, runOrRaise) import XMonad.Actions.WindowGo (raise, runOrRaise)
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
( PP ( PP
@ -93,8 +84,8 @@ import XMonad.Hooks.StatusBar
statusBarProp, statusBarProp,
withEasySB, withEasySB,
) )
import XMonad.Layout (JumpToLayout (JumpToLayout), Resize (Expand, Shrink)) import XMonad.Layout (Resize (Expand, Shrink))
import XMonad.Layout.Fullscreen (fullscreenEventHook, fullscreenFull, fullscreenManageHook) import XMonad.Layout.Fullscreen (fullscreenEventHook)
import XMonad.Layout.LayoutModifier import XMonad.Layout.LayoutModifier
import qualified XMonad.Layout.LayoutModifier import qualified XMonad.Layout.LayoutModifier
import XMonad.Layout.Named (named) import XMonad.Layout.Named (named)
@ -111,7 +102,7 @@ import XMonad.Layout.WindowNavigation
windowNavigation, windowNavigation,
) )
import XMonad.StackSet (RationalRect (RationalRect), Stack (Stack), Workspace (tag), currentTag, greedyView, integrate', shift, stack) import XMonad.StackSet (RationalRect (RationalRect), Stack (Stack), Workspace (tag), currentTag, greedyView, integrate', shift, stack)
import XMonad.Util.EZConfig (additionalKeysP, additionalMouseBindings) import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Util.Font (fi) import XMonad.Util.Font (fi)
import XMonad.Util.Loggers (logTitles, wrapL) import XMonad.Util.Loggers (logTitles, wrapL)
import XMonad.Util.SpawnOnce (spawnOnce) import XMonad.Util.SpawnOnce (spawnOnce)
@ -123,51 +114,44 @@ main = do
colors <- getWalColors colors <- getWalColors
xmonad . ewmhFullscreen . ewmh xmonad . ewmhFullscreen . ewmh
. withEasySB (statusBarProp "xmobar ~/.config/xmobar/xmobarrc" (pure $ myXmobarPP colors)) defToggleStrutsKey . withEasySB (statusBarProp "xmobar ~/.config/xmobar/xmobarrc" (pure $ myXmobarPP colors)) defToggleStrutsKey
$ withNavigation2DConfig def $ $ def
def { modMask = mod4Mask,
{ modMask = mod4Mask, terminal = "st",
terminal = "st", startupHook = myStartupHook,
startupHook = myStartupHook, borderWidth = 2,
borderWidth = 2, normalBorderColor = "#000000",
normalBorderColor = head colors, focusedBorderColor = colors !! 7,
focusedBorderColor = colors !! 4, workspaces = myWorkspaces,
workspaces = myWorkspaces, manageHook = myManageHook,
manageHook = myManageHook, layoutHook = myLayout,
layoutHook = myLayout, handleEventHook =
handleEventHook = handleEventHook def <+> fullscreenEventHook
handleEventHook def <+> fullscreenEventHook }
} `additionalKeysP` [ ("M-S-z", spawn "xscreensaver-command -lock"),
`additionalKeysP` [ ("M-S-z", spawn "xscreensaver-command -lock"), ("M-S-s", unGrab *> spawn "cast_screenshot"),
("M-S-s", unGrab *> spawn "cast_screenshot"), ("M-f", runOrRaise "brave" (className =? "Brave-browser")),
("M-f", runOrRaise "brave" (className =? "Brave-browser")), ("M-i", raise (className =? "jetbrains-idea")),
("M-o", runOrRaise "emacs" (className =? "Emacs")), ("M-<Space>", spawn "rofi -show drun"),
("M-i", raise (className =? "jetbrains-idea")), ("M-p", spawn "dmenu-with-suggestions"),
("M-<Space>", spawn "rofi -show drun"), -- audio settings
("M-p", spawn "dmenu-with-suggestions"), ("<XF86AudioLowerVolume>", spawn "amixer set Master 5%- unmute"),
-- audio settings ("<XF86AudioRaiseVolume>", spawn "amixer set Master 5%+ unmute"),
("<XF86AudioLowerVolume>", spawn "amixer set Master 5%- unmute"), ("<XF86AudioMute>", spawn "amixer set Master toggle"),
("<XF86AudioRaiseVolume>", spawn "amixer set Master 5%+ unmute"), ("<XF86AudioPlay>", spawn "playerctl play-pause"),
("<XF86AudioMute>", spawn "amixer set Master toggle"), ("<XF86AudioPrev>", spawn "playerctl previous"),
("<XF86AudioPlay>", spawn "playerctl play-pause"), ("<XF86AudioNext>", spawn "playerctl next"),
("<XF86AudioPrev>", spawn "playerctl previous"), -- window navigation
("<XF86AudioNext>", spawn "playerctl next"), ("M-l", sendMessage $ Go R),
-- window navigation ("M-h", sendMessage $ Go L),
("M-l", windowGo R False), ("M-S-h", sendMessage Shrink), -- Shrink horiz window width
("M-h", windowGo L False), ("M-S-l", sendMessage Expand), -- Expand horiz window width
("M-S-h", sendMessage Shrink), -- Shrink horiz window width -- layout switching
("M-S-l", sendMessage Expand), -- Expand horiz window width ("M-<Tab>", sendMessage NextLayout),
-- layout switching -- dmenu stuff
("M-<Tab>", sendMessage NextLayout), ("M1-<F4>", spawn "powerbutton"),
("M-<F11>", sendMessage $ JumpToLayout "Full"), -- jump directly to the Full layout -- lockscreen
-- dmenu stuff ("M-<Escape>", spawn "betterlockscreen -l")
("M1-<F4>", spawn "powerbutton"), ]
-- lockscreen
("M-<F1>", spawn "betterlockscreen -l & sleep 4 && xdg-screensaver activate")
]
`additionalMouseBindings` [ ((mod4Mask, button1), \w -> focus w >> mouseMoveWindow w >> afterDrag (snapMagicMove (Just 200) (Just 200) w)),
((mod4Mask .|. shiftMask, button1), \w -> focus w >> mouseMoveWindow w >> afterDrag (snapMagicResize [L, R, U, D] (Just 200) (Just 200) w)),
((mod4Mask, button3), \w -> focus w >> mouseResizeWindow w >> afterDrag (snapMagicResize [R, D] (Just 50) (Just 50) w))
]
myXmobarPP :: [String] -> PP myXmobarPP :: [String] -> PP
myXmobarPP colors = myXmobarPP colors =
@ -175,8 +159,8 @@ myXmobarPP colors =
{ ppSep = walXmobarColor 1 " \63617 ", { ppSep = walXmobarColor 1 " \63617 ",
ppTitleSanitize = xmobarStrip, ppTitleSanitize = xmobarStrip,
ppCurrent = wrap " " "" . xmobarBorder "Top" (colors !! 6) 2, ppCurrent = wrap " " "" . xmobarBorder "Top" (colors !! 6) 2,
ppHidden = walXmobarColor 2 . wrap " " "", ppHidden = white . wrap " " "",
ppHiddenNoWindows = walXmobarColor 1 . wrap " " "", ppHiddenNoWindows = lowWhite . wrap " " "",
ppUrgent = red . wrap (yellow "!") (yellow "!"), ppUrgent = red . wrap (yellow "!") (yellow "!"),
ppVisible = wrap " " "" . xmobarBorder "Bottom" (colors !! 6) 2, ppVisible = wrap " " "" . xmobarBorder "Bottom" (colors !! 6) 2,
ppOrder = \[ws, l, _, wins] -> [ws, l, wins], ppOrder = \[ws, l, _, wins] -> [ws, l, wins],
@ -184,8 +168,8 @@ myXmobarPP colors =
ppSort = hideWorkspaces ppSort = hideWorkspaces
} }
where where
formatFocused = wrap (walXmobarColor 4 "<fn=2>\58279</fn>") (walXmobarColor 4 "<fn=2>\58254</fn>") . walXmobarColor 4 . ppWindow formatFocused = wrap (walXmobarColor 7 "<fn=2>\58279</fn>") (walXmobarColor 7 "<fn=2>\58254</fn>") . walXmobarColor 7 . ppWindow
formatUnfocused = wrap (walXmobarColor 7 "<fn=2>\58279</fn>") (walXmobarColor 7 "<fn=2>\58254</fn>") . walXmobarColor 7 . ppWindow formatUnfocused = wrap (walXmobarColor 4 "<fn=2>\58279</fn>") (walXmobarColor 4 "<fn=2>\58254</fn>") . walXmobarColor 4 . ppWindow
walXmobarColor index = xmobarColor (colors !! index) "" walXmobarColor index = xmobarColor (colors !! index) ""
ppWindow :: String -> String ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
@ -209,14 +193,10 @@ myXmobarPP colors =
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
mapM_ spawnOnce "picom &"
spawnOnce spawnOnce "sh $HOME/.fehbg"
[ "picom --experimental-backends &", spawnOnce "setxkbmap -option caps:escape"
"sh $HOME/.fehbg", spawnOnce "xset r rate 300 50"
"setxkbmap -option caps:escape",
"xset r rate 300 50",
"signal-deskto &"
]
getWalColors :: IO [String] getWalColors :: IO [String]
getWalColors = do getWalColors = do
@ -232,7 +212,7 @@ mySpacing' i = spacingRaw True (Border i 0 i i) True (Border i 0 i i) True
myWorkspaces :: [String] myWorkspaces :: [String]
myWorkspaces = show <$> ([1 .. 9] :: [Integer]) myWorkspaces = show <$> ([1 .. 9] :: [Integer])
myLayout = fullscreenFull $ smartBorders $ tiled ||| smartBorders Full ||| Mirror (fullWSpacing 8 $ Tall nmaster delta ratio) myLayout = smartBorders $ windowNavigation tiled ||| smartBorders Full ||| Mirror (fullWSpacing 8 $ Tall nmaster delta ratio)
where where
tiled = named "Tall" $ mySpacing' 8 $ Tall nmaster delta ratio tiled = named "Tall" $ mySpacing' 8 $ Tall nmaster delta ratio
nmaster = 1 -- Default number of windows in the master pane nmaster = 1 -- Default number of windows in the master pane
@ -271,7 +251,6 @@ myManageHook =
(className =? "TelegramDesktop") <&&> (title ~=? "Media viewer") --> doFloat (className =? "TelegramDesktop") <&&> (title ~=? "Media viewer") --> doFloat
] ]
<+> insertPosition End Newer <+> insertPosition End Newer
<+> fullscreenManageHook
where where
viewShift = doF . liftM2 (.) greedyView shift viewShift = doF . liftM2 (.) greedyView shift