Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

subtle config

By: a guest on Oct 28th, 2011  |  syntax: Ruby  |  size: 25.55 KB  |  views: 270  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #
  2. # Author::  Christoph Kappel <unexist@dorfelite.net>
  3. # Version:: $Id: data/subtle.rb,v 2978 2011/08/02 11:16:25 unexist $
  4. # License:: GNU GPLv2
  5. #
  6. # = Subtle default 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. #
  16. # == Options
  17. #
  18. # Following options change behaviour and sizes of the window manager:
  19. #
  20.  
  21. # Window move/resize steps in pixel per keypress
  22. set :step, 5
  23.  
  24. # Window screen border snapping
  25. set :snap, 10
  26.  
  27. # Default starting gravity for windows. Comment out to use gravity of
  28. # currently active client
  29. set :gravity, :center66
  30.  
  31. # Make transient windows urgent
  32. set :urgent, false
  33.  
  34. # Honor resize size hints globally
  35. set :resize, false
  36.  
  37. # Enable gravity tiling
  38. set :tiling, true
  39.  
  40. # Font string either take from e.g. xfontsel or use xft
  41. set :font, "xft:Luxi Mono-10"
  42. #set :font, "xft:sans-8"
  43.  
  44. # Separator between sublets
  45. set :separator, "|"
  46.  
  47. # Set the WM_NAME of subtle (Java quirk)
  48. # set :wmname, "LG3D"
  49.  
  50. #
  51. # == Screen
  52. #
  53. # Generally subtle comes with two panels per screen, one on the top and one at
  54. # the bottom. Each panel can be configured with different panel items and
  55. # sublets screen wise. The default config uses top panel on the first screen
  56. # only, it's up to the user to enable the bottom panel or disable either one
  57. # or both.
  58.  
  59. # === Properties
  60. #
  61. # [*stipple*]    This property adds a stipple pattern to both screen panels.
  62. #
  63. #                Example: stipple "~/stipple.xbm"
  64. #                         stipple Subtlext::Icon.new("~/stipple.xbm")
  65. #
  66. # [*top*]        This property adds a top panel to the screen.
  67. #
  68. #                Example: top [ :views, :title ]
  69. #
  70. # [*bottom*]     This property adds a bottom panel to the screen.
  71. #
  72. #                Example: bottom [ :views, :title ]
  73.  
  74. #
  75. # Following items are available for the panels:
  76. #
  77. # [*:views*]     List of views with buttons
  78. # [*:title*]     Title of the current active window
  79. # [*:tray*]      Systray icons (Can be used only once)
  80. # [*:keychain*]  Display current chain (Can be used only once)
  81. # [*:sublets*]   Catch-all for installed sublets
  82. # [*:sublet*]    Name of a sublet for direct placement
  83. # [*:spacer*]    Variable spacer (free width / count of spacers)
  84. # [*:center*]    Enclose items with :center to center them on the panel
  85. # [*:separator*] Insert separator
  86. #
  87. # Empty panels are hidden.
  88. #
  89. # === Links
  90. #
  91. # http://subforge.org/projects/subtle/wiki/Multihead
  92. # http://subforge.org/projects/subtle/wiki/Panel
  93. #
  94.  
  95. screen 1 do
  96.   top    [ :views,  :spacer, :keychain, :spacer, :cpu, :memory, :pacman, :weather_mod, :clock ]
  97.   bottom [ :mpd, :spacer, :title, :tray ]
  98. end
  99.  
  100. # Example for a second screen:
  101. #screen 2 do
  102. #  top    [ :views, :title, :spacer ]
  103. #  bottom [ ]
  104. #end
  105.  
  106. #
  107. # == Styles
  108. #
  109. # Styles define various properties of styleable items in a CSS-like syntax.
  110. #
  111. # If no background color is given no color will be set. This will ensure a
  112. # custom background pixmap won't be overwritten.
  113. #
  114. # === Link
  115. #
  116. # http://subforge.org/projects/subtle/wiki/Styles
  117.  
  118. # Style for all style elements
  119. style :all do
  120.   background  "#252525"
  121.   foreground  "#707070"
  122.   border      "#707070", 0
  123.   padding     5
  124.   padding_top 0
  125. end
  126.  
  127. # Style for the views
  128. style :views do
  129.  
  130.   foreground "#E5CB85"
  131.   padding_right 12
  132.   padding_left  12
  133.  
  134.   # Style for the active views
  135.   style :focus do
  136.     foreground  "#252525"
  137.     background  "#E5CB85"
  138.     border_top  "#E5CB85", 3
  139.   end
  140.  
  141.   # Style for urgent window titles and views
  142.   style :urgent do
  143.     border_top  "#AF7561", 3
  144.   end
  145.  
  146.   # Style for occupied views (views with clients)
  147.   style :occupied do
  148.     border_top  "#E5CB85", 3
  149.   end
  150.  
  151.   # Style for unoccupied views (views without clients)
  152.   style :unoccupied do
  153.     border_top  "#252525", 3
  154.   end
  155. end
  156.  
  157. # Style for sublets
  158. style :sublets do
  159.   foreground  "#707070"
  160.   icon        "#E5CB85"
  161. end
  162.  
  163. # Style for separator
  164. style :separator do
  165.   foreground  "#707070"
  166. end
  167.  
  168. # Style for focus window title
  169. style :title do
  170.   foreground  "#DDDDDD"
  171. end
  172.  
  173. # Style for active/inactive windows
  174. style :clients do
  175.   active      "#E5CB85", 2
  176.   inactive    "#252525", 2
  177.   margin      5
  178.   width       50
  179. end
  180.  
  181. # Style for subtle
  182. style :subtle do
  183.   margin      0, 0, 0, 0
  184.   panel       "#252525"
  185.   background  "#252525"
  186.   stipple     "#757575"
  187. end
  188.  
  189. #
  190. # == Gravities
  191. #
  192. # Gravities are predefined sizes a window can be set to. There are several ways
  193. # to set a certain gravity, most convenient is to define a gravity via a tag or
  194. # change them during runtime via grab. Subtler and subtlext can also modify
  195. # gravities.
  196. #
  197. # A gravity consists of four values which are a percentage value of the screen
  198. # size. The first two values are x and y starting at the center of the screen
  199. # and he last two values are the width and height.
  200. #
  201. # === Example
  202. #
  203. # Following defines a gravity for a window with 100% width and height:
  204. #
  205. #   gravity :example, [ 0, 0, 100, 100 ]
  206. #
  207. # === Link
  208. #
  209. # http://subforge.org/projects/subtle/wiki/Gravity
  210. #
  211.  
  212. # Top left
  213. gravity :top_left,       [   0,   0,  50,  50 ]
  214. gravity :top_left66,     [   0,   0,  50,  66 ]
  215. gravity :top_left33,     [   0,   0,  50,  34 ]
  216.  
  217. # Top
  218. gravity :top,            [   0,   0, 100,  50 ]
  219. gravity :top66,          [   0,   0, 100,  66 ]
  220. gravity :top33,          [   0,   0, 100,  34 ]
  221.  
  222. # Top right
  223. gravity :top_right,      [  50,   0,  50,  50 ]
  224. gravity :top_right66,    [  50,   0,  50,  66 ]
  225. gravity :top_right33,    [  50,   0,  50,  33 ]
  226.  
  227. # Left
  228. gravity :left,           [   0,   0,  50, 100 ]
  229. gravity :left66,         [   0,   0,  66, 100 ]
  230. gravity :left33,         [   0,   0,  33, 100 ]
  231.  
  232. # Center
  233. gravity :center,         [   0,   0, 100, 100 ]
  234. gravity :center66,       [  17,  17,  66,  66 ]
  235. gravity :center33,       [  33,  33,  33,  33 ]
  236.  
  237. # Right
  238. gravity :right,          [  50,   0,  50, 100 ]
  239. gravity :right66,        [  34,   0,  66, 100 ]
  240. gravity :right33,        [  67,   0,  33, 100 ]
  241.  
  242. # Bottom left
  243. gravity :bottom_left,    [   0,  50,  50,  50 ]
  244. gravity :bottom_left66,  [   0,  34,  50,  66 ]
  245. gravity :bottom_left33,  [   0,  67,  50,  33 ]
  246.  
  247. # Bottom
  248. gravity :bottom,         [   0,  50, 100,  50 ]
  249. gravity :bottom66,       [   0,  34, 100,  66 ]
  250. gravity :bottom33,       [   0,  67, 100,  33 ]
  251.  
  252. # Bottom right
  253. gravity :bottom_right,   [  50,  50,  50,  50 ]
  254. gravity :bottom_right66, [  50,  34,  50,  66 ]
  255. gravity :bottom_right33, [  50,  67,  50,  33 ]
  256.  
  257. # Gimp
  258. gravity :gimp_image,     [  15,   0,  70, 100 ]
  259. gravity :gimp_toolbox,   [   0,   0,  15, 100 ]
  260. gravity :gimp_dock,      [  85,   0,  15, 100 ]
  261.  
  262. #
  263. # == Grabs
  264. #
  265. # Grabs are keyboard and mouse actions within subtle, every grab can be
  266. # assigned either to a key and/or to a mouse button combination. A grab
  267. # consists of a chain and an action.
  268. #
  269. # === Finding keys
  270. #
  271. # The best resource for getting the correct key names is
  272. # */usr/include/X11/keysymdef.h*, but to make life easier here are some hints
  273. # about it:
  274. #
  275. # * Numbers and letters keep their names, so *a* is *a* and *0* is *0*
  276. # * Keypad keys need *KP_* as prefix, so *KP_1* is *1* on the keypad
  277. # * Strip the *XK_* from the key names if looked up in
  278. #   /usr/include/X11/keysymdef.h
  279. # * Keys usually have meaningful english names
  280. # * Modifier keys have special meaning (Alt (A), Control (C), Meta (M),
  281. #   Shift (S), Super (W))
  282. #
  283. # === Chaining
  284. #
  285. # Chains are a combination of keys and modifiers to one or a list of keys
  286. # and can be used in various ways to trigger an action. In subtle, there are
  287. # two ways to define chains for grabs:
  288. #
  289. #   1. *Default*: Add modifiers to a key and use it for a grab
  290. #
  291. #      *Example*: grab "W-Return", "urxvt"
  292. #
  293. #   2. *Chain*: Define a list of grabs that need to be pressed in order
  294. #
  295. #      *Example*: grab "C-y Return", "urxvt"
  296. #
  297. # ==== Mouse buttons
  298. #
  299. # [*B1*] = Button1 (Left mouse button)
  300. # [*B2*] = Button2 (Middle mouse button)
  301. # [*B3*] = Button3 (Right mouse button)
  302. # [*B4*] = Button4 (Mouse wheel up)
  303. # [*B5*] = Button5 (Mouse wheel down)
  304. #
  305. # ==== Modifiers
  306. #
  307. # [*A*] = Alt key
  308. # [*C*] = Control key
  309. # [*M*] = Meta key
  310. # [*S*] = Shift key
  311. # [*W*] = Super (Windows) key
  312. #
  313. # === Action
  314. #
  315. # An action is something that happens when a grab is activated, this can be one
  316. # of the following:
  317. #
  318. # [*symbol*] Run a subtle action
  319. # [*string*] Start a certain program
  320. # [*array*]  Cycle through gravities
  321. # [*lambda*] Run a Ruby proc
  322. #
  323. # === Example
  324. #
  325. # This will create a grab that starts a urxvt when Alt+Enter are pressed:
  326. #
  327. #   grab "A-Return", "urxvt"
  328. #   grab "C-a c",    "urxvt"
  329. #
  330. # === Link
  331. #
  332. # http://subforge.org/projects/subtle/wiki/Grabs
  333. #
  334.  
  335. # Jump to view1, view2, ...
  336. grab "W-S-1", :ViewJump1
  337. grab "W-S-2", :ViewJump2
  338. grab "W-S-3", :ViewJump3
  339. grab "W-S-4", :ViewJump4
  340.  
  341. # Switch current view
  342. grab "W-1", :ViewSwitch1
  343. grab "W-2", :ViewSwitch2
  344. grab "W-3", :ViewSwitch3
  345. grab "W-4", :ViewSwitch4
  346. grab "W-5", :ViewSwitch5
  347. grab "W-6", :ViewSwitch6
  348.  
  349. # Select next and prev view */
  350. grab "KP_Add",      :ViewNext
  351. grab "KP_Subtract", :ViewPrev
  352.  
  353. # Move mouse to screen1, screen2, ...
  354. grab "W-A-1", :ScreenJump1
  355. grab "W-A-2", :ScreenJump2
  356. grab "W-A-3", :ScreenJump3
  357. grab "W-A-4", :ScreenJump4
  358.  
  359. # Force reload of config and sublets
  360. grab "C-A-r", :SubtleReload
  361.  
  362. # Force restart of subtle
  363. grab "W-C-S-r", :SubtleRestart
  364.  
  365. # Quit subtle
  366. grab "W-C-q", :SubtleQuit
  367.  
  368. # Move current window
  369. grab "W-B1", :WindowMove
  370.  
  371. # Resize current window
  372. grab "W-B3", :WindowResize
  373.  
  374. # Toggle floating mode of window
  375. grab "W-f", :WindowFloat
  376.  
  377. # Toggle fullscreen mode of window
  378. grab "W-space", :WindowFull
  379.  
  380. # Toggle sticky mode of window (will be visible on all views)
  381. grab "W-s", :WindowStick
  382.  
  383. # Toggle zaphod mode of window (will span across all screens)
  384. grab "W-equal", :WindowZaphod
  385.  
  386. # Raise window
  387. grab "W-r", :WindowRaise
  388.  
  389. # Lower window
  390. grab "W-l", :WindowLower
  391.  
  392. # Select next windows
  393. grab "W-Left",  :WindowLeft
  394. grab "W-Down",  :WindowDown
  395. grab "W-Up",    :WindowUp
  396. grab "W-Right", :WindowRight
  397.  
  398. # Kill current window
  399. grab "W-q", :WindowKill
  400.  
  401. # Cycle between given gravities
  402. grab "KP_7", [ :top_left,     :top_left66,     :top_left33     ]
  403. grab "KP_8", [ :top,          :top66,          :top33          ]
  404. grab "KP_9", [ :top_right,    :top_right66,    :top_right33    ]
  405. grab "KP_4", [ :left,         :left66,         :left33         ]
  406. grab "KP_5", [ :center,       :center66,       :center33       ]
  407. grab "KP_6", [ :right,        :right66,        :right33        ]
  408. grab "KP_1", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
  409. grab "KP_2", [ :bottom,       :bottom66,       :bottom33       ]
  410. grab "KP_3", [ :bottom_right, :bottom_right66, :bottom_right33 ]
  411.  
  412.  
  413. # In case no numpad is available e.g. on notebooks
  414. #grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
  415. #grab "W-w", [ :top,          :top66,          :top33          ]
  416. #grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
  417. #grab "W-a", [ :left,         :left66,         :left33         ]
  418. #grab "W-s", [ :center,       :center66,       :center33       ]
  419. #grab "W-d", [ :right,        :right66,        :right33        ]
  420. #
  421. # QUERTZ
  422. #grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
  423. #
  424. # QWERTY
  425. #grab "W-z", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
  426. #
  427. #grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
  428. #grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
  429.  
  430. # Exec programs
  431. grab "W-t", "urxvt"
  432. grab "W-u", "uzbl-browser"
  433. grab "W-Return", "dmenu_run"
  434.  
  435. grab "W-b", "urxvt -name bashmount -geometry 53x24 -e bashmount"
  436.  
  437. grab "W-i", "urxvt -name ncmpcpp -e ncmpcpp"
  438.  
  439. grab "W-w", "urxvt -name weechat -e weechat-curses"
  440. grab "W-m", "urxvt -name mutt -e mutt"
  441. grab "W-n", "urxvt -name newsbeuter -e newsbeuter"
  442. grab "W-j", "urxvt -name jabber -e mcabber"
  443.  
  444. # Run Ruby lambdas
  445. grab "S-F2" do |c|
  446.   puts c.name
  447. end
  448.  
  449. grab "S-F3" do
  450.   puts Subtlext::VERSION
  451. end
  452.  
  453.  
  454. grab "A-Tab" do
  455.   clients = Subtlext::Client.visible
  456.   clients.last.instance_eval do
  457.     focus
  458.     raise
  459.   end
  460. end
  461.  
  462. grab "W-A-t" do
  463.   if((c = Subtlext::Client["scratch"]))
  464.     c.toggle_stick
  465.     c.focus
  466.   elsif((c = Subtlext::Subtle.spawn("urxvt -name scratch")))
  467.     c.tags  = []
  468.     c.flags = [ :stick ]
  469.   end
  470. end
  471.  
  472. #
  473. # == Tags
  474. #
  475. # Tags are generally used in subtle for placement of windows. This placement is
  476. # strict, that means that - aside from other tiling window managers - windows
  477. # must have a matching tag to be on a certain view. This also includes that
  478. # windows that are started on a certain view will not automatically be placed
  479. # there.
  480. #
  481. # There are to ways to define a tag:
  482. #
  483. # === Simple
  484. #
  485. # The simple way just needs a name and a regular expression to just handle the
  486. # placement:
  487. #
  488. # Example:
  489. #
  490. #  tag "terms", "terms"
  491. #
  492. # === Extended
  493. #
  494. # Additionally tags can do a lot more then just control the placement - they
  495. # also have properties than can define and control some aspects of a window
  496. # like the default gravity or the default screen per view.
  497. #
  498. # Example:
  499. #
  500. #  tag "terms" do
  501. #    match   "xterm|[u]?rxvt"
  502. #    gravity :center
  503. #  end
  504. #
  505. # === Default
  506. #
  507. # Whenever a window has no tag it will get the default tag and be placed on the
  508. # default view. The default view can either be set by the user with adding the
  509. # default tag to a view by choice or otherwise the first defined view will be
  510. # chosen automatically.
  511. #
  512. # === Properties
  513. #
  514. # [*borderless*] This property enables the borderless mode for tagged clients.
  515. #
  516. #                Example: borderless true
  517. #                Links:    http://subforge.org/projects/subtle/wiki/Tagging#Borderless
  518. #                          http://subforge.org/projects/subtle/wiki/Clients#Borderless
  519. #
  520. # [*fixed*]      This property enables the fixed mode for tagged clients.
  521. #
  522. #                Example: fixed true
  523. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Fixed
  524. #                         http://subforge.org/projects/subtle/wiki/Clients#Fixed
  525. #
  526. # [*float*]      This property enables the float mode for tagged clients.
  527. #
  528. #                Example: float true
  529. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Float
  530. #                         http://subforge.org/projects/subtle/wiki/Clients#Float
  531. #
  532. # [*full*]       This property enables the fullscreen mode for tagged clients.
  533. #
  534. #                Example: full true
  535. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Fullscreen
  536. #                         http://subforge.org/projects/subtle/wiki/Clients#Fullscreen
  537. #
  538. # [*geometry*]   This property sets a certain geometry as well as floating mode
  539. #                to the tagged client, but only on views that have this tag too.
  540. #                It expects an array with x, y, width and height values whereas
  541. #                width and height must be >0.
  542. #
  543. #                Example: geometry [100, 100, 50, 50]
  544. #                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Geometry
  545. #
  546. # [*gravity*]    This property sets a certain to gravity to the tagged client,
  547. #                but only on views that have this tag too.
  548. #
  549. #                Example: gravity :center
  550. #                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Gravity
  551. #
  552. # [*match*]      This property adds matching patterns to a tag, a tag can have
  553. #                more than one. Matching works either via plaintext, regex
  554. #                (see man regex(7)) or window id. Per default tags will only
  555. #                match the WM_NAME and the WM_CLASS portion of a client, this
  556. #                can be changed with following possible values:
  557. #
  558. #                [*:name*]      Match the WM_NAME
  559. #                [*:instance*]  Match the first (instance) part from WM_CLASS
  560. #                [*:class*]     Match the second (class) part from WM_CLASS
  561. #                [*:role*]      Match the window role
  562. #                [*:type*]      Match the window type
  563. #
  564. #                Examples: match instance: "urxvt"
  565. #                          match [:role, :class] => "test"
  566. #                          match "[xa]+term"
  567. #                Link:     http://subforge.org/projects/subtle/wiki/Tagging#Match
  568. #
  569. # [*position*]   Similar to the geometry property, this property just sets the
  570. #                x/y coordinates of the tagged client, but only on views that
  571. #                have this tag, too. It expects an array with x and y values.
  572. #
  573. #                Example: position [ 10, 10 ]
  574. #                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Position
  575. #
  576. # [*resize*]     This property enables the float mode for tagged clients.
  577. #
  578. #                Example: resize true
  579. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Resize
  580. #                         http://subforge.org/projects/subtle/wiki/Clients#Resize
  581. #
  582. # [*stick*]      This property enables the float mode for tagged clients.
  583. #
  584. #                Example: stick true
  585. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Stick
  586. #                         http://subforge.org/projects/subtle/wiki/Clients#Stick
  587. #
  588. # [*type*]       This property sets the tagged client to be treated as a specific
  589. #                window type though as the window sets the type itself. Following
  590. #                types are possible:
  591. #
  592. #                [*:desktop*]  Treat as desktop window (_NET_WM_WINDOW_TYPE_DESKTOP)
  593. #                              Link: http://subforge.org/projects/subtle/wiki/Clients#Desktop
  594. #                [*:dock*]     Treat as dock window (_NET_WM_WINDOW_TYPE_DOCK)
  595. #                              Link: http://subforge.org/projects/subtle/wiki/Clients#Dock
  596. #                [*:toolbar*]  Treat as toolbar windows (_NET_WM_WINDOW_TYPE_TOOLBAR)
  597. #                              Link: http://subforge.org/projects/subtle/wiki/Clients#Toolbar
  598. #                [*:splash*]   Treat as splash window (_NET_WM_WINDOW_TYPE_SPLASH)
  599. #                              Link: http://subforge.org/projects/subtle/wiki/Clients#Splash
  600. #                [*:dialog*]   Treat as dialog window (_NET_WM_WINDOW_TYPE_DIALOG)
  601. #                              Link: http://subforge.org/projects/subtle/wiki/Clients#Dialog
  602. #
  603. #                Example: type :desktop
  604. #                Link:    http://subforge.org/projects/subtle/wiki/Tagging#Type
  605. #
  606. # [*urgent*]     This property enables the urgent mode for tagged clients.
  607. #
  608. #                Example: stick true
  609. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Stick
  610. #                         http://subforge.org/projects/subtle/wiki/Clients#Urgent
  611. #
  612. # [*zaphod*]     This property enables the zaphod mode for tagged clients.
  613. #
  614. #                Example: zaphod true
  615. #                Links:   http://subforge.org/projects/subtle/wiki/Tagging#Zaphod
  616. #                         http://subforge.org/projects/subtle/wiki/Clients#Zaphod
  617. #
  618. #
  619. # === Link
  620. #
  621. # http://subforge.org/projects/subtle/wiki/Tagging
  622. #
  623.  
  624. # Simple tags
  625. tag "terms" do
  626.   match :instance => "urxvt"
  627. end
  628.  
  629. tag "browser" do
  630.   match "uzbl|opera|firefox|navigator"
  631.   gravity :right33
  632. end
  633.  
  634. tag "bashmount" do
  635.   match "bashmount"
  636.   gravity :center33
  637. end
  638.  
  639. tag "musique" do
  640.   match :instance => "ncmpcpp"
  641.   gravity :bottom_left
  642. end
  643.  
  644. tag "weechat" do
  645.   match "weechat"
  646.   gravity :right
  647. end
  648.  
  649. tag "mutt" do
  650.   match :instance => "mutt"
  651.   gravity :top_left
  652. end
  653.  
  654. tag "jabber" do
  655.   match :instance => "jabber"
  656.   gravity :bottom_left
  657. end
  658.  
  659. tag "news" do
  660.   match :instance => "newsbeuter"
  661.   gravity :left66
  662. end
  663.  
  664. # Placement
  665. tag "editor" do
  666.   match  "[g]?vim"
  667.   resize true
  668. end
  669.  
  670. tag "fixed" do
  671.   geometry [ 10, 10, 100, 100 ]
  672.   stick    true
  673. end
  674.  
  675. tag "resize" do
  676.   match  "sakura|gvim"
  677.   resize true
  678. end
  679.  
  680. tag "gravity" do
  681.   gravity :center
  682. end
  683.  
  684. # Modes
  685. tag "stick" do
  686.   match "mplayer|scratch"
  687.   float true
  688.   stick true
  689. end
  690.  
  691. tag "float" do
  692.   match "display"
  693.   float true
  694. end
  695.  
  696. # Gimp
  697. tag "gimp_image" do
  698.   match   :role => "gimp-image-window"
  699.   gravity :gimp_image
  700. end
  701.  
  702. tag "gimp_toolbox" do
  703.   match   :role => "gimp-toolbox$"
  704.   gravity :gimp_toolbox
  705. end
  706.  
  707. tag "gimp_dock" do
  708.   match   :role => "gimp-dock"
  709.   gravity :gimp_dock
  710. end
  711.  
  712. #
  713. # == Views
  714. #
  715. # Views are the virtual desktops in subtle, they show all windows that share a
  716. # tag with them. Windows that have no tag will be visible on the default view
  717. # which is the view with the default tag or the first defined view when this
  718. # tag isn't set.
  719. #
  720. # Like tags views can be defined in two ways:
  721. #
  722. # === Simple
  723. #
  724. # The simple way is exactly the same as for tags:
  725. #
  726. # Example:
  727. #
  728. #   view "terms", "terms"
  729. #
  730. # === Extended
  731. #
  732. # The extended way for views is also similar to the tags, but with fewer
  733. # properties.
  734. #
  735. # Example:
  736. #
  737. #  view "terms" do
  738. #    match "terms"
  739. #    icon  "/usr/share/icons/icon.xbm"
  740. #  end
  741. #
  742. # === Properties
  743. #
  744. # [*match*]      This property adds a matching pattern to a view. Matching
  745. #                works either via plaintext or regex (see man regex(7)) and
  746. #                applies to names of tags.
  747. #
  748. #                Example: match "terms"
  749. #
  750. # [*dynamic*]    This property hides unoccupied views, views that display no
  751. #                windows.
  752. #
  753. #                Example: dynamic true
  754. #
  755. # [*icon*]       This property adds an icon in front of the view name. The
  756. #                icon can either be path to an icon or an instance of
  757. #                Subtlext::Icon.
  758. #
  759. #                Example: icon "/usr/share/icons/icon.xbm"
  760. #                         icon Subtlext::Icon.new("/usr/share/icons/icon.xbm")
  761. #
  762. # [*icon_only*]  This property hides the view name from the view buttons, just
  763. #                the icon will be visible.
  764. #
  765. #                Example: icon_only true
  766. #
  767. #
  768. # === Link
  769. #
  770. # http://subforge.org/projects/subtle/wiki/Tagging
  771. #
  772.  
  773. view "com" do
  774.   match     "mutt|weechat|jabber"
  775.   icon      "~/.icons/subtle/balloon.xbm"
  776.   icon_only true
  777. end
  778.  
  779. view "www" do
  780.   match     "browser|news"
  781.   icon      "~/.icons/subtle/world.xbm"
  782.   icon_only true
  783. end
  784.  
  785. view "misc" do
  786.   match     "default"
  787.   icon      "~/.icons/subtle/notepad.xbm"
  788.   icon_only true
  789. end
  790.  
  791. view "terms" do
  792.   match     "terms"
  793.   icon      "~/.icons/subtle/terminal.xbm"
  794.   icon_only true
  795. end
  796.  
  797. view "media" do
  798.   match     "musique|video"
  799.   icon      "~/.icons/subtle/movie.xbm"
  800.   icon_only true
  801. end
  802. view "gimp" do
  803.   match     "gimp_.*"
  804.   icon      "~/.icons/subtle/pencil.xbm"
  805.   icon_only true
  806. end
  807.  
  808. #
  809. # == Sublets
  810. #
  811. # Sublets are Ruby scripts that provide data for the panel and can be managed
  812. # with the sur script that comes with subtle.
  813. #
  814. # === Example
  815. #
  816. #  sur install clock
  817. #  sur uninstall clock
  818. #  sur list
  819. #
  820. # === Configuration
  821. #
  822. # All sublets have a set of configuration values that can be changed directly
  823. # from the config of subtle.
  824. #
  825. # There are three default properties, that can be be changed for every sublet:
  826. #
  827. # [*interval*]    Update interval of the sublet
  828. # [*foreground*]  Default foreground color
  829. # [*background*]  Default background color
  830. #
  831. # sur can also give a brief overview about properties
  832. #
  833. # === Example
  834. #
  835. #   sur config clock
  836. #
  837. # The syntax of the sublet configuration is similar to other configuration
  838. # options in subtle:
  839. #
  840. # === Example
  841. #
  842. #  sublet :clock do
  843. #    interval      30
  844. #    foreground    "#eeeeee"
  845. #    background    "#000000"
  846. #    format_string "%H:%M:%S"
  847. #  end
  848. #
  849. #  === Link
  850. #
  851. # http://subforge.org/projects/subtle/wiki/Sublets
  852. #
  853. sublet :mpd do
  854.   interval          5
  855.   format_string     "%note% %artist% - %title% (%album%)"
  856.   not_running_text  "MPD non lancé"
  857.   stop_text         "Stoppé"
  858.   pause_text        "Pause"
  859.   pause_color       "#707070"
  860.   stop_color        "#707070"
  861.   show_colors       true
  862. end
  863.  
  864. sublet :cpu do
  865.   interval 1
  866. end
  867.  
  868. sublet :clock do
  869.   interval 20
  870.   format_string "%R"
  871. end
  872.  
  873. sublet :pacman do
  874.   interval    1000
  875.   separator   "/"
  876.   updatefile  "/home/polo/.config/subtle/pacmanupdates"
  877. end
  878.  
  879. sublet :weather_mod do
  880.   interval      1000
  881.   locale        "fr"
  882.   units         "c"
  883.   location      "Bordeaux"
  884.   sep           "/"
  885.   sep_color     "#707070"
  886.   temp_color    "#707070"
  887.   day_color     "#707070"
  888.   current_label ""
  889.   temp_suffix   "°"
  890. end
  891. #
  892. # == Hooks
  893. #
  894. # And finally hooks are a way to bind Ruby scripts to a certain event.
  895. #
  896. # Following hooks exist so far:
  897. #
  898. # [*:client_create*]    Called whenever a window is created
  899. # [*:client_configure*] Called whenever a window is configured
  900. # [*:client_focus*]     Called whenever a window gets focus
  901. # [*:client_kill*]      Called whenever a window is killed
  902. #
  903. # [*:tag_create*]       Called whenever a tag is created
  904. # [*:tag_kill*]         Called whenever a tag is killed
  905. #
  906. # [*:view_create*]      Called whenever a view is created
  907. # [*:view_configure*]   Called whenever a view is configured
  908. # [*:view_jump*]        Called whenever the view is switched
  909. # [*:view_kill*]        Called whenever a view is killed
  910. #
  911. # [*:tile*]             Called on whenever tiling would be needed
  912. # [*:reload*]           Called on reload
  913. # [*:start*]            Called on start
  914. # [*:exit*]             Called on exit
  915. #
  916. # === Example
  917. #
  918. # This hook will print the name of the window that gets the focus:
  919. #
  920. #   on :client_focus do |c|
  921. #     puts c.name
  922. #   end
  923. #
  924. # === Link
  925. #
  926. # http://subforge.org/projects/subtle/wiki/Hooks
  927. #
  928.  
  929. on :start do
  930.   Subtlext::Subtle.spawn "~/scripts/autostart.sh"
  931. end
  932.  
  933. # vim:ts=2:bs=2:sw=2:et:fdm=marker
  934.  
  935.