guest@dotshare [~/groups/wms/subtle] $ ls Midnight/ | cat

Midnight (scrot, raw, dl) (+7 likes)

spjulius Aug 01, 2011 (wms/subtle)

SCROT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
#
# Author::  Christoph Kappel <unexist@dorfelite.net>
# Version:: $Id$
# License:: GNU GPL
#
# = Subtle default configuration # {{{
#
# This file will be installed as default and can also be used as a starter for
# an own custom configuration file. The system wide config usually resides in
# +/etc/xdg/subtle+ and the user config in +HOME/.config/subtle+, both locations
# are dependent on the locations specified by +XDG_CONFIG_DIRS+ and
# +XDG_CONFIG_HOME+.

begin
  require "#{ENV["HOME"]}/hg/subtle-contrib/ruby/launcher.rb"

  # Set fonts
   Subtle::Contrib::Launcher.fonts = [
    "xft:Pragmata:pixelsize=9:antialias=true",
   ]
rescue LoadError => error
  puts error
end


# == Options
#
# Border size in pixel of the windows

# Window move/resize steps in pixel per keypress
set :step, 5

# Window screen border snapping
set :snap, 10

set :gap, 3

# Default starting gravity for windows (0 = gravity of last client)
set :gravity, :center

# Make transient windows urgent
set :urgent, false

# Honor resize size hints globally
set :resize, true

# Screen strut for e.g. other panels (left, right, top, bottom)

# Font string either take from e.g. xfontsel or use xft
#set :font, "-*-*-medium-*-*-*-14-*-*-*-*-*-*-*"
set :font, "xft:pragmata:pixelsize=9"

# Space around windows

# Panel size padding (left, right, top, bottom)

# Separator between sublets
set :separator, "//"

# Outline border size in pixel of panel items #}}}


screen 1 do
  # Add stipple to panels
  stipple false

  # Content of the bottom panel
  bottom     [ :title, :spacer, :views, ]

  # Content of the top panel
  top  [ :spacer, :mpd, :separator, :clock, ]
end #}}}


# Colors of focus window title
style :title do
  padding     1, 10, 0
  foreground  "#aaaaaa"
  border_bottom "#303030", 0
  background  "#151515"
end

style :focus do
  padding     1, 4, 0, 4
  foreground  "#151515"
  background  "#739896"
end

style :urgent do
  padding     3, 4, 0, 4
  border_bottom "#8edf8d", 2
  foreground  "#ffffff"
  background  "#519f50"
end

style :occupied do
  padding     1, 4, 0, 4
  border_bottom "#303030", 2
  foreground  "#606060"
  background  "#151515"
end

style :views do
  padding     1, 4, 0, 4
  foreground  "#aaaaaa"
  background  "#151515"
end

style :sublets do
  padding     1, 10, 0
  foreground  "#707070"
  border_bottom "#303030", 0
  background  "#151515"
end

style :separator do
  padding     1, 0, 0
  foreground  "#983528"
  background  "#151515"
end

style :clients do
  active      "#739896", 3
  inactive    "#252525", 3
  margin      4
end

style :subtle do
  padding     2
  panel_top   "#151515"
  panel_bottom "#151515"
  launcher_top "#202020"
  launcher_bottom "#ff0000"
  stipple     "#757575"
end

# }}}

# == Gravities# {{{

# set :tiling, true

# Top left
gravity :tl_a1,             [   0,   0,  33,  33 ]
gravity :tl_a2,             [   0,   0,  50,  33 ]
gravity :tl_a3,             [   0,   0,  67,  33 ]

gravity :tl_b1,             [   0,   0,  33,  50 ]
gravity :tl_b2,             [   0,   0,  50,  50 ]
gravity :tl_b3,             [   0,   0,  67,  50 ]

gravity :tl_c1,             [   0,   0,  33,  67 ]
gravity :tl_c2,             [   0,   0,  50,  67 ]
gravity :tl_c3,             [   0,   0,  67,  67 ]

