Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

Imported the examples/ directory in the main repo, as well as my configs. Also
wrote an example config and some documentation to go along with it.
  • Loading branch information...
commit 082b4a82c1f3b4cf3f674512df8943ac73c215d3 0 parents
@tych0 tych0 authored
11 README
@@ -0,0 +1,11 @@
+This is a repository for examples of how to use qtile, it is structured as
+follows:
+
+config/ -- demonstration of basic configuration
+scripts/ -- basic scripting with qsh
+user-configs/ -- configurations from various users (typically more customized
+ and advanced)
+user-scripts/ -- scripts written by various users
+
+To contribute please for the repo on github and make a pull request.
+
6 config/README
@@ -0,0 +1,6 @@
+config.py: Example basic qtile configuration file, should work with most
+ distros and the Windows key.
+
+xsession: Example xsession file. To run anything besides qtile when your X
+ session starts, you'll need to define one of these in ~/.xsession, and chmod +x
+ it.
113 config/config.py
@@ -0,0 +1,113 @@
+# Note that since qtile configs are just python scripts, you can check for
+# syntax and runtime errors by just running this file as is from the command
+# line, e.g.:
+#
+# python config.py
+
+from libqtile.manager import Key, Screen, Group, Drag, Click
+from libqtile.command import lazy
+from libqtile import layout, bar, widget, hook
+
+# The screens variable contains information about what bars are drawn where on
+# each screen. If you have multiple screens, you'll need to construct multiple
+# Screen objects, each with whatever widgets you want.
+#
+# Below is a screen with a top bar that contains several basic qtile widgets.
+screens = [Screen(top = bar.Bar([
+ # This is a list of our virtual desktops.
+ widget.GroupBox(urgent_alert_method='text'),
+
+ # A prompt for spawning processes or switching groups. This will be
+ # invisible most of the time.
+ widget.Prompt(),
+
+ # Current window name.
+ widget.WindowName(),
+ widget.Volume(),
+ widget.Battery(
+ energy_now_file='charge_now',
+ energy_full_file='charge_full',
+ power_now_file='current_now',
+ ),
+ widget.Systray(),
+ widget.Clock('%Y-%m-%d %a %I:%M %p'),
+ ], 30)) # our bar is 30px high
+]
+
+# Super_L (the Windows key) is typically bound to mod4 by default, so we use
+# that here.
+mod = "mod4"
+
+# The keys variable contains a list of all of the keybindings that qtile will
+# look through each time there is a key pressed.
+keys = [
+ # Log out; note that this doesn't use mod4: that's intentional in case mod4
+ # gets hosed (which happens if you unplug and replug your usb keyboard
+ # sometimes, or on system upgrades). This way you can still log back out
+ # and in gracefully.
+ Key(["shift", "mod1"], "q", lazy.shutdown()),
+
+ Key([mod], "k", lazy.layout.down()),
+ Key([mod], "j", lazy.layout.up()),
+ Key([mod], "h", lazy.layout.previous()),
+ Key([mod], "l", lazy.layout.previous()),
+ Key([mod, "shift"], "space", lazy.layout.rotate()),
+ Key([mod, "shift"], "Return",lazy.layout.toggle_split()),
+ Key(["mod1"], "Tab", lazy.nextlayout()),
+ Key([mod], "x", lazy.window.kill()),
+
+ # interact with prompts
+ Key([mod], "r", lazy.spawncmd()),
+ Key([mod], "g", lazy.switchgroup()),
+
+ # start specific apps
+ Key([mod], "n", lazy.spawn("firefox")),
+ Key([mod], "Return", lazy.spawn("xterm")),
+
+ # Change the volume if your keyboard has special volume keys.
+ Key(
+ [], "XF86AudioRaiseVolume",
+ lazy.spawn("amixer -c 0 -q set Master 2dB+")
+ ),
+ Key(
+ [], "XF86AudioLowerVolume",
+ lazy.spawn("amixer -c 0 -q set Master 2dB-")
+ ),
+ Key(
+ [], "XF86AudioMute",
+ lazy.spawn("amixer -c 0 -q set Master toggle")
+ ),
+
+ # Also allow changing volume the old fashioned way.
+ Key([mod], "equal", lazy.spawn("amixer -c 0 -q set Master 2dB+")),
+ Key([mod], "minus", lazy.spawn("amixer -c 0 -q set Master 2dB-")),
+]
+
+# This allows you to drag windows around with the mouse if you want.
+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())
+]
+
+# Next, we specify group names, and use the group name list to generate an appropriate
+# set of bindings for group switching.
+groups = []
+for i in ["a", "s", "d", "f", "u", "i", "o", "p"]:
+ groups.append(Group(i))
+ keys.append(
+ Key([mod], i, lazy.group[i].toscreen())
+ )
+ keys.append(
+ Key([mod, "mod1"], i, lazy.window.togroup(i))
+ )
+
+# Two basic layouts.
+layouts = [
+ layout.Stack(stacks=2, border_width=1),
+ layout.Max(),
+]
+
+# vim: tabstop=4 shiftwidth=4 expandtab
8 config/xsession
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Java apps are broken and need a WM on their hardcoded list. For maximum
+# irony, you should impersonate LG3D, a window manager written by Sun in Java.
+# Available from http://tools.suckless.org/wmname
+wmname LG3D
+
+exec qtile
118 user-configs/cortesi/cortesi-config.py
@@ -0,0 +1,118 @@
+from libqtile.manager import Key, Screen, Group
+from libqtile.command import lazy
+from libqtile import layout, bar, widget
+
+# The bindings below are for use with a Kinesis keyboard, and may not make
+# sense for standard keyboards.
+keys = [
+ # First, a set of bindings to control the layouts
+ Key(
+ ["mod1"], "k",
+ lazy.layout.down()
+ ),
+ Key(
+ ["mod1"], "j",
+ lazy.layout.up()
+ ),
+ Key(
+ ["mod1", "control"], "k",
+ lazy.layout.shuffle_down()
+ ),
+ Key(
+ ["mod1", "control"], "j",
+ lazy.layout.shuffle_up()
+ ),
+ Key(
+ ["mod1"], "space",
+ lazy.layout.next()
+ ),
+ Key(
+ ["mod1", "shift"], "space",
+ lazy.layout.rotate()
+ ),
+ Key(
+ ["mod1", "shift"], "Return",
+ lazy.layout.toggle_split()
+ ),
+
+ Key(["mod1"], "n", lazy.spawn("firefox")),
+ Key(["mod1"], "h", lazy.to_screen(1)),
+ Key(["mod1"], "l", lazy.to_screen(0)),
+ # ~/bin/x starts a terminal program
+ Key(["mod1"], "Return", lazy.spawn("~/bin/x")),
+ Key(["mod1"], "Tab", lazy.nextlayout()),
+ Key(["mod1"], "w", lazy.window.kill()),
+
+ # The bindings below control Amarok, and my sound volume.
+ Key(
+ ["mod1", "shift"], "k",
+ lazy.spawn("amixer -c 1 -q set Speaker 2dB+")
+ ),
+ Key(
+ ["mod1", "shift"], "j",
+ lazy.spawn("amixer -c 1 -q set Speaker 2dB-")
+ ),
+ Key(
+ ["mod1", "shift"], "n",
+ lazy.spawn("amarok -t")
+ ),
+ Key(
+ ["mod1", "shift"], "l",
+ lazy.spawn("amarok -f")
+ ),
+ Key(
+ ["mod1", "shift"], "h",
+ lazy.spawn("amarok -r")
+ ),
+]
+
+# 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("s"),
+ Group("d"),
+ Group("f"),
+ Group("u"),
+ Group("i"),
+ Group("o"),
+ Group("p"),
+]
+for i in groups:
+ keys.append(
+ Key(["mod1"], i.name, lazy.group[i.name].toscreen())
+ )
+ keys.append(
+ Key(["mod1", "shift"], i.name, lazy.window.togroup(i.name))
+ )
+
+
+# Two simple layout instances:
+layouts = [
+ layout.Max(),
+ layout.Stack(stacks=2)
+]
+
+
+# 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,
+ ),
+ )
+]
160 user-configs/roger/roger-config.py
@@ -0,0 +1,160 @@
+from libqtile.manager import Key, Click, Drag, Screen, Group
+from libqtile.command import lazy
+from libqtile import layout, bar, widget
+
+mod = 'mod4'
+keys = [
+ Key(
+ [mod], "k",
+ lazy.layout.down()
+ ),
+ Key(
+ [mod], "j",
+ lazy.layout.up()
+ ),
+ Key(
+ [mod], "f",
+ lazy.window.toggle_floating()
+ ),
+ Key(
+ [mod], "space",
+ lazy.nextlayout()
+ ),
+ Key([mod], "Tab",
+ lazy.layout.next()
+ ),
+ Key([mod, "shift"], "Tab",
+ lazy.layout.previous()
+ ),
+ Key(
+ [mod, "shift"], "space",
+ lazy.layout.rotate()
+ ),
+ Key(
+ [mod, "shift"], "Return",
+ lazy.layout.toggle_split()
+ ),
+
+ Key([mod, "shift"], "Right",
+ lazy.layout.increase_ratio()),
+ Key([mod, "shift"], "Left",
+ lazy.layout.decrease_ratio()),
+
+ Key([mod], "w", lazy.window.kill()),
+ Key([mod], "F2", lazy.spawn(
+ "dmenu_run -p run -nb '#202020' -nf '#ffffff' -fa 'Anonymous Pro-10'")),
+
+ Key(
+ [mod, "shift"], "k",
+ lazy.spawn("amixer -c 0 -q set Master 2dB+")
+ ),
+ Key(
+ [mod, "shift"], "j",
+ lazy.spawn("amixer -c 0 -q set Master 2dB-")
+ ),
+ Key(
+ [mod], "g",
+ lazy.togroup()
+ ),
+ Key(
+ [mod], "Left", lazy.group.prevgroup(),
+ ),
+ Key(
+ [mod], "Right", lazy.group.nextgroup(),
+ ),
+]
+
+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())
+]
+
+# Next, we specify group names, and use the group name list to generate an appropriate
+# set of bindings for group switching.
+groups = [
+# Group("1"),
+# Group("2"),
+]
+for i in groups:
+ keys.append(
+ Key(["mod4"], i.name, lazy.group[i.name].toscreen())
+ )
+ keys.append(
+ Key(["mod4", "shift"], i.name, lazy.window.togroup(i.name))
+ )
+
+
+layouts = [
+ layout.Max(),
+ layout.Stack(stacks=2),
+ layout.Tile(ratio=0.25),
+]
+
+
+screens = [
+ Screen(
+ top = bar.Bar(
+ [
+ widget.GroupBox(borderwidth=2,
+ fontsize=14,
+ padding=1, margin_y=1),
+ widget.Sep(),
+ widget.Prompt(),
+ widget.WindowName(
+ fontsize=14, margin_x=6),
+ #widget.Sep(),
+ #widget.Mpd(fontsize=16),
+ #widget.Sep(),
+ #widget.CPUGraph(width=50, graph_color='0066FF',
+ # fill_color='001188'),
+ #widget.MemoryGraph(width=50, graph_color='22FF44',
+ # fill_color='11AA11'),
+ #widget.SwapGraph(width=50, graph_color='FF2020',
+ # fill_color='C01010'),
+ widget.Sep(),
+ widget.Volume(theme_path='/usr/share/icons/gnome/256x256/status/'),
+ widget.Systray(),
+ widget.Sep(),
+ widget.Clock('%H:%M %d/%m/%y',
+ fontsize=18, padding=6),
+ ],
+ 24
+ ),
+ ),
+]
+
+# change focus on mouse over
+follow_mouse_focus = True
+
+def main(qtile):
+ from dgroups import DGroups, Match, simple_key_binder
+ global mod
+
+ groups = {
+ 'h4x': {'init': True, 'persist': True,
+ 'spawn': 'guake', 'exclusive': True},
+ 'design': {},
+ 'www': {'exclusive': True},
+ # master set the master window/windows of layout
+ 'emesene': {'layout': 'tile', 'master': Match(role=['main'])},
+ 'gajim': {'layout': 'tile', 'master': Match(role=['roster'])},
+ }
+
+ apps = [
+ {'match': Match(wm_class=['Guake.py',
+ 'MPlayer', 'Exe', 'Gnome-keyring-prompt'],
+ wm_type=['dialog', 'utility', 'splash']), 'float': True},
+ {'match': Match(wm_class=['Gimp']),
+ 'group': 'design', 'float': True},
+ {'match': Match(wm_class=['emesene']),
+ 'group': 'emesene'},
+ {'match': Match(wm_class=['Chromium-browser', 'Minefield'],
+ role=['browser']), 'group': 'www'},
+ {'match': Match(wm_class=['Gajim.py']),
+ 'group': 'gajim'},
+ {'match': Match(wm_class=['Wine']), 'float': True, 'group': 'wine'},
+ ]
+ dgroups = DGroups(qtile, groups, apps, simple_key_binder(mod))
197 user-configs/tailhook/tailhook-config.py
@@ -0,0 +1,197 @@
+# -*- coding: utf-8 -*-
+from libqtile.manager import Key, Click, Drag, Screen, Group
+from libqtile.command import lazy
+from libqtile import layout, bar, widget, hook
+
+from libqtile import xcbq
+xcbq.keysyms["XF86AudioRaiseVolume"] = 0x1008ff13
+xcbq.keysyms["XF86AudioLowerVolume"] = 0x1008ff11
+xcbq.keysyms["XF86AudioMute"] = 0x1008ff12
+
+
+def window_sorter(win):
+ patterns = (
+ ('Яндекс.Почта', 'E-mail'),
+ ('Gmail', 'E-mail'),
+ ('SquirrelMail', 'E-mail'),
+ ('zeromq', 'Docs'),
+ ('PyYAML', 'Docs'),
+ ('documentation', 'Docs'),
+ ('-ietf-', 'Docs'),
+ ('GNOME Live!', 'Docs'),
+ ('Guide', 'Docs'),
+ )
+ for k, v in patterns:
+ if k in win.name:
+ return v
+
+mod = "mod4"
+keys = [
+ Key([mod], "j",
+ lazy.layout.down()),
+ Key([mod], "k",
+ lazy.layout.up()),
+ Key([mod, "shift"], "j",
+ lazy.layout.move_down()),
+ Key([mod, "shift"], "k",
+ lazy.layout.move_up()),
+ Key([mod, "control"], "j",
+ lazy.layout.section_down()),
+ Key([mod, "control"], "k",
+ lazy.layout.section_up()),
+ Key([mod], "h",
+ lazy.layout.collapse_branch()), # for tree layout
+ Key([mod], "l",
+ lazy.layout.expand_branch()), # for tree layout
+ Key([mod], "r",
+ lazy.layout.sort_windows(window_sorter)), # for tree layout
+ Key([mod, "shift"], "h",
+ lazy.layout.move_left()),
+ Key([mod, "shift"], "l",
+ lazy.layout.move_right()),
+ Key([mod, "control"], "l",
+ lazy.layout.increase_ratio()),
+ Key([mod, "control"], "h",
+ lazy.layout.decrease_ratio()),
+ Key([mod], "comma",
+ lazy.layout.increase_nmaster()),
+ Key([mod], "period",
+ lazy.layout.decrease_nmaster()),
+ Key([mod], "Tab",
+ lazy.group.next_window()),
+ Key([mod, "shift"], "Tab",
+ lazy.group.prev_window()),
+ Key([mod, "shift"], "Return",
+ lazy.layout.rotate()),
+ Key([mod, "shift"], "space",
+ lazy.layout.toggle_split()),
+
+ Key([mod], "w",
+ lazy.to_screen(0)),
+ Key([mod], "e",
+ lazy.to_screen(1)),
+ Key([mod], "space",
+ lazy.nextlayout()),
+ Key([mod], "c",
+ lazy.window.kill()),
+ Key([mod], "t",
+ lazy.window.disable_floating()),
+ Key([mod, "shift"], "t",
+ lazy.window.enable_floating()),
+ Key([mod], "p",
+ lazy.spawn("exec dmenu_run "
+ "-fn 'Consolas:size=13' -nb '#000000' -nf '#ffffff' -b")),
+ Key([mod], "b",
+ lazy.spawn("~/note/conf/uzbl/open_history")),
+ Key([mod, "shift"], "b",
+ lazy.spawn("~/note/conf/uzbl/open_bookmark")),
+ Key([mod], "s",
+ lazy.spawn("~/note/conf/uzbl/open_ddg")),
+ Key([mod, "shift"], "s",
+ lazy.spawn("~/note/conf/uzbl/open_goog")),
+ Key([mod], "q",
+ lazy.spawn('xtrlock')),
+ Key([mod], "y",
+ lazy.spawn('xclip -o -selection primary | xclip -selection clipboard')),
+ Key([mod], "u",
+ lazy.spawn('xclip -o -selection clipboard | xclip -selection primary')),
+
+ Key([], "XF86AudioRaiseVolume",
+ lazy.spawn("amixer sset Master 5%+")),
+ Key([], "XF86AudioLowerVolume",
+ lazy.spawn("amixer sset Master 5%-")),
+ Key([], "XF86AudioMute",
+ lazy.spawn("amixer sset Master toggle")),
+ Key(["shift"], "XF86AudioRaiseVolume",
+ lazy.spawn("mpc volume +5")),
+ Key(["shift"], "XF86AudioLowerVolume",
+ lazy.spawn("mpc volume -5")),
+ Key(["shift"], "XF86AudioMute",
+ lazy.spawn("mpc toggle")),
+
+ Key([mod], "Left",
+ lazy.prevgroup()),
+ Key([mod], "Right",
+ lazy.nextgroup()),
+]
+
+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())
+]
+
+border = dict(
+ border_normal='#808080',
+ border_width=2,
+ )
+
+layouts = [
+ layout.Tile(**border),
+ layout.Max(),
+ layout.Stack(**border),
+ layout.TreeTab(sections=['Surfing', 'E-mail', 'Docs', 'Incognito']),
+ layout.Slice('left', 320, wmclass='pino',
+ fallback=layout.Slice('right', 320, role='roster',
+ fallback=layout.Stack(1, **border))),
+ layout.Slice('left', 192, role='gimp-toolbox',
+ fallback=layout.Slice('right', 256, role='gimp-dock',
+ fallback=layout.Stack(1, **border))),
+ ]
+floating_layout = layout.Floating(**border)
+
+groups = [
+ Group('1'),
+ Group('2', layout='max'),
+ Group('3'),
+ Group('4', layout='treetab'),
+ Group('5'),
+ Group('6'),
+ Group('7'),
+ Group('8'),
+ Group('9'),
+ ]
+
+for i in groups:
+ keys.append(
+ Key([mod], i.name, lazy.group[i.name].toscreen())
+ )
+ keys.append(
+ Key([mod, "shift"], i.name, lazy.window.togroup(i.name))
+ )
+
+screens = [
+ Screen(
+ top = bar.Bar(
+ [
+ widget.GroupBox(borderwidth=2,
+ font='Consolas',fontsize=18,
+ padding=1, margin_x=1, margin_y=1),
+ widget.Sep(),
+ widget.WindowName(
+ font='Consolas',fontsize=18, margin_x=6),
+ widget.Sep(),
+ widget.Battery(
+ font='Consolas',fontsize=18, margin_x=6),
+ widget.Sep(),
+ widget.CPUGraph(),
+ widget.MemoryGraph(),
+ widget.SwapGraph(foreground='C02020'),
+ widget.Sep(),
+ widget.Systray(),
+ widget.Sep(),
+ widget.Clock('%H:%M:%S %d.%m.%Y',
+ font='Consolas', fontsize=18, padding=6),
+ ],
+ 24,
+ ),
+ ),
+]
+
+@hook.subscribe.client_new
+def dialogs(window):
+ if(window.window.get_wm_type() == 'dialog'
+ or window.window.get_wm_transient_for()):
+ window.floating = True
7 user-configs/tych0/README
@@ -0,0 +1,7 @@
+Features include:
+ caps lock-based
+ special layouts for gimp and pidgin
+ jailing of certain apps to dynamically created groups
+ alternate urgent hint notification
+ alternate default floating rules
+
189 user-configs/tych0/config.py
@@ -0,0 +1,189 @@
+from libqtile.manager import Key, Screen, Group, Drag, Click
+from libqtile.command import lazy
+from libqtile import layout, bar, widget, hook
+
+import platform
+
+# TODO:
+# 1. better multi screen switching
+# 2. better hotkeys for dgroups
+# 3. perhaps make it so you don't have to pass font_options everywhere?
+
+# Number of screens on machines I use regularly.
+hostname = platform.node()
+num_screens = {
+ 'tanders-ubuntu': 2,
+ 'smitten': 2,
+ 'smalls': 1,
+}
+
+# global font options
+font_options = dict(
+ font = 'Consolas',
+ fontsize = 18,
+ padding = 3,
+)
+
+if num_screens[hostname] == 2:
+ screens = [
+ Screen(top = bar.Bar([
+ widget.GroupBox(urgent_alert_method='text', **font_options),
+ widget.Prompt(**font_options),
+ widget.WindowName(**font_options),
+ widget.Mpris(**font_options),
+ widget.Volume(**font_options),
+ ], 30,),
+ ),
+ Screen(top = bar.Bar([
+ widget.GroupBox(urgent_alert_method='text', **font_options),
+ widget.WindowName(**font_options),
+ widget.Systray(),
+ widget.Clock('%Y-%m-%d %a %I:%M %p', **font_options),
+ ], 30,),
+ ),
+ ]
+else:
+ # 1 screen
+ screens = [Screen(top = bar.Bar([
+ widget.GroupBox(urgent_alert_method='text', **font_options),
+ widget.Prompt(**font_options),
+ widget.WindowName(**font_options),
+ widget.Volume(**font_options),
+ # 1 screen means this is a laptop, so let's render the battery
+ widget.Battery(energy_now_file='charge_now',
+ energy_full_file='charge_full',
+ power_now_file='current_now',
+ **font_options),
+ widget.Systray(),
+ widget.Clock('%Y-%m-%d %a %I:%M %p', **font_options),
+ ],30,),),
+ ]
+
+keys = [
+ # Log out; note that this doesn't use mod3: that's intentional in case mod3
+ # gets hosed (which happens if you unplug and replug your usb keyboard
+ # sometimes, or on ubuntu upgrades). This way you can still log back out
+ # and in gracefully.
+ Key(["shift", "mod1"], "q", lazy.shutdown()),
+
+ Key(["mod3"], "k", lazy.layout.down()),
+ Key(["mod3"], "j", lazy.layout.up()),
+ Key(["mod3"], "h", lazy.layout.previous()),
+ Key(["mod3"], "l", lazy.layout.previous()),
+ Key(["mod3", "shift"], "space", lazy.layout.rotate()),
+ Key(["mod3", "shift"], "Return",lazy.layout.toggle_split()),
+ Key(["mod1"], "Tab", lazy.nextlayout()),
+ Key(["mod3", "mod1"], "h", lazy.to_screen(0)),
+ Key(["mod3", "mod1"], "l", lazy.to_screen(1)),
+ Key(["mod3"], "x", lazy.window.kill()),
+
+ # interact with prompts
+ Key(["mod3"], "r", lazy.spawncmd()),
+ Key(["mod3"], "g", lazy.switchgroup()),
+
+ # start specific apps
+ Key(["mod3"], "n", lazy.spawn("firefox")),
+ Key(["mod3"], "m", lazy.spawn("clementine")),
+ Key(["mod3"], "Return", lazy.spawn("xterm")),
+
+ # Change the volume if our keyboard has keys
+ Key(
+ [], "XF86AudioRaiseVolume",
+ lazy.spawn("amixer -c 0 -q set Master 2dB+")
+ ),
+ Key(
+ [], "XF86AudioLowerVolume",
+ lazy.spawn("amixer -c 0 -q set Master 2dB-")
+ ),
+ Key(
+ [], "XF86AudioMute",
+ lazy.spawn("amixer -c 0 -q set Master toggle")
+ ),
+
+ # also allow changing volume the old fashioned way
+ Key(["mod3"], "equal", lazy.spawn("amixer -c 0 -q set Master 2dB+")),
+ Key(["mod3"], "minus", lazy.spawn("amixer -c 0 -q set Master 2dB-")),
+
+ # allow play pause as well
+ Key(["mod3"], "p", lazy.spawn("vif.py play_pause")),
+]
+
+# Drag floating layouts.
+mouse = [
+ Drag(["mod3"], "Button1", lazy.window.set_position_floating(),
+ start=lazy.window.get_position()),
+ Drag(["mod3"], "Button3", lazy.window.set_size_floating(),
+ start=lazy.window.get_size()),
+ Click(["mod3"], "Button2", lazy.window.bring_to_front())
+]
+
+# Next, we specify group names, and use the group name list to generate an appropriate
+# set of bindings for group switching.
+static_groups = ['a', 's', 'd', 'f']
+groups = []
+for i in static_groups:
+ groups.append(Group(i))
+ keys.append(
+ Key(["mod3"], i, lazy.group[i].toscreen())
+ )
+ keys.append(
+ Key(["mod3", "mod1"], i, lazy.window.togroup(i))
+ )
+
+border_args = dict(
+ border_width=1,
+)
+
+layouts = [
+ layout.Stack(stacks=2, **border_args),
+ layout.Max(),
+
+ # a layout just for gimp
+ layout.Slice('left', 192, name='gimp', role='gimp-toolbox',
+ fallback=layout.Slice('right', 256, role='gimp-dock',
+ fallback=layout.Stack(stacks=1, **border_args))),
+
+ # a layout for pidgin
+ layout.Slice('right', 256, name='pidgin', role='buddy_list',
+ fallback=layout.Stack(stacks=1, **border_args)),
+]
+
+# Automatically float these types. This overrides the default behavior (which
+# is to also float utility types), but the default behavior breaks our fancy
+# gimp slice layout specified later on.
+floating_layout = layout.Floating(auto_float_types=[
+ "notification",
+ "toolbar",
+ "splash",
+ "dialog",
+])
+
+def main(qtile):
+ from dgroups import DGroups, Match, simple_key_binder
+
+ dynamic_groups = {
+ 'music': {'exclusive': False, 'spawn': 'clementine'},
+ 'www': {'exclusive': False, 'layout': 'max'},
+ 'io': {'exclusive': False, 'layout': 'pidgin'},
+ 'java': {'exclusive': False, 'layout': 'stack'},
+ }
+
+ # persist any already set up groups
+ global static_groups
+ for group in static_groups:
+ dynamic_groups[group] = {'persist': True}
+
+ apps = [
+ {'match': Match(wm_class=['Firefox', 'google-chrome', 'Google-chrome']),
+ 'group': 'www'},
+ {'match': Match(wm_class=['Pidgin'], role=['Buddy List']),
+ 'group': 'io'},
+ {'match': Match(wm_class=['Clementine', 'Viridian']),
+ 'group': 'music'},
+ {'match': Match(wm_class=['sun-awt-X11-XFramePeer', 'GroupWise']),
+ 'group': 'java'},
+ ]
+
+ dgroups = DGroups(qtile, dynamic_groups, apps, simple_key_binder('mod3'))
+
+# vim: tabstop=4 shiftwidth=4 expandtab
11 user-configs/tych0/xsession
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+QTILE=$HOME/.qtile
+
+# make the cursor move the right speed
+xset mouse 2 9
+
+# impersonate LG3D so java swing apps work
+wmname LG3D
+
+exec qtile -c $QTILE/config.py
Please sign in to comment.
Something went wrong with that request. Please try again.