Advertisement
kbmonkey

vi-like Pytyle config

Sep 15th, 2011
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 20.31 KB | None | 0 0
  1. #===============================================================================
  2. # vi-like window management
  3. # For best use, configure your WM to switch desktops via W-A-j / W-A-k
  4. # Pytyle config file: ~/.config/pytyle/pytylerc
  5. #
  6. # Keys used: (W)inkey, (S)hift, (A)lt, (C)trl
  7. #
  8. # Tiling On/Off.......................... W-a     W-u
  9. # Focus Next/Prev window................. W-j     W-k
  10. # Move window within desktop............. W-C-j   W-C-k
  11. # Move window to another desktop......... W-S-j   W-S-k
  12. # Size the split area.................... W-h     W-l
  13. # Add/remove master split areas.......... W-,     W-.
  14. # Reload Pytyle config................... W-q
  15. # (resets layout on all desktops)
  16. #
  17. #
  18. # #===============================================================================
  19. # PyTyle - A manual tiling manager
  20. # Copyright (C) 2009  Andrew Gallant <andrew@pytyle.com>
  21. #
  22. # This program is free software; you can redistribute it and/or modify
  23. # it under the terms of the GNU General Public License as published by
  24. # the Free Software Foundation; either version 2 of the License, or
  25. # (at your option) any later version.
  26. #
  27. # This program is distributed in the hope that it will be useful,
  28. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  30. # GNU General Public License for more details.
  31. #
  32. # You should have received a copy of the GNU General Public License
  33. # along with this program; if not, write to the Free Software
  34. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  35. #===============================================================================
  36.  
  37. """
  38. .pytylerc
  39.  
  40. The configuration file for PyTyle. See below for further instructions.
  41. """
  42.  
  43. """
  44. IMPORTANT!
  45.  
  46. This *IS* a Python file, and therefore, it must be valid Python syntax.
  47. If you get the syntax wrong here, PyTyle will not start.
  48. """
  49.  
  50.  
  51. #------------------------------------------------------------------------------
  52. # MISCELLANEOUS OPTIONS
  53. #------------------------------------------------------------------------------
  54. Config.MISC = {
  55.                # This is a list of all available tilers. If a tiler
  56.                # is not listed here, it cannot be used. They are
  57.                # loaded when PyTyle starts.
  58.                'tilers': ['Vertical', 'Horizontal', 'HorizontalRows', 'Maximal', 'Cascade'],
  59.  
  60.                # Enables tiling for all desktops/viewports/screens upon
  61.                # PyTyle startup. Desktops et al can still be disabled from
  62.                # tiling by issuing the "untile" command. Default layouts
  63.                # specified below will still be used.
  64.                'global_tiling': False,
  65.  
  66.                # This timeout is used several times in the main event
  67.                # loop. It is the amount of time (seconds) we wait, for
  68.                # example, between when a new window is created and when
  69.                # we scan for new windows. I imagine that if you have a
  70.                # slower system, you might want to increase this.
  71.                #
  72.                # Note: Using a timeout seems like a hack. Any better
  73.                # ideas?
  74.                #
  75.                # Note 2: I tested this on my P3 1.0 GHz with 128MB
  76.                # of memory, and this value worked fine.
  77.                'timeout': 0.1,
  78.  
  79.                # Toggles window decorations. I do not recommend
  80.                # currently disabling window decorations, as it's
  81.                # quite experimental. It could also be removed in the
  82.                # future, because without decorations, it is difficult
  83.                # to tell which window is active (usually).
  84.                #
  85.                # Note: I haven't researched this yet, but how easy is
  86.                # it to draw borders around windows (XMonad style)?
  87.                'decorations': True,
  88.  
  89.                # This setting should reflect whether or not you have
  90.                # decorations enabled or disabled from the *WINDOW
  91.                # MANAGER* end. This is needed because we can't reliably
  92.                # detect if windows have decorations or not.
  93.                #
  94.                # For example, if you have decorations disabled in Openbox,
  95.                # then set this to "False" to prevent PyTyle from adding
  96.                # decorations to your windows.
  97.                'original_decor': True,
  98.                }
  99.  
  100.  
  101. #------------------------------------------------------------------------------
  102. # KEY BINDINGS
  103. #------------------------------------------------------------------------------
  104.  
  105. # Key binding format:
  106. # [Alt-][Shift-][Ctrl-][Super-]KEY
  107. #
  108. # Where you can use any combination of modifiers. And KEY is:
  109. #
  110. # Any letter or number. There are also names for special keys.
  111. #
  112. # For a complete listing, see the PyTyle wiki:
  113. # http://pytyle.com/wiki/Key_listing
  114. #
  115. # Note: I haven't been able to get the F([1-9]|(1[0-2]) keys
  116. # to work yet. (Although, I've only tried in OpenBox.)
  117. #
  118. # Note 2: If you've used XMonad, you'll feel right as rain!
  119. # I started on Arch with XMonad, and moved to OpenBox,
  120. # so naturally, the key bindings clone XMonad's.
  121. #
  122. Config.KEYMAP = {
  123.                  # This will enable and tile the current *screen*.
  124.                  # It will also re-tile when pressed. You can
  125.                  # only access the rest of the key bindings if
  126.                  # you've enabled tiling on the current screen.
  127.                  # (Although I'm thinking of changing this for
  128.                  # screen[0-2]_focus.)
  129.                  'Super-A': 'tile.default',
  130.  
  131.                  # Examples of how you can bind specific tiling
  132.                  # layouts to certain keys.
  133.                  #'Alt-Ctrl-H': 'tile.Horizontal',
  134.                  #'Alt-Ctrl-M': 'tile.Maximal',
  135.                  #'Alt-Ctrl-C': 'tile.Cascade',
  136.  
  137.                  # This will disable and untile the current
  138.                  # *screen*. PyTyle tries to remember the original
  139.                  # positions and sizes of all tiled windows,
  140.                  # although it isn't quite perfect yet. (Specifically,
  141.                  # if you have more than one screen.)
  142.                  'Super-U': 'untile',
  143.  
  144.                  # This will cycle through all available tiling
  145.                  # algorithms. By default, there are currently only
  146.                  # two: Vertical and Horizontal. (If you know Python,
  147.                  # I have made it stupidly easy to add tiling
  148.                  # algorithms. Check out the core Tile.py, and then
  149.                  # Tilers/TileDefault.py which provides common methods
  150.                  # to both Tilers/Horizontal.py and Tilers/Vertical.py.)
  151.                  'Super-Z': 'cycle_tiler',
  152.  
  153.                  # Reloads the configuration file. Make changes to your
  154.                  # config file, and have them applied immediately by
  155.                  # calling this without having to restart PyTyle.
  156.                  'Super-Q': 'reload',
  157.  
  158.                  # This is a hard reset of the current screen. It will
  159.                  # force a re-tile and refresh PyTyle's image of the
  160.                  # current screen. It will keep the same tiling
  161.                  # algorithm, however.
  162.                  'Alt-Shift-space': 'reset',
  163.  
  164.                  # This will cycle all slave windows through the
  165.                  # master area. (If there is more than one master
  166.                  # window, it will use the first master window.)
  167.                  'Ctrl-Super-C': 'cycle',
  168.  
  169.                  # The following three will simply put *focus* on to
  170.                  # the last active window of the specified screen.
  171.                  # Remember, these currently only work properly if
  172.                  # tiling is enabled on the screen.
  173.                  #'Alt-W': 'screen0_focus',
  174.                  #'Alt-E': 'screen1_focus',
  175.                  #'Alt-R': 'screen2_focus',
  176.  
  177.                  # The following three will move the currently focused
  178.                  # window to the specified screen.
  179.                  'Alt-Shift-W': 'screen0_put',
  180.                  'Alt-Shift-E': 'screen1_put',
  181.                  'Alt-Shift-R': 'screen2_put',
  182.  
  183.                  # The following two will increase and decrease the master
  184.                  # area. Depending on the tiling algorithm, these could
  185.                  # be irrelevant or do different things. (For instance,
  186.                  # in the Vertical layout, it will change the master area
  187.                  # width, and in the Horizontal layout, it will change the
  188.                  # master area height.)
  189.                  'Super-H': 'master_decrease',
  190.                  'Super-L': 'master_increase',
  191.  
  192.                  # The following two will increase and decrease the number
  193.                  # of master windows. This will allow you to easily configure
  194.                  # a grid layout dynamically, among other things.
  195.                  'Super-period': 'add_master',
  196.                  'Super-comma': 'remove_master',
  197.  
  198.                  # This will make the currently active window the master.
  199.                  'Alt-Return': 'make_active_master',
  200.  
  201.                  # This will move focus to the master window (or the first
  202.                  # master window if there are more than one).
  203.                  'Super-M': 'win_master',
  204.  
  205.                  # This will close the currently focused window. You do
  206.                  # *NOT* need to use this to close windows. It is only
  207.                  # included here for completeness. (In other words, you
  208.                  # can close a window any way you like, minimize to
  209.                  # tray, etc.)
  210.                  #'Alt-Shift-C': 'win_close',
  211.  
  212.                  # The following two will cycle focus to the previous or
  213.                  # next windows. (The algorithm for this is determined
  214.                  # by the current tiling layout.)
  215.                  'Super-J': 'win_previous',
  216.                  'Super-K': 'win_next',
  217.  
  218.                  # The following two will switch the current window with
  219.                  # the previous or next window.
  220.                  'Ctrl-Super-J': 'switch_previous',
  221.                  'Ctrl-Super-K': 'switch_next',
  222.  
  223.                  # This is a debugging binding that shows some information
  224.                  # about the current desktop. It's only useful if you're
  225.                  # running PyTyle from a terminal.
  226.                  #'Alt-D': 'query',
  227.                  }
  228.  
  229. #------------------------------------------------------------------------------
  230. # COMMAND LINE CALLBACKS
  231. #------------------------------------------------------------------------------
  232.  
  233. # This section will allow you to assign commands to numbers that can
  234. # be run on the command line using the pytyle-client executable.
  235. #
  236. # Thanks to Johannes Pirkl for this patch!
  237.  
  238. Config.CALLBACKS = {
  239.     0: 'make_active_master',
  240.     1: 'switch_previous',
  241.     2: 'switch_next',
  242. }
  243.  
  244. #------------------------------------------------------------------------------
  245. # DOCKS, PANELS, ETC...
  246. #------------------------------------------------------------------------------
  247.  
  248. # This will allow you to forcefully tell PyTyle about any docks/panels that
  249. # you may have. If you have a basic setup (read: one screen), then I would
  250. # advise that you ignore this for now, and only configure this if you notice
  251. # that PyTyle is putting windows over your docks/panels.
  252. #
  253. # However, if you have two or more screens and have docks/panels, you *MUST*
  254. # configure this, otherwise PyTyle will use the entirety of your screens.
  255. # The problem here is that with xinerama, it's only going to tell you the
  256. # x/y/width/height of each screen, and the window manager isn't much more
  257. # help. (Especially since they aren't required to broadcast their struts
  258. # or partial struts, to my knowledge. If I had that information, I might be
  259. # able to eliminate this configuration.)
  260. #
  261. # The configuration is pretty straight-forward. See the commented out example
  262. # for a sample. (Which will create even margins around the tiling windows
  263. # for two screens. It's actually kind of neat looking. Try it.)
  264. #
  265. # Note: If you have this set and you only have one screen, it will override
  266. # the workarea reported by your window manager.
  267. Config.WORKAREA = {}
  268.  
  269. # Pretty straight forward here. Just use the screen number as your key,
  270. # (starting from zero) and specify *all four* of the configuration
  271. # options: top, bottom, left, and right. Each value should be the number
  272. # of pixels from the edge of the screen that PyTyle should ignore.
  273. #Config.WORKAREA = {
  274. #                   0: {
  275. #                       'top': 100,
  276. #                       'bottom': 100,
  277. #                       'left': 100,
  278. #                       'right': 100,
  279. #                       },
  280. #                   1: {
  281. #                       'top': 200,
  282. #                       'bottom': 200,
  283. #                       'left': 200,
  284. #                       'right': 200,
  285. #                       },
  286. #                   }
  287.  
  288.  
  289. #------------------------------------------------------------------------------
  290. # IGNORE WINDOW LIST
  291. #------------------------------------------------------------------------------
  292.  
  293. # This is a simple list of windows that PyTyle should exclude from
  294. # tiling. It's case-insensitive and will search the name and class
  295. # of the window. (This search algorithm could change, as I haven't
  296. # put much thought into it.)
  297. #
  298. # Note: This is useful for things like run dialogs and other quick
  299. # popups that PyTyle can't detect. (It will, however, detect popups
  300. # within other windows.) Also useful for applications like Gimp.
  301. #
  302. # Note 2: You shouldn't need to put dmenu here.
  303. Config.FILTER = [
  304.                'gmrun', 'gimp', 'download', 'mirage', 'gcolor2',
  305.         'gcalctool', 'obconf',
  306.                ]
  307.  
  308.  
  309. #------------------------------------------------------------------------------
  310. # LAYOUT SPECIFIC OPTIONS
  311. #------------------------------------------------------------------------------
  312.  
  313. # Sometimes layouts can be tweaked slightly to better suit your
  314. # tastes. For example, width/height factors. See the example
  315. # below for instructions on how to configure your layout.
  316. #
  317. # Note: Not every layout will have configuration options.
  318. Config.LAYOUT = {
  319.                  'Vertical': {
  320.                               # The default width factor. This is used when
  321.                               # the screen is initially tiled (or reset).
  322.                               # Possible values: 0 < x <= 1.0
  323.                               'width_factor': 0.5,
  324.  
  325.                               # Allows you to set a margin around *each*
  326.                               # window (in pixels, must be greater than 0).
  327.                               'margin': 6,
  328.                               },
  329.  
  330.                   'Gimp': {
  331.                             'width_factor': 0.1,
  332.                             'margin': 2,
  333.                             },
  334.  
  335. #                 'Horizontal': {
  336. #                                # The default height factor. This is used
  337. #                                # when the screen is initialled tiled (or
  338. #                                # reset). Possible values:
  339. #                                # 0 < y <= 1.0
  340. #                                'height_factor': 0.5,
  341.  
  342. #                                # Allows you to set a margin around *each*
  343. #                                # window (in pixels, must be greater than 0).
  344. #                                'margin': 2,
  345. #                                },
  346.  
  347. #                 'Maximal': {
  348. #                             # Nothing here yet... Are there any options for
  349. #                             # Maximal? (True full screen? i.e., overlap panels
  350. #                             # and docks?)
  351. #                             },
  352.  
  353. #                 'Cascade': {
  354. #                             # This will be determined automatically,
  355. #                             # but in case the windows aren't
  356. #                             # "cascading", you might need to set this
  357. #                             # differently.
  358. #                             'decoration_height': 25,
  359.  
  360. #                             # Determines the width of the windows relative
  361. #                             # to the screen width. Possible
  362. #                             # values: 0 < x <= 1.0
  363. #                             'width_factor': 1.0,
  364.  
  365. #                             # Determines the height of the windows relative
  366. #                             # to the screen height. Possible
  367. #                             # values: 0 < y <= 1.0
  368. #                             'height_factor': 1.0,
  369.  
  370. #                             # The number of pixels to "push" each subsequent
  371. #                             # window over. (Automatically adjusts itself
  372. #                             # for horizontal alignment.)
  373. #                             'push_over': 0,
  374.  
  375. #                             # Determines the horizontal alignment of the
  376. #                             # cascading windows. Possible
  377. #                             # values are "left" or "right".
  378. #                             'horz_align': 'left',
  379. #                             },
  380.  
  381.                   # Default settings for the "HorizontalRows" layout.
  382.                   'HorizontalRows': {
  383.                                      # The default height factor. This is used
  384.                                      # when the screen is initialled tiled (or
  385.                                      # reset). Possible values:
  386.                                      # 0 < y <= 1.0
  387.                                      'height_factor': 0.5,
  388.  
  389.                                      # Simply sets how many windows to have
  390.                                      # in each row.
  391.                                      'row_size': 2,
  392.  
  393.                                      # Allows you to set a margin around *each*
  394.                                      # window (in pixels, must be greater than 0).
  395.                                      'margin': 0,
  396.                                      },
  397.  
  398.                   # An example of a perhaps more "traditional" cascading
  399.                   # layout that uses smaller windows.
  400.                   #
  401.                   # Note: If you need to have multiple cascading layouts
  402.                   # simultaneously, you'll need to create your own layout.
  403.                   # Quickly:
  404.                   #    1. Create your tiling class, say Tilers/MyCascade.py.
  405.                   #    2. Copy the contents of Tilers/Cascade.py into your
  406.                   #       new file.
  407.                   #    3. Change *all* instances of "Cascade" to "MyCascade"
  408.                   #       or whatever you named your layout.
  409.                   #    4. Add your new tiler to the list above.
  410.                   #    5. Add a new section here of configuration options
  411.                   #       for your new cascading layout.
  412. #                 'Cascade': {
  413. #                             'decoration_height': 25,
  414. #                             'width_factor': 0.5,
  415. #                             'height_factor': 0.5,
  416. #                             'push_over': 25,
  417. #                             'horz_align': 'left',
  418. #                             }
  419.                  }
  420.  
  421.  
  422. #------------------------------------------------------------------------------
  423. # TILING PER WORKSPACE/SCREEN
  424. #------------------------------------------------------------------------------
  425.  
  426. # This will let you configure the default tiling algorithms on a
  427. # per screen per workspace basis. A default tiler must be set.
  428. # Also, see the commented out configuration for an example.
  429. #
  430. # Remember: You can always cycle through the different tiling
  431. # algorithms after the initial tile.
  432. Config.TILING = {
  433.                'default': 'Vertical',
  434.                }
  435.  
  436. # This configuration sets the default tiler to "Vertical", and the
  437. # default tiler of Screen 1 to "Horizontal" (so all desktops on
  438. # Screen 1 will have a horizontal layout at first). Also, this will
  439. # set the default layout on Screen 0 for desktops 4 and 6 to
  440. # "Horizontal".
  441. #
  442. # Note: Screen and desktop numbers start from 0. So desktop 4 should
  443. # be configured using "3" below.
  444. #
  445. # Take note of the following desktop/viewport numbering scheme:
  446. # One row: 0 1 2 3
  447. # Multiple rows:
  448. # 0 1 2
  449. # 3 4 5
  450. # 6 7 8
  451. #Config.TILING = {
  452. #                 'default': 'Vertical',
  453. #                 0: {
  454. #                       5: 'Horizontal',
  455. #                       7: 'Horizontal',
  456. #                    },
  457. #                 1: 'Horizontal',
  458. #                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement