Skip to content

Instantly share code, notes, and snippets.

@YellowOnion
Created August 16, 2010 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YellowOnion/526755 to your computer and use it in GitHub Desktop.
Save YellowOnion/526755 to your computer and use it in GitHub Desktop.
from libqtile.manager import Key, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget
# I have two screens, each of which has a Bar at the bottom. Each Bar has two
# simple widgets - a GroupBox, and a WindowName.
screens = [
Screen(
bottom = bar.Bar(
[
widget.GroupBox(),
widget.WindowName()
],
30,
),
),
Screen(
bottom = bar.Bar(
[
widget.GroupBox(),
widget.WindowName()
],
30,
),
)
]
# bindings below are you a dvorak layout may not make sense
mod_key = "mod4"
keys = [
# First, a set of bindings to control the layouts
Key(
[mod_key], "k",
lazy.layout.down()
),
Key(
[mod_key], "j",
lazy.layout.up()
),
Key(
[mod_key, "control"], "k",
lazy.layout.shuffle_down()
),
Key(
[mod_key, "control"], "j",
lazy.layout.shuffle_up()
),
Key(
[mod_key], "space",
lazy.layout.next()
),
Key(
[mod_key, "shift"], "space",
lazy.layout.rotate()
),
Key(
[mod_key, "shift"], "Return",
lazy.layout.toggle_split()
),
Key([mod_key], "apostrophe", lazy.spawn("chromium")),
Key([mod_key], "s", lazy.to_screen(1)), # toggle screens
Key([mod_key], "Return", lazy.spawn("gnome-terminal")),
Key([mod_key], "Tab", lazy.nextlayout()),
Key([mod_key], "w", lazy.window.kill()),
Key(
[mod_key], "semicolon",
lazy.spawn("clementine -r")
),
Key(
[mod_key], "q",
lazy.spawn("clementine -s")
),
Key(
[mod_key], "j",
lazy.spawn("clementine -t")
),
Key(
[mod_key], "k",
lazy.spawn("clementine -f")
),
]
# Next, we specify group names, and use the group name list to generate an appropriate
# set of bindings for group switching.
groups = [
Group("a"),
Group("o"),
Group("e"),
Group("u"),
Group("g"),
Group("c"),
Group("r"),
Group("l"),
]
for i in groups:
keys.append(
Key([mod_key], i.name, lazy.group[i.name].toscreen())
)
keys.append(
Key([mod_key, "shift"], i.name, lazy.window.togroup(i.name))
)
# Two simple layout instances:
layouts = [
layout.Max(),
layout.Stack(stacks=2)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment