mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 22:49:41 +00:00
Compare commits
No commits in common. "2d17c2c145fcc1a9ffd011c5e3292147de167a3f" and "24775459edc5646a0b2d6b4a4623779e8cd6f5d1" have entirely different histories.
2d17c2c145
...
24775459ed
3 changed files with 8 additions and 36 deletions
|
|
@ -23,10 +23,8 @@ instance LayoutClass SetMasterNTall a where
|
||||||
let ws' = W.Workspace t (unSetMasterNTall l) s
|
let ws' = W.Workspace t (unSetMasterNTall l) s
|
||||||
in (fmap . fmap . fmap) SetMasterNTall . runLayout ws'
|
in (fmap . fmap . fmap) SetMasterNTall . runLayout ws'
|
||||||
|
|
||||||
handleMessage (SetMasterNTall l@(ResizableTall n0 d f s)) mess
|
handleMessage (SetMasterNTall l@(ResizableTall _n0 d f s)) mess
|
||||||
| Just (SetMasterN n) <- fromMessage mess = pure $
|
| Just (SetMasterN n) <- fromMessage mess = pure $ Just $ SetMasterNTall $ ResizableTall n d f s
|
||||||
if n0 /= n then Just $ SetMasterNTall $ ResizableTall n d f s
|
|
||||||
else Nothing
|
|
||||||
| otherwise = (fmap . fmap) SetMasterNTall . handleMessage l $ mess
|
| otherwise = (fmap . fmap) SetMasterNTall . handleMessage l $ mess
|
||||||
|
|
||||||
description (SetMasterNTall l) = description l
|
description (SetMasterNTall l) = description l
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@ import XMonad.Util.NamedScratchpad
|
||||||
import XMonad.Util.SpawnOnce
|
import XMonad.Util.SpawnOnce
|
||||||
|
|
||||||
import Data.Char.Greek
|
import Data.Char.Greek
|
||||||
import qualified Data.Map.Strict as M
|
|
||||||
import Data.Ratio
|
import Data.Ratio
|
||||||
import Data.Semigroup
|
import Data.Semigroup
|
||||||
|
import qualified Data.Map.Strict as M
|
||||||
import System.Posix
|
import System.Posix
|
||||||
import Graphics.X11.ExtraTypes.XF86
|
import Graphics.X11.ExtraTypes.XF86
|
||||||
|
|
||||||
|
|
@ -209,21 +209,11 @@ setMasterNEventHandleHook :: Event -> X All
|
||||||
setMasterNEventHandleHook ev =
|
setMasterNEventHandleHook ev =
|
||||||
let adjustMasterCount :: X ()
|
let adjustMasterCount :: X ()
|
||||||
adjustMasterCount = do
|
adjustMasterCount = do
|
||||||
ws <- gets windowset
|
count <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||||
-- Remove the floating windows in the count
|
if count <= 3 then sendMessage (SetMasterN 1)
|
||||||
let s :: Maybe (W.Stack Window)
|
else if count <= 5 then sendMessage (SetMasterN 2)
|
||||||
s = W.stack $ W.workspace $ W.current ws
|
else if count <= 7 then sendMessage (SetMasterN 3)
|
||||||
|
else pure ()
|
||||||
count :: Int
|
|
||||||
count =
|
|
||||||
length
|
|
||||||
$ filter (flip M.notMember (W.floating ws))
|
|
||||||
$ W.integrate' s
|
|
||||||
|
|
||||||
if count > 7 then sendMessage (SetMasterN 4)
|
|
||||||
else if count > 5 then sendMessage (SetMasterN 3)
|
|
||||||
else if count > 3 then sendMessage (SetMasterN 2)
|
|
||||||
else sendMessage (SetMasterN 1)
|
|
||||||
in do
|
in do
|
||||||
case ev of
|
case ev of
|
||||||
MapRequestEvent{} -> adjustMasterCount
|
MapRequestEvent{} -> adjustMasterCount
|
||||||
|
|
|
||||||
|
|
@ -76,20 +76,4 @@
|
||||||
services.mullvad-vpn.enable = true;
|
services.mullvad-vpn.enable = true;
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
|
|
||||||
# Printing and auto-discovery of Wi-Fi printers
|
|
||||||
services.avahi = {
|
|
||||||
enable = true;
|
|
||||||
nssmdns4 = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.printing = {
|
|
||||||
enable = true;
|
|
||||||
drivers = with pkgs; [
|
|
||||||
cups-filters
|
|
||||||
cups-browsed
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue