mirror of
https://github.com/Horhik/dotfiles.git
synced 2024-11-25 09:31:34 +00:00
update xmonad config
This commit is contained in:
parent
5647b59fa9
commit
0af5eea4f0
|
@ -6,6 +6,8 @@ set -g @onedark_widgets "#(date +%s)"
|
|||
# set -g @plugin 'dracula/tmux'
|
||||
|
||||
# Theme
|
||||
|
||||
|
||||
set -g @dracula-show-powerline true
|
||||
|
||||
|
||||
|
|
|
@ -20,15 +20,43 @@ import XMonad.Util.Run
|
|||
import XMonad.Hooks.ManageDocks
|
||||
import XMonad.Layout.Gaps
|
||||
import XMonad.Layout.ToggleLayouts
|
||||
import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle))
|
||||
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
|
||||
import XMonad.Actions.MouseResize
|
||||
import XMonad.Util.Themes
|
||||
import XMonad.Util.EZConfig
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Layout.NoBorders (noBorders, smartBorders)
|
||||
import XMonad.Layout.Tabbed
|
||||
import XMonad.Hooks.DynamicLog
|
||||
import XMonad.Util.Scratchpad
|
||||
import XMonad.Util.NamedScratchpad
|
||||
|
||||
-- Layouts
|
||||
import XMonad.Layout.Accordion
|
||||
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
|
||||
import XMonad.Layout.ShowWName
|
||||
import XMonad.Layout.Simplest
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Layout.SubLayouts
|
||||
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
|
||||
import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle))
|
||||
import qualified XMonad.Layout.MultiToggle as MT (Toggle(..))
|
||||
|
||||
|
||||
import qualified Graphics.X11.ExtraTypes.XF86 as XF86
|
||||
|
||||
import qualified XMonad.StackSet as W
|
||||
|
@ -38,6 +66,7 @@ import GruvboxColors as Colors
|
|||
|
||||
|
||||
home = "/home/horhik/"
|
||||
myFont = "xft:Mononoki Nerd Font:regular:size=9:antialias=true:hinting=true"
|
||||
myTerminal = "alacritty"
|
||||
myEditor = "nvim"
|
||||
myMainDisplay = "eDP-1"
|
||||
|
@ -232,26 +261,111 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
|
|||
--
|
||||
defaultGapSize = 7;
|
||||
defaultGaps = gaps [(U,defaultGapSize), (R,defaultGapSize), (D, defaultGapSize), (L, defaultGapSize)]
|
||||
defaultSpaces = spacingRaw True (Border 7 7 7 7) True (Border 7 7 7 7) True
|
||||
spacesAndGaps = defaultSpaces . defaultGaps
|
||||
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
|
||||
|
||||
myTabConfig = def { inactiveBorderColor = commentColor
|
||||
, activeTextColor = selectionColor}
|
||||
myLayout = smartBorders . avoidStruts
|
||||
$ spacesAndGaps
|
||||
$ tiled ||| Mirror tiled ||| noBorders Full ||| simpleTabbed -- tabbed shrinkText (theme kavonAutumnTheme )
|
||||
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
|
||||
|
||||
spacesAndGaps = mySpacing 7 . defaultGaps
|
||||
|
||||
|
||||
|
||||
tall = renamed [Replace "tall"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
magnify = renamed [Replace "magnify"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ magnifier
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
monocle = renamed [Replace "monocle"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ limitWindows 20 Full
|
||||
floats = renamed [Replace "floats"]
|
||||
$ smartBorders
|
||||
$ limitWindows 20 simplestFloat
|
||||
grid = renamed [Replace "grid"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ limitWindows 12
|
||||
$ mySpacing 8
|
||||
$ mkToggle (single MIRROR)
|
||||
$ Grid (16/10)
|
||||
spirals = renamed [Replace "spirals"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ mySpacing' 8
|
||||
$ spiral (6/7)
|
||||
threeCol = renamed [Replace "threeCol"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ limitWindows 7
|
||||
$ ThreeCol 1 (3/100) (1/2)
|
||||
threeRow = renamed [Replace "threeRow"]
|
||||
$ smartBorders
|
||||
$ addTabs shrinkText myTabTheme
|
||||
$ subLayout [] (smartBorders Simplest)
|
||||
$ limitWindows 7
|
||||
-- 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 myTabTheme
|
||||
tallAccordion = renamed [Replace "tallAccordion"]
|
||||
$ Accordion
|
||||
wideAccordion = renamed [Replace "wideAccordion"]
|
||||
$ Mirror Accordion
|
||||
|
||||
-- setting colors for tabs layout and tabs sublayout.
|
||||
myTabTheme = def { fontName = myFont
|
||||
, activeColor = myFocusedBorderColor
|
||||
, inactiveColor = myNormalBorderColor
|
||||
, activeBorderColor = myFocusedBorderColor
|
||||
, inactiveBorderColor = myNormalBorderColor
|
||||
, activeTextColor = myNormalBorderColor
|
||||
, inactiveTextColor = purpleColor
|
||||
}
|
||||
|
||||
-- Theme for showWName which prints current workspace when you change workspaces.
|
||||
myShowWNameTheme :: SWNConfig
|
||||
myShowWNameTheme = def
|
||||
{ swn_font = "xft:Ubuntu:bold:size=60"
|
||||
, swn_fade = 1.0
|
||||
, swn_bgcolor = "#1c1f24"
|
||||
, swn_color = "#ffffff"
|
||||
}
|
||||
|
||||
-- The layout hook
|
||||
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats
|
||||
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
|
||||
where
|
||||
-- default tiling algorithm partitions the screen into two panes
|
||||
tiled = Tall nmaster delta ratio
|
||||
|
||||
-- The default number of windows in the master pane
|
||||
nmaster = 1
|
||||
|
||||
-- Default proportion of screen occupied by master pane
|
||||
ratio = 1/2
|
||||
|
||||
-- Percent of screen to increment by when resizing panes
|
||||
delta = 3/100
|
||||
myDefaultLayout = withBorder myBorderWidth tall
|
||||
||| noBorders magnify
|
||||
||| noBorders monocle
|
||||
||| floats
|
||||
||| noBorders tabs
|
||||
||| grid
|
||||
||| spirals
|
||||
||| threeCol
|
||||
||| threeRow
|
||||
||| noBorders tallAccordion
|
||||
||| noBorders wideAccordion
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Window rules:
|
||||
|
@ -473,7 +587,7 @@ defaults (bar0, bar1) = def {
|
|||
mouseBindings = myMouseBindings,
|
||||
|
||||
-- hooks, layouts
|
||||
layoutHook = myLayout,
|
||||
layoutHook = myLayoutHook,
|
||||
manageHook = myManageHook,
|
||||
handleEventHook = myEventHook,
|
||||
logHook = myLogHook (bar0, bar1),
|
||||
|
|
Loading…
Reference in a new issue