Harsh J

Memoirs of a QWERTY Keyboard

Archive for the ‘Guide’ tag

Fixing the missing clipboard size feature in GIMP

with 4 comments

Sort of fixing actually

As you might have seen in GIMP (2.2 and below) and Photoshop, when you copy an image to the clipboard (Ctrl + C or Ctrl + X) and create a new file via (File -> New) the size shown there automatically adjusts itself to the size of the image in the clipboard.

This feature was missing from the latest GIMP release (2.4). The reasons for that may be found here, but IMO its a bad thing this can’t be supported anymore, I heavily relied on it for one :(

Now on to fixing this issue:

My approach, like others, is to rely on hotkeys. In the following guide, I make a shortcut of the required function by mapping it to the [Y] key on the keyboard.

First off, the feature we’re looking for is the ‘Paste as new image‘ feature found under Edit menu of the working image.

Now to set a hotkey, use the guide below:

1. Go to File > Keyboard Shortcuts.

Gimp - Open keyboard shortcuts dialog box

2. Expand the Edit menu and click and set the accelerator for “Paste as New” as [Y] or any key you wish (Must not conflict with other ones).

Gimp - set keyboard shortcut for new image from clipboard

3. You’re done!

Now when you copy an area in an image and need to create a new file of that size you copied, just hit the [Y] key and it should do the task.

Gimp on!

P.s. In case you screw up the hotkey settings, just remember to revert to defaults, don’t panic. :)

Written by Harsh

January 16th, 2008 at 9:05 pm

Shorten the apt-get install!

without comments

sudo apt-get install [name]

Thats probably one of the most used commands on your Ubuntu box. Hate writing such long lines for while installing a package as quick as possible? This guide should help you reducing the length of that command to just, well, 1 character!

Like this example:

user@domain:~$ i john
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
john
(. . .)

Notice the one-letter i in the above? I created i to stand for apt-get install.

Unix/Linux have something fantastic in them called alias. The command alias is used to create shorter and quicker keywords to another command which could be very long with all its parameters. So lets move on to making a simple alias for apt-get.

Basically our command is:

alias i="sudo apt-get install"

But just giving that would not last anymore once your terminal is closed. To make it permanent we have to do the following in the Terminal:

echo alias i=\"sudo apt-get install\" > ~/.bash_aliases

Now give this command:

gedit ~/.bashrc

A text editor should open with some content in it. Now scroll a bit until you find the following lines: (Should be around 50~ lines from beginning)

#if [ -f ~/.bash_aliases ]; then
#. ~/.bash_aliases
#fi

Now remove those 3 #’s (hash comment symbols) from each of the lines so that they look like this:

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

Save and close the editor. Restart your Terminal and voila, you can now do the i method as shown earlier! :D

Example:

user@domain:~$ i gnome-bluetooth
[sudo] password for user:
Reading package lists… Done
Building dependency tree
Reading state information… Done
gnome-bluetooth is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Written by Harsh

December 16th, 2007 at 7:00 pm