mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 19:40:24 +10:00
Adding a MyLayouts module for XMonad.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
-- Custom (my personal configs)
|
||||
import Custom.MyGridMenu
|
||||
import Custom.MyKeys
|
||||
import Custom.MyLayouts
|
||||
import Custom.MyPrompts
|
||||
import Custom.MyScratchpads
|
||||
import Custom.MyTreeMenu
|
||||
@@ -42,27 +43,6 @@ import XMonad.Hooks.ServerMode
|
||||
import XMonad.Hooks.SetWMName
|
||||
import XMonad.Hooks.WorkspaceHistory
|
||||
|
||||
-- Layouts
|
||||
import XMonad.Layout.GridVariants (Grid(Grid))
|
||||
import XMonad.Layout.SimplestFloat
|
||||
import XMonad.Layout.Spiral
|
||||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Layout.Tabbed
|
||||
import XMonad.Layout.ThreeColumns
|
||||
|
||||
-- Layouts modifiers
|
||||
import XMonad.Layout.LayoutModifier
|
||||
import XMonad.Layout.LimitWindows (limitWindows, increaseLimit, decreaseLimit)
|
||||
import XMonad.Layout.Magnifier
|
||||
import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), (??))
|
||||
import XMonad.Layout.MultiToggle.Instances (StdTransformers(NBFULL, MIRROR, NOBORDERS))
|
||||
import XMonad.Layout.NoBorders
|
||||
import XMonad.Layout.Renamed (renamed, Rename(Replace))
|
||||
import XMonad.Layout.ShowWName
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
|
||||
import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle))
|
||||
|
||||
-- Utilities
|
||||
import XMonad.Util.EZConfig (additionalKeysP)
|
||||
import XMonad.Util.NamedScratchpad
|
||||
@@ -83,29 +63,6 @@ myStartupHook = do
|
||||
-- spawnOnce "kak -d -s mysession &"
|
||||
setWMName "LG3D"
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- MENUS FOR GRIDSELECT AND TREESELECT
|
||||
------------------------------------------------------------------------
|
||||
-- The lists below are actually 3-tuples for use with gridSelect and treeSelect.
|
||||
-- TreeSelect uses all three values in the 3-tuples but GridSelect only needs first
|
||||
-- two values in each list (see myAppGrid, myBookmarkGrid and myConfigGrid below).
|
||||
|
||||
|
||||
myBookmarks :: [(String, String, String)]
|
||||
myBookmarks = [ ("DistroTube.com", myBrowser ++ "https://www.distrotube.com", "Official website for DistroTube")
|
||||
, ("DistroWatch", myBrowser ++ "https://www.distrowatch.com", "DistroWatch Release Announcements")
|
||||
, ("Arch Linux", myBrowser ++ "https://www.archlinux.org/", "Official website for Arch Linux")
|
||||
, ("Arch User Repository", myBrowser ++ "https://aur.archlinux.org/", "The Arch User Repository AUR")
|
||||
, ("Arch Wiki", myBrowser ++ "https://wiki.archlinux.org/", "The Arch Wiki")
|
||||
, ("LBRY", myBrowser ++ "https://lbry.tv/@DistroTube:2", "DistroTube on LBRY")
|
||||
, ("GitLab", myBrowser ++ "https://gitlab.com/dwt1", "GitLab Page for DistroTube")
|
||||
, ("Patreon", myBrowser ++ "https://www.patreon.com/distrotube", "DT on Patreon")
|
||||
, ("Diaspora", myBrowser ++ "https://diasp.org/stream", "DT on Diaspora")
|
||||
, ("Mastodon", myBrowser ++ "https://mastodon.technology/web/accounts/85897", "DT on Mastodon")
|
||||
, ("Reddit", myBrowser ++ "https://www.reddit.com/r/distrotube/", "r/DistroTube")
|
||||
, ("YouTube", myBrowser ++ "https://www.youtube.com/c/DistroTube?view_as=subscriber", "DT on YouTube")
|
||||
]
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- WORKSPACES
|
||||
------------------------------------------------------------------------
|
||||
@@ -165,90 +122,6 @@ myLogHook :: X ()
|
||||
myLogHook = fadeInactiveLogHook fadeAmount
|
||||
where fadeAmount = 1.0
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- LAYOUTS
|
||||
------------------------------------------------------------------------
|
||||
-- Makes setting the spacingRaw simpler to write. The spacingRaw
|
||||
-- module adds a configurable amount of space around windows.
|
||||
mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||
mySpacing i = spacingRaw False (Border i i i i) True (Border i i i i) True
|
||||
|
||||
-- Below is a variation of the above except no borders are applied
|
||||
-- if fewer than two windows. So a single window has no gaps.
|
||||
mySpacing' :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||
mySpacing' i = spacingRaw True (Border i i i i) True (Border i i i i) True
|
||||
|
||||
-- Defining a bunch of layouts, many that I don't use.
|
||||
tall = renamed [Replace "tall"]
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
magnify = renamed [Replace "magnify"]
|
||||
$ magnifier
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
monocle = renamed [Replace "monocle"]
|
||||
$ limitWindows 20 Full
|
||||
floats = renamed [Replace "floats"]
|
||||
$ limitWindows 20 simplestFloat
|
||||
grid = renamed [Replace "grid"]
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ mkToggle (single MIRROR)
|
||||
$ Grid (16/10)
|
||||
spirals = renamed [Replace "spirals"]
|
||||
$ mySpacing' 8
|
||||
$ spiral (6/7)
|
||||
threeCol = renamed [Replace "threeCol"]
|
||||
$ limitWindows 7
|
||||
$ mySpacing' 4
|
||||
$ ThreeCol 1 (3/100) (1/2)
|
||||
threeRow = renamed [Replace "threeRow"]
|
||||
$ limitWindows 7
|
||||
$ mySpacing' 4
|
||||
-- Mirror takes a layout and rotates it by 90 degrees.
|
||||
-- So we are applying Mirror to the ThreeCol layout.
|
||||
$ Mirror
|
||||
$ ThreeCol 1 (3/100) (1/2)
|
||||
tabs = renamed [Replace "tabs"]
|
||||
-- I cannot add spacing to this layout because it will
|
||||
-- add spacing between window and tabs which looks bad.
|
||||
$ tabbed shrinkText myTabConfig
|
||||
where
|
||||
myTabConfig = def { fontName = "xft:Mononoki Nerd Font:regular:pixelsize=11"
|
||||
, activeColor = "#292d3e"
|
||||
, inactiveColor = "#3e445e"
|
||||
, activeBorderColor = "#292d3e"
|
||||
, inactiveBorderColor = "#292d3e"
|
||||
, activeTextColor = "#ffffff"
|
||||
, inactiveTextColor = "#d0d0d0"
|
||||
}
|
||||
|
||||
-- Theme for showWName which prints current workspace when you change workspaces.
|
||||
myShowWNameTheme :: SWNConfig
|
||||
myShowWNameTheme = def
|
||||
{ swn_font = "xft:Sans:bold:size=60"
|
||||
, swn_fade = 1.0
|
||||
, swn_bgcolor = "#000000"
|
||||
, swn_color = "#FFFFFF"
|
||||
}
|
||||
|
||||
-- The layout hook
|
||||
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats $
|
||||
mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
|
||||
where
|
||||
-- I've commented out the layouts I don't use.
|
||||
myDefaultLayout = tall
|
||||
||| magnify
|
||||
||| noBorders monocle
|
||||
||| floats
|
||||
-- ||| grid
|
||||
||| noBorders tabs
|
||||
-- ||| spirals
|
||||
-- ||| threeCol
|
||||
-- ||| threeRow
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- MAIN
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user