Advertisement
Guest User

subtle.rb

a guest
Mar 19th, 2011
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 18.65 KB | None | 0 0
  1. #
  2. # Author:: Christoph Kappel <unexist@dorfelite.net>
  3. # Version:: $Id: contrib/subtle.rb,v 2264 2010/11/08 23:03:50 unexist $
  4. # License:: GNU GPL
  5. #
  6. # = Subtle example configuration
  7. #
  8. # This file will be installed as default and can also be used as a starter for
  9. # an own custom configuration file. The system wide config usually resides in
  10. # +/etc/xdg/subtle+ and the user config in +HOME/.config/subtle+, both locations
  11. # are dependent on the locations specified by +XDG_CONFIG_DIRS+ and
  12. # +XDG_CONFIG_HOME+.
  13. #
  14.  
  15. # == Options {{{
  16. #
  17. # Following options change behaviour and sizes of the window manager:
  18. #
  19. # Border size in pixel of the windows
  20. set :border, 1
  21.  
  22. # Window move/resize steps in pixel per keypress
  23. set :step, 5
  24.  
  25. # Window screen border snapping
  26. set :snap, 10
  27.  
  28. # Default starting gravity for windows (0 = gravity of last client)
  29. set :gravity, :center
  30.  
  31. # Make transient windows urgent
  32. set :urgent, false
  33.  
  34. # Enable respecting of size hints globally
  35. set :resize, false
  36.  
  37. # Screen size padding (left, right, top, bottom)
  38. set :padding, [ 0, 0, 1, 0 ]
  39.  
  40. # Font string either take from e.g. xfontsel or use xft
  41. set :font, "-*-clean-medium-*-*-*-12-*-*-*-*-*-*-*"
  42. #set :font, "xft:sans-8"
  43.  
  44. # Space around windows
  45. set :gap, 0
  46.  
  47. # Separator between sublets
  48. set :separator, " "
  49.  
  50. # Outline border size in pixel of panel items
  51. set :outline, 0
  52. # == Options }}}
  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 sublets
  58. # screen wise. Per default only the top panel on the first screen is used, it's
  59. # up to the user to enable the bottom panel or disable either one or both.
  60. #
  61. # Empty panels are hidden.
  62. #
  63. # Following items are available:
  64. #
  65. # [*:views*] List of views with buttons
  66. # [*:title*] Title of the current active window
  67. # [*:tray*] Systray icons (Can be used once)
  68. # [*:sublets*] Catch-all for installed sublets
  69. # [*:sublet*] Name of a sublet for direct placement
  70. # [*:spacer*] Variable spacer (free width / count of spacers)
  71. # [*:center*] Enclose items with :center to center them on the panel
  72. # [*:separator*] Insert separator
  73. #
  74. # === Link
  75. #
  76. # http://subforge.org/wiki/subtle/Panel
  77. #
  78.  
  79. screen 1 do
  80.   # Add stipple to panels
  81.   stipple false
  82.  
  83.   # Content of the top panel
  84.   top [ :clock, :wifi, :spacer, :battery, :temp, :mpd ]
  85.  
  86.   # Content of the bottom panel
  87.   bottom [  :views, :task,
  88.             :spacer, :separator,
  89.             :gmail, :separator,
  90.             :battery, :separator,
  91.             :spacer, :temp,
  92.             :volume, :tray
  93.   ]
  94. end
  95. # == Screen }}}
  96.  
  97. # == Colors {{{
  98. #
  99. # Colors directly define the look of subtle, valid values are:
  100. #
  101. # [*hexadecimal*] #0000ff
  102. # [*decimal*] (0, 0, 255)
  103. # [*names*] blue
  104. #
  105. # Whenever there is no valid value for a color set - subtle will use a default
  106. # one. There is only one exception to this: If no background color is given no
  107. # color will be set. This will ensure a custom background pixmap won't be
  108. # overwritten.
  109. #
  110. # === Link
  111. #
  112. # http://subforge.org/wiki/subtle/Themes
  113. #
  114.  
  115. # Colors {{{
  116. color :title_fg, "#ffffff"
  117. color :title_bg, "#1a1a1a"
  118. color :title_border, "#1a1a1a"
  119.  
  120. color :focus_fg, "#ffffff"
  121. color :focus_bg, "#595959"
  122. color :focus_border, "#1a1a1a"
  123.  
  124. color :urgent_fg, "#850000"
  125. #color :urgent_bg, "#404040"
  126. #color :urgent_border, "#1a1a1a"
  127.  
  128. color :occupied_fg, "#777777"
  129. color :occupied_bg, "#404040"
  130. color :occupied_border, "#1a1a1a"
  131.  
  132. color :views_fg, "#a8a8a8"
  133. color :views_bg, "#1a1a1a"
  134. color :views_border, "#1a1a1a"
  135.  
  136. color :sublets_fg, "#595959"
  137. color :sublets_bg, "#1a1a1a"
  138. color :sublets_border, "#1a1a1a"
  139.  
  140. color :client_active, "#595959"
  141. color :client_inactive, "#404040"
  142.  
  143. color :panel, "#1a1a1a"
  144. #color :background, "#404040"
  145.  
  146. color :stipple, "#595959"
  147. color :separator, "#850000"
  148. # }}}
  149.  
  150. # == Gravities {{{
  151. #
  152. # Gravities are predefined sizes a window can be set to. There are several ways
  153. # to set a certain gravity, most convenient is to define a gravity via a tag or
  154. # change them during runtime via grab. Subtler and subtlext can also modify
  155. # gravities.
  156. #
  157. # A gravity consists of four values which are a percentage value of the screen
  158. # size. The first two values are x and y starting at the center of the screen
  159. # and he last two values are the width and height.
  160. #
  161. # === Example
  162. #
  163. # Following defines a gravity for a window with 100% width and height:
  164. #
  165. # gravity :example, [ 0, 0, 100, 100 ]
  166. #
  167. # === Link
  168. #
  169. # http://subforge.org/wiki/subtle/Gravity
  170. #
  171.  
  172.   # Top left
  173. gravity :top_left, [ 0, 0, 59, 50 ]
  174. gravity :top_left66, [ 0, 0, 59, 66 ]
  175. gravity :top_left33, [ 0, 0, 59, 34 ]
  176.  
  177.   # Top
  178. gravity :top, [ 0, 0, 100, 50 ]
  179. gravity :top66, [ 0, 0, 100, 66 ]
  180. gravity :top33, [ 0, 0, 100, 34 ]
  181.  
  182.   # Top right
  183. gravity :top_right, [ 100, 0, 41, 50 ]
  184. gravity :top_right66, [ 100, 0, 41, 66 ]
  185. gravity :top_right33, [ 100, 0, 41, 34 ]
  186.  
  187.   # Left
  188. gravity :left, [ 0, 0, 59, 100 ]
  189. gravity :left66, [ 0, 50, 59, 34 ]
  190. gravity :left33, [ 0, 50, 30, 34 ]
  191.  
  192.   # Center
  193. gravity :center, [ 0, 0, 100, 100 ]
  194. gravity :center66, [ 0, 50, 100, 34 ]
  195. gravity :center33, [ 50, 50, 50, 34 ]
  196.  
  197.   # Right
  198. gravity :right, [ 100, 0, 41, 100 ]
  199. gravity :right66, [ 100, 50, 41, 34 ]
  200. gravity :right33, [ 100, 50, 20, 34 ]
  201.  
  202.   # Bottom left
  203. gravity :bottom_left, [ 0, 100, 59, 50 ]
  204. gravity :bottom_left66, [ 0, 100, 59, 66 ]
  205. gravity :bottom_left33, [ 0, 100, 59, 34 ]
  206.  
  207.   # Bottom
  208. gravity :bottom, [ 0, 100, 100, 50 ]
  209. gravity :bottom66, [ 0, 100, 100, 66 ]
  210. gravity :bottom33, [ 0, 100, 100, 34 ]
  211.  
  212.   # Bottom right
  213. gravity :bottom_right, [ 100, 100, 41, 50 ]
  214. gravity :bottom_right66, [ 100, 100, 41, 66 ]
  215. gravity :bottom_right33, [ 100, 100, 41, 34 ]
  216.  
  217.   # Gimp
  218. gravity :gimp_image, [ 50, 50, 80, 100 ]
  219. gravity :gimp_toolbox, [ 0, 0, 10, 100 ]
  220. gravity :gimp_dock, [ 100, 0, 10, 100 ]
  221. # == Gravities }}}
  222.  
  223. # == Grabs {{{
  224. #
  225. # Grabs are keyboard and mouse actions within subtle, every grab can be
  226. # assigned either to a key and/or to a mouse button combination. A grab
  227. # consists of a chain and an action.
  228. #
  229. # === Finding keys
  230. #
  231. # The best resource for getting the correct key names is
  232. # */usr/include/X11/keysymdef.h*, but to make life easier here are some hints
  233. # about it:
  234. #
  235. # * Numbers and letters keep their names, so *a* is *a* and *0* is *0*
  236. # * Keypad keys need *KP_* as prefix, so *KP_1* is *1* on the keypad
  237. # * Strip the *XK_* from the key names if looked up in
  238. # /usr/include/X11/keysymdef.h
  239. # * Keys usually have meaningful english names
  240. # * Modifier keys have special meaning (Alt (A), Control (C), Meta (M),
  241. # Shift (S), Super (W))
  242. #
  243. # === Chaining
  244. #
  245. # Chains are a combination of keys and modifiers to one key and can be used in
  246. # various ways to trigger an action. In subtle there are two ways to define
  247. # chains for grabs:
  248. #
  249. # 1. Default way*: Add modifiers to a key and use it for a grab
  250. #
  251. # *Example*: grab "W-Return", "urxvt"
  252. #
  253. # 2. *Escape way*: Define an escape grab that needs to be pressed before
  254. # *any* other grab can be used like in screen/tmux.
  255. #
  256. # *Example*: grab "C-y", :SubtleEscape
  257. # grab "Return", "urxvt"
  258. #
  259. # ==== Mouse buttons
  260. #
  261. # [*B1*] = Button1 (Left mouse button)
  262. # [*B2*] = Button2 (Middle mouse button)
  263. # [*B3*] = Button3 (Right mouse button)
  264. # [*B4*] = Button4 (Mouse wheel up)
  265. # [*B5*] = Button5 (Mouse wheel down)
  266. #
  267. # ==== Modifiers
  268. #
  269. # [*A*] = Alt key
  270. # [*C*] = Control key
  271. # [*M*] = Meta key
  272. # [*S*] = Shift key
  273. # [*W*] = Super (Windows) key
  274. #
  275. # === Action
  276. #
  277. # An action is something that happens when a grab is activated, this can be one
  278. # of the following:
  279. #
  280. # [*symbol*] Run a subtle action
  281. # [*string*] Start a certain program
  282. # [*array*] Cycle through gravities
  283. # [*lambda*] Run a Ruby proc
  284. #
  285. # === Example
  286. #
  287. # This will create a grab that starts a urxvt when Alt+Enter are pressed:
  288. #
  289. # grab "A-Return", "urxvt"
  290. #
  291. # === Link
  292. #
  293. # http://subforge.org/wiki/subtle/Grabs
  294. #
  295.  
  296. # Escape grab
  297. # grab "C-y", :SubtleEscape
  298.  
  299. # Jump to view1, view2, ...
  300. grab "W-S-1", :ViewJump1
  301. grab "W-S-2", :ViewJump2
  302. grab "W-S-3", :ViewJump3
  303. grab "W-S-4", :ViewJump4
  304.  
  305. # Switch current view
  306. grab "W-1", :ViewSwitch1
  307. grab "W-2", :ViewSwitch2
  308. grab "W-3", :ViewSwitch3
  309. grab "W-4", :ViewSwitch4
  310.  
  311. # Select next and prev view */
  312. grab "KP_Add", :ViewNext
  313. grab "KP_Subtract", :ViewPrev
  314.  
  315. # Move mouse to screen1, screen2, ...
  316. grab "W-A-1", :ScreenJump1
  317. grab "W-A-2", :ScreenJump2
  318. grab "W-A-3", :ScreenJump3
  319. grab "W-A-4", :ScreenJump4
  320.  
  321. # Force reload of config and sublets
  322. grab "W-C-r", :SubtleReload
  323.  
  324. # Force restart of subtle
  325. grab "W-C-S-r", :SubtleRestart
  326.  
  327. # Quit subtle
  328. grab "W-S-q", :SubtleQuit
  329.  
  330. # Move current window
  331. grab "W-B1", :WindowMove
  332.  
  333. # Resize current window
  334. grab "W-B3", :WindowResize
  335.  
  336. # Toggle floating mode of window
  337. grab "W-f", :WindowFloat
  338.  
  339. # Toggle fullscreen mode of window
  340. grab "W-space", :WindowFull
  341.  
  342. # Toggle sticky mode of window (will be visible on all views)
  343. grab "W-v", :WindowStick
  344.  
  345. # Raise window
  346. grab "W-r", :WindowRaise
  347.  
  348. # Lower window
  349. grab "W-l", :WindowLower
  350.  
  351. # Select next windows
  352. grab "W-Left", :WindowLeft
  353. grab "W-Down", :WindowDown
  354. grab "W-Up", :WindowUp
  355. grab "W-Right", :WindowRight
  356. grab "A-S-Tab", :WindowLeft
  357. grab "A-Tab", :WindowRight
  358. grab "W-S-Tab", :WindowUp
  359. grab "W-Tab", :WindowDown
  360.  
  361. # Kill current window
  362. grab "A-F4", :WindowKill
  363.  
  364. # Cycle between given gravities
  365. grab "W-KP_7", [ :top_left, :top_left66, :top_left33 ]
  366. grab "W-KP_8", [ :top, :top66, :top33 ]
  367. grab "W-KP_9", [ :top_right, :top_right66, :top_right33 ]
  368. grab "W-KP_4", [ :left, :left66, :left33 ]
  369. grab "W-KP_5", [ :center, :center66, :center33 ]
  370. grab "W-KP_6", [ :right, :right66, :right33 ]
  371. grab "W-KP_1", [ :bottom_left, :bottom_left66, :bottom_left33 ]
  372. grab "W-KP_2", [ :bottom, :bottom66, :bottom33 ]
  373. grab "W-KP_3", [ :bottom_right, :bottom_right66, :bottom_right33 ]
  374. grab "W-q", [ :top_left, :top_left66, :top_left33 ]
  375. grab "W-w", [ :top, :top66, :top33 ]
  376. grab "W-e", [ :top_right, :top_right66, :top_right33 ]
  377. grab "W-a", [ :left, :left66, :left33 ]
  378. grab "W-s", [ :center, :center66, :center33 ]
  379. grab "W-d", [ :right, :right66, :right33 ]
  380. grab "W-z", [ :bottom_left, :bottom_left66, :bottom_left33 ]
  381. grab "W-x", [ :bottom, :bottom66, :bottom33 ]
  382. grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
  383.  
  384. # Exec programs
  385. grab "A-F2", 'dmenu_run -nb "#908884" -nf "#000" -sb "#22211f" -sf "#908884" -p "Launch:" -i'
  386. grab "W-Return", "urxvtc"
  387.  
  388. # Run Ruby lambdas
  389. grab "S-F2" do |c|
  390.   puts c.name
  391. end
  392.  
  393. grab "S-F3" do
  394.   puts Subtlext::VERSION
  395. end
  396. # == Grabs }}}
  397.  
  398. # == Tags {{{
  399. #
  400. # Tags are generally used in subtle for placement of windows. This placement is
  401. # strict, that means that - aside from other tiling window managers - windows
  402. # must have a matching tag to be on a certain view. This also includes that
  403. # windows that are started on a certain view will not automatically be placed
  404. # there.
  405. #
  406. # There are to ways to define a tag:
  407. #
  408. # [*string*] With a WM_CLASS/WM_NAME
  409. # [*hash*] With a hash of properties
  410. #
  411. # === Default
  412. #
  413. # Whenever a window has no tag it will get the default tag and be placed on the
  414. # default view. The default view can either be set by the user with adding the
  415. # default tag to a view by choice or otherwise the first defined view will be
  416. # chosen automatically.
  417. #
  418. # === Properties
  419. #
  420. # Additionally tags can do a lot more then just control the placement - they
  421. # also have properties than can define and control some aspects of a window
  422. # like the default gravity or the default screen per view.
  423. #
  424. # [*float*] This property either sets the tagged client floating or prevents
  425. # it from being floating depending on the value.
  426. #
  427. # Example: float true
  428. #
  429. # [*full*] This property either sets the tagged client to fullscreen or
  430. # prevents it from being set to fullscreen depending on the value.
  431. #
  432. # Example: full true
  433. #
  434. # [*gravity*] This property sets a certain to gravity to the tagged client,
  435. # but only on views that have this tag too.
  436. #
  437. # Example: gravity :center
  438. #
  439. # [*match*] This property adds matching patterns to a tag, a tag can have
  440. # more than one. Matching works either via plaintext, regex
  441. # (see man regex(7)) or window id. Per default tags will only
  442. # match the WM_NAME and the WM_CLASS portion of a client, this
  443. # can be changed with following possible values:
  444. #
  445. # [*:name*] Match the WM_NAME
  446. # [*:instance*] Match the first (instance) part from WM_CLASS
  447. # [*:class*] Match the second (class) part from WM_CLASS
  448. # [*:role*] Match the window role
  449. #
  450. # Example: match :instance => "urxvt"
  451. # match [:role, :class] => "test"
  452. # match "[xa]+term"
  453. #
  454. # [*exclude*] This property works exactly the same way as *match*, but it
  455. # excludes clients that match from this tag. That can be helpful
  456. # with catch-all tags e.g. for console apps.
  457. #
  458. # Example: exclude :instance => "irssi"
  459. #
  460. # [*resize*] This property either enables or disables honoring of client
  461. # resize hints and is independent of the global option.
  462. #
  463. # Example: resize true
  464. #
  465. # [*size*] This property sets a certain to size as well as floating to the
  466. # tagged client, but only on views that have this tag too. It
  467. # expects an array with x, y, width and height values.
  468. #
  469. # Example: size [100, 100, 50, 50]
  470. #
  471. # [*stick*] This property either sets the tagged client to stick or prevents
  472. # it from being set to stick depending on the value. Stick clients
  473. # are visible on every view.
  474. #
  475. # Example: stick true
  476. #
  477. # [*type*] This property sets the [[Tagging|tagged]] client to be treated
  478. # as a specific window type though as the window sets the type
  479. # itself. Following types are possible:
  480. #
  481. # [*:desktop*] Treat as desktop window (_NET_WM_WINDOW_TYPE_DESKTOP)
  482. # [*:dock*] Treat as dock window (_NET_WM_WINDOW_TYPE_DOCK)
  483. # [*:toolbar*] Treat as toolbar windows (_NET_WM_WINDOW_TYPE_TOOLBAR)
  484. # [*:splash*] Treat as splash window (_NET_WM_WINDOW_TYPE_SPLASH)
  485. # [*:dialog*] Treat as dialog window (_NET_WM_WINDOW_TYPE_DIALOG)
  486. #
  487. # Example: type :desktop
  488. #
  489. # [*urgent*] This property either sets the tagged client to be urgent or
  490. # prevents it from being urgent depending on the value. Urgent
  491. # clients will get keyboard and mouse focus automatically.
  492. #
  493. # Example: urgent true
  494. #
  495. # === Link
  496. #
  497. # http://subforge.org/wiki/subtle/Tagging
  498. #
  499.  
  500. # Simple tags
  501. tag "terms", "xterm|[u]?rxvt[c]?"
  502. tag "browser", "chromium|firefox|navigator"
  503. tag "office"
  504.  
  505. # Placement
  506. tag "office" do
  507.   match "[g]?vim"
  508.   resize true
  509. end
  510.  
  511. tag "office" do
  512.   match "VirtualBox"
  513.   float true
  514.   resize true
  515. end
  516.  
  517. tag "fixed" do
  518.   geometry [ 10, 10, 100, 100 ]
  519.   stick true
  520. end
  521.  
  522. tag "resize" do
  523.   match "sakura|gvim"
  524.   resize true
  525. end
  526.  
  527. tag "gravity" do
  528.   gravity :center
  529. end
  530.  
  531. # Modes
  532. tag "stick" do
  533.   match "mplayer"
  534.   float true
  535. # stick true
  536. end
  537.  
  538. tag "float" do
  539.   match "display"
  540.   float true
  541. end
  542.  
  543. # Gimp
  544. tag "gimp_image" do
  545.   match :role => "gimp-image-window"
  546.   gravity :gimp_image
  547. end
  548.  
  549. tag "gimp_toolbox" do
  550.   match :role => "gimp-toolbox$"
  551.   gravity :gimp_toolbox
  552. end
  553.  
  554. tag "gimp_dock" do
  555.   match :role => "gimp-dock"
  556.   gravity :gimp_dock
  557. end
  558. # == Tags }}}
  559.  
  560. # == Views {{{
  561. #
  562. # Views are the virtual desktops in subtle, they show all windows that share a
  563. # tag with them. Windows that have no tag will be visible on the default view
  564. # which is the view with the default tag or the first defined view when this
  565. # tag isn't set.
  566. #
  567. # === Link
  568. #
  569. # http://subforge.org/wiki/subtle/Tagging
  570. #
  571.  
  572. view " sys ", "terms|default"
  573. view " web ", "browser"
  574. view " fun ", "gimp_.*"
  575. view " stuff ", "office"
  576.  
  577. # == Views }}}
  578.  
  579. # == Sublets {{{
  580. #
  581. # Sublets are Ruby scripts that provide data for the panel and can be managed
  582. # with the sur script that comes with subtle.
  583. #
  584. # Follwing properties can be changed directly:
  585. #
  586. # [*interval*] Update interval of the sublet
  587. # [*foreground*] Default foreground color
  588. # [*background*] Default background color
  589. #
  590. # === Example
  591. #
  592. # sublet :clock do
  593. # interval 30
  594. # foreground "#eeeeee"
  595. # background "#000000"
  596. # format_string "%H:%M:%S"
  597. # end
  598. #
  599. # === Link
  600. #
  601. # http://subforge.org/wiki/subtle/Sublets#Configuration
  602. #
  603.  
  604. sublet :clock do
  605.   interval 60
  606.   format_date "%a %m/%d"
  607.   format_time "@ %I:%M %p"
  608. end
  609.  
  610. sublet :gmail do
  611.   user "nedam.nedam@gmail.co"
  612.   password "986320035"
  613.   foreground "#555753"
  614.   urgent "#ffc400"
  615.   normal "#eeeeee"
  616. end
  617.  
  618. sublet :wifi do
  619.   foreground "#ffc123"
  620. end
  621.  
  622. sublet :battery do
  623.   foreground "#f57900"
  624. end
  625.  
  626. sublet :mpd do
  627.   foreground "#46a4ff"
  628.   format_string "%note% %artist% - %album% - %title%"
  629. end
  630.  
  631. # == Sublets }}}
  632.  
  633. # == Hooks {{{
  634. #
  635. # And finally hooks are a way to bind Ruby scripts to a certain event.
  636. #
  637. # Following hooks exist so far:
  638. #
  639. # [*:client_create*] Called whenever a window is created
  640. # [*:client_configure*] Called whenever a window is configured
  641. # [*:client_focus*] Called whenever a window gets focus
  642. # [*:client_kill*] Called whenever a window is killed
  643. #
  644. # [*:tag_create*] Called whenever a tag is created
  645. # [*:tag_kill*] Called whenever a tag is killed
  646. #
  647. # [*:view_create*] Called whenever a view is created
  648. # [*:view_configure*] Called whenever a view is configured
  649. # [*:view_jump*] Called whenever the view is switched
  650. # [*:view_kill*] Called whenever a view is killed
  651. #
  652. # [*:tile*] Called on whenever tiling would be needed
  653. # [*:reload*] Called on reload
  654. # [*:start*] Called on start
  655. # [*:exit*] Called on exit
  656. #
  657. # === Example
  658. #
  659. # This hook will print the name of the window that gets the focus:
  660. #
  661. # on :client_focus do |c|
  662. # puts c.name
  663. # end
  664. #
  665. # === Link
  666. #
  667. # http://subforge.org/wiki/subtle/Hooks
  668. # == Hooks }}}
  669.  
  670. # == Snippets {{{
  671. #
  672.  
  673. ### # Current-view
  674. ### on :start do
  675. ### # Create missing tags
  676. ### views = Subtlext::View.all.map {|v| v.name }
  677. ### tags = Subtlext::Tag.all.map {|t| t.name }
  678. ###
  679. ### views.each do |v|
  680. ### unless(tags.include?(v))
  681. ### t = Subtlext::Tag.new(v)
  682. ### t.save
  683. ### end
  684. ### end
  685. ### end
  686. ###
  687. ### # Assign tags to clients
  688. ### on :client_create do |c|
  689. ### view = Subtlext::View.current
  690. ### tags = c.tags.map {|t| t.name }
  691. ###
  692. ### # Add tag to view
  693. ### view.tag(view.name) unless(view.tags.include?(view.name))
  694. ###
  695. ### # Exclusive for clients with default tag only
  696. ### if(tags.include?("default") and 1 == tags.size)
  697. ### c.tags = [ view.name ]
  698. ### end
  699. ### end
  700.  
  701. #on :start do
  702. #  Subtlext::Subtle.spawn "nitrogen --restore"
  703. #  Subtlext::Subtle.spawn "xsetroot -cursor_name left_ptr"
  704. #end
  705.  
  706. #begin
  707. #  require "#{ENV["HOME"]}/bin/launcher/launcher.rb"
  708.  
  709. #  # Set fonts
  710. #  Subtle::Contrib::Launcher.fonts = [
  711. #    "xft:Envy Code R:pixelsize=80:antialias=true",
  712. #    "xft:Envy Code R:pixelsize=12:antialias=true"
  713. #  ]
  714. #rescue LoadError => err
  715. #  p err
  716. #end
  717. #grab "W-grave" do
  718. #  Subtle::Contrib::Launcher.run
  719. #end
  720. # == Snippets }}}
  721.  
  722. # vim:ts=2:bs=2:sw=2:et:fdm=marker
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement