Project

General

Profile

unexist.dev

/

subtle

Assorted tidbits and projects

subtle.rb

René Neumann, 09/22/2012 12:24 AM

 
1
# -*- encoding: utf-8 -*-
2
#
3
# Author::  Christoph Kappel <unexist@subforge.org>
4
# Version:: $Id: data/subtle.rb,v 3182 2012/02/04 16:39:33 unexist $
5
# License:: GNU GPLv2
6
#
7
# = Subtle default configuration
8
#
9
# This file will be installed as default and can also be used as a starter for
10
# an own custom configuration file. The system wide config usually resides in
11
# +/etc/xdg/subtle+ and the user config in +HOME/.config/subtle+, both locations
12
# are dependent on the locations specified by +XDG_CONFIG_DIRS+ and
13
# +XDG_CONFIG_HOME+.
14
#
15

    
16
#
17
# == Options
18
#
19
# Following options change behaviour and sizes of the window manager:
20
#
21

    
22
# Window move/resize steps in pixel per keypress
23
set :increase_step, 5
24

    
25
# Window screen border snapping
26
set :border_snap, 10
27

    
28
# Default starting gravity for windows. Comment out to use gravity of
29
# currently active client
30
set :default_gravity, :center
31

    
32
# Make dialog windows urgent and draw focus
33
set :urgent_dialogs, false
34

    
35
# Honor resize size hints globally
36
set :honor_size_hints, false
37

    
38
# Enable gravity tiling for all gravities
39
set :gravity_tiling, false
40

    
41
# Enable click-to-focus focus model
42
set :click_to_focus, false
43

    
44
# Skip pointer movement on e.g. gravity change
45
set :skip_pointer_warp, false
46

    
47
# Skip pointer movement to urgent windows
48
set :skip_urgent_warp, false
49

    
50
# Set the WM_NAME of subtle (Java quirk)
51
# set :wmname, "LG3D"
52

    
53
#
54
# == Screen
55
#
56
# Generally subtle comes with two panels per screen, one on the top and one at
57
# the bottom. Each panel can be configured with different panel items and
58
# sublets screen wise. The default config uses top panel on the first screen
59
# only, it's up to the user to enable the bottom panel or disable either one
60
# or both.
61

    
62
# === Properties
63
#
64
# [*stipple*]    This property adds a stipple pattern to both screen panels.
65
#
66
#                Example: stipple "~/stipple.xbm"
67
#                         stipple Subtlext::Icon.new("~/stipple.xbm")
68
#
69
# [*top*]        This property adds a top panel to the screen.
70
#
71
#                Example: top [ :views, :title ]
72
#
73
# [*bottom*]     This property adds a bottom panel to the screen.
74
#
75
#                Example: bottom [ :views, :title ]
76

    
77
#
78
# Following items are available for the panels:
79
#
80
# [*:views*]     List of views with buttons
81
# [*:title*]     Title of the current active window
82
# [*:tray*]      Systray icons (Can be used only once)
83
# [*:keychain*]  Display current chain (Can be used only once)
84
# [*:sublets*]   Catch-all for installed sublets
85
# [*:sublet*]    Name of a sublet for direct placement
86
# [*:spacer*]    Variable spacer (free width / count of spacers)
87
# [*:center*]    Enclose items with :center to center them on the panel
88
# [*:separator*] Insert separator
89
#
90
# Empty panels are hidden.
91
#
92
# === Links
93
#
94
# http://subforge.org/projects/subtle/wiki/Multihead
95
# http://subforge.org/projects/subtle/wiki/Panel
96
#
97

    
98
screen 1 do
99
  top    [ :views, :title, :keychain, :spacer, :clock, :seperator, :tray ]
100
  bottom [ :center, :mpd, :center ]
101
end
102

    
103
# Example for a second screen:
104
#screen 2 do
105
#  top    [ :views, :title, :spacer ]
106
#  bottom [ ]
107
#end
108

    
109
#
110
# == Styles
111
#
112
# Styles define various properties of styleable items in a CSS-like syntax.
113
#
114
# If no background color is given no color will be set. This will ensure a
115
# custom background pixmap won't be overwritten.
116
#
117
# Following properties are available for most the styles:
118
#
119
# [*foreground*] Foreground text color
120
# [*background*] Background color
121
# [*margin*]     Outer spacing
122
# [*border*]     Border color and size
123
# [*padding*]    Inner spacing
124
# [*font*]       Font string (xftontsel or xft)
125
#
126
# === Link
127
#
128
# http://subforge.org/projects/subtle/wiki/Styles
129

    
130
# Style for all style elements
131
style :all do
132
  icon        "#757575"
133
  border      "#303030", 0
134
  padding     0, 3
135
  font        "xft:Comfortaa-13"
136
  background  "#202020"
137
end
138

    
139
# Style for the all views
140
style :views do
141
  foreground  "#757575"
142

    
143
  # Style for the active views
144
  style :focus do
145
    foreground  "#fecf35"
146
  end
147

    
148
  # Style for urgent window titles and views
149
  style :urgent do
150
    foreground  "#ff9800"
151
  end
152

    
153
  # Style for occupied views (views with clients)
154
  style :occupied do
155
    foreground  "#b8b8b8"
156
  end
157
end
158

    
159
# Style for sublets
160
style :sublets do
161
  foreground  "#949494"
162
  
163
  style :clock do
164
    font "xft:BonvenoCF-11:Bold"
165
    min_width 120
166
  end
167
end
168

    
169

    
170
# Style for separator
171
style :separator do
172
  foreground  "#757575"
173
  separator   "|"
174
end
175

    
176
# Style for focus window title
177
style :title do
178
  foreground  "#fecf35"
179
end
180

    
181
# Style for active/inactive windows
182
style :clients do
183
  active    "#303030", 2
184
  inactive  "#202020", 2
185
  margin    0
186
  width     50
187
end
188

    
189
# Style for subtle
190
style :subtle do
191
  margin      0, 0, 0, 0
192
  panel       "#202020"
193
end
194

    
195
#
196
# == Gravities
197
#
198
# Gravities are predefined sizes a window can be set to. There are several ways
199
# to set a certain gravity, most convenient is to define a gravity via a tag or
200
# change them during runtime via grab. Subtler and subtlext can also modify
201
# gravities.
202
#
203
# A gravity consists of four values which are a percentage value of the screen
204
# size. The first two values are x and y starting at the center of the screen
205
# and he last two values are the width and height.
206
#
207
# === Example
208
#
209
# Following defines a gravity for a window with 100% width and height:
210
#
211
#   gravity :example, [ 0, 0, 100, 100 ]
212
#
213
# === Link
214
#
215
# http://subforge.org/projects/subtle/wiki/Gravity
216
#
217

    
218
# Top left
219
gravity :top_left,       [   0,   0,  50,  50 ]
220
gravity :top_left66,     [   0,   0,  50,  66 ]
221
gravity :top_left33,     [   0,   0,  50,  34 ]
222

    
223
# Top
224
gravity :top,            [   0,   0, 100,  50 ]
225
gravity :top66,          [   0,   0, 100,  66 ]
226
gravity :top33,          [   0,   0, 100,  34 ]
227

    
228
# Top right
229
gravity :top_right,      [  50,   0,  50,  50 ]
230
gravity :top_right66,    [  50,   0,  50,  66 ]
231
gravity :top_right33,    [  50,   0,  50,  33 ]
232

    
233
# Left
234
gravity :left,           [   0,   0,  50, 100 ]
235
gravity :left66,         [   0,   0,  66, 100 ]
236
gravity :left33,         [   0,   0,  33, 100 ]
237

    
238
# Center
239
gravity :center,         [   0,   0, 100, 100 ]
240
gravity :center66,       [  17,  17,  66,  66 ]
241
gravity :center33,       [  33,  33,  33,  33 ]
242

    
243
# Right
244
gravity :right,          [  50,   0,  50, 100 ]
245
gravity :right66,        [  34,   0,  66, 100 ]
246
gravity :right33,        [  67,   0,  33, 100 ]
247

    
248
# Bottom left
249
gravity :bottom_left,    [   0,  50,  50,  50 ]
250
gravity :bottom_left66,  [   0,  34,  50,  66 ]
251
gravity :bottom_left33,  [   0,  67,  50,  33 ]
252

    
253
# Bottom
254
gravity :bottom,         [   0,  50, 100,  50 ]
255
gravity :bottom66,       [   0,  34, 100,  66 ]
256
gravity :bottom33,       [   0,  67, 100,  33 ]
257

    
258
# Bottom right
259
gravity :bottom_right,   [  50,  50,  50,  50 ]
260
gravity :bottom_right66, [  50,  34,  50,  66 ]
261
gravity :bottom_right33, [  50,  67,  50,  33 ]
262

    
263
# Gimp
264
gravity :gimp_image,     [  10,   0,  80, 100 ]
265
gravity :gimp_toolbox,   [   0,   0,  10, 100 ]
266
gravity :gimp_dock,      [  90,   0,  10, 100 ]
267

    
268
#
269
# == Grabs
270
#
271
# Grabs are keyboard and mouse actions within subtle, every grab can be
272
# assigned either to a key and/or to a mouse button combination. A grab
273
# consists of a chain and an action.
274
#
275
# === Finding keys
276
#
277
# The best resource for getting the correct key names is
278
# */usr/include/X11/keysymdef.h*, but to make life easier here are some hints
279
# about it:
280
#
281
# * Numbers and letters keep their names, so *a* is *a* and *0* is *0*
282
# * Keypad keys need *KP_* as prefix, so *KP_1* is *1* on the keypad
283
# * Strip the *XK_* from the key names if looked up in
284
#   /usr/include/X11/keysymdef.h
285
# * Keys usually have meaningful english names
286
# * Modifier keys have special meaning (Alt (A), Control (C), Meta (M),
287
#   Shift (S), Super (W))
288
#
289
# === Chaining
290
#
291
# Chains are a combination of keys and modifiers to one or a list of keys
292
# and can be used in various ways to trigger an action. In subtle, there are
293
# two ways to define chains for grabs:
294
#
295
#   1. *Default*: Add modifiers to a key and use it for a grab
296
#
297
#      *Example*: grab "W-Return", "urxvt"
298
#
299
#   2. *Chain*: Define a list of grabs that need to be pressed in order
300
#
301
#      *Example*: grab "C-y Return", "urxvt"
302
#
303
# ==== Mouse buttons
304
#
305
# [*B1*]  = Button1 (Left mouse button)
306
# [*B2*]  = Button2 (Middle mouse button)
307
# [*B3*]  = Button3 (Right mouse button)
308
# [*B4*]  = Button4 (Mouse wheel up)
309
# [*B5*]  = Button5 (Mouse wheel down)
310
# [*...*]
311
# [*B20*] = Button20 (Are you sure that this is a mouse and not a keyboard?)
312
#
313
# ==== Modifiers
314
#
315
# [*A*] = Alt key (Mod1)
316
# [*C*] = Control key
317
# [*M*] = Meta key (Mod3)
318
# [*S*] = Shift key
319
# [*W*] = Super/Windows key (Mod4)
320
# [*G*] = Alt Gr (Mod5)
321
#
322
# === Action
323
#
324
# An action is something that happens when a grab is activated, this can be one
325
# of the following:
326
#
327
# [*symbol*] Run a subtle action
328
# [*string*] Start a certain program
329
# [*array*]  Cycle through gravities
330
# [*lambda*] Run a Ruby proc
331
#
332
# === Example
333
#
334
# This will create a grab that starts a urxvt when Alt+Enter are pressed:
335
#
336
#   grab "A-Return", "urxvt"
337
#   grab "C-a c",    "urxvt"
338
#
339
# === Link
340
#
341
# http://subforge.org/projects/subtle/wiki/Grabs
342
#
343

    
344
# Jump to view1, view2, ...
345
grab "W-S-1", :ViewJump1
346
grab "W-S-2", :ViewJump2
347
grab "W-S-3", :ViewJump3
348
grab "W-S-4", :ViewJump4
349

    
350
# Switch current view
351
grab "W-1", :ViewSwitch1
352
grab "W-2", :ViewSwitch2
353
grab "W-3", :ViewSwitch3
354
grab "W-4", :ViewSwitch4
355

    
356
# Select next and prev view */
357
grab "KP_Add",      :ViewNext
358
grab "KP_Subtract", :ViewPrev
359

    
360
# Move mouse to screen1, screen2, ...
361
grab "W-A-1", :ScreenJump1
362
grab "W-A-2", :ScreenJump2
363
grab "W-A-3", :ScreenJump3
364
grab "W-A-4", :ScreenJump4
365

    
366
# Force reload of config and sublets
367
grab "W-C-r", :SubtleReload
368

    
369
# Force restart of subtle
370
grab "W-C-S-r", :SubtleRestart
371

    
372
# Quit subtle
373
grab "W-C-q", :SubtleQuit
374

    
375
# Move current window
376
grab "W-B1", :WindowMove
377

    
378
# Resize current window
379
grab "W-B3", :WindowResize
380

    
381
# Toggle floating mode of window
382
grab "W-f", :WindowFloat
383

    
384
# Toggle fullscreen mode of window
385
grab "W-space", :WindowFull
386

    
387
# Toggle sticky mode of window (will be visible on all views)
388
grab "W-s", :WindowStick
389

    
390
# Toggle zaphod mode of window (will span across all screens)
391
grab "W-equal", :WindowZaphod
392

    
393
# Raise window
394
grab "W-r", :WindowRaise
395

    
396
# Lower window
397
grab "W-l", :WindowLower
398

    
399
# Select next windows
400
grab "W-Left",  :WindowLeft
401
grab "W-Down",  :WindowDown
402
grab "W-Up",    :WindowUp
403
grab "W-Right", :WindowRight
404

    
405
# Kill current window
406
grab "W-S-k", :WindowKill
407

    
408
# Cycle between given gravities
409
grab "W-KP_7", [ :top_left,     :top_left66,     :top_left33     ]
410
grab "W-KP_8", [ :top,          :top66,          :top33          ]
411
grab "W-KP_9", [ :top_right,    :top_right66,    :top_right33    ]
412
grab "W-KP_4", [ :left,         :left66,         :left33         ]
413
grab "W-KP_5", [ :center,       :center66,       :center33       ]
414
grab "W-KP_6", [ :right,        :right66,        :right33        ]
415
grab "W-KP_1", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
416
grab "W-KP_2", [ :bottom,       :bottom66,       :bottom33       ]
417
grab "W-KP_3", [ :bottom_right, :bottom_right66, :bottom_right33 ]
418

    
419
# In case no numpad is available e.g. on notebooks
420
#grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
421
#grab "W-w", [ :top,          :top66,          :top33          ]
422
#grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
423
#grab "W-a", [ :left,         :left66,         :left33         ]
424
#grab "W-s", [ :center,       :center66,       :center33       ]
425
#grab "W-d", [ :right,        :right66,        :right33        ]
426
#
427
# QUERTZ
428
#grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
429
#
430
# QWERTY
431
#grab "W-z", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
432
#
433
#grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
434
#grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
435

    
436
# Exec programs
437
grab "W-Return", "terminal --hide-menubar"
438

    
439
grab "W-b", :MpdNext
440
grab "W-z", :MpdPrevious
441
grab "W-c", :MpdToggle
442
grab "W-v", :MpdStop
443

    
444

    
445
#
446
# == Tags
447
#
448
# Tags are generally used in subtle for placement of windows. This placement is
449
# strict, that means that - aside from other tiling window managers - windows
450
# must have a matching tag to be on a certain view. This also includes that
451
# windows that are started on a certain view will not automatically be placed
452
# there.
453
#
454
# There are to ways to define a tag:
455
#
456
# === Simple
457
#
458
# The simple way just needs a name and a regular expression to just handle the
459
# placement:
460
#
461
# Example:
462
#
463
#  tag "terms", "terms"
464
#
465
# === Extended
466
#
467
# Additionally tags can do a lot more then just control the placement - they
468
# also have properties than can define and control some aspects of a window
469
# like the default gravity or the default screen per view.
470
#
471
# Example:
472
#
473
#  tag "terms" do
474
#    match   "xterm|[u]?rxvt"
475
#    gravity :center
476
#  end
477
#
478
# === Default
479
#
480
# Whenever a window has no tag it will get the default tag and be placed on the
481
# default view. The default view can either be set by the user with adding the
482
# default tag to a view by choice or otherwise the first defined view will be
483
# chosen automatically.
484
#
485
# === Properties
486
#
487
# [*borderless*] This property enables the borderless mode for tagged clients.
488
#
489
#                Example: borderless true
490
#                Links:    http://subforge.org/projects/subtle/wiki/Tagging#Borderless
491
#                          http://subforge.org/projects/subtle/wiki/Clients#Borderless
492
#
493
# [*fixed*]      This property enables the fixed mode for tagged clients.
494
#
495
#                Example: fixed true
496
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Fixed
497
#                         http://subforge.org/projects/subtle/wiki/Clients#Fixed
498
#
499
# [*float*]      This property enables the float mode for tagged clients.
500
#
501
#                Example: float true
502
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Float
503
#                         http://subforge.org/projects/subtle/wiki/Clients#Float
504
#
505
# [*full*]       This property enables the fullscreen mode for tagged clients.
506
#
507
#                Example: full true
508
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Fullscreen
509
#                         http://subforge.org/projects/subtle/wiki/Clients#Fullscreen
510
#
511
# [*geometry*]   This property sets a certain geometry as well as floating mode
512
#                to the tagged client, but only on views that have this tag too.
513
#                It expects an array with x, y, width and height values whereas
514
#                width and height must be >0.
515
#
516
#                Example: geometry [100, 100, 50, 50]
517
#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Geometry
518
#
519
# [*gravity*]    This property sets a certain to gravity to the tagged client,
520
#                but only on views that have this tag too.
521
#
522
#                Example: gravity :center
523
#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Gravity
524
#
525
# [*match*]      This property adds matching patterns to a tag, a tag can have
526
#                more than one. Matching works either via plaintext, regex
527
#                (see man regex(7)) or window id. Per default tags will only
528
#                match the WM_NAME and the WM_CLASS portion of a client, this
529
#                can be changed with following possible values:
530
#
531
#                [*:name*]      Match the WM_NAME
532
#                [*:instance*]  Match the first (instance) part from WM_CLASS
533
#                [*:class*]     Match the second (class) part from WM_CLASS
534
#                [*:role*]      Match the window role
535
#                [*:type*]      Match the window type
536
#
537
#                Examples: match instance: "urxvt"
538
#                          match [:role, :class] => "test"
539
#                          match "[xa]+term"
540
#                Link:     http://subforge.org/projects/subtle/wiki/Tagging#Match
541
#
542
# [*position*]   Similar to the geometry property, this property just sets the
543
#                x/y coordinates of the tagged client, but only on views that
544
#                have this tag, too. It expects an array with x and y values.
545
#
546
#                Example: position [ 10, 10 ]
547
#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Position
548
#
549
# [*resize*]     This property enables the float mode for tagged clients. When set,
550
#                subtle honors size hints, that define various size constraints like
551
#                sizes for columns and rows of a terminal.
552
#
553
#                Example: resize true
554
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Resize
555
#                         http://subforge.org/projects/subtle/wiki/Clients#Resize
556
#
557
# [*stick*]      This property enables the stick mode for tagged clients. When set,
558
#                clients are visible on all views, even when they don't have matching
559
#                tags. On multihead, sticky clients keep the screen they are assigned
560
#                on.
561
#
562
#                Supported values are either true or a number to specify a screen.
563
#
564
#                Example: stick true
565
#                         stick 1
566
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Stick
567
#                         http://subforge.org/projects/subtle/wiki/Clients#Stick
568
#
569
# [*type*]       This property sets the tagged client to be treated as a specific
570
#                window type though as the window sets the type itself. Following
571
#                types are possible:
572
#
573
#                [*:desktop*]  Treat as desktop window (_NET_WM_WINDOW_TYPE_DESKTOP)
574
#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Desktop
575
#                [*:dock*]     Treat as dock window (_NET_WM_WINDOW_TYPE_DOCK)
576
#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Dock
577
#                [*:toolbar*]  Treat as toolbar windows (_NET_WM_WINDOW_TYPE_TOOLBAR)
578
#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Toolbar
579
#                [*:splash*]   Treat as splash window (_NET_WM_WINDOW_TYPE_SPLASH)
580
#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Splash
581
#                [*:dialog*]   Treat as dialog window (_NET_WM_WINDOW_TYPE_DIALOG)
582
#                              Link: http://subforge.org/projects/subtle/wiki/Clients#Dialog
583
#
584
#                Example: type :desktop
585
#                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Type
586
#
587
# [*urgent*]     This property enables the urgent mode for tagged clients. When set,
588
#                subtle automatically sets this client to urgent.
589
#
590
#                Example: urgent true
591
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Stick
592
#                         http://subforge.org/projects/subtle/wiki/Clients#Urgent
593
#
594
# [*zaphod*]     This property enables the zaphod mode for tagged clients. When set,
595
#                the client spans across all connected screens.
596
#
597
#                Example: zaphod true
598
#                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Zaphod
599
#                         http://subforge.org/projects/subtle/wiki/Clients#Zaphod
600
#
601
#
602
# === Link
603
#
604
# http://subforge.org/projects/subtle/wiki/Tagging
605
#
606

    
607
# Simple tags
608
tag "terms",   "xterm|[u]?rxvt"
609
tag "browser", "uzbl|opera|firefox|navigator"
610

    
611
# Placement
612
tag "editor" do
613
  match  "[g]?vim"
614
  resize true
615
end
616

    
617
tag "fixed" do
618
  geometry [ 10, 10, 100, 100 ]
619
  stick    true
620
end
621

    
622
tag "resize" do
623
  match  "sakura|gvim"
624
  resize true
625
end
626

    
627
tag "gravity" do
628
  gravity :center
629
end
630

    
631
# Modes
632
tag "stick" do
633
  match "mplayer"
634
  float true
635
  stick true
636
end
637

    
638
tag "float" do
639
  match "display"
640
  float true
641
end
642

    
643
# Gimp
644
tag "gimp_image" do
645
  match   :role => "gimp-image-window"
646
  gravity :gimp_image
647
end
648

    
649
tag "gimp_toolbox" do
650
  match   :role => "gimp-toolbox$"
651
  gravity :gimp_toolbox
652
end
653

    
654
tag "gimp_dock" do
655
  match   :role => "gimp-dock"
656
  gravity :gimp_dock
657
end
658

    
659
tag "gimp_scum" do
660
  match role: "gimp-.*|screenshot"
661
end
662

    
663
# Pidgin
664
tag "pidgin_contact" do
665
  match :role => "buddy_list", :class => "Pidgin"
666
  gravity :right33
667
  fixed true
668
  borderless true
669
end
670

    
671
tag "pidgin_conversation" do
672
  match :role => "conversation", :class => "Pidgin"
673
  gravity :left66
674
  fixed true
675
  borderless true
676
end
677

    
678
#
679
# == Views
680
#
681
# Views are the virtual desktops in subtle, they show all windows that share a
682
# tag with them. Windows that have no tag will be visible on the default view
683
# which is the view with the default tag or the first defined view when this
684
# tag isn't set.
685
#
686
# Like tags views can be defined in two ways:
687
#
688
# === Simple
689
#
690
# The simple way is exactly the same as for tags:
691
#
692
# Example:
693
#
694
#   view "terms", "terms"
695
#
696
# === Extended
697
#
698
# The extended way for views is also similar to the tags, but with fewer
699
# properties.
700
#
701
# Example:
702
#
703
#  view "terms" do
704
#    match "terms"
705
#    icon  "/usr/share/icons/icon.xbm"
706
#  end
707
#
708
# === Properties
709
#
710
# [*match*]      This property adds a matching pattern to a view. Matching
711
#                works either via plaintext or regex (see man regex(7)) and
712
#                applies to names of tags.
713
#
714
#                Example: match "terms"
715
#
716
# [*dynamic*]    This property hides unoccupied views, views that display no
717
#                windows.
718
#
719
#                Example: dynamic true
720
#
721
# [*icon*]       This property adds an icon in front of the view name. The
722
#                icon can either be path to an icon or an instance of
723
#                Subtlext::Icon.
724
#
725
#                Example: icon "/usr/share/icons/icon.xbm"
726
#                         icon Subtlext::Icon.new("/usr/share/icons/icon.xbm")
727
#
728
# [*icon_only*]  This property hides the view name from the view buttons, just
729
#                the icon will be visible.
730
#
731
#                Example: icon_only true
732
#
733
#
734
# === Link
735
#
736
# http://subforge.org/projects/subtle/wiki/Tagging
737
#
738

    
739
view "terms", "terms|default"
740
view "www",   "browser"
741

    
742
view "gimp" do
743
  match "gimp_.*"
744
  dynamic true
745
end
746

    
747
view "pidgin" do
748
  match "pidgin_.*"
749
  dynamic true
750
end
751

    
752
view "dev",   "editor"
753

    
754
#
755
# == Sublets
756
#
757
# Sublets are Ruby scripts that provide data for the panel and can be managed
758
# with the sur script that comes with subtle.
759
#
760
# === Example
761
#
762
#  sur install clock
763
#  sur uninstall clock
764
#  sur list
765
#
766
# === Configuration
767
#
768
# All sublets have a set of configuration values that can be changed directly
769
# from the config of subtle.
770
#
771
# There are three default properties, that can be be changed for every sublet:
772
#
773
# [*interval*]    Update interval of the sublet
774
# [*foreground*]  Default foreground color
775
# [*background*]  Default background color
776
#
777
# sur can also give a brief overview about properties:
778
#
779
# === Example
780
#
781
#   sur config clock
782
#
783
# The syntax of the sublet configuration is similar to other configuration
784
# options in subtle:
785
#
786
# === Example
787
#
788
#  sublet :clock do
789
#    interval      30
790
#    foreground    "#eeeeee"
791
#    background    "#000000"
792
#    format_string "%H:%M:%S"
793
#  end
794
#
795

    
796
sublet :clock do
797
  style :clock
798
  interval 10
799
  format_string "%R (%d. %b)"
800
end
801

    
802

    
803
#  === Link
804
#
805
# http://subforge.org/projects/subtle/wiki/Sublets
806
#
807

    
808
#
809
# == Hooks
810
#
811
# And finally hooks are a way to bind Ruby scripts to a certain event.
812
#
813
# Following hooks exist so far:
814
#
815
# [*:client_create*]    Called whenever a window is created
816
# [*:client_configure*] Called whenever a window is configured
817
# [*:client_focus*]     Called whenever a window gets focus
818
# [*:client_kill*]      Called whenever a window is killed
819
#
820
# [*:tag_create*]       Called whenever a tag is created
821
# [*:tag_kill*]         Called whenever a tag is killed
822
#
823
# [*:view_create*]      Called whenever a view is created
824
# [*:view_configure*]   Called whenever a view is configured
825
# [*:view_jump*]        Called whenever the view is switched
826
# [*:view_kill*]        Called whenever a view is killed
827
#
828
# [*:tile*]             Called on whenever tiling would be needed
829
# [*:reload*]           Called on reload
830
# [*:start*]            Called on start
831
# [*:exit*]             Called on exit
832
#
833
# === Example
834
#
835
# This hook will print the name of the window that gets the focus:
836
#
837
#   on :client_focus do |c|
838
#     puts c.name
839
#   end
840
#
841
# === Link
842
#
843
# http://subforge.org/projects/subtle/wiki/Hooks
844
#
845

    
846
# === Contrib
847
#
848
# http://subforge.org/projects/subtle-contrib/wiki/
849
#
850
begin
851
  require "#{ENV["HOME"]}/subtle-contrib/ruby/launcher.rb" 
852

    
853
  Subtle::Contrib::Launcher.fonts = [
854
    "xft:Insonsolata:pixelsize=60:antialias=true",
855
    "xft:Inconsolata:pixelsize=12:antialias=true" 
856
  ] 
857
  Subtle::Contrib::Launcher.paths = ENV["PATH"]
858
rescue LoadError => error
859
  puts error
860
end
861

    
862
grab "W-x" do
863
  Subtle::Contrib::Launcher.run
864
end
865
# vim:ts=2:bs=2:sw=2:et:fdm=marker