# Top center
gravity :tc_a1,             [   0,   0, 100,  50 ]
gravity :tc_a2,             [   0,   0, 100,  67 ]
gravity :tc_a3,             [   0,   0, 100,  33 ]

gravity :tc_b1,             [  33,   0,  34,  33 ]
gravity :tc_b2,             [  33,   0,  34,  50 ]
gravity :tc_b3,             [  33,   0,  34,  67 ]

# Top right
gravity :tr_a1,             [  67,   0,  33,  33 ]
gravity :tr_a2,             [  50,   0,  50,  33 ]
gravity :tr_a3,             [  33,   0,  67,  33 ]

gravity :tr_b1,             [  67,   0,  33,  50 ]
gravity :tr_b2,             [  50,   0,  50,  50 ]
gravity :tr_b3,             [  33,   0,  67,  50 ]

gravity :tr_c1,             [  67,   0,  33,  67 ]
gravity :tr_c2,             [  50,   0,  50,  67 ]
gravity :tr_c3,             [  33,   0,  67,  67 ]

# Left
gravity :l_a1,              [   0,  33,  33,  34 ]
gravity :l_a2,              [   0,  33,  50,  34 ]
gravity :l_a3,              [   0,  33,  67,  34 ]

gravity :l_b1,              [   0,  50,  33, 100 ]
gravity :l_b2,              [   0,  50,  50, 100 ]
gravity :l_b3,              [   0,  50,  67, 100 ]


# Center
gravity :center,            [   0,   0, 100, 100 ]

# Right
gravity :r_a1,              [  67,  33,  33,  34 ]
gravity :r_a2,              [  50,  33,  50,  34 ]
gravity :r_a3,              [  33,  33,  67,  34 ]

gravity :r_b1,              [  67,  50,  33, 100 ]
gravity :r_b2,              [  50,  50,  50, 100 ]
gravity :r_b3,              [  33,  50,  67, 100 ]

# Bottom left
gravity :bl_a1,             [   0,  67,  33,  33 ]
gravity :bl_a2,             [   0,  67,  50,  33 ]
gravity :bl_a3,             [   0,  67,  67,  33 ]

gravity :bl_b1,             [   0,  50,  33,  50 ]
gravity :bl_b2,             [   0,  50,  50,  50 ]
gravity :bl_b3,             [   0,  50,  67,  50 ]

gravity :bl_c1,             [   0,  33,  33,  67 ]
gravity :bl_c2,             [   0,  33,  50,  67 ]
gravity :bl_c3,             [   0,  33,  67,  67 ]

# Bottom center
gravity :bc_a1,             [   0,  50, 100,  50 ]
gravity :bc_a2,             [   0,  33, 100,  67 ]
gravity :bc_a3,             [   0,  67, 100,  33 ]

gravity :bc_b1,             [  33,  67,  34,  33 ]
gravity :bc_b2,             [  33,  50,  34,  50 ]
gravity :bc_b3,             [  33,  33,  34,  67 ]

# Bottom right
gravity :br_a1,             [  67,  67,  33,  33 ]
gravity :br_a2,             [  50,  67,  50,  33 ]
gravity :br_a3,             [  33,  67,  67,  33 ]

gravity :br_b1,             [  67,  50,  33,  50 ]
gravity :br_b2,             [  50,  50,  50,  50 ]
gravity :br_b3,             [  33,  50,  67,  50 ]

gravity :br_c1,             [  67,  33,  33,  67 ]
gravity :br_c2,             [  50,  33,  50,  67 ]
gravity :br_c3,             [  33,  33,  67,  67 ]

# Gimp
gravity :gimp_image,        [  10,   0,  80, 100 ]
gravity :gimp_toolbox,      [   0,   0,  10, 100 ]
gravity :gimp_dock,         [  90,   0,  10, 100 ]

# }}}


# Switch current view
grab "W-1", :ViewSwitch1
grab "W-2", :ViewSwitch2
grab "W-3", :ViewSwitch3
grab "W-4", :ViewSwitch4
grab "W-5", :ViewSwitch5
grab "W-6", :ViewSwitch6
grab "W-7", :ViewSwitch7

(1..7).each do |i|
  grab "W-S-%d" % [ i ] do |c|
    views = Subtlext::View.all
    names = views.map { |v| v.name }
 
    # Sanity check
    if(i <= views.size)
      # Tag client
      tags = c.tags.reject { |t| names.include?(t.name) or "default" == t.name }
      tags << names[i - 1]
 
      c.tags = tags
 
      # Tag view
      views[i - 1].tag(names[i - 1])
    end
  end
end

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

# Move mouse to screen1, screen2, ...
grab "W-A-1", :ScreenJump1
grab "W-A-2", :ScreenJump2
grab "W-A-3", :ScreenJump3
grab "W-A-4", :ScreenJump4

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

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

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

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

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

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

# Launcher
grab "W-space" do Subtle::Contrib::Launcher.run; end

# Toggle sticky mode of window (will be visible on all views)
#grab "W-C-s", :WindowStick
grab "W-C-s" do |c| c.toggle_stick; c.tags = [ Subtlext::View.current.name ]; end

# Raise window
grab "W-r", :WindowRaise

# Lower window
grab "W-m", :WindowLower

# Select next windows
grab "W-h",  :WindowLeft
grab "W-j",  :WindowDown
grab "W-k",  :WindowUp
grab "W-l",  :WindowRight

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

# Cycle between given gravities

grab "W-KP_7",  [ :tl_a1, :tl_a2, :tl_a3, :tl_b1, :tl_b2, :tl_b3, :tl_c1, :tl_c2, :tl_c3 ]
grab "W-KP_8",  [ :tc_a1, :tc_a2, :tc_a3, :tc_b1, :tc_b2, :tc_b3                         ]
grab "W-KP_9",  [ :tr_a1, :tr_a2, :tr_a3, :tr_b1, :tr_b2, :tr_b3, :tr_c1, :tr_c2, :tr_c3 ]

grab "W-KP_4",  [ :l_a1,  :l_a2,  :l_a3,  :l_b1,  :l_b2,  :l_b3 ]
grab "W-KP_6",  [ :r_a1,  :r_a2,  :r_a3,  :r_b1,  :r_b2,  :r_b3 ]

grab "W-KP_1",  [ :tl_a1, :tl_a2, :tl_a3, :tl_b1, :tl_b2, :tl_b3, :tl_c1, :tl_c2, :tl_c3 ]
grab "W-KP_2",  [ :bc_a1, :bc_a2, :bc_a3, :bc_b1, :bc_b2, :bc_b3                         ]
grab "W-KP_3",  [ :br_a1, :br_a2, :br_a3, :br_b1, :br_b2, :br_b3, :br_c1, :br_c2, :br_c3 ]

# In case no numpad is available e.g. on notebooks

grab "W-q",     [ :tl_a1, :tl_a2, :tl_a3, :tl_b1, :tl_b2, :tl_b3, :tl_c1, :tl_c2, :tl_c3 ]
grab "W-w",     [ :tc_a1, :tc_a2, :tc_a3, :tc_b1, :tc_b2, :tc_b3                         ]
grab "W-e",     [ :tr_a1, :tr_a2, :tr_a3, :tr_b1, :tr_b2, :tr_b3, :tr_c1, :tr_c2, :tr_c3 ]

grab "W-a",     [ :l_a1,  :l_a2,  :l_a3,  :l_b1,  :l_b2,  :l_b3 ]
grab "W-d",     [ :r_a1,  :r_a2,  :r_a3,  :r_b1,  :r_b2,  :r_b3 ]

grab "W-z",     [ :bl_a1, :bl_a2, :bl_a3, :bl_b1, :bl_b2, :bl_b3, :bl_c1, :bl_c2, :bl_c3 ]
grab "W-x",     [ :bc_a1, :bc_a2, :bc_a3, :bc_b1, :bc_b2, :bc_b3                         ]
grab "W-c",     [ :br_a1, :br_a2, :br_a3, :br_b1, :br_b2, :br_b3, :br_c1, :br_c2, :br_c3 ]

# Exec programs

