public
Description: A dynamic, hackable window manager written in Python
Homepage: http://incise.org/whimsy.html
Clone URL: git://github.com/mackstann/whimsy.git
mackstann (author)
Wed Dec 17 00:45:49 -0800 2008
commit  2c742ca6b26b35670a2e7df4d65ddfc4af985065
tree    c805c40f131a6b250c9d0445e03a697cb441f0c3
parent  9079b0e248731161d341555d2e43effeabd90e0b
whimsy / config.py
6b8193df » mackstann 2008-07-11 new example_config.py, simp... 1 # Written by Nick Welch in the years 2005-2008. Author disclaims copyright.
2
3 from whimsy.base_config import *
4
8bbdf5b8 » mackstann 2008-09-15 mv example_config.py config.py 5 import socket
6
3c97a1f0 » mackstann 2008-12-17 switch mpd stuff to corn db... 7 def corn(cmd):
8 return 'dbus-send --session --type=method_call --dest=org.mpris.corn '\
9 '/Player org.freedesktop.MediaPlayer.%s' % cmd
8bbdf5b8 » mackstann 2008-09-15 mv example_config.py config.py 10
b1892258 » mackstann 2008-07-12 window_manager now contains... 11 wm.vwidth = W * 3
12 wm.vheight = H * 3
13
8bbdf5b8 » mackstann 2008-09-15 mv example_config.py config.py 14 chains = [
ec021c2d » mackstann 2008-10-15 if_key_press -> if key, if_... 15 (if_key("u", C+A), viewport_absolute_move( 0, 0)),
16 (if_key("i", C+A), viewport_absolute_move( W, 0)),
17 (if_key("o", C+A), viewport_absolute_move(W*2, 0)),
18 (if_key("j", C+A), viewport_absolute_move( 0, H)),
19 (if_key("k", C+A), viewport_absolute_move( W, H)),
20 (if_key("l", C+A), viewport_absolute_move(W*2, H)),
21 (if_key("m", C+A), viewport_absolute_move( 0, H*2)),
22 (if_key("comma", C+A), viewport_absolute_move( W, H*2)),
23 (if_key("period", C+A), viewport_absolute_move(W*2, H*2)),
24
25 (if_key("Left", C), viewport_relative_move(-W, 0)),
26 (if_key("Right", C), viewport_relative_move(+W, 0)),
27 (if_key("Up", C), viewport_relative_move( 0, -H)),
28 (if_key("Down", C), viewport_relative_move( 0, +H)),
29
29d99882 » mackstann 2008-11-17 s/aterm/urxvt/ 30 (if_key("x", C+A), execute("urxvt")),
ec021c2d » mackstann 2008-10-15 if_key_press -> if key, if_... 31 (if_key("s", C+A), execute("sleep 1; xset s activate")),
32
3c97a1f0 » mackstann 2008-12-17 switch mpd stuff to corn db... 33 (if_key("z", M4), execute(corn("Prev"))),
34 (if_key("x", M4), execute(corn("Stop"))),
35 (if_key("c", M4), execute(corn("Play"))),
36 (if_key("v", M4), execute(corn("Pause"))),
37 (if_key("b", M4), execute(corn("Next"))),
ec021c2d » mackstann 2008-10-15 if_key_press -> if key, if_... 38
bf4fb75c » mackstann 2008-11-24 support for _NET_WM_STATE, ... 39 (if_key('w', C+A), if_manipulable, delete_client()),
40 (if_button(1, A), if_manipulable, flipping_move()),
41 (if_button(3, A), if_manipulable, flipping_resize()),
42 (if_button(4, A), if_manipulable, client_method('stack_bottom')),
43 (if_button(5, A), if_manipulable, client_method('stack_top')),
8bbdf5b8 » mackstann 2008-09-15 mv example_config.py config.py 44
45 # maximizations: full screen, left half, right half
46
a33650f5 » mackstann 2008-11-24 new ewmh.tile() which respe... 47 (if_key("f", M4), if_manipulable, ewmh.tile(0, 0, 100, 100)),
48 (if_key("h", M4), if_manipulable, ewmh.tile(0, 0, 50, 100)),
49 (if_key("l", M4), if_manipulable, ewmh.tile(50, 0, 50, 100)),
6b8193df » mackstann 2008-07-11 new example_config.py, simp... 50 ]
51
8bbdf5b8 » mackstann 2008-09-15 mv example_config.py config.py 52 # the recursiveness of grabbing on root is also causing global keybindings to
53 # temporarily shift focus to root when using them.
54
55 for chain in chains:
56 app.hub.attach("event", *chain)
6b8193df » mackstann 2008-07-11 new example_config.py, simp... 57
58 app.run()
59