restructured qtile configs and added gitignore
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# coding = utf-8
|
||||
from libqtile import bar, widget
|
||||
|
||||
widget_defaults = dict(
|
||||
font='sans',
|
||||
fontsize=12,
|
||||
padding=3,
|
||||
)
|
||||
extension_defaults = widget_defaults.copy()
|
||||
|
||||
|
||||
main_bar = bar.Bar([
|
||||
widget.CurrentLayoutIcon(),
|
||||
widget.GroupBox(),
|
||||
widget.Prompt(),
|
||||
widget.WindowName(),
|
||||
widget.Systray(),
|
||||
widget.TextBox("Vol:"),
|
||||
widget.Volume(),
|
||||
widget.CPU(format='CPU: {load_percent}%'),
|
||||
widget.Memory(format='RAM: {MemUsed}MB'),
|
||||
widget.Memory(format='Swap: {SwapUsed}MB'),
|
||||
widget.NetGraph(),
|
||||
widget.Clock(format='%Y-%m-%d %H:%M'),
|
||||
],24)
|
||||
|
||||
left_bar = bar.Bar([
|
||||
widget.CurrentLayoutIcon(),
|
||||
widget.GroupBox(),
|
||||
widget.WindowName(),
|
||||
],24)
|
||||
|
||||
top_bar = bar.Bar([
|
||||
widget.CurrentLayoutIcon(),
|
||||
widget.GroupBox(),
|
||||
widget.WindowName(),
|
||||
],24)
|
||||
@@ -28,149 +28,12 @@
|
||||
|
||||
#endregion
|
||||
|
||||
from typing import List # noqa: F401
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
from libqtile import bar, layout, widget, hook
|
||||
from libqtile.config import Click, Drag, Group, Key, Screen
|
||||
from libqtile.lazy import lazy
|
||||
|
||||
mod = "mod4"
|
||||
terminal = "termite"
|
||||
|
||||
#region key_and_mouse_bindings
|
||||
|
||||
keys = [
|
||||
# moving windows around
|
||||
Key([mod], "h", lazy.layout.left()),
|
||||
Key([mod], "l", lazy.layout.right()),
|
||||
Key([mod], "j", lazy.layout.down()),
|
||||
Key([mod], "k", lazy.layout.up()),
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||
Key([mod, "shift"], "j", lazy.layout.shuffle_down()),
|
||||
Key([mod, "shift"], "k", lazy.layout.shuffle_up()),
|
||||
|
||||
# resize windows
|
||||
Key([mod], "plus", lazy.layout.grow()),
|
||||
Key([mod], "minus", lazy.layout.shrink()),
|
||||
Key([mod], "n", lazy.layout.normalize()),
|
||||
Key([mod], "o", lazy.layout.maximize()),
|
||||
Key([mod], "space", lazy.window.toggle_fullscreen()),
|
||||
|
||||
# app hotkeys
|
||||
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
|
||||
Key([mod],"f", lazy.spawn("firefox"),desc="Launch firefox"),
|
||||
Key([mod],"e", lazy.spawn("pcmanfm"),desc="Launch pcmanfm"),
|
||||
Key([mod],"c", lazy.spawn("code"),desc="Launch visual studio code"),
|
||||
|
||||
# Toggle between different layouts as defined below
|
||||
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
|
||||
Key([mod], "BackSpace", lazy.window.kill(), desc="Kill focused window"),
|
||||
|
||||
# qtile hotkeys
|
||||
Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"),
|
||||
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"),
|
||||
Key([mod], "r", lazy.spawncmd(),desc="Spawn a command using a prompt widget"),
|
||||
|
||||
# Media hotkeys
|
||||
Key([], 'XF86AudioRaiseVolume', lazy.spawn('pulseaudio-ctl up 1')),
|
||||
Key([], 'XF86AudioLowerVolume', lazy.spawn('pulseaudio-ctl down 1')),
|
||||
Key([], 'XF86AudioMute', lazy.spawn('pulseaudio-ctl mute')),
|
||||
]
|
||||
|
||||
|
||||
# Drag floating layouts.
|
||||
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())
|
||||
]
|
||||
#endregion
|
||||
|
||||
#region groups
|
||||
groups = [Group(i) for i in "asdfuiop"]
|
||||
|
||||
for i in groups:
|
||||
keys.extend([
|
||||
# mod1 + letter of group = switch to group
|
||||
Key(["mod1","control"], i.name, lazy.group[i.name].toscreen(),
|
||||
desc="Switch to group {}".format(i.name)),
|
||||
|
||||
# mod1 + shift + letter of group = switch to & move focused window to group
|
||||
Key(["mod1","control", "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
|
||||
desc="Switch to & move focused window to group {}".format(i.name)),
|
||||
# Or, use below if you prefer not to switch to that group.
|
||||
# # mod1 + shift + letter of group = move focused window to group
|
||||
# Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
|
||||
# desc="move focused window to group {}".format(i.name)),
|
||||
])
|
||||
#endregion
|
||||
|
||||
#region layouts
|
||||
focus_color = '#bd93f9'
|
||||
layouts = [
|
||||
layout.MonadTall(
|
||||
border_focus = focus_color,
|
||||
border_width = 2,
|
||||
new_at_current = True,
|
||||
),
|
||||
layout.Floating(
|
||||
border_focus = focus_color,
|
||||
),
|
||||
layout.Max(),
|
||||
layout.MonadWide(
|
||||
border_focus = focus_color,
|
||||
border_width = 2,
|
||||
new_at_current = True,
|
||||
),
|
||||
]
|
||||
#endregion
|
||||
|
||||
#region widgets_and_screens
|
||||
|
||||
widget_defaults = dict(
|
||||
font='sans',
|
||||
fontsize=12,
|
||||
padding=3,
|
||||
)
|
||||
extension_defaults = widget_defaults.copy()
|
||||
|
||||
main_bar = [
|
||||
widget.CurrentLayout(),
|
||||
widget.GroupBox(),
|
||||
widget.Prompt(),
|
||||
widget.WindowName(),
|
||||
widget.Systray(),
|
||||
widget.TextBox("Vol:"),
|
||||
widget.Volume(),
|
||||
widget.CPU(format='CPU: {load_percent}%',
|
||||
update_interval=2),
|
||||
widget.Clock(format='%Y-%m-%d %a %H:%M'),
|
||||
]
|
||||
|
||||
left_bar = [
|
||||
widget.CurrentLayout(),
|
||||
widget.GroupBox(),
|
||||
widget.WindowName(),
|
||||
]
|
||||
|
||||
top_bar = [
|
||||
widget.CurrentLayout(),
|
||||
widget.GroupBox(),
|
||||
widget.WindowName(),
|
||||
]
|
||||
|
||||
screens = [
|
||||
Screen(bottom=bar.Bar(top_bar,24)),
|
||||
Screen(top=bar.Bar(main_bar,24)),
|
||||
Screen(top=bar.Bar(left_bar,24)),
|
||||
]
|
||||
|
||||
#endregion
|
||||
#import custom files
|
||||
from keys import keys, mouse
|
||||
from screens import screens
|
||||
from layouts import layouts
|
||||
|
||||
#region miscelanious
|
||||
dgroups_key_binder = None
|
||||
@@ -179,23 +42,6 @@ main = None # WARNING: this is deprecated and will be removed soon
|
||||
follow_mouse_focus = True
|
||||
bring_front_click = False
|
||||
cursor_warp = False
|
||||
floating_layout = layout.Floating(float_rules=[
|
||||
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||
{'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"
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
term = 'termite'
|
||||
focus_color = '#bd93f9'
|
||||
border_width = 2
|
||||
mod = 'mod4'
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from libqtile.config import Group#, ScratchPad, DropDown
|
||||
|
||||
from defines import term
|
||||
|
||||
groups = [Group(i) for i in "asdfuiop"]
|
||||
#groups = [
|
||||
# Group("code", spawn="code", layout="monadtall", persist=True),
|
||||
# Group("chat", spawn=["firefox https://web.whatsapp.com/","discord"],layout="monadwide",persist=True),
|
||||
# Group("spot", spawn="spotify",layout="max", persist=True),
|
||||
# ScratchPad("scratch",[DropDown('term',term)])
|
||||
#]
|
||||
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env python
|
||||
# coding = utf-8
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from libqtile.config import Key, Drag, Click
|
||||
from libqtile.command import lazy
|
||||
|
||||
from groups import groups
|
||||
from defines import mod, term
|
||||
|
||||
keys = [
|
||||
# moving windows around
|
||||
Key([mod], "h", lazy.layout.left()),
|
||||
Key([mod], "l", lazy.layout.right()),
|
||||
Key([mod], "j", lazy.layout.down()),
|
||||
Key([mod], "k", lazy.layout.up()),
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||
Key([mod, "shift"], "j", lazy.layout.shuffle_down()),
|
||||
Key([mod, "shift"], "k", lazy.layout.shuffle_up()),
|
||||
|
||||
# resize windows
|
||||
Key([mod], "plus", lazy.layout.grow()),
|
||||
Key([mod], "minus", lazy.layout.shrink()),
|
||||
Key([mod], "n", lazy.layout.normalize()),
|
||||
Key([mod], "o", lazy.layout.maximize()),
|
||||
Key([mod], "space", lazy.window.toggle_fullscreen()),
|
||||
|
||||
# app hotkeys
|
||||
Key([mod], "Return", lazy.spawn(term), desc="Launch terminal"),
|
||||
Key([mod],"f", lazy.spawn("firefox"),desc="Launch firefox"),
|
||||
Key([mod],"e", lazy.spawn("pcmanfm"),desc="Launch pcmanfm"),
|
||||
Key([mod],"c", lazy.spawn("code"),desc="Launch visual studio code"),
|
||||
|
||||
# Toggle between different layouts as defined below
|
||||
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
|
||||
Key([mod], "BackSpace", lazy.window.kill(), desc="Kill focused window"),
|
||||
|
||||
# qtile hotkeys
|
||||
Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"),
|
||||
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"),
|
||||
Key([mod], "r", lazy.spawncmd(),desc="Spawn a command using a prompt widget"),
|
||||
|
||||
# Media hotkeys
|
||||
Key([], 'XF86AudioRaiseVolume', lazy.spawn('pulseaudio-ctl up 1')),
|
||||
Key([], 'XF86AudioLowerVolume', lazy.spawn('pulseaudio-ctl down 1')),
|
||||
Key([], 'XF86AudioMute', lazy.spawn('pulseaudio-ctl mute')),
|
||||
]
|
||||
|
||||
|
||||
# Drag floating layouts.
|
||||
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())
|
||||
]
|
||||
|
||||
for i in groups:
|
||||
keys.extend([
|
||||
# mod1 + letter of group = switch to group
|
||||
Key(["mod1","control"], i.name, lazy.group[i.name].toscreen(),
|
||||
desc="Switch to group {}".format(i.name)),
|
||||
|
||||
# mod1 + shift + letter of group = switch to & move focused window to group
|
||||
Key(["mod1","control", "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
|
||||
desc="Switch to & move focused window to group {}".format(i.name)),
|
||||
# Or, use below if you prefer not to switch to that group.
|
||||
# # mod1 + shift + letter of group = move focused window to group
|
||||
# Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
|
||||
# desc="move focused window to group {}".format(i.name)),
|
||||
])
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from libqtile import layout
|
||||
|
||||
from defines import focus_color,border_width
|
||||
|
||||
layouts = [
|
||||
layout.MonadTall(
|
||||
align=1,
|
||||
border_focus = focus_color,
|
||||
border_width = border_width,
|
||||
new_at_current = True,
|
||||
),
|
||||
layout.Floating(
|
||||
border_focus = focus_color,
|
||||
border_width = border_width,
|
||||
),
|
||||
layout.Max(),
|
||||
layout.MonadWide(
|
||||
border_focus = focus_color,
|
||||
border_width = border_width,
|
||||
new_at_current = True,
|
||||
),
|
||||
]
|
||||
|
||||
floating_layout = layout.Floating(
|
||||
border_focus = focus_color,
|
||||
border_width = border_width,
|
||||
float_rules=[
|
||||
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||
{'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
|
||||
])
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
# coding = utf-8
|
||||
|
||||
from libqtile.config import Screen
|
||||
|
||||
from bars import main_bar, left_bar, top_bar
|
||||
|
||||
screens = [
|
||||
Screen(bottom=top_bar),
|
||||
Screen(top=main_bar),
|
||||
Screen(top=left_bar),
|
||||
]
|
||||
Reference in New Issue
Block a user