Making new image in Gimp same size as clipboard

Have you ever tried to copy an image in Gimp and open a new image to paste it into? Then you’ve probably noticed that the size of that new image isn’t automatically adjusted to the size of the image in your clipboard – like it is in Photoshop or in earlier versions of Gimp.

However, a new and simpler feature has replaced the automatic image size in Gimp. That is “Paste into image”. This is easily done by going to Edit -> Paste as -> New Image, as you see in the screenshot below, or simply by pressing Ctrl + Shift + V.

Happy editing!

Using Wacom tablet with dual monitors (TwinView) in Ubuntu

I have a setup with two monitors on my computer and wanted to restrict my Wacom tablet to only one of the screens. Otherwise, the tablet is expanded to the entire two screens, making any drawing stretched.

This has shown to be quite simple to fix if you can live with a script doing the job for you. First, type the following in a terminal and note the output:

xinput --list

You will see a bunch of names for you peripheral devices. You should look for anything that has to do with “Wacom”. For instance, on my machine, I see these names:

⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Wacom Graphire4 4x5 eraser              	id=12	[slave  pointer  (2)]
⎜   ↳ Wacom Graphire4 4x5 cursor              	id=13	[slave  pointer  (2)]
⎜   ↳ Wacom Graphire4 4x5 pad                 	id=14	[slave  pointer  (2)]
⎜   ↳ Wacom Graphire4 4x5 stylus              	id=15	[slave  pointer  (2)]

Now, create a file somewhere on your computer. I’ve put mine in a subdir of my home directory, naming it “wacom-settings.sh”. Add these contents to the file and change the name of each “Wacom…” to whatever you received as output above:

#!/bin/sh
xsetwacom --set "Wacom Graphire4 4x5 stylus" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 stylus" Screen_No 0x001
xsetwacom --set "Wacom Graphire4 4x5 cursor" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 cursor" Screen_No 0x001
xsetwacom --set "Wacom Graphire4 4x5 pad" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 pad" Screen_No 0x001
xsetwacom --set "Wacom Graphire4 4x5 eraser" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 eraser" Screen_No 0x001

Then you’ll just have to make the file executable. This could be done from terminal by issuing the command

chmod +x wacom-settings.sh

in the same directory as the file.

You could also right-click the file, select Properties > Permissions tab and check “Allow executing this file as a program”.

You might either add this file to your startup applications under System > Preferences > Startup Applications (this will only work if your tablet is connected when logging in) or you could add a launcher on either your desktop or in one of your panels by dragging the file there.

This should be it. To test that the configuration really works, double click the file and click “Run in Terminal”. If the tablet appears on the wrong screen, change the Screen_No above from  0x001 to 0x000.

Good luck with your notes and drawings!

Updated method for drawing springs in Inkscape

I’ve written an earlier post on how to draw simple schematically springs in Inkscape. After reading a great tip from ~suv in the Launchpad bug tracker, I figured I should bring you guys another update on how to do this using ~suv’s method.

Basically, what you need to do is to draw a zig-zag line in Inkscape using the pen tool . This is fairly easy to do, so I’ll leave that part up to you. Just turn on the grid by pushing SHIFT+3 first, as this will make it easier to draw it symmetrically. Have a look at the picture below:

The next thing is to select all the nodes on the sharp edges of your spring as in the image below:

Afterwards, push the button outlined in the screenshot to make the selected nodes smooth.

We’re soon done, all we need to do now is to turn each of the node handles on either the top or the bottom of our wiggly line 180 degrees. This is where it’s really nice to have the grid enabled to make sure all the handles are turned just the same amount.

And we’re finished! Below you see my finalized spring:

You may put this into whatever physical context you want. Connect it to boxes, power grids or horses – just remember to show off that you have now become a worthy spring master! I decided to go with a good old sports car.

If you like to, you may download the source .svg file here.

How to draw a spring in Inkscape

Update: Check out the new spring drawing method here. The old one on this page is still useful, but the new one is a bit faster.

I’ve been working on some free-body diagrams lately, and in my last paper I needed to draw a spring. Since I didn’t find any simple way to do this, I thought I should give a quick tutorial here.

First of all, turn on the grid by clicking SHIFT + 3 on your keyboard (the # key).

When your grid is turned on, enable the bezier curve editor by clicking this button: