Git Product home page Git Product logo

ssokolow / quicktile Goto Github PK

View Code? Open in Web Editor NEW
856.0 29.0 77.0 2.29 MB

Adds window-tiling hotkeys to any X11 desktop. (An analogue to WinSplit Revolution for people who don't want to use Compiz Grid)

Home Page: https://ssokolow.com/quicktile/

License: GNU General Public License v2.0

Python 98.18% Shell 1.82%
python x11 utility tiling gtk window-manager tiling-window-manager addon gtk3 python3

quicktile's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quicktile's Issues

Better dimensions for "portrait" monitors

I have a dual monitor setup, the same size monitors with one in landscape (1920w by 1080h) and one portrait mode (1080w by 1920h). So cycling through the dimensions on my landscape monitor with quicktile works exactly as I'd like, however on the portrait monitor I'd like the window dimensions to be slightly differently. For example currently cycling through quicktile.py bottom results in the following window three sizes:

quickitle_screenshot_bottom_default

But having the window that skinny isn't any use to me, it'd be better if it cycled through full width but varying heights like this:

quickitle_screenshot_bottom_portrait

I've only used this on my own machine so it'd need some testing for cross compatibility but you can check my fork out for an initial working version. It should behave as normal on monitors in landscape mode (where the monitor is wider than it is tall) but on portrait monitors it will have different dimensions for the top, middle and bottom positions.

Add "monitor-switch-all" command

It would be nice to have a "monitor switch" command for all open windows. A typical use case would be when working on a laptop while travelling, then plug it in to an external monitor, if I want to move all the windows to the external monitor I have to do that for each window one by one.

Minimum window dimensions can interfere with cycling through QuickTile presets

When a Window like Firefox refuses to shrink beyond a certain size, it can block QuickTile from progressing to the next preset size in the sequence. (For example, Firefox refusing to narrow to one third of the screen width)

This will probably have to be fixed alongside issue #10 since it will require QuickTile to keep state on each window being tiled rather than just inferring from the window's current size.

Long lines in terminal lines are not wrapped

I cannot reproduce this consistently but to try it:

  • open a terminal eg. gnome-terminal or mate-terminal
  • snap the window to the left or right half of the screen
  • type "env" or other command which produces some long lines
  • observe the long lines not being wrapped

I observed this when I ssh'd to a Centos6 server which is running zsh. My host machine is Debian Wheezy running MATE 1.6.0.

I am using quicktile 0.2.2

Keybinds shouldn't be hard-coded

Before making an initial release, I need to decide on one (or more) of the following approaches to keybinds and then implement it/them:

  • Something like --dump-conf and purely manual editing
  • xbindkeys-style (CLI "press your key combo" UI)
  • GTK+ GUI keybind editor

I'll also need to decide on an on-disk format for config editing which is simple to implement. Maybe whatever I cook up for ssokolow/timeclock#4 and ssokolow/timeclock#2 if my idea for using decorators pans out.

cycle_dimensions sequences shouldn't be hard-coded

Currently, all aspects of mapping between key combinations and commands with --daemonize are configurable, but the definition of what those commands do is still hard-coded.

Given that most commands are essentially macros, cycling windows through sequences of position-dimension presets and that I've seen real-world examples of people editing quicktile.py simply to alter the POSITIONS map, this needs to change.

However, it won't be as simple as the existing config keys for the following reasons:

  • ConfigParser doesn't natively support lists of lists
  • SimpleJSON wasn't added to stdlib as the json module until Python 2.6
  • Mechanisms like pickle don't produce config files that are easy to read and edit by hand
  • I have no idea when I'll be ready to produce the GTK+ GUI for customizing configurations.
  • I don't want to add to QuickTile's list of dependencies for continued support of older Python versions just yet.

My current avenue of interest is exploring how much I'd have to compromise the expressiveness of the current system and what syntax I could easily parse to comfortably store a sequence of positions in a reasonably intuitive, human-editable string that will still be easy to both parse and generate when it comes time to create a configuration GUI.

QuickTile is broken for terminator on XFCE

Firt let me say this is an awesome app!!! Keep up with the good work!

Hi, I have a problem with terminator (https://launchpad.net/terminator, 0.96-r1 and 0.97-r1) and quicktile (0.2.2 and 0.1.5) on xfce 4.10.

I have quicktile started as daemon and when I focus terminator and try to tile it - the windows jumps and starts sliding (like an animation) until only the title bar is visible.

Here is screenshot before tiling
terminator-normal

Here is a screenshot trying to tile terminator to top-left
terminator-topleft

Debug info (seems perfectly fine):

Xlib.protocol.request.QueryExtension
DEBUG: window: <wnck.Window object at 0xfac280 (WnckWindow at 0x1039ab0)>
DEBUG: Monitor: 1, gtk.gdk.Rectangle(1920, 0, 1920, 1080)
DEBUG: dims [[0, 0, 960, 513], [0, 0, 640, 513], [0, 0, 1280, 513]]
DEBUG: result (1920, 27, 960, 513)
DEBUG: Monitor: 1, gtk.gdk.Rectangle(1920, 0, 1920, 1080)
DEBUG: repositioning to (1920, 27, 960, 513)

If there is any more info I can provide please point me in the right direction. I will try to help as much as possible.

Thanks in advance!

git-gui tends to steal focus

To replicate:

  1. Place a git gui window on screen
  2. Focus another window and place it above git gui
  3. Place the cursor somewhere which won't be occupied by the focused window when the quicktile resize is complete
  4. Press a quicktile keybinding that results in window resize/reposition
  5. Watch as git gui (or sometimes another window like Firefox) steals focus

I've demonstrated the problem in LXDE with both Openbox and Metacity (via --replace).

This problem is compounded by git gui being inaccessible by the GDK API that quicktile uses in much the same way as MPlayer is. (NET_WM_WINDOW_TYPE is None)

In both cases (git-gui receiving focus and Firefox receiving focus), minimizing git-gui causes the problem to stop occurring.

This also needs to be tested on LXDE and some other desktop sessions on my Lubuntu desktop to confirm that it isn't a bad interaction with something specific either to LXDE or to my main (Gentoo) machine. It's also possible it's a GDK bug.

emacs grabs key commands

Just installed quicktile; when trying to resize an emacs window it instead prints out a message saying that the key combination is undefined.

Metacity ignores move()

Not sure why or what the solution is, but Metacity does not respond to the move() or resize_move() request.

I did read this which lead to this. Not sure if there's a solution in there though. :-)

I'll post back here if I find a solution, but it's a low priority for me as I'm happy enough repositioning the windows by hand.

xfdesktop is tiled by quicktile if it has focus

When I have quicktile running in XFCE, it seems that it is possible to affect and move xfdesktop if it happens to have focus. Moving xfdesktop disrupts things quite a bit and it isn't reversible when I'm using multiple monitors.

I added the following code to the top of WindowManager.reposition():

        if win.get_window_type() != wnck.WindowType.__enum_values__[0]:
            return

This excludes anything but normal windows (WNCK_WINDOW_NORMAL) from being repositioned by quicktile. xfdesktop is type WNCK_WINDOW_DESKTOP. I'm not sure if this is where this snippit belongs, but it made sense to me and fixed the issue for myself.

System: Debian testing, updated 2014-02-18
Ref: https://developer.gnome.org/libwnck/stable/WnckWindow.html#WnckWindowType

Xlib error on 15.04

The --daemonize option triggers a python xlib error.
Currently on xubuntu 15.04

xlib version: 0.14

Traceback (most recent call last):
  File "./quicktile.py", line 1261, in <module>
    if not app.run():
  File "./quicktile.py", line 913, in run
    self.keybinder = KeyBinder()
  File "./quicktile.py", line 752, in __init__
    self.xdisp = xdisplay or Display()
  File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 85, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 67, in __init__
    apply(protocol.display.Display.__init__, (self, ) + args, keys)
  File "/usr/local/lib/python2.7/dist-packages/Xlib/protocol/display.py", line 123, in __init__
    raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0.0": Invalid MIT-MAGIC-COOKIE-1 key

Not sure whether this is related to quicktile itself. Has anybody had the same issue ?

crashes on particular hotkeys like " Mod1 + Mod4 + , "

The Error I get after pressing the hotkey:

Xlib.protocol.request.QueryExtension
Traceback (most recent call last):
File "/usr/bin/quicktile", line 577, in handle_xevent
self.wm.doCommand(self.keys[keycode])
KeyError: 59

My current environtment:

Linux bodhi32-ThinkPad-X61 3.5.0-11-generic #11 SMP Wed Aug 22
14:45:14 CDT 2012 i686 i686 i386 GNU/Linux

I'm using e17, feel free to ask me for further information

Some applications have a margin when tiled

I am running Elementary OS (based on Gnome & Ubuntu 14.04) and some applications are not getting tiled correctly. They are too small and have a margin on all sides.

This happens for example with

  • Nautilus
  • Geary
  • Pantheon Terminal
  • Maya Calendar

Other applications like Firefox or SublimeText are getting tiled just fine.

Here is a Screenshot of the Terminal set to half screen.

screenshot from 2015-04-21 18 42 20

"monitor-switch" keybinding should adjust dimensions if window is tiled

If a window is tiled and then the monitor-switch command (Ctrl+Alt+KP_Enter by default) is used to switch it to a monitor with different geometry (different dimensions, different panels, etc.), it will retain its old shape despite that shape no longer corresponding to the preset.

This shouldn't need to wait until the massive redesign required for implementing #10 properly. All I need to do is divide up cycleDimensions so this algorithm becomes possible:

  1. Call the code cycleDimensions uses to identify the preset the window currently matches.
  2. Call the current code in cmd_cycleMonitors
  3. Call the code cycleDimensions uses to apply a specific preset in order to re-apply the preset from step 1.

Other window fraction sizes (namely fourths)

Right now quicktile's defaults for a window size are 1/3, 1/2, and 2/3.

As screens grow larger, it would be nice if other fractions were also easily available and configurable by the user, like 1/4 or 1/5.

If I perhaps overlooked this functionality, it would be nice to add this information to the README.

QuickTile needs a more polished GitHub Pages site

The QuickTile site is functional, but not really very good as a means of impressing visitors. I should really give it a proper redesign with some of the following features:

  • Important details and links should be made more prominent so they don't risk getting lost among the rest of the text.
  • More distinctive, memorable, and professional-looking.
  • A logo that can also be put up on Open Hub.
  • Mention the lack of a tray icon as a feature. (One which will be preserved as an option should I ever implement one)
  • Perhaps a bit of Javascript to check the browser's User-Agent string and, if the user is on OSX or Windows, amend the X11 requirement note to suggest a platform-appropriate alternative?
  • An animation in the style of a demonstration video (to complement the illustrations in the command reference)
  • Finish migrating the information from the current site to the new Sphinx-based design

EDIT: I've started to revise and check off the list according to the copy of the gtk3_port branch on my hard drive with the rewritten Sphinx documentation.

wnck reform breaks XQuartz (`DEBUG: window: None`)

discussion started at #9

XQuartz 2.7.4 (xorg-server 1.13.0)
quartz-wm 1.3.1

setup dependencies through macports (my version info: http://pastebin.ca/2465248)
opened a simple terminal window (xterm) then ran:

bash-4.2$ git checkout f7978209bab75a705a436e6c556a69843741e5a8
bash-4.2$ ./quicktile.py --debug top
DEBUG: NET_WM_WINDOW_TYPE: None
DEBUG: win <gtk.gdk.Window object at 0x105518320 (GdkWindow at 0x7f9a3394d360)>
DEBUG: useArea [gtk.gdk.Rectangle(1366, 1058, 1920, 1080)]
DEBUG: useRect gtk.gdk.Rectangle(1366, 1058, 1920, 1080)
DEBUG: winGeom (0, 0, 1918, 533)
DEBUG: monitorID 2
DEBUG: dims [[0, 0, 1920, 540], [640, 0, 640, 540]]
DEBUG: result (2006, 1058, 640, 540)
bash-4.2$ 
bash-4.2$ git checkout 73973763b3503bb726c5531db8529248168040f1
bash-4.2$ ./quicktile.py --debug top

** (quicktile.py:61677): WARNING **: Trying to register gtype 'WnckWindowState' as enum when in fact it is of type 'GFlags'

** (quicktile.py:61677): WARNING **: Trying to register gtype 'WnckWindowActions' as enum when in fact it is of type 'GFlags'

** (quicktile.py:61677): WARNING **: Trying to register gtype 'WnckWindowMoveResizeMask' as enum when in fact it is of type 'GFlags'
DEBUG: window: None
bash-4.2$ 

QuickTile fails pathologically when encountering panel reservations on edges between monitors

Was: Windows get resized to (0,0,0,0) on a clean install of Ubuntu 14.04.1

On a fresh install of Ubuntu 14.04.1 I get the following results when running quicktile on the latest master branch (commit 7571ac6).

$ ./quicktile.py -d --debug
<class 'Xlib.protocol.request.QueryExtension'>
DEBUG: window: <wnck.Window object at 0x7ff418e7d5f0 (WnckWindow at 0x1955e00)>
DEBUG: Monitor: 0, gtk.gdk.Rectangle(0, 0, 1920, 1200)
DEBUG: dims [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
DEBUG: Result overlaps panel. Falling back to usableRect.
DEBUG: result (0, 0, 0, 0)
DEBUG: Monitor: 0, gtk.gdk.Rectangle(0, 0, 1920, 1200)
DEBUG: repositioning to (0, 0, 0, 0)

Earlier today, before performing the fresh install of Ubuntu 14.04.1, I was running Ubuntu 14.04.1 which was upgraded from a fresh install of Ubuntu 13.04. On that installation I was running a quicktile fork based on an old commit (7a5bf6f). Everything worked fine.

However, on the fresh install of 14.04.1, when running the old commit 7a5bf6f, I get the following debug output:

$ ./quicktile.py -d --debug
<class 'Xlib.protocol.request.QueryExtension'>
DEBUG: NET_WM_WINDOW_TYPE: ('ATOM', 32, ['_NET_WM_WINDOW_TYPE_NORMAL'])
DEBUG: win <gtk.gdk.Window object at 0x7f2b10078280 (GdkWindow at 0x27d1480)>
DEBUG: useArea []
DEBUG: useRect gtk.gdk.Rectangle(0, 0, 0, 0)
DEBUG: winGeom (49, 24, 200, 228)
DEBUG: monitorID 0
DEBUG: dims [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
DEBUG: Result overlaps panel. Falling back to usableRect.
DEBUG: result (0, 0, 0, 0)

Could it be that quicktile depeneds on some library that was available in Ubuntu 13.04, but is not present in 14.04?

Any suggestions to track down the issue and find a workaround would be appreciated!

doesn't work on x2go server side

When run on x2go (NX based) quicktile doesn't find the active window.

running ubuntu 12.04
x2goagent: 3.5.0.21
x2goserver: 4.0.1.6
x2goserver-extensions: 4.0.1.6

The real X server is Xquartz, as specified in #28

$ git co f7978209bab75a705a436e6c556a69843741e5a8
HEAD is now at f797820... Audit and fix up the API documentation.
$ ((f797820...))$ ./quicktile.py --debug bottom
[no output]
$ ((f797820...))$ git checkout 73973763b3503bb726c5531db8529248168040f1
Previous HEAD position was f797820... Audit and fix up the API documentation.
HEAD is now at 7397376... Never forget to test your docs for typos before committing
$ ((7397376...))$ ./quicktile.py --debug bottom
DEBUG: window: None
jfdagenais@jfddesk:~/devel/tools/quicktile$ ((7397376...))$ 

So neither pre-wnck or post-wnck work, but the wnck spits out DEBUG: window: None

This is a real corner case and I am just reporting a issue to document the effort and maybe benefit someone else in the future.

Thank! ;)

Window Gravities

QuickTile's resize mechanism should allow the x,y coordinates for window-resizing geometry to apply to a customizable portion of the window. (eg. center, rather than top-left)

This would remove the need for a whole new function for centering a window without altering its dimensions along one axis.

No module named wnck

Trying to use quicktile on Linux Mint Mate 16 x64 and getting the following error when I run quicktile.py:

zap@bangarang ~/quicktile $ ./quicktile.py
Traceback (most recent call last):
  File "./quicktile.py", line 57, in <module>
    import gtk, gobject, wnck
ImportError: No module named wnck

Any idea how I can resolve this?

Thank you.

Since I have switched to Gnome3, there was no working replacement for the Compiz Grid plugin. At least: until I found your tool.

Since I am so thankful, I have put you (respective the Quicktile Script) on my Flattr subscription list. Keep up the nice work!

Better error message needed when keybinding fails

When starting quicktile under XFCE (as distributed in Fedora 16), the application reports a bunch of BadAccess errors and doesn't react to key presses. The errors are generated by the calls to grab_key in _init_xlib(). The reason is that XFCE already associates the keyshortcuts to other functions. It would be nice if the application would display (at the command prompt) an appropriate error message when the call to grab_key fails (it is possible to detect the error with a CatchError handler).

Thanks for this application, it's fantastic :)

Feature: Be able to manually set shortcut combinations WITHOUT setting "ModMask" modifier key(s).

To start, finding this tool was super-awesome! I've just moved over from Windows to Xubuntu for my work environment (instead of Ubuntu because of several critical glitches with multi-monitor support and lagginess in Unity) and as such, despaired because moving to Xubuntu meant the loss of Compiz as the windows manager.

To explain further, Compiz has excellent advanced windows management tools that make binding key combinations to window positioning (via the Put extension). Finding Quicktile provided a replacement for the shortcuts that I use practically every fes seconds!

So, to the matter of this issue I'm creating. As the summary says, it is sometimes useful to be able to not use the "ModMask" value so that we can dictate different modifier combinations for each of the available options.

My use case is that I've got <Shift><Alt><F> bound to a mouse key from when I was on windows (is a Logitech G700) that is not configurable on Ubuntu. Apart from the fact that the mouse's hardware keys can't be re-bound directly from Xubuntu, I have the same set of keys bound across many computers for these window management shortcuts.

What I would hope for is to be able to set the value of "ModMask" to something like "None" and if such a value is detected, the script should can set the "ModMask" to an empty string. This was the simplest way to modify the script without learning much more about Python (I have zero experience with Python - I'm a PHP/Ruby/JS developer).

I'm creating a fork and will push my minor modification that implements my suggested change to it. Here's the commit hash to the commit in which you can find my modification: af93250e4e514410a65ca1bc2d53c1f2f13e7404.

Once again, thanks for the excellent tool and your wonderful work!

Grow/Shrink Bindings

It should be possible to grow/shrink windows horizontally or vertically by some small increment (10px?) using the numpad /*-+ keys.

To do this properly will require window gravity (Issue #9) and some mechanism to remember gravity for a given window as assigned by the last tiling operation but invalidate it and reset to some user-specified default on manual repositioning.

Maybe a dict with native window IDs for keys where the values include the last quicktile-set geometry as a validity test.

Switching to libwnck broke the ability to chain identical commands at the command line

With the old system, it was possible to say quicktile.py left left and have a window jump two presets ahead in the cycle.

Something about how I'm using libwnck seems to have broken this. (I'm guessing I'm not giving it time to update its geometry cache, which would mean that each call to "left" doesn't build on the previous one.)

Users needing this functionality are advised to use commit f797820 (zip) until the problem is fixed.

Defining custom commands shouldn't conflict with a system-wide install

Given that some of the forks I see are purely for the purpose of implementing a custom command, it'd probably be a good idea to add support for extending QuickTile in case the user wants to also have it installed outside their homedir.

The first thing I'll want to do is extend the config file syntax to allow users to customize tiling presets without having to know any Python (issue #13) but, once that's done, it should just be a simple matter of allowing users to write custom commands into a file with a name like ~/.config/quicktile/extra_commands.py.

This will probably be a bit low priority, since I'll first want to set up the infrastructure to encourage users to share their enhancements, but it shouldn't be too difficult now that I've cleaned up the command API and switched to using decorators to register them.

The main design concern will be that, since I haven't yet justified the added complexity of a multi-file design, I can't use imp.load_source. As such, I'll probably use execfile instead and pass the extension API in without requiring an import.

It has its problems, but I don't foresee any of them becoming significant to this use case in the near future. (And certainly not before the 1.0.0 release when apply any API-breaking fixes that have accumulated on the TODO list.)

setup.py still only useful for "./setup.py develop"

While QuickTile is a single-file script, having a setup.py which can only be used for ./setup.py develop is very un-professional.

Also, QuickTile needs a quicktile.desktop to be installed in /etc/xdg/autostart for easy setup.

As such, consider it a bug that ./setup.py install doesn't work.

libwnck bindings broken on Arch?

The last quicktile version (7397376) does not work with the wnck version installed on my arch linux system :

AttributeError: 'module' object has no attribute 'WINDOW_CHANGE_X'

I use :

  • libwnck 2.30.7
  • pyhon2-wnck 2.32.0

Which wnck version is quicktile compatible with ?

Gap at top of tiled windows

I am running ubuntu 14.04. When tiling windows, there is a small gap at the top of the windows. I've tried changing the struts, but even when running reposition with (800, 0, 800, 900), I get the same issue:
DEBUG: Repositioning to (800, 0, 800, 900)

I have even tried changing the new_y value to -20 and it still won't move the window up. Maximize does work in all situations.

I wonder if it is a similar problem to what this person had:

http://stackoverflow.com/questions/10415097/window-position-a-little-off-just-after-spawning-and-moving-using-python-wnck

screenshot from 2015-07-21 12 24 20

struct.error: ushort format requires 0 <= number <= USHRT_MAX

First run setup.py install
Then /usr/local/bin/quicktile.py -d
And have error
Xlib.protocol.request.QueryExtension
Traceback (most recent call last):
File "./quicktile.py", line 1261, in
if not app.run():
File "./quicktile.py", line 918, in run
self.keybinder.bind(self._modmask + key, call)
File "./quicktile.py", line 805, in bind
1, X.GrabModeAsync, X.GrabModeAsync)
File "/usr/lib/pymodules/python2.7/Xlib/xobject/drawable.py", line 558, in grab_key
keyboard_mode = keyboard_mode)
File "/usr/lib/pymodules/python2.7/Xlib/protocol/rq.py", line 1406, in init
self._binary = apply(self._request.to_binary, args, keys)
File "/usr/lib/pymodules/python2.7/Xlib/protocol/rq.py", line 1095, in to_binary
return apply(self.to_binary, varargs, keys)
File "", line 2, in to_binary
struct.error: ushort format requires 0 <= number <= USHRT_MAX
Can someone help with this?

Add more detailed instructions for disabling the Compiz Grid plugin to the FAQ

Was: Broken window size cycling on Ubuntu 14.04

Issue

I am not sure if this is a bug or just something I did wrong.
On a Ubuntu 12.04 the window size cycling was working perfectly (I was able to switch from 1/2 to 1/3 to 2/3 by pressing the number multiple times).
Now that I've installed quicktile on Ubuntu 14.04, the only available size is 1/2.

Debugging tips

  • <Ctrl>+<Alt>+0 does minimise the current window.
  • <Ctrl>+<Alt>+5 does switch between maximised and "almost maximised".
  • If I open a terminal and try to cycle through the different position for the "corner sequences", the first is caught but the following repetitions just drop the number I'm pressing into the terminal.
  • The "side sequences" are, instead, always caught, but the dimension does not cycle.

Make keybinding conflicts more obvious in QuickTile console output

Given situations like issue #44, I should really amend the console output so that users can clearly see the presence or absence of messages like Received <Ctrl><Alt><KP_4>, resolved to preset [...]when trying to track down a problem.

"Opaque unless you know QuickTile's internals" is a bit of an understatement when talking about the current --debug messages.

I'll also want to pair it with a CONTRIBUTING.md that walks potential bug-reporters through checking things like that.

Tiling fails with Matlab

Tiling doesn't seem to work with Java GUI applications. Specifically I have this issue with Matlab and Jabref.

P.S. Thanks for the great tool!

Support more splits

It'd be nice to have 9 different regions of the screen to snap to, instead of 4. (I have a 4k monitor) Not sure how you'd want to implement this, but I know enough Python (hopefully) to contribute.

Small issue when moving a window to second monitor

Thank you for the great update! Now usage of quicktile (current commit) with a two monitor setup with XFCE (panel spanning the the lower part of the left monitor) is very nice!

I observed a small issue:

  • First I resize a window to the lower left quarter of the left monitor. (fine)
  • Now I move the window over to the second monitor. Since there is no toolbar I have a small gap to the lower bound of the monitor. (fine, since by design)
  • Now I want to resize the window to again fill the lower left quarter of the right monitor, in order to fill the gap. This does not work as expected, since quicktile remebers the last resizing action to be "lower left quarter" and as such now resizes the window to the next smaller size "lower left sixth".

I would expect that moving a window to the next monitor to reset the last remembered action so that the window would be resized to "lower left quarter", inspite of "lower left sixth".

Hopefully my explanation is understandable.

Peter

Super_L & Mod4

QuickTile currently fails to bind keys like Super_L (left Windows key) when they've been configured as modifiers.

I tested this on two different computers with two different keyboards and I was not able to get the Super_L key to work with version 0.2.2. However, I tested this with an older version 0.1.5 and I was able to get it to work by using Mod4 for the modifier.

The 0.1.5 source code can be found at the following location. Maybe someone can spot what changed to cause Mod4 to stop working?

https://github.com/brettbatie/quicktile/blob/master/quicktile.py

I'm going to continue using 0.1.5 until this is fixed as I prefer using the super key.

"Already tiled" detection is too permissive when used with monitor-switch

Thank you for the great update! Now usage of quicktile (current commit) with a two monitor setup with XFCE (panel spanning the the lower part of the left monitor) is very nice!

I observed a small issue:

  • First I resize a window to the lower left quarter of the left monitor. (fine)
  • Now I move the window over to the second monitor. Since there is no toolbar I have a small gap to the lower bound of the monitor. (fine, since by design)
  • Now I want to resize the window to again fill the lower left quarter of the right monitor, in order to fill the gap. This does not work as expected, since quicktile remebers the last resizing action to be "lower left quarter" and as such now resizes the window to the next smaller size "lower left sixth".

I would expect that moving a window to the next monitor to reset the last remembered action so that the window would be resized to "lower left quarter", inspite of "lower left sixth".

Hopefully my explanation is understandable.

Peter

quicktile assumes querty keycode mappings, don't work with other layouts

So e.g. if you use the colemak keyboard layout (e.g. using setxkbmap gb -variant colemak), and have a quicktile action bound to E, then pressing e (which on a colemak keyboard is keycode 45) doesn't do anything. To get the desired action you need to press the key that would be 'e' if the keyboard was querty, i.e. keycode 26 (which on colemak is actually the 'f' key).

Windows incorrectly sized on non-rectangular desktop

screen0: 1440x900 with panels
screen1: 1920x1080 no panels.

The largest "safe" area not to overlap the panels is returned as only 841 pixels high. I commented out this code block and it works fine, windows are sized correctly not to overlap the panels without this.

#TODO: Support non-rectangular usable areas. (eg. Xinerama)
if self._root.supports_net_wm_hint("_NET_WORKAREA"):
    p = gtk.gdk.atom_intern('_NET_WORKAREA')
    desktopGeo = self._root.get_root_window().property_get(p)[2][0:4]
    monitorGeom = gtk.gdk.Rectangle(*desktopGeo).intersect(monitorGeom)

Quicktile does not use all the available area on dual-screen setup and Gnome 2

I use quicktile on a RHEL 6 desktop with Gnome 2. I have two screens; Gnome panels are displayed only on one of them, while the other one is completely empty,

Whenever quicktile maximizes a window, regardless of the monitor, it leaves two horizontal bars at the top and the bottom of the screen. This works well on the primary monitor, since it prevents the window from overlapping with Gnome panels. However, it is unnecessary on the secondary monitor, where Gnome panels are not displayed.

KDE doesn't cycle properly because of window geometry issues

KDE can't cycle properly because of window geometry issues.

I wrote a quick fix so that cycleDimensions uses Euclidean distance to determine if a window dimension is "identical" to one of the options. This way, the fact that it will never perfectly match ideal dimensions isn't an issue.

I'm using Kubuntu 8.10.

Here's the diff:


diff --git a/quicktile.py b/quicktile.py
index db7510c..612fe4c 100755
--- a/quicktile.py
+++ b/quicktile.py
@@ -41,7 +41,7 @@ **author**  = "Stephan Sokolow (deitarion/SSokolow)"
 **version** = "0.1.4"
 **license** = "GNU GPL 2.0 or later"
## 

+from heapq import heappop, heappush
 import pygtk
 pygtk.require('2.0')

@@ -236,12 +236,25 @@ class WindowManager(object):
                         int(tup[2] \* monitorGeom.width),
                         int(tup[3] \* monitorGeom.height)))
-        result = gtk.gdk.Rectangle(*dims[0])
-        for pos, val in enumerate(dims):
-            if tuple(winGeom) == tuple(val):
-                result = gtk.gdk.Rectangle(*dims[(pos + 1) % len(dims)])
-                break
-        logging.debug("winGeom %r", tuple(winGeom))
- ```
     logging.debug("dims %r", dims)
  ```
- ```
     euclid_distance = []
  ```
-        for pos, val in enumerate(dims):
-            distance = sum([(wg-vv)**2 for (wg, vv) in zip(tuple(winGeom), tuple(val))])
-            heappush(euclid_distance, (distance, pos))
  +
-        # Get minimum euclidean distance.
-        pos = heappop(euclid_distance)[1]
-        result = gtk.gdk.Rectangle(*dims[(pos + 1) % len(dims)])
-   
  +#        result = gtk.gdk.Rectangle(_dims[0])
  +#        for pos, val in enumerate(dims):
  +#            if tuple(winGeom) == tuple(val):
  +#                result = gtk.gdk.Rectangle(_dims[(pos + 1) % len(dims)])
  +#                break
  +
-        logging.debug("result %r", tuple(result))
       self.reposition(win, result, monitorGeom)
       return result
  <\code><\pre>

Tag versions

Hi,

seeing #35 i realized that there are not tags for quicktile. This would help upgrading/downgrading to specific version of the script.

@brettbatie created a new repo without forking this one to answer this (of course he could / should have checked out the specific commit).

Anyway, I forked and tagged the all the commits bumping the version constant, but unfortunately github does not allow PR for this kind of commits. So here are they are for you @ssokolow to add them :

git tag -a 0.1.3 b3bf0e25b350df4a9624f45993e0651b623a915c -m "0.1.3"
git tag -a 0.1.4 4c4415a84e84ebf9aa2f9f0afa6089f363ba8bab -m "0.1.4"
git tag -a 0.1.5 bb47e9b355ce5da66306f883642954a899f84853 -m "0.1.5"
git tag -a 0.1.6 f7978209bab75a705a436e6c556a69843741e5a8 -m "0.1.6"
git tag -a 0.2.0 87b3e2f4a7c35ad633a4a58ec710694d54d82f10 -m "0.2.0"
git tag -a 0.2.0.1 86b001d7d4d3cf799950f04cab328659d83f21d5 -m "0.2.0.1"
git tag -a 0.2.1 30857f9e79488a09fe67f13c44717f3b221bfaa3 -m "0.2.1"
git tag -a 0.2.2 0a69eb000f71fb36b2ed43c31fa2e25d3545a5c8 -m "0.2.2"

Thanks!

OpenOffice.org and Wine throw off positioning under OpenBox

Under OpenBox, current quicktile HEAD (56d82f6) positions OpenOffice.org windows a titlebar height above the target location and, when cycling monitors, incrementally causes the window to creep higher.

I've managed to break this down into two separate issues:

  1. Under OpenBox 3.4.11.2, OpenOffice.org is positioned one titlebar's height too high. This problem is absent under KWin 4.4.5 and Metacity 2.30.3 and, therefore, suggests a problematic interaction between OpenBox and OpenOffice.org.
  2. Under current quicktile HEAD (56d82f6), the titlebar height sometimes isn't taken into account when positioning and sizing windows. However, given the intermittent nature of the problem, it may just be a bug in how the WMs I test with and GTK+ handle things like --replace.

At first, reverting to aed3ece (the last version where I was manually calculating the extents of the window frame rather than using win.get_frame_extents) appeared to fix the second problem, but now I suspect it may have just been the restarting of quicktile.

I'll leave this bug open until I find a workaround or the OpenBox/OpenOffice.org/GTK+ developers fix the issue for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.