mirror of
https://github.com/Horhik/dotfiles.git
synced 2024-11-25 17:41:32 +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'
|
# set -g @plugin 'dracula/tmux'
|
||||||
|
|
||||||
# Theme
|
# Theme
|
||||||
|
|
||||||
|
|
||||||
set -g @dracula-show-powerline true
|
set -g @dracula-show-powerline true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,43 @@ import XMonad.Util.Run
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
import XMonad.Layout.Gaps
|
import XMonad.Layout.Gaps
|
||||||
import XMonad.Layout.ToggleLayouts
|
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.Themes
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import XMonad.Layout.Spacing
|
import XMonad.Layout.Spacing
|
||||||
import XMonad.Layout.NoBorders (noBorders, smartBorders)
|
import XMonad.Layout.NoBorders (noBorders, smartBorders)
|
||||||
import XMonad.Layout.Tabbed
|
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
import XMonad.Util.Scratchpad
|
import XMonad.Util.Scratchpad
|
||||||
import XMonad.Util.NamedScratchpad
|
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 Graphics.X11.ExtraTypes.XF86 as XF86
|
||||||
|
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
@ -38,6 +66,7 @@ import GruvboxColors as Colors
|
||||||
|
|
||||||
|
|
||||||
home = "/home/horhik/"
|
home = "/home/horhik/"
|
||||||
|
myFont = "xft:Mononoki Nerd Font:regular:size=9:antialias=true:hinting=true"
|
||||||
myTerminal = "alacritty"
|
myTerminal = "alacritty"
|
||||||
myEditor = "nvim"
|
myEditor = "nvim"
|
||||||
myMainDisplay = "eDP-1"
|
myMainDisplay = "eDP-1"
|
||||||
|
@ -232,26 +261,111 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||||
--
|
--
|
||||||
defaultGapSize = 7;
|
defaultGapSize = 7;
|
||||||
defaultGaps = gaps [(U,defaultGapSize), (R,defaultGapSize), (D, defaultGapSize), (L, defaultGapSize)]
|
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
|
mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||||
spacesAndGaps = defaultSpaces . defaultGaps
|
mySpacing i = spacingRaw False (Border i i i i) True (Border i i i i) True
|
||||||
|
|
||||||
myTabConfig = def { inactiveBorderColor = commentColor
|
mySpacing' :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||||
, activeTextColor = selectionColor}
|
mySpacing' i = spacingRaw True (Border i i i i) True (Border i i i i) True
|
||||||
myLayout = smartBorders . avoidStruts
|
|
||||||
$ spacesAndGaps
|
spacesAndGaps = mySpacing 7 . defaultGaps
|
||||||
$ tiled ||| Mirror tiled ||| noBorders Full ||| simpleTabbed -- tabbed shrinkText (theme kavonAutumnTheme )
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
where
|
||||||
-- default tiling algorithm partitions the screen into two panes
|
myDefaultLayout = withBorder myBorderWidth tall
|
||||||
tiled = Tall nmaster delta ratio
|
||| noBorders magnify
|
||||||
|
||| noBorders monocle
|
||||||
-- The default number of windows in the master pane
|
||| floats
|
||||||
nmaster = 1
|
||| noBorders tabs
|
||||||
|
||| grid
|
||||||
-- Default proportion of screen occupied by master pane
|
||| spirals
|
||||||
ratio = 1/2
|
||| threeCol
|
||||||
|
||| threeRow
|
||||||
-- Percent of screen to increment by when resizing panes
|
||| noBorders tallAccordion
|
||||||
delta = 3/100
|
||| noBorders wideAccordion
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- Window rules:
|
-- Window rules:
|
||||||
|
@ -473,7 +587,7 @@ defaults (bar0, bar1) = def {
|
||||||
mouseBindings = myMouseBindings,
|
mouseBindings = myMouseBindings,
|
||||||
|
|
||||||
-- hooks, layouts
|
-- hooks, layouts
|
||||||
layoutHook = myLayout,
|
layoutHook = myLayoutHook,
|
||||||
manageHook = myManageHook,
|
manageHook = myManageHook,
|
||||||
handleEventHook = myEventHook,
|
handleEventHook = myEventHook,
|
||||||
logHook = myLogHook (bar0, bar1),
|
logHook = myLogHook (bar0, bar1),
|
||||||
|
|
Loading…
Reference in a new issue