grab "W-Return", "urxvt"
grab "A-F2", 'dmenu_run -fn "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*" -nb "#202020" -nf "#757575" -sb "#757575" -sf "#202020" -p "RUN:" -i'
grab "XF86AudioMute", "amixer sset Master toggle"
grab "XF86AudioLowerVolume", "amixer set Master 1%- unmute"
grab "XF86AudioRaiseVolume", "amixer set Master 1%+ unmute"
grab "XF86HomePage", "firefox"

# Media Keys
grab "XF86AudioPlay", "mpc toggle"
grab "XF86AudioPrev", "mpc prev"
grab "XF86AudioNext", "mpc next"
grab "XF86AudioStop", "mpc stop"
grab "XF86AudioMedia", "/home/spjulius/bin/mpm"
grab "XF86AudioLowerVolume", "/home/spjulius/bin/volume -d 5"
grab "XF86AudioRaiseVolume", "/home/spjulius/bin/volume -i 5"
grab "XF86AudioMute", "/home/spjulius/bin/volume -t"
grab "W-XF86AudioMedia", "albumbler"

# Run Ruby lambdas
grab "S-F2" do |c|
  puts c.name
end

grab "S-F3" do
  puts Subtlext::VERSION
end # }}}

# == Tags# {{{

# Simple tags
tag "terms",   "xterm|[u]?rxvt"
tag "browser", "uzbl|opera|firefox|navigator"
tag "filem",   "thunar|gtk2fontsel|lxappearance" 
tag "editor",  "gedit"
tag "chat",    "emesene|pidgin"

# Placement
tag "editor" do
  match  "[g]?vim"
  resize true
end

tag "fixed" do
  geometry [ 10, 10, 100, 100 ]
  stick    true
end

tag "resize" do
  match  "sakura|gvim"
  resize true
end

tag "gravity" do
  gravity :center
end

# Modes
tag "stick" do
  match "mplayer"
  float true
  stick true
end

tag "float" do
  match "display"
  float true
end

# Gimp
tag "gimp_image" do
  match   :role => "gimp-image-window"
  gravity :gimp_image
end

tag "gimp_toolbox" do
  match   :role => "gimp-toolbox$"
  gravity :gimp_toolbox
end

tag "gimp_dock" do
  match   :role => "gimp-dock"
  gravity :gimp_dock
end


# == Views # {{{

view "TERMS" do
  match "terms|default"
  icon_only false
end

view "MISC" do
  match "editor"
end

view "INET" do
  match "browser"
end

view "FILEM" do
  match "gimp_.*|filem|chat"

end #}}}

# == Sublets# {{{

sublet :fuzzytime do
  locale        "es"
end

sublet :pacman do
  interval      60
  separator     "/"
  label_color   "#D23D3D"
  count_color   "#404040"
end

sublet :smpd do
  artist_color  "#8542FF"
  title_color   "#505050"
  pause_color   "#101010"
end

# }}}

# == Hooks# {{{
on :start do

  # Create missing tags
  views = Subtlext::View.all.map { |v| v.name }
  tags  = Subtlext::Tag.all.map { |t| t.name }
 
  views.each do |v|
    unless(tags.include?(v))
      t = Subtlext::Tag.new(v)
      t.save
    end
  end
end

on :client_create do |c|
  view = Subtlext::View.current
  tags = c.tags.map { |t| t.name }
 
  # Add tag to view
  view.tag(view.name) unless(view.tags.include?(view.name))
 
  # Exclusive for clients with default tag only
  if(tags.include?("default") and 1 == tags.size)
    c.tags = [ view.name ]
  end
    
  # Focus client on creation
  c.views.first.jump
  c.focus
end

#}}}

CLICK TO VIEW

x

Notes

My subtle config, only the mpd and clock sublets

Comments

dipilibupap said about 13 years ago

<3 it man !

spjulius said about 13 years ago

thanks dipi

Him said about 13 years ago

Beautiful. I love it when setups come together this way.

Zypeh said about 12 years ago

begin
require “#{ENV["HOME”]}/hg/subtle-contrib/ruby/launcher.rb"
^ what does this line mean? thank you.