Off-screen windows with Inkscape on MacOS and XQuartz

My go-to editor for vector images is Inkscape. So much so that I use it in the creation of my cartoons and comic strips, and have been writing a monthly column about it in Full Circle Magazine for over six years now!

Just recently I’ve switched jobs and have to use a Mac as my day-to-day work machine, rather than the Linux box I’m used to. Whilst Inkscape is available for the Mac, there is no maintainer to release native builds. For most releases, therefore, the Mac offering is a straight port of the Linux version, and uses XQuartz as its X Server. Unfortunately XQuartz has more than a few “issues” – not least of which is a significant problem with multi-screen setups. At my new job they suffer from the delusion that more screens are better, so I have to work with a 3-screen arrangement that would make an air traffic controller proud.

The biggest problem with XQuartz on a multi-screen setup is that it has an annoying tendency to place new windows off-screen. This manifests itself in Inkscape as dialogs disappearing into the ether before you ever get a chance to see them. Open the Document Properties dialog and there’s a good chance it will be placed at some obnoxious coordinates that render it invisible to the user. The same with the Fill & Stroke dialog, the Inkscape Preferences, the Align & Distribute dialog, and all the others. If you get lucky some might appear where you can use them, but enough will go missing that it makes working with the program virtually impossible for anything but the simplest of uses.

This issue is well known to MacOS users of Inkscape, and has been reported on Launchpad at least twice, has its own entry in the Inkscape FAQ, and also crops up on the main Inkscape forum. There are various workarounds mentioned on those sites, but they’re all a little clunky, to say the least.

So I’ve crafted my own clunky (but hopefully slightly less clunky than the others) solution to the problem: a shell script to find all the Inkscape windows and move them to the top-left of the XQuartz screen. But that seemed like overkill when it’s usually just the last dialog you tried to open that you need to move. And what about other applications? Surely Inkscape can’t be the only program that XQuartz has problems with. So I expanded the script to cover all those cases.

1) You’ll need to install the ‘wmctrl’ program, which does the hard work of repositioning the windows. I installed it using Homebrew. (brew install wmctrl)

2) Download the script using this link

3) Please take a look at the script (it’s not that long) to confirm that it’s not sending all your bitcoins to me, or anything equally dodgy. Then you’ll need to make it executable by running:

chmod +x

4) To use it, open a terminal within XQuartz and run it with either no options, or a single option, as follows (this is the result of running with the -h option):

Usage: [option]
With no options : move the last opened window to the top left of the screen
-1, -p, --previous : move the previously opened window to the top left of the screen
-i, --inkscape : move all the Inkscape windows to the top left of the screen
-a, --all : move all the windows from all applications to the top left of the screen
-h, --help : show this help text
With any other option, try to find windows that match the string provided as part of their WM_CLASS property, and move them to the top left.

Note: the -1 option lets you open a terminal to run this script *after* your window has gone missing

E.g. xterm will move all your Xterm windows to the top left, -i will move only the Inkscape windows, and will just move the last window you opened. As the note in the help text suggests, if you try to open a dialog in Inkscape (or some other program) and it doesn’t appear due to rendering off-screen, you can then open a terminal and run -1 (or -p or –previous) to move the window to the top left.

Please note that this script probably isn’t very robust, and any efforts to move the “last” or “previous” windows are purely based on the assumption that wmctrl -l lists windows in the order they were opened. It has worked well enough for my purposes, but that doesn’t mean it will work for you.

For bonus points you can add the script to the ‘Applications’ menu in XQuartz, so it’s always readily available when you lose a dialog. In that case it’s best to call it with no options, so you can select it as soon as a dialog goes AWOL.

Posted in Miscellaneous, SVG, Tech. Tags: , . No Comments »

Ubuntu 12.04.3 EDID checksum error

A colleague of mine came into work to find that his dual monitor setup on Ubuntu 12.04.3 was no longer working correctly. The main monitor (connected via HDMI) was being detected okay, but the secondary monitor (connected via a VGA cable) was appearing as “Unknown” and limited to a resolution of 800×600. He was also seeing errors about the “EDID checksum” in his logs.

After a bit of searching on the internet we tried various ways to fix the problem, from the obvious re-seating the VGA cable to the less obvious installation of “mesa-utils”, but to no avail.

The thing that finally worked – as is often the case with computers – was to turn it off and on again. Obviously that was one of the first things we’d tried: the computer had been shut down, the monitor turned off, then monitor followed by computer switched on again. But that alone wasn’t enough to fix the issue.

What was actually required was to completely unplug the mains lead from the monitor. Simply pressing the power button on the front isn’t enough for the monitor’s processor to do a full “reboot”. Pulling the power cable (and VGA lead for good measure), leaving it for 30 seconds, then plugging both back in fixed the issue immediately. Ubuntu could recognise the monitor once again, and it was automatically set to its intrinsic resolution of 1280×1024.

So if you find yourself with an EDID checksum error, before you get too deep into the world of xrandr or Xorg.conf files, try completely removing the power from the monitor. It just might save you a lot of time and effort!

Posted in Linux, Tech. No Comments »

Full Circle Magazine, Issue 66

The latest issue of Full Circle Magazine, featuring Part 6 of Mark’s Inkscape tutorial, is now available for free download.

Full Circle Magazine is a free publication which focuses on Ubuntu and Linux in general, though the Inkscape tutorials are largely applicable to Windows and MacOS users as well.

Posted in Linux, SVG, Tech. No Comments »

Full Circle Magazine, Issue 65

The latest issue of Full Circle Magazine, featuring Part 5 of my Inkscape tutorial, is now available for free download.

Full Circle Magazine is a free publication which focuses on Ubuntu and Linux in general, though the Inkscape tutorials are largely applicable to Windows and MacOS users as well.

Posted in SVG, Tech. No Comments »

The Ubuntu Shopping Lens Debacle

It seems that Canonical are attempting to raise some money by inserting affiliate links into your Unity Dash when you type in a search term. Currently the main target for these links is Amazon, but I’m sure others will be added over time.

I’m not a fan of the Dash at all. I find it slow and cumbersome to operate with a mouse, and frustratingly ineffectual when I try to type a search term. Of course it doesn’t help that my 1980s vintage clacky keyboard lacks a Windows key, so all the “just hit the META key and type…” posts are useless to me. My dislike of the Dash aside, however, I think adding affiliate links to the desktop is a great idea. Free software often struggles to become financially self-sufficient, so more experimentation in this area is a good thing.

Except that the implementation in Ubuntu was an obvious PR disaster from the outset. Did they really think that people would be happy that the search terms they use when looking for files and applications on the local disk are also being sent to Amazon and other retailers as a matter of course? Mark Shuttleworth was quick to point out they’re not “putting ads” into Ubuntu and Jono Bacon posted that no user-identifying data is sent, but that just ignores the fact that there could be user-identifying data in the search terms themselves.

Mark Shuttleworth’s answer, early in the comments on his post, seems a little short-sighted to me:

…the Home lens of the Dash is “search everything”. If you want to search locally only, use the hotkey to specify the specific scope you want, like Super-A for apps, or Super-F for files.

So if I don’t want to send my search terms to Amazon, I have to search each separate scope individually (remembering a few more keyboard shortcuts along the way). That sucks.

It looks like there may be an option to disable these searches coming along as a result of the backlash. But even that solution is overkill – it becomes all-or-nothing, you either get affiliate links or you don’t. Wouldn’t it be better to just put a button at the bottom of the local search results to “Search our online shopping partners”? Perhaps beside a more general “Search online” button to perform a search using the user’s preferred search engine. No information would be sent out until one of the buttons was pressed, allowing the user to keep their local searches local, but making it trivially easy to perform affiliate and other searches when they want to share their search terms with the world.

I hope that Canonical, and other Free software vendors, can find sustainable ways to make money. But treating your users’ data – and that includes their local search terms – as anything less than confidential by default is not the way to go about it.

Full Circle Magazine, Issue 63

The latest issue of Full Circle Magazine, featuring Part 3 of my Inkscape tutorial, is now available for free download.

Full Circle Magazine is a free publication which focuses on Ubuntu and Linux in general, though the Inkscape tutorials are largely applicable to Windows and MacOS users as well.

Minimus AVR USB

Thanks to this overly syndicated blog post (really – Planet Ubuntu I can understand given its content, but Planet Mozilla and Planet Inkscape, too!?) I discovered a wonderful little device called Minimus AVR USB. Basically it’s a USB-enabled (and USB-programmable) AVR microcontroller on a board with the I/O lines brought out to solder connections and just enough on-board peripherals (two buttons, three LEDs) to do some basic things without breaking out the soldering iron.

I’ve been meaning to get back into microcontrollers for a while and been tempted to go down the Arduino route, but too little spare time meant that I never got any further. Because of their slightly illicit origins as PS3 modding tools, Minimus boards are readily available at modding sites for just a few pounds (I bought mine for less than £5 from here).

I hope to post more about these in future, but I wanted to get an early post in to mention a little pitfall I fell into. I’m developing on a Ubuntu box and managed to get the AVR toolchain installed and working easily enough. I grabbed the demo code from the Minimus site and was able to push the hex file to the board in order to get the lights flashing and the buttons working. At least I knew the little board was operational.

Next I opened the source code, but as it’s been written to compile using AVR’s Windows toolchain I promptly ignored the build instructions and make file. “It’s just a few lines of code”, I thought to myself, “I can hand compile it easily enough.” So I did. And it compiled. And I converted the resultant file into a hex file for pushing to the Minimus. I pushed it with no errors, reset the device and… no flashing lights.

Many hours of tweaking that tiny source file proved that I could turn each of the lights on permanently, or off permanently. But I couldn’t persuade them to flash, and I couldn’t read the state of the hardware button. I threw in snippets of code I’d found to disable the watchdog timer, but still no joy. I tried setting the I/O lines using binary, hex, decimal, bit shifts and any other method I could think of. Nothing worked.

The solution finally came when I found some other code online and built using the make file. Suddenly the lights were flashing and the button was working! Something in the make file – one of the many switches to GCC probably – was sufficient to get things working. So if you find yourself here because you’ve bought a Minimus to play with and can’t seem to get it going, check that you’re building with a make file, not compiling by hand.

Posted in Miscellaneous, Tech. 2 Comments »

It’s not over ’til the fat Chumby sings

I’ve written about my Chumby on this blog in the past (and this one, too). Alas! Chumby Indistries is effectively no more, the staff having moved on and any worthwhile intellectual property in the hands of a corporate trustee.

Fortunately the servers are still serving, so my Chumby is still working as well as ever. There will come a day when they’re switched off, but one advantage of the Chumby’s open source nature is that a couple of the users over at the Chumby forum have been able to create ‘untethered’ versions of the firmware which don’t rely on the Chumby Industries servers. I’m sure I’ll lose some functionality when the servers go dark, but at least my squishy little friend won’t turn into a brick.

Make Magazine has a long and interesting interview with Andrew ‘Bunnie’ Huang talking about his time a Chumby Industries, and more. It should be required reading for all those Kickstarter projects hoping to create the next big thing in hardware…

There’s a certain irony to Chumby Industries closing down, right at a time when other people have raised millions of dollars with a similar idea. Yes, the Pebble Watch may be more portable than a Chumby and fill a slightly different niche, but the idea of a clock/watch that can switch between various single-purpose applications and feed you with information from the internet makes them more similar than different. There’s clearly a demand for such “third screen” devices and I think the Chumby was simply an idea ahead of its time.

So while my Chumby still works as Bunnie intended, I’ll continue to enjoy the eclectic delights it offers up. With luck an untethered firmware will extend its life even further. Chumby Industries may be gone, but Chumbys live on.

End of life for Ubuntu 10.10 (Maverick Meerkat)

Today I turned on my computers at home and at work to be presented with an alert telling me that the operating system on them, Ubuntu 10.10 “Maverick Meerkat”, has reached its end of life. This event has reminded me just how frustrated I am with some of the decisions Canonical has made in the transition to their Unity interface…

I’ve been a Ubuntu user since its first release, choosing to live life on the bleeding edge of the regular six-monthly releases, rather than relax with the LTS releases. Generally this approach worked well for me, until the problem trilogy of 10.04, 10.10 and 11.04.

  • 10.04, “Lucid Lynx”, was an LTS (long term support) release which used the old Gnome 2 interface. It’s still supported for another year, until April 2013.
  • 10.10, “Maverick Meerkat” was a normal six-monthly release which used the Gnome 2 interface. Support has just expired for this version.
  • 11.04, “Natty Narwhal” was a normal six-monthly release which used the Unity interface and is supported until October 2012.

Back in 2010 I went through my usual two upgrades, the first putting me on an LTS release, and the second taking me back off that track to the six-monthly cycle. I had expected to upgrade to 11.04, but then Unity happened.

I’ll admit that I’m one of the people who doesn’t like Unity. In its current form I find it far less efficient than the workflow I’d established with Gnome 2. It doesn’t work with my preferred choice of focus-follows-mouse. Most of all, it’s fundamentally broken with my multi-monitor setup (something that the developers are actively addressing, though, so I might be in luck with 12.04). That last point meant that upgrading to Unity just wasn’t an option, regardless of my opinions of it as a user interface.

That’s my real gripe. If Unity had first appeared in 10.10 then I would have found that it didn’t work, stuck with 10.04, and still have until 2013 for Unity to get fixed, or for me to find an alternative. So please, Canonical, if you decide to make any more significant changes that may stop people upgrading by failing to work with their not-very-exotic hardware, at least do it in the version immediately following an LTS release.

RIP Jack Tramiel

A couple of days ago Jack Tramiel, founder of Commodore and subsequently responsible for Atari’s home computer renaissance in the 1980s passed away.

I grew up during the home computer boom of the 80s. My first machine was a Sinclair ZX81, but that was replaced by a Commodore Vic-20. But it was my next computer, an Atari ST, which was perhaps the first machine I really fell in love with. I worked throughout my 6 weeks school holiday in order to save the £260 it cost, and although it has since been re-housed (using a hacksaw on the motherboard in order to fit it into a 19″ rack case!) I still have it sitting next to me now.

For day-to-day use it was replaced by an Atari Mega STE, then an Atari Falcon. I even have an Atari Jaguar which still sees occasional use for games of Tempest 2000. Ultimately, through using MiNT on the STE and Falcon, I was able to gain my first serious experiences with a Unix command line interface… which led directly to my switch to Linux in 1995 (and which I’ve been using ever since).

From games to music to programming, Tramiel’s Atari was behind most of my hobbies during the late 80s and early 90s. Rest in peace, Jack, and thanks for all the good times.