aboutsummaryrefslogtreecommitdiff
path: root/gui/conf/qtile.py
blob: bfda21ff5dd0787e59ff06e274fe7dda99707164 (plain)
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
124
125
126
127
128
129
130
131
132
133
from libqtile.config import Key, Screen, Group, Drag, Click, ScratchPad, DropDown
from libqtile.command import lazy
from libqtile import layout, bar, widget

from typing import List

mod = "mod4"

def hide_show_bar(qtile):
    bar = qtile.currentScreen.top
    if bar.is_show():
        bar.show(is_show=False)
    else:
        bar.show(is_show=True)
    qtile.currentGroup.layoutAll()

keys = [
    Key([mod], "k", lazy.layout.down()),
    Key([mod], "j", lazy.layout.up()),

    Key([mod, "shift"], "k", lazy.layout.shuffle_down()),
    Key([mod, "shift"], "j", lazy.layout.shuffle_up()),

    Key([mod], "l", lazy.layout.next()),
    Key([mod], "h", lazy.layout.previous()),

    Key([mod], "s", lazy.layout.toggle_split()),

    Key([mod], "Return", lazy.spawn("kitty")),
    Key([mod, "shift"], "Return", lazy.spawn("nvim-qt --no-ext-tabline")),

    Key([mod], "v", lazy.next_layout()),

    Key([mod, "shift"], "q", lazy.window.kill()),

    Key(["control", "mod1"], "Escape",    lazy.shutdown()),
    Key(["control", "mod1"], "BackSpace", lazy.restart()),

    Key([mod], "space", lazy.spawn("rofi -show combi")),

    Key([mod, "shift"], "b", lazy.function(hide_show_bar)),

    Key([], "Menu", lazy.group['scratchpad'].dropdown_toggle('term'))
]

groups = [ Group(i) for i in "1234567890" ]

for i in groups:
    keys.extend([
        Key([mod], i.name, lazy.group[i.name].toscreen()),
        Key([mod, "shift"], i.name, lazy.window.togroup(i.name)),
    ])

groups += [ScratchPad("scratchpad", [
    DropDown("term", "kitty")
])]

layouts = [
    layout.Max(),
    layout.Stack(
        num_stacks=2,
        border_focus="#909636",
        border_normal="#161616",
        border_width=4
    ),
    layout.Stack(
        num_stacks=3,
        border_focus="#909636",
        border_normal="#161616",
        border_width=4
    )
]

widget_defaults = dict(
    font='Iosevka',
    fontsize=12,
    padding=2,
)
extension_defaults = widget_defaults.copy()

screens = [
    Screen(
        top=bar.Bar(
            [
                widget.GroupBox(
                    foreground = '#161616',
                    active = '#161616',
                    inactive = '#161616',
                    disable_drag = True,
                    this_current_screen_border = '#161616',
                ),
                widget.WindowName(
                    foreground = '#161616',
                ),
                widget.Clock(
                    foreground = '#161616',
                    format = '%Y-%m-%d %R'
                ),
            ],
            24,
            background = "#909636",
        ),
    ),
]

mouse = [
    Drag([mod], "Button1", lazy.window.set_position_floating(),
         start=lazy.window.get_position()),
    Drag([mod], "Button3", lazy.window.set_size_floating(),
         start=lazy.window.get_size()),
    Click([mod], "Button2", lazy.window.bring_to_front())
]

dgroups_key_binder = None
dgroups_app_rules = []  # type: List
main = None
follow_mouse_focus = True
bring_front_click = False
cursor_warp = True
floating_layout = layout.Floating(float_rules=[
    {'wmclass': 'confirm'},
    {'wmclass': 'dialog'},
    {'wmclass': 'download'},
    {'wmclass': 'error'},
    {'wmclass': 'file_progress'},
    {'wmclass': 'notification'},
    {'wmclass': 'splash'},
    {'wmclass': 'toolbar'},
    {'wname': 'pinentry'},
    {'wmclass': 'ssh-askpass'},
])
auto_fullscreen = True
focus_on_window_activation = "smart"