Trying out dual-booting Linux again

After a long, long time being on Windows because of Autodesk Sketchbook Pro – keeping sane with a mishmash of Cygwin and Linux virtual boxes so that I could get around the limits of Windows as a development platform, and grumbling about little things like the slow performance of git and the occasional problem with too-long file paths – I’m giving dual-booting to Linux a try again.

W-‘s good influence here: his new SSD arrived and he decided to allocate some space for dual-booting to Linux. Since we have the same hardware configuration for our laptops, I figured I’d see if the Wacom drivers Just Worked and if the sketching programs on Linux had improved since I last checked them out. Mypaint still didn’t have the selection tools I was looking for, but Krita looks like it might work for my sketches. The interface isn’t as pen-friendly as Autodesk Sketchbook Pro (which I couldn’t get going under WINE), but I might be able to get the hang of using the subset of features I actually rely on.

I had some setup issues in the beginning. The Kubuntu 15 install disk I tried crashed during setup due to a wireless-related issue. I tried ElementaryOS, but found it to be a hassle because the default Elementary theme caused Emacs to crash. (Priorities, priorities.) Frankensteining it back to a basic Ubuntu distribution by removing packages and editing files like /etc/lsb-release didn’t completely solve my problems, so I installed Kubuntu 14 instead. That seems to be working so far.

I ran into a few more issues with applications. Dropbox sync created directories but not the files within them. I’m not sure whether it was the fiddling we did with our network setup (including quite a few reboots of routers and modems) or whether Dropbox sync got fixed after I unlinked my laptop through the web interface and then reconfigured it, but at least my files are downloading now at a decent speed.

The version of Evernote I installed under WINE didn’t allow me to edit notes. Upgrading WINE to 1.7 and downgrading Evernote to 5.8.3 seems to have made Evernote work, though, so now it’s synchronizing the gazillions of notes I’ve accumulated throughout the years.

Postfix Gmail forwarding was straightforward to set up. I successfully sent a test message, and my Gnus config seems to be working fine with direct IMAP access to Gmail. I might give offlineimap a try, maybe with notmuch.

I have an old Truecrypt volume lying around, and the Linux binaries were able to mount it. Hooray!

Git was giving me problems, so I added the git-core repository.

I’ll still probably need to boot into Windows to do my business accounting in Quickbooks, which I use mainly because it imports into Turbotax and therefore saves me from having to figure out all the tax stuff by hand. I don’t do that frequently, though, so it should be okay.

I use a Python script to download Flickr metadata. Turns out the latest version of flickrapi is incompatible with it, so I downgraded flickrapi with:

sudo pip install flickrapi==1.4.5

and that worked.

It turns out it’s the little things you notice. I missed being able to use Win+number to start or switch to applications. Fortunately, the following script worked for me, once I figured out that KDE’s custom keyboard shortcuts wanted full path to the shell command: /home/sacha/bin/focus_or_launch emacs instead of using ~/bin/focus_or_launch emacs. I modified it slightly to only look at –class instead of –name.

#!/bin/bash

# NAME:         focus_or_launch
# VERSION:      0.4
# AUTHOR:       (c) 2014 Glutanimate <https://github.com/Glutanimate/>
#
# DESCRIPTION:  Focus existing app window or launch application if no
#               window found
#
#               Simplified version of a script by Henning Bekel
#               (https://bbs.archlinux.org/viewtopic.php?pid=625009#p625009)
#
# DEPENDENCIES: xdotool
#
# LICENSE:      GNU GPLv3 (http://www.gnu.de/documents/gpl-3.0.en.html)
#
# NOTICE:       THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 
#               EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 
#               PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR 
#               IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
#               AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 
#               PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
#               YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
#
#               IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY 
#               COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS 
#               PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 
#               INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 
#               THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED 
#               INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE 
#               PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER 
#               PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# USAGE:        focus_or_launch <command>
# EXAMPLE:      focus_or_launch google-chrome


############# GLOBVAR/PREP ###############

Executable="$1"
ExecutableBase="$(basename "$Executable")"
Usage="\
Usage: $(basename $0) command
E.g.:  $(basename $0) google-chrome\
"

############## USGCHECKS #################

if [[ $# -ne 1 || "$1" =~ ^(-h|--help)$ ]]; then
  echo "$Usage"
  exit 1
fi

################ MAIN ####################

MostRecentWID="$(xdotool search --class "$ExecutableBase" | tail -1 2> /dev/null)"

if [[ -z "$MostRecentWID" ]]; then
  echo "$ExecutableBase not found. Launching new window."
  "$Executable" > /dev/null 2>&1 &
  disown
else
  echo "Focusing existing instance of $ExecutableBase."
  # use brute-force approach if activating most recent WID doesn't work
  xdotool windowactivate "$MostRecentWID" 2>&1 | grep failed \
  && xdotool search --class "$ExecutableBase" windowactivate %@
fi

There are probably a few more things I’ll run into, but it’s a good start. =)

  • Charlie McMackin

    Welcome back to the GNU[er] side! I’d like to hear more about your Sketchbook Pro workflow and how Mypaint doesn’t quite fit. Also, did you try the MyPaint 1.2 beta PPA listed on http://mypaint.org/ ? I’m not a developer on that project, I just have a curiosity on others’ sketching workflows, particularly when using linux.

    • I sometimes use selections to move things around so that I have more space to draw, but it didn’t look like selections were in MyPaint yet (https://github.com/mypaint/mypaint/issues/31 ). Krita seems to be holding up nicely to what I want to do, though. I just need to customize the toolbars and maybe look into tasksets… =)

    • Workflow-wise, I have a few template files with layers that set up grids, etc. I also have a few Emacs functions that set up appropriately-named files. Look for my/prepare-index-card-template in http://sachachua.com/dotemacs if you’re curious, and wander around from there. my/rename-scanned-cards converts to PNGs and handles renaming, and then I upload a backup to Flickr. (No actual scanning is involved any more, but I haven’t gotten around to renaming my functions.)

  • tompurl

    I’m a heavy user of Emacs and Krita and have found Debian 8 to be hassle free on my Thinkpad x230. I also have a wifi card that requires non-free software, but I was able to install that using a “non-free” package in about 15 seconds after the base installation.

    If you don’t mind being a little behind the bleeding edge then Debian is really stable.

  • After many years of dual booting, my preferred method of installing is now to first put on Ubuntu (with Unity), and then add Mate desktop. (One of my sons prefers Cinnamon desktop). Mate runs a little faster on my Thinkpad X200, but Unity is better for the X230T with a pen when rotated into portrait orientation. I had some problems in the early days with Dropbox working on Ubuntu variants, and even now find bugs that show up with Mate that don’t show up on Unity. It’s a lot to expect developers to support every platform, and basic Ubuntu is the most popular distribution. I can see getting used to Unity, when eventually I might run Ubuntu on a Nexus phone.

    • Yeah, that’s pretty much why I decided to go with something Ubuntu-based for starters. =) I might look into something like Arch a little later on.

  • Benjamin Slade

    I had actually been wondering why you were using Windows, and had suspected it must be because of particular applications available there. Hopefully Linux will continue to work out for your workflow; I find Linux a much more friendly, customisable, and secure environment to work in.

  • mikekmcguire

    Hi Sacha! I’ve been reading your blog for ages — you are a ball of Emacs wonder :) Is there a reason you don’t use a Macbook of some sort?

    • I really like my Lenovo X220 tablet PC’s combination of a Wacom stylus-enabled screen that I can flip around and fold down (so no Macbook for me), TrackPoint, decent survivability (I’ve dropped this from an embarrassing height onto a hard surface), and enough CPU/mem so I can do Actual Stuff on it instead of the almost-but-not-quite-there things I can do with a tablet (so no iPads or Android tablets, either). =)