Skip to content

Instantly share code, notes, and snippets.

@kartoch
Last active August 29, 2015 14:00
Show Gist options
  • Save kartoch/11044136 to your computer and use it in GitHub Desktop.
Save kartoch/11044136 to your computer and use it in GitHub Desktop.
Qtile configuration
from libqtile.config import Key, Screen, Group, Drag, Click, Match
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
mod = "mod4"
keys = [
# Switch between windows in current stack pane
Key(
[mod], "k",
lazy.layout.down()
),
Key(
[mod], "j",
lazy.layout.up()
),
# Move windows up or down in current stack
Key(
[mod, "control"], "k",
lazy.layout.shuffle_down()
),
Key(
[mod, "control"], "j",
lazy.layout.shuffle_up()
),
# Switch window focus to other pane(s) of stack
Key(
[mod], "space",
lazy.layout.next()
),
# Swap panes of split stack
Key(
[mod, "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(
[mod, "shift"], "Return",
lazy.layout.toggle_split()
),
Key([mod], "Return", lazy.spawn("xterm")),
# Toggle between different layouts as defined below
Key([mod], "Tab", lazy.nextlayout()),
Key([mod], "w", lazy.window.kill()),
Key([mod, "control"], "r", lazy.restart()),
Key([mod, "control"], "q", lazy.shutdown()),
Key([mod], "r", lazy.spawncmd()),
]
config_groups = {
'1': ("ampersand", []),
'2': ("eacute", []),
'3': ("quotedbl", []),
'4': ("apostrophe", []),
'5': ("parenleft", []),
'6': ("minus", []),
'7': ("egrave", []),
'8': ("underscore", []),
'mail': ("ccedilla", [Match(wm_class=["Thunderbird"])]),
'music': ("agrave", [Match(wm_class=["Spotify"])]),
}
groups = [Group(i) for i in sorted(config_groups.keys())]
for i in groups:
# mod1 + letter of group = switch to group
keys.append(
Key([mod], config_groups[i.name][0], lazy.group[i.name].toscreen())
)
# mod1 + shift + letter of group = switch to & move focused window to group
keys.append(
Key([mod, "shift"], config_groups[i.name][0], lazy.window.togroup(i.name))
)
i.matches = config_groups[i.name][1]
layouts = [
layout.Max(),
layout.Stack(num_stacks=2)
]
widget_defaults = dict(
font='Arial',
fontsize=13,
padding=3,
)
screens = [
Screen(
top=bar.Bar(
[
widget.GroupBox(),
widget.Prompt(),
widget.WindowTabs(),
widget.CurrentLayout(),
widget.Notify(),
widget.Systray(),
widget.Clock(format='%d-%m-%Y %I:%M %p'),
],
30,
),
),
Screen(
top=bar.Bar(
[
widget.GroupBox(),
widget.Prompt(),
widget.WindowTabs(),
widget.CPUGraph(
graph_color="18BAEB", fill_color="1667EB.3",
background="000000", border_color="757575"
),
widget.MemoryGraph(
graph_color="FF8000", fill_color="B37A00.3",
background="000000", border_color="757575"
),
widget.NetGraph(
graph_color="00FF51", fill_color="008A32.3",
background="000000", border_color="757575"
),
widget.SwapGraph(
graph_color="FF0000", fill_color="910000.3",
background="000000", border_color="757575"
),
widget.CurrentLayout(),
],
30,
),
),
]
# 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())
]
dgroups_key_binder = None
dgroups_app_rules = []
main = None
follow_mouse_focus = True
bring_front_click = True
cursor_warp = False
floating_layout = layout.Floating()
auto_fullscreen = True
wmname = "qtile"
@hook.subscribe.startup
def runner():
import subprocess
subprocess.call(['xsetroot', '-cursor_name', 'left_ptr'])
subprocess.call(['setxkbmap', '-layout', '"fr"'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment