Mostly done now, except for some popups and tweaking. We have a top bar with dmenu launcher, 9 workspaces, window buttons, thermal monitor, graphs, battery monitor, wifi monitor, sound monitors, system tray, layout indicator, datetime, update counter and screen indicator. On the bottom is a debug bar (only shown when debug=true in config) which is pretty useless at the moment.
This commit is contained in:
parent
a5ef8739db
commit
2df1347241
24 changed files with 721 additions and 51 deletions
99
kuro/base.py
99
kuro/base.py
|
@ -1,4 +1,6 @@
|
|||
from libqtile import layout as libqtile_layout
|
||||
from libqtile import layout as libqtile_layout, layout, bar, widget
|
||||
from libqtile.command import lazy
|
||||
from libqtile.config import Key, Group, Screen, Drag, Click
|
||||
|
||||
|
||||
class BaseConfig:
|
||||
|
@ -25,7 +27,22 @@ class BaseTheme:
|
|||
follow_mouse_focus = True
|
||||
bring_front_click = False
|
||||
cursor_warp = False
|
||||
floating_layout = libqtile_layout.Floating()
|
||||
floating_layout = libqtile_layout.Floating(float_rules=[
|
||||
{'wmclass': 'confirm'},
|
||||
{'wmclass': 'dialog'},
|
||||
{'wmclass': 'download'},
|
||||
{'wmclass': 'error'},
|
||||
{'wmclass': 'file_progress'},
|
||||
{'wmclass': 'notification'},
|
||||
{'wmclass': 'splash'},
|
||||
{'wmclass': 'toolbar'},
|
||||
{'wmclass': 'confirmreset'}, # gitk
|
||||
{'wmclass': 'makebranch'}, # gitk
|
||||
{'wmclass': 'maketag'}, # gitk
|
||||
{'wname': 'branchdialog'}, # gitk
|
||||
{'wname': 'pinentry'}, # GPG key password entry
|
||||
{'wmclass': 'ssh-askpass'}, # ssh-askpass
|
||||
])
|
||||
auto_fullscreen = True
|
||||
focus_on_window_activation = "smart"
|
||||
extensions = []
|
||||
|
@ -48,22 +65,88 @@ class BaseTheme:
|
|||
self.screens = self.init_screens()
|
||||
|
||||
def init_keys(self):
|
||||
return []
|
||||
return [
|
||||
# Switch between windows in current stack pane
|
||||
Key(["mod4"], "k", lazy.layout.down()),
|
||||
Key(["mod4"], "j", lazy.layout.up()),
|
||||
|
||||
# Move windows up or down in current stack
|
||||
Key(["mod4", "control"], "k", lazy.layout.shuffle_down()),
|
||||
Key(["mod4", "control"], "j", lazy.layout.shuffle_up()),
|
||||
|
||||
# Switch window focus to other pane(s) of stack
|
||||
Key(["mod4"], "space", lazy.layout.next()),
|
||||
|
||||
# Swap panes of split stack
|
||||
Key(["mod4", "shift"], "space", lazy.layout.rotate()),
|
||||
|
||||
# Toggle between split and unsplit sides of stack.
|
||||
# Split = all windows displayed
|
||||
# Unsplit = 1 window displayed, like Max layout, but still with
|
||||
# multiple stack panes
|
||||
Key(["mod4", "shift"], "Return", lazy.layout.toggle_split()),
|
||||
Key(["mod4"], "Return", lazy.spawn("xterm")),
|
||||
|
||||
# Toggle between different layouts as defined below
|
||||
Key(["mod4"], "Tab", lazy.next_layout()),
|
||||
Key(["mod4"], "w", lazy.window.kill()),
|
||||
|
||||
Key(["mod4", "control"], "r", lazy.restart()),
|
||||
Key(["mod4", "control"], "q", lazy.shutdown()),
|
||||
Key(["mod4"], "r", lazy.spawncmd()),
|
||||
]
|
||||
|
||||
def init_groups(self):
|
||||
return []
|
||||
groups = [Group(i) for i in "asdfuiop"]
|
||||
for i in groups:
|
||||
self.keys.extend([
|
||||
# mod1 + letter of group = switch to group
|
||||
Key(["mod4"], i.name, lazy.group[i.name].toscreen()),
|
||||
|
||||
# mod1 + shift + letter of group = switch to & move focused window to group
|
||||
Key(["mod4", "shift"], i.name, lazy.window.togroup(i.name)),
|
||||
])
|
||||
return groups
|
||||
|
||||
def init_layouts(self):
|
||||
return []
|
||||
return [
|
||||
layout.Max(),
|
||||
layout.Stack(num_stacks=2)
|
||||
]
|
||||
|
||||
def init_widget_defaults(self):
|
||||
return {}
|
||||
return dict(
|
||||
font='sans',
|
||||
fontsize=12,
|
||||
padding=3,
|
||||
)
|
||||
|
||||
def init_screens(self):
|
||||
return []
|
||||
# noinspection PyUnresolvedReferences
|
||||
return [
|
||||
Screen(
|
||||
bottom=bar.Bar(
|
||||
[
|
||||
widget.GroupBox(),
|
||||
widget.Prompt(),
|
||||
widget.WindowName(),
|
||||
widget.TextBox("Kuro BaseConfig", foreground="#ff0000", name="default"),
|
||||
widget.Systray(),
|
||||
widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
|
||||
],
|
||||
24,
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
def init_mouse(self):
|
||||
return []
|
||||
return [
|
||||
Drag(["mod4"], "Button1", lazy.window.set_position_floating(),
|
||||
start=lazy.window.get_position()),
|
||||
Drag(["mod4"], "Button3", lazy.window.set_size_floating(),
|
||||
start=lazy.window.get_size()),
|
||||
Click(["mod4"], "Button2", lazy.window.bring_to_front())
|
||||
]
|
||||
|
||||
# Callbacks
|
||||
def callback_startup_once(self, *args, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue