This repository was archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathlayouts.py
123 lines (115 loc) · 4.09 KB
/
layouts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
'''
My group/workspace layouts.
The built in layouts can be found here:
http://docs.qtile.org/en/latest/manual/ref/layouts.html
Look at porting some Xmonad layouts to qtile:
https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Layout/Circle.hs
https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Layout/Cross.hs
>> Try cribbing from what the XmonadTall layout does:
http://qtile.readthedocs.io/en/latest/_modules/libqtile/layout/xmonad.html#MonadTall
'''
from settings import COLS, FONT_PARAMS
from libqtile import layout
# Annoyingly, there isn't a common subset of parameters for all layouts that
# can be passed as a dict splat. There _are_ some common ones for multiple
# layouts, so they are defined here and used where possible to give a
# consistent UI.
BORDER_NORMAL = COLS["dark_2"]
# BORDER_FOCUS = COLS["blue_2"]
BORDER_FOCUS = COLS["red_1"]
BORDER_WIDTH = 3
MARGIN = 10
layouts = [
# XXX : Emulating BSPWM (but not matching it) setting fair=False will
# cause
layout.Bsp(
border_normal=BORDER_NORMAL,
border_focus=BORDER_FOCUS,
border_width=BORDER_WIDTH,
margin=MARGIN,
fair=False,
),
# XXX : My default layout. Single window fills the screen and it can
# keep a stack of secondary windows off to the side quite easily.
layout.MonadTall(
border_normal=BORDER_NORMAL,
border_focus=BORDER_FOCUS,
border_width=BORDER_WIDTH,
margin=MARGIN,
ratio=0.7,
),
# XXX : Same idea as MonadTall but the smaller windows are along the
# top/bottom of the main window
layout.MonadWide(
border_normal=BORDER_NORMAL,
border_focus=BORDER_FOCUS,
border_width=BORDER_WIDTH,
margin=MARGIN,
ratio=0.9,
),
# XXX : Good for browser style flipping between windows when working on
# large coding projects (beats constant buffer/tab swaps in Vim!)
layout.TreeTab(
inactive_fg=COLS["light_0"],
inactive_bg=BORDER_NORMAL,
active_bg=COLS["light_3"],
active_fg=BORDER_NORMAL,
sections=[" .: Windows :."],
# Want a consistant font w. the terminal here
foreground=FONT_PARAMS["foreground"],
fontsize=FONT_PARAMS["fontsize"],
font="ProFontWindows Nerd Font Mono Book",
),
# XXX : Emulate Wmii tiling: each new window adds to the focused
# column. Moving a window "out" of the current colmun creates
# a new column.
layout.Wmii(
border_normal=BORDER_NORMAL,
border_focus=BORDER_FOCUS,
border_width=BORDER_WIDTH,
margin=MARGIN,
),
# XXX : A simple grid fill of the screen aiming for square number tilings
# at the expense of leaving blank positions if it correctly places
# the remaining windows.
# layout.Matrix(
# border_normal=BORDER_NORMAL,
# border_focus=BORDER_FOCUS,
# border_width=BORDER_WIDTH,
# margin=MARGIN,
# ),
# XXX: Split the screen according to a given ratio. Kind of tricky to
# know exactly what it will do without experimenting...!
# layout.RatioTile(
# border_normal=BORDER_NORMAL,
# border_focus=BORDER_FOCUS,
# border_width=BORDER_WIDTH,
# margin=MARGIN,
# ratio=2.5
# ),
]
# Specification for auto floating windows: this isn't a layout in the same
# way as the ones listed above.
floating_layout = layout.Floating(
border_normal=BORDER_NORMAL,
border_focus=BORDER_FOCUS,
border_width=BORDER_WIDTH,
float_rules=[
{'wmclass': 'confirm'},
{'wmclass': 'dialog'},
{'wmclass': 'download'},
{'wmclass': 'error'},
{'wmclass': 'file_progress'},
{'wmclass': 'notification'},
{'wmclass': 'splash'},
{'wmclass': 'toolbar'},
{'wmclass': 'gcr-prompter'},
{'wmclass': 'confirmreset'},
{'wmclass': 'makebranch'},
{'wmclass': 'maketag'},
{'wmclass': 'peek'},
{'wname': 'branchdialog'},
{'wname': 'pinentry'},
{'wmclass': 'ssh-askpass'},
]
)