Skip to content

Instantly share code, notes, and snippets.

@jpzk
Created November 9, 2013 10:04
Show Gist options
  • Save jpzk/7383897 to your computer and use it in GitHub Desktop.
Save jpzk/7383897 to your computer and use it in GitHub Desktop.
qtile config for blog post
from libqtile.config import Key, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget
import os
mod = "mod1"
modR = "mod5"
keys = [
# Switch between windows in current stack pane
Key(
[mod], "k",
lazy.layout.down()
),
Key(
[mod], "j",
lazy.layout.up()
),
Key(
[mod], "h",
lazy.layout.next()
),
Key(
[mod], "l",
lazy.layout.next()
),
# 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()
),
# Keyboard Keys for Audio
Key([modR], "Next", lazy.spawn("cmus-remote --next")),
Key([modR], "Prior", lazy.spawn("cmus-remote --prev")),
Key([], "XF86AudioMute", lazy.spawn("amixer -q set Master toggle")),
Key([modR], "End", lazy.spawn("amixer -c 0 sset Master 1- unmute")),
Key([modR], "Home", lazy.spawn("amixer -c 0 sset Master 1+ unmute")),
Key([], "KP_Add", lazy.spawn("amixer -c 0 sset Master 1+ unmute")),
Key([], "KP_Subtract", lazy.spawn("amixer -c 0 sset Master 1- unmute")),
Key([], "KP_Multiply", lazy.spawn("cmus-remote --next")),
Key([], "KP_Divide", lazy.spawn("cmus-remote --prev")),
# Shutdown
Key([], "KP_Delete", lazy.spawn("shutdown -h -a now")),
# Applications
Key([mod], "c", lazy.spawn("roxterm -e cmus")),
Key([mod], "w", lazy.spawn("firefox")),
Key([mod], "a", lazy.spawn("roxterm -e alsamixer")),
Key([modR], "v", lazy.spawn("roxterm -e vifm")),
Key([modR], "n", lazy.spawn("nautilus --no-desktop")),
Key([modR], "h", lazy.spawn("roxterm -e htop")),
Key([modR], "t", lazy.spawn("transmission-gtk")),
Key([modR], "l", lazy.spawn("~/.dotfiles/bin/lockscreen")),
Key([modR], "m", lazy.spawn("roxterm -e mutt")),
Key([modR], "j", lazy.spawn("roxterm -e mcabber")),
Key([modR], "u", lazy.spawn("uzbl-browser")),
Key([], "Super_R", lazy.spawn("shutdown -a -h now")),
# Switching between the screens.
Key([mod, "shift"], "h", lazy.to_screen(0)),
Key([mod, "shift"], "j", lazy.to_screen(1)),
Key([mod, "shift"], "k", lazy.to_screen(2)),
Key([mod], "Return", lazy.spawn("roxterm")),
Key([mod], "dead_circumflex", lazy.spawn("roxterm")),
Key([mod], "e", lazy.spawn("roxterm -z 3")),
# Toggle between different layouts as defined below
Key([mod], "Tab", lazy.nextlayout()),
Key([mod, "shift"], "q", lazy.window.kill()),
Key([mod, "shift"], "e", lazy.spawn("killall -9 /usr/bin/python /bin/qtile")),
Key([mod, "control"], "r", lazy.restart()),
]
groups = [
Group("1"),
Group("2"),
Group("3"),
Group("4"),
Group("5")
]
for i in groups:
# mod1 + letter of group = switch to group
keys.append(
Key([mod], i.name, lazy.group[i.name].toscreen())
)
# mod1 + shift + letter of group = switch to & move focused window to group
keys.append(
Key([mod, "shift"], i.name, lazy.window.togroup(i.name))
)
dgroups_key_binder = None
dgroups_app_rules = []
layouts = [
layout.Max(),
layout.Stack(stacks=2, border_focus="#cccccc"),
]
screens = [
Screen(
bottom = bar.Bar(
[
widget.GroupBox(highlight_method='block', fontsize=12),
widget.Prompt(fontsize=12),
widget.WindowName(fontsize=12),
widget.Sep(),
widget.TextBox("CPU", fontsize=12),
widget.CPUGraph(graph_color="FFFFFF", border_width=0),
widget.Sep(),
widget.TextBox("Mem", fontsize=12),
widget.MemoryGraph(graph_color="FFFFFF", border_width=0),
widget.Sep(),
widget.TextBox("Net", fontsize=12),
widget.NetGraph(graph_color="FFFFFF", border_width=0, interface="p9p1"),
widget.Sep(),
widget.YahooWeather(fontsize=12, update_interval=60, woeid=683160),
widget.Sep(),
widget.BitcoinTicker(fontsize=12, update_interval=60, currency='euro'),
widget.Sep(),
widget.Clock('%Y-%m-%d %a %I:%M %p', fontsize=12),
widget.Sep(),
widget.Notify(fontsize=12),
widget.Sep(),
widget.Systray(),
],
30,
),
),
]
main = None
follow_mouse_focus = True
cursor_warp = False
floating_layout = layout.Floating()
mouse = ()
auto_fullscreen = True
widget_defaults = {}
os.system("xsetroot -cursor_name left_ptr")
os.system("feh --bg-center ~/.dotfiles/qtile/wallpaper.jpg")
lazy.to_screen(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment