Compare commits

..

No commits in common. "5f1cea7f2544da57c5e7cae886f6a064e1c2beab" and "77dc32f91c05414691343f2be0e71a2bc0368b2e" have entirely different histories.

3 changed files with 22 additions and 95 deletions

View file

@ -8,7 +8,6 @@ import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.InsertPosition import XMonad.Hooks.InsertPosition
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.OnPropertyChange
import XMonad.Hooks.RefocusLast import XMonad.Hooks.RefocusLast
import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar
import XMonad.Layout.NoBorders import XMonad.Layout.NoBorders
@ -25,12 +24,12 @@ import XMonad.Util.NamedScratchpad
import XMonad.Util.SpawnOnce import XMonad.Util.SpawnOnce
import XMonad.Layout.Magnifier import XMonad.Layout.Magnifier
import Data.Char.Greek
import Data.Semigroup
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
import System.Posix import System.Posix
import Graphics.X11.ExtraTypes.XF86 import Graphics.X11.ExtraTypes.XF86
import Data.Char.Greek
main :: IO () main :: IO ()
main = main =
xmonad xmonad
@ -38,7 +37,6 @@ main =
-- https://wiki.archlinux.org/title/java#Gray_window,_applications_not_resizing_with_WM,_menus_immediately_closing -- https://wiki.archlinux.org/title/java#Gray_window,_applications_not_resizing_with_WM,_menus_immediately_closing
. javaHack . javaHack
. withSB xmobarConfig . docks . withSB xmobarConfig . docks
. setEwmhActivateHook myActivateHook
. ewmhFullscreen . ewmh . ewmhFullscreen . ewmh
$ def $ def
{ modMask = superMask { modMask = superMask
@ -52,7 +50,6 @@ main =
, startupHook = myStartupHook , startupHook = myStartupHook
, layoutHook = myLayout , layoutHook = myLayout
, manageHook = myManageHook , manageHook = myManageHook
, handleEventHook = myEventHandleHook
} }
-- Only remove mappings that needs pass through -- Only remove mappings that needs pass through
@ -69,88 +66,31 @@ myLayout =
in avoidStruts . smartBorders $ in avoidStruts . smartBorders $
mag tallr ||| Full mag tallr ||| Full
isSioyek :: Query Bool isOneOf :: Eq a => Query a -> [a] -> Query Bool
isSioyek = className =? "sioyek" isOneOf q = fmap or . traverse (q =?)
isDiscord :: Query Bool
isDiscord =
let electronDiscord = className =? "discord"
firefoxDiscord = isFirefox <&&> title ~? "Discord"
in electronDiscord <||> firefoxDiscord
isEvolution :: Query Bool
isEvolution = className ~? "gnome.Evolution"
isFirefox :: Query Bool
isFirefox = className =? "firefox"
isSpotify :: Query Bool
isSpotify = isFirefox <&&> title ~? "Spotify"
isFirefoxPip :: Query Bool
isFirefoxPip = isFirefox <&&> title =? "Picture-in-Picture"
isFeh :: Query Bool
isFeh = className =? "feh"
isNautilus :: Query Bool
isNautilus = className ~? "Nautilus"
isNautilusPreviewer :: Query Bool
isNautilusPreviewer = className ~? "NautilusPreviewer"
isMinder :: Query Bool
isMinder = className =? "Minder" <&&> (not <$> title ~? "Pick a Color")
isKitty :: Query Bool
isKitty = className =? "kitty"
myActivateHook :: ManageHook
myActivateHook =
-- Ignore activate request
composeOne
[ isDiscord -?> mempty
, isEvolution -?> mempty
, isSioyek -?> mempty
, isFeh -?> mempty
, return True -?> doFocus
]
myManageHook :: ManageHook myManageHook :: ManageHook
myManageHook = myManageHook =
composeAll composeAll
[ isNautilusPreviewer --> customFloating centeredFloat [ className ~? "NautilusPreviewer" --> customFloating centeredFloat
, isFeh --> customFloating buttomRightFloat , className =? "feh" --> customFloating buttomRightFloat
, isMinder --> customFloating centeredFloat , className =? "Minder"
, isFirefoxPip --> doFloat <&&> not <$> title ~? "Pick a Color" -- ignore the color picker
, isDiscord --> (doF $ W.shift chatWS) --> customFloating centeredFloat
, isEvolution --> (doF $ W.shift chatWS) , className =? "firefox"
<&&> title =? "Picture-in-Picture"
--> doFloat
, namedScratchpadManageHook myScratchpads
] ]
<> composeOne <> composeOne
[ isFirefox -?> insertPosition Master Newer [ className =? "firefox" -?> insertPosition Master Newer
, isKitty -?> insertPosition Below Newer , className =? "kitty" -?> insertPosition Below Newer
, isNautilus <||> isSioyek -?> insertPosition End Older , className `isOneOf`
[ "sioyek"
, "Nautilus"
]
-?> insertPosition End Older
] ]
<> namedScratchpadManageHook myScratchpads
myEventHandleHook :: Event -> X All
myEventHandleHook =
-- TODO: is there a way to always open certain sites in new windows in firefox?
onTitleChange $ composeAll
[ isSpotify --> doShiftAndViewIfMoved multimediaWS
, isDiscord --> doShiftAndViewIfMoved chatWS
]
-- If the title changes in the background, we don't want to greedy view that workspace.
-- Imagine Spotify playing in the background, a track change would focus that workspace.
-- We prevent this by checking if the window is already there.
doShiftAndViewIfMoved :: WorkspaceId -> Query (Endo WindowSet)
doShiftAndViewIfMoved n = doF . shiftAndViewIfMoved n =<< ask
shiftAndViewIfMoved :: WorkspaceId -> Window -> WindowSet -> WindowSet
shiftAndViewIfMoved n w s = case W.findTag w s of
Just from | n `W.tagMember` s && n /= from -> W.greedyView n $ W.shiftWin n w s
_ -> s
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
@ -283,15 +223,9 @@ superMask, altMask :: KeyMask
superMask = mod4Mask superMask = mod4Mask
altMask = mod1Mask altMask = mod1Mask
myWorkspaces :: [WorkspaceId] myWorkspaces :: [String]
myWorkspaces = map (:[]) $ take 8 greekLower myWorkspaces = map (:[]) $ take 8 greekLower
multimediaWS :: WorkspaceId
multimediaWS = myWorkspaces !! 6
chatWS :: WorkspaceId
chatWS = myWorkspaces !! 3
centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect
centeredFloat = W.RationalRect (1/9) (1/9) (7/9) (7/9) centeredFloat = W.RationalRect (1/9) (1/9) (7/9) (7/9)
smallFloat = W.RationalRect (3/5) (3/5) (2/7) (2/7) smallFloat = W.RationalRect (3/5) (3/5) (2/7) (2/7)

View file

@ -75,10 +75,7 @@
}; };
"/home" = { "/home" = {
mountOptions = [ mountOptions = [ "noatime" ];
"compress=zstd"
"noatime"
];
mountpoint = "/home"; mountpoint = "/home";
}; };

View file

@ -56,10 +56,6 @@ in
"browser.ctrlTab.sortByRecentlyUsed" = false; "browser.ctrlTab.sortByRecentlyUsed" = false;
"layout.css.devPixelsPerPx" = 1.1; "layout.css.devPixelsPerPx" = 1.1;
# open links in new window
# this works a lot better with xmonad where I have a bunch of windows
"browser.link.open_newwindow" = 2;
# Sponsored crap # Sponsored crap
# Yes # Yes
"browser.newtabpage.activity-stream.showSearch" = true; "browser.newtabpage.activity-stream.showSearch" = true;