mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:39:39 +00:00
Compare commits
3 commits
08f653d95d
...
084261c58e
| Author | SHA1 | Date | |
|---|---|---|---|
| 084261c58e | |||
| e65e37d3a9 | |||
| 1a33f45e18 |
6 changed files with 68 additions and 39 deletions
|
|
@ -58,6 +58,7 @@ in
|
||||||
./hetzner_benchmark/nixos/misc.nix
|
./hetzner_benchmark/nixos/misc.nix
|
||||||
./hetzner_benchmark/nixos/programs.nix
|
./hetzner_benchmark/nixos/programs.nix
|
||||||
./hetzner_benchmark/nixos/builder.nix
|
./hetzner_benchmark/nixos/builder.nix
|
||||||
|
./hetzner_benchmark/nixos/sane-nix.nix
|
||||||
|
|
||||||
../nixosModules/common/fish.nix
|
../nixosModules/common/fish.nix
|
||||||
../nixosModules/common/disable-command-not-found.nix
|
../nixosModules/common/disable-command-not-found.nix
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,7 @@
|
||||||
users.groups.remotebuild = { };
|
users.groups.remotebuild = { };
|
||||||
nix = {
|
nix = {
|
||||||
nrBuildUsers = 64; # defaults to 32
|
nrBuildUsers = 64; # defaults to 32
|
||||||
settings = {
|
settings.trusted-users = [ "remotebuild" ];
|
||||||
trusted-users = [ "remotebuild" ];
|
|
||||||
|
|
||||||
min-free = 50 * 1024 * 1024 * 1024; # start gc when < 10 GB is available
|
|
||||||
max-free = 100 * 1024 * 1024 * 1024; # stop gc when 20 GB is available
|
|
||||||
|
|
||||||
max-jobs = "auto";
|
|
||||||
cores = 0;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.nix-daemon.serviceConfig = {
|
systemd.services.nix-daemon.serviceConfig = {
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
{
|
{
|
||||||
# 500GB Storage
|
# 500GB Storage
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
min-free = 20 * 1024 * 1024 * 1024;
|
min-free = 50 * 1024 * 1024 * 1024;
|
||||||
max-free = 50 * 1024 * 1024 * 1024;
|
max-free = 100 * 1024 * 1024 * 1024;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.nix-daemon.serviceConfig = {
|
systemd.services.nix-daemon.serviceConfig = {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ library
|
||||||
hs-source-dirs: lib
|
hs-source-dirs: lib
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
XMonad.Layout.Reflect.Message
|
XMonad.Layout.Reflect.Message
|
||||||
|
XMonad.Layout.SetMasterNTall
|
||||||
Data.Char.Greek
|
Data.Char.Greek
|
||||||
|
|
||||||
executable leanamonad
|
executable leanamonad
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
|
||||||
|
|
||||||
|
-- Wraps ResizableTall, allows setting master count to a number directly
|
||||||
|
module XMonad.Layout.SetMasterNTall
|
||||||
|
( SetMasterNTall(..)
|
||||||
|
, SetMasterN(..)
|
||||||
|
) where
|
||||||
|
|
||||||
|
import XMonad
|
||||||
|
import qualified XMonad.StackSet as W
|
||||||
|
import XMonad.Layout.ResizableTile
|
||||||
|
|
||||||
|
-- Message
|
||||||
|
data SetMasterN = SetMasterN Int
|
||||||
|
instance Message SetMasterN
|
||||||
|
|
||||||
|
-- Layout
|
||||||
|
newtype SetMasterNTall a = SetMasterNTall { unSetMasterNTall :: ResizableTall a }
|
||||||
|
deriving (Read, Show)
|
||||||
|
|
||||||
|
instance LayoutClass SetMasterNTall a where
|
||||||
|
runLayout (W.Workspace t l s) =
|
||||||
|
let ws' = W.Workspace t (unSetMasterNTall l) s
|
||||||
|
in (fmap . fmap . fmap) SetMasterNTall . runLayout ws'
|
||||||
|
|
||||||
|
handleMessage (SetMasterNTall l@(ResizableTall _n0 d f s)) mess
|
||||||
|
| Just (SetMasterN n) <- fromMessage mess = pure $ Just $ SetMasterNTall $ ResizableTall n d f s
|
||||||
|
| otherwise = (fmap . fmap) SetMasterNTall . handleMessage l $ mess
|
||||||
|
|
||||||
|
description (SetMasterNTall l) = description l
|
||||||
|
|
@ -16,15 +16,14 @@ import XMonad.Hooks.OnPropertyChange
|
||||||
import XMonad.Hooks.RefocusLast
|
import XMonad.Hooks.RefocusLast
|
||||||
import XMonad.Hooks.StatusBar
|
import XMonad.Hooks.StatusBar
|
||||||
import XMonad.Layout.FocusTracking
|
import XMonad.Layout.FocusTracking
|
||||||
import XMonad.Layout.IfMax
|
|
||||||
import XMonad.Layout.Magnifier hiding (Toggle)
|
import XMonad.Layout.Magnifier hiding (Toggle)
|
||||||
import qualified XMonad.Layout.Magnifier as Mag
|
import qualified XMonad.Layout.Magnifier as Mag
|
||||||
import XMonad.Layout.NoBorders
|
import XMonad.Layout.NoBorders
|
||||||
import XMonad.Layout.PerWorkspace
|
|
||||||
import XMonad.Layout.Reflect
|
import XMonad.Layout.Reflect
|
||||||
import XMonad.Layout.Reflect.Message
|
import XMonad.Layout.Reflect.Message
|
||||||
import XMonad.Layout.Renamed
|
import XMonad.Layout.Renamed
|
||||||
import XMonad.Layout.ResizableTile
|
import XMonad.Layout.ResizableTile
|
||||||
|
import XMonad.Layout.SetMasterNTall
|
||||||
import XMonad.Layout.Spacing
|
import XMonad.Layout.Spacing
|
||||||
import XMonad.Layout.ToggleLayouts
|
import XMonad.Layout.ToggleLayouts
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
|
@ -72,26 +71,16 @@ main =
|
||||||
myLayout =
|
myLayout =
|
||||||
avoidStruts
|
avoidStruts
|
||||||
$ smartBorders
|
$ smartBorders
|
||||||
$ onWorkspace researchWS (toggleLayouts (mag tallr) full)
|
$ toggleLayouts (magnifierOff tallr) full
|
||||||
$ onWorkspace chatWS (toggleLayouts (mag tallr) full)
|
|
||||||
$ onWorkspace multimediaWS (toggleLayouts (mag tallr) full)
|
|
||||||
$ toggleLayouts (mag tallr) full
|
|
||||||
where
|
where
|
||||||
mag = magnifierOff
|
|
||||||
|
|
||||||
full = focusTracking Full
|
full = focusTracking Full
|
||||||
|
|
||||||
mkTallrN n =
|
|
||||||
smartSpacingWithEdge 5
|
|
||||||
$ reflectMsg . reflectHoriz
|
|
||||||
$ ResizableTall n (1/10) (3/7) []
|
|
||||||
|
|
||||||
tallr =
|
tallr =
|
||||||
renamed [ Replace "Tall" ]
|
renamed [ Replace "Tall" ]
|
||||||
$ ifMax 3 (mkTallrN 1)
|
$ smartSpacingWithEdge 5
|
||||||
$ ifMax 5 (mkTallrN 2)
|
$ reflectMsg . reflectHoriz
|
||||||
$ ifMax 7 (mkTallrN 3)
|
$ SetMasterNTall
|
||||||
$ mkTallrN 4
|
$ ResizableTall 1 (1/10) (3/7) []
|
||||||
|
|
||||||
isSioyek :: Query Bool
|
isSioyek :: Query Bool
|
||||||
isSioyek = className =? "sioyek"
|
isSioyek = className =? "sioyek"
|
||||||
|
|
@ -206,14 +195,33 @@ myEventHandleHook =
|
||||||
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
||||||
-- We prevent this by checking if the window is in the current workspace
|
-- We prevent this by checking if the window is in the current workspace
|
||||||
onTitleChange
|
onTitleChange
|
||||||
$ (windowIsInCurrentWorkspace -->)
|
( windowIsInCurrentWorkspace --> composeAll
|
||||||
$ composeAll
|
[ isSpotify --> doShiftAndGreedyView multimediaWS
|
||||||
[ isSpotify --> doShiftAndGreedyView multimediaWS
|
, isYouTube --> doShiftAndGreedyView multimediaWS
|
||||||
, isYouTube --> doShiftAndGreedyView multimediaWS
|
, isDiscord --> doShiftAndGreedyView chatWS
|
||||||
, isDiscord --> doShiftAndGreedyView chatWS
|
, isWhatsApp --> doShiftAndGreedyView chatWS
|
||||||
, isWhatsApp --> doShiftAndGreedyView chatWS
|
, isElement --> doShiftAndGreedyView chatWS
|
||||||
, isElement --> doShiftAndGreedyView chatWS
|
]
|
||||||
]
|
)
|
||||||
|
<> setMasterNEventHandleHook
|
||||||
|
|
||||||
|
setMasterNEventHandleHook :: Event -> X All
|
||||||
|
setMasterNEventHandleHook ev =
|
||||||
|
let adjustMasterCount :: X ()
|
||||||
|
adjustMasterCount = do
|
||||||
|
count <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||||
|
if count <= 3 then sendMessage (SetMasterN 1)
|
||||||
|
else if count <= 5 then sendMessage (SetMasterN 2)
|
||||||
|
else if count <= 7 then sendMessage (SetMasterN 3)
|
||||||
|
else pure ()
|
||||||
|
in do
|
||||||
|
case ev of
|
||||||
|
MapRequestEvent{} -> adjustMasterCount
|
||||||
|
ConfigureEvent{} -> adjustMasterCount
|
||||||
|
DestroyWindowEvent {} -> adjustMasterCount
|
||||||
|
_ -> pure ()
|
||||||
|
|
||||||
|
pure (All True)
|
||||||
|
|
||||||
doShiftAndGreedyView :: WorkspaceId -> Query (Endo WindowSet)
|
doShiftAndGreedyView :: WorkspaceId -> Query (Endo WindowSet)
|
||||||
doShiftAndGreedyView n = doF . go =<< ask
|
doShiftAndGreedyView n = doF . go =<< ask
|
||||||
|
|
@ -400,9 +408,6 @@ altMask = mod1Mask
|
||||||
myWorkspaces :: [WorkspaceId]
|
myWorkspaces :: [WorkspaceId]
|
||||||
myWorkspaces = map (:[]) $ take 8 greekLower
|
myWorkspaces = map (:[]) $ take 8 greekLower
|
||||||
|
|
||||||
researchWS :: WorkspaceId
|
|
||||||
researchWS = myWorkspaces !! 2
|
|
||||||
|
|
||||||
chatWS :: WorkspaceId
|
chatWS :: WorkspaceId
|
||||||
chatWS = myWorkspaces !! 3
|
chatWS = myWorkspaces !! 3
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue