Uncategorized
Whoops, I’m back.
Sorry everyone, there was a bit of a problem here and while I was doing some server maintenance I accidentally deleted the database for this site. There were one or two posts I know people were interested in so I’ll reupload everything as soon as I can.
It’s also time for some new content, which will be coming shortly; updates on some new projects, some freelancing information, and some general thoughts about stuff.
Stay tuned, more to come.
Quick Tips: Ubuntu Shortcut Keys
Because I always forget how I did this, I’m going to write it down. Firstly, I spend a lot of time in Terminals, so I like having a quick shortcut to use to open one. Control + Super seemed a good choice for this.
Unfortunately, the keyboard shortcut tool doesn’t let you map the Super button anymore, so to set it we need to use gconf. Open gconf-editor and go to /apps/metacity/globalkeybindings/ and look for the option named “run_command_terminal” you can set it here by changing the value to “<Control>Super_L”; in this case it will work with the left windows key.
Another issue I found again today after opening Blender again for the first time in a long while, was that Alt+RMB (edge ring select) gets stolen by Compiz and turned into a Menu popup instead. This can be fixed in gconf as well by going to /apps/compiz/general/allscreens/options/ and changing the value for window_menu_button to “<Control><Alt>Button3″.
How to use SVG to create easily changeable desktop backgrounds in Ubuntu.
I was wanting to leave myself a set of to do notes on my desktop the other day, so that I could see them after I woke up the next morning. I’ve done this a few times before, by editing the original image and saving out a new one.
I decided I wanted to make it look a bit less terrible by using Inkscape instead of the Gimp. For quick rectangles and text, Inkscape really is faster and looks better. As I was editing it, I wondered if it would be possible to use the SVG itself as a background image.
I opened up the Appearance settings, and browsed for the file. What do you know, it showed up. This in and of itself isn’t that exciting, until you realise that SVG can be changed really easily in a script. It’s just XML data. What can be interesting is that you can embed a link to a non SVG image to use an underlay. I didn’t have to duplicate my 600kb JPG, I was able to just embed that link, and then add text and paths on top of it.
What’s more exciting was that as soon as I saved any changes, the background image automatically refreshed itself. Something I was never able to make Windows XP do easily, without making an actual call to Windows’ DLL system. This was just edit, save, bam.
The possibilities are quite interesting. I may later put together some bash or python to do something fun like updating the BG with system internals, getting currently playing music, etc. Really you could do anything with this. All without damaging your original image or mucking around with graphics blitting code.
The only things to be aware of is that when you save in Inkscape, it defaults to an SVG format with a -lot- of extra information which makes the file more confusing than it needs to be. Just remember to save it as “Plain SVG” if you’re doing this. Also, the image link must be a full path. A relative link doesn’t work correctly, and Gnome can’t display the image. For example:
<image
xlink:href="/home/username/images/backgrounds/mypic.jpg"
x="0"
y="0"
width="1680"
height="1050"
id="image11" />
When it originally saved, it only saved as xlink:href=”mypic.jpg” If you’re doing future editing only in a script by changing the XML directly, you shouldn’t have to worry about this after you change it once.