Inspecting GTK dialogs with Parasite

Parasite is a program much like Firebug, except this is for GTK based applications.

By opening a program with parasite enabled, you can literally click elements of the GUI to reveal their properties.

parasite

The installation is pretty simple, open a terminal, clone the git repo, compile install and run. I like to make a folder for software I checkout from SVN or Git in my home dir so I don’t get things all messy. You need git to clone, so if you don’t have it installed already:

$ sudo apt-get install git-core

Clone it:

$ mkdir ~/git_software && cd ~/git_software && git clone git://github.com/chipx86/gtkparasite

Compile and install it:

$ ./autogen.sh && make && sudo make install

I run 64bit, so I had to do the following command to get things working:

$ sudo cp /usr/local/lib/gtk-2.0 /usr/lib64/ -r

Try it out (prefix an application name with GTK_MODULES=gtkparasite):

$ GTK_MODULES=gtkparasite gedit

Reverting two Ubuntu features ‘removed’ in 9.04

Ubuntu Jaunty 9.04 has many improvements on the prior release of Intrepid 8.10, however 2 things were removed that I didn’t agree with. They are pretty easy to change back so I wanted to share them with you all.

Update Notifier in system tray

I guess the idea behind this change was intended to make updates more obvious… but to power-users like myself, I consider it an annoyance. Every time I’d run apt-get, a “update yo shiz” window would pop up above my terminal and anger me. I’m not the stupid windows user Ubuntu’s starting to treat me like. I just don’t have time for updates that require a restart in the middle of the day when I’m trying to get some work done.

gconftool -s --type bool /apps/update-notifier/auto_launch false

tip from launchpad

Ctrl+Alt+Backspace

This would classically restart X… but for some reason they removed this as well?!?! Whatever, here’s how to fix it.

sudo aptitude install dontzap && sudo dontzap –d

tip from Chris Johnston

deluge torrent - sort of like uTorrent for Linux

When I first switched to Linux, I was running a lot of things in WINE because I was having trouble finding good linux alternatives for a few programs I use every day. Many programs weren’t a problem because they were designed (or redesigned) to be open-source and cross-platform. Those of you who have been following along have seen me recommend some applications as I made the switch but for the record, here’s a quick breakdown.

Cross platform applications that didn’t effect my switch to linux:
Web browsing: Firefox
Email: Thunderbird
(S)FTP: Filezilla
Web browsing: Opera (used for testing)

Applications I used on Windows and their alternatives I’ve found for Linux:
Text Editing: - Notepad++ | Geany
IRC: mIRC | Konversation (tried kvirc for a while but it’s too buggy)
Music: MusikCube | Amarok 1.4 / Exaile

The other programs I use are either minuscule or obvious (e.g. AIM to pidgin).

Today I’d like to share with you another great application that has replaced uTorrent (which I ran in WINE for a while and disliked), Deluge. What I love about deluge is that it is a native application with an interface that looks and behaves much like uTorrent does. Right click open folder in uTorrent in WINE is very face palm because it would try to open it in the stripped down windows explorer type thing :shudder:.

Anyway… I started using deluge at version 0.5 or so and since then it’s had a major code rewrite and feels more solid and (appears it) is now more extendible. Below is a screenshot of how nice it looks.

deluge

It even has a web-ui (if you install the package). You need to run this manually with the following command:

deluge -u web

deluge-webui

The only thing it’s missing (that it had in earlier versions) is a good RSS plugin. There are some “solutions” like the FlexRSS plugin or Feeder (web ui only; good luck, have fun with installing that) but they are inferior to uTorrent. However, that is not enough to send me away and I highly recommend this as a Linux torrent client.

To install the latest version in Ubuntu 9.04 Jaunty Jackalope, I added the following PPA to my software sources >> https://launchpad.net/~deluge-team/+archive/ppa

Ubuntu System Panel - A ’start menu’ for the power-user

Ubuntu System Panel (USP) is a replacement for the standard three menus (Applications, Places, System) that come with Ubuntu in the top left. USP condenses these three menus into one easily filtered menu system. You can either navigate the list by clicking buttons related to the type of application you’re looking for (e.g. Accessories, Games, System Tools) or just start typing the name of what you want for a live filter search (my preferred method).

ubuntu-system-panel

There are many extra tweaks, as seen above I’ve “pimped” mine out a bit with the options. The preferences dialog, you can get to by right clicking system and choosing preferences, has a lot to be desired as it’s interface is a bit O.o. If you play around for a while though, you’ll be able to figure it out.

ubuntu-system-panel_rightclick
usp-preferences

Optionally, I’ve provided my configuration file which you can apply to your USP by selecting “restore” in the bottom right of the preferences dialog.

Read the installation documentation to get started.

Liquid Rescaling images - A truly mind-blowing plugin for GIMP

I’ve been using a lot of GIMP since switching to Linux because while Photoshop inside WINE is fast, it’s buggy and opening up a virtual machine just isn’t worth the time for a small edit. I’ve been getting used to the differences and with the latest release of 2.6.6 (packaged with Ubuntu 9.04, Jaunty Jackalope) it’s really starting to come together.

Looking to get the most power out of this application, I headed over to this messy repository that is the official plugin registry. Doing a quick breeze through to see if anything caught my eye, it quickly did with this page about Liquid Rescaling. The picture was enough to catch my attention but the video below dropped my jaw.

Looking to learn more, I went to the official page to learn more. On the download page, I found out that it’s included in the Ubuntu repsitories:

sudo apt-get install gimp-plugin-registry

After installing, I went to the help >> plugin browser in gimp and found that it was under the ‘layer’ file menu. I gave it a shot and It really is magic!

Panoramic Sunsets are so much nicer, aren’t they? :-P

Step one, original picture:
sunset

Step two, mark the area I’d like preserved:
sunset-edit

Step three, magic:
sunset-panoramic

NautilusSvn - Finally an SVN GUI for Linux that doesn’t totally suck

Now I know that headline may upset some people but from when I originally switched from Windows as my primary desktop, to up until ~a few months ago, I was at a loss for a decent SVN GUI in Linux. The SVN clients in the [Ubuntu] repositories were unstable, quirky or just total garbage.

The first I tried was Rapid SVN, rated high in the ‘add/remove’ programs dialog. I found this very unstable. Next I tried eSvn which I also found unstable and quirky. Then unto KDE svn which seemed quite stable and solid actually… but unfortunately I use GNOME and this application is (obviously) for KDE, so naturally(?), there were some bugs. In particular the title bars and some other variables were not passing values properly, they would show up as literal %t or what have you. This was a deal breaker for me. Smart SVN came recommended and I agree, it has potential but it seemed to be too much for my simple needs and hell, if I’m going to run a Java application, I might as well switch my IDE to Eclipse and use the plugin for that (which is actually a good interface to SVN).

However, I love my current IDE, Geany and I don’t use SVN strictly for code projects. Some of the Ninjaz and I collaborate in mapping using SVN.

For a while I used svn in the terminal, which is really as minimal as you can get and to a degree, I really enjoy it. It also makes for good practice when I need to do things concerning SVN on a server. However, this is 2009 and I (usually) feel more efficient with a GUI.

In windows, my favorite SVN client was Tortoise SVN, the de facto standard in SVN for windows. After tireless research I finally came across the application I was dreaming for, Nautilus SVN, which is attempting to clone Tortoise SVN for Linux. Written in Python, it integrates itself nicely into Nautilus’ right click (context) menu. When I first started using it, the application was pretty barebones but with the latest release, it has come a long way. Bringing in nice emblems and icons to signify status and accompany menu options, it’s really starting to feel like a solid application.

Nautilus SVN in action

Nautilus SVN in action

At version 0.12 beta, it’s obviously got some minor bugs but nothing that stands out… too hard. There is currently an issue with the status checks responsible for the folder emblems that can cause nautilus to temporarily freeze while retrieving information from large repositories but the problem is being addressed, though they’ve hit a few snags along the way.

I talked with one of the developers, Bruce from the Netherlands on their IRC channel, #nautilussvn on irc.freenode.org and feel confident in direction of the project. Bruce is a really nice and informative guy which makes the project all the more interesting to me.

I wish the team the best in the future and I’ll definitely be sticking with this for a while, I suggest other GNOME users check it out as well.

Nexuiz 2.5 is released!

Quoting the change log:

Almost a year of hard work, 3000 single changes, new developers and players, a few tourneys and lots of matches have passed since the last release.

Today the Alientrap team is proud to bring you a new and improved Nexuiz! Still trying to achieve this fine balance between fun and a challenge, you will notice lots of small additions that will make playing even more fun.

Some larger changes like the new guns and particle effects will make you want to dive into the great and friendly Nexuiz community, while the large additions including the race game mode, some new maps and improved netcode will take away lots of hours of your free time.

Do you dare to take a look and see for yourself what a totally free and open source game can be?

New features include:

  • Completely redone HUD and user adjustable scoreboard
  • Totally rewritten Client/Server communication to cut the bandwidth usage in half
  • New gamemode “Race”. Try to get from start to end of a level as fast as possible. Available as free-for-all and team variant. Further allows to play with or without a qualification period.
  • Added several new weapons (on-hand Grappling Hook, Port-O-Launch, T.A.G. Seeker, Heavy Laser Assault Cannon, Rifle)
  • Map editor NetRadiant included
  • Improved all effects for eye candy and tweakability
  • All maps recompiled with external lightmaps which allow for much crisper shadows
  • Added maps desertfactory (DM, TDM, MinstaGib), racetrack (Race) and made aggressor support Key Hunt
  • New player sounds, announcer sounds/voices, textures, crosshairs, weapon models, effects and menu skins
  • Added support for video capture to OggTheora
  • Integrated the Havoc mod into the menu! Havoc servers use quite different physics and weapons, give it a try!
  • Fixed a crash with ATI drivers on shutdown or vid_restart
  • Fixed several problems with lagging gameplay/crashes/wrong display of effects
  • Improved bots (teamworking, bunnyhopping, swimming, better way finding, support for ladders, less CPU usage, faster map loading)
  • Better visual display of carried items (Strength, Shield, flags and keys)
  • Better parental guidance support with cl_gentle and cl_nogibs
  • Lots of tourney-related features (timeout/in, spectator-slots, allready, warmup mode, lockteams, unlockteams, movetoteam_red/blue/…, nospectators, records, cointoss)
  • Added some effects customization options like cl_casings, cl_weaponpriority
  • Many more map entities allowing for more dynamic maps
  • Restructured and improved menu: demos menu and multiple campaigns are back, also added an advanced menu containing ALL settings of the game

For a more complete list of changes see: https://sourceforge.net/project/shownotes.php?release_id=672474&group_id=81584

As usual, you can download the newest release from our download page.

If you are providing a mirror of the release, please notify us so we can add it to the official mirror list. For any comments, suggestions or questions, please refer to our forum or the FAQ.

Because of many major changes there is NO PATCH available.
To make sure nothing breaks, you should use a new directory to unzip Nexuiz 2.5!

If you use 2.5 and see a server with no gametype it’s an 2.4.2 server, don’t play on those. :)

Alientrap is also currently looking for new coders, modelers, mappers and people experienced with creating sound effects. If you feel like helping improve Nexuiz or Zymotic please contact the team via forum or IRC.

You can Download Nexuiz Here. To run Nexuiz, extract the files anywhere on your computer and run the executable. Try GLX first and if you experience problems, you hardware maybe better suited for the SDL version. The main difference between the two is the software libraries they are compiled for.

If you’d like to spread the word, it’s a good idea to share the Nexuiz 2.5 release on your facebook account. You can digg it here: http://digg.com/pc_games/Nexuiz_2_5_is_released

Batch images conversion - color to transparency from the linux terminal

I’ve been re-theming and old forum and the themes that are available are a little less than perfect for our needs. I found a few suitable templates but it still results in me creating a mash-up. Some of the images (though gif) set the image background color to that of the site background. As I was using a different color, this obviously looked bad but I wasn’t about to manually edit all the files to give them transparency.

Being aware of the amazing command line tool for Linux, ImageMagick, I set out to find a tool to help me. I found a transparency flag, calculated the RGB values with the eyedropper in GIMP, then after a test run, I through it in a for loop.

screenshot2

So a directory down from my image source, I created a folder called “new” and ran the following color and like magic, they were all converted.

for image in *.gif; do convert -transparent 'RGB(48,71,94)' $image ../new/$image; done

Finding files and strings using the terminal in Linux

My favorite thing about Linux is the terminal. I use it countless times a day to do all sorts of tasks, like managing game servers or writing scripts to do tedious tasks. One of the most popular things I do in the terminal is search for files or strings inside of files and today I’d like to go over a few methods and tricks for doing this. There are three tools that make this task amazingly easy but combining them is where we find the real power. These three tools are locate, find and grep. I will cover the basic use of these tools with some examples and tricks but I suggest you take a look at the man pages for the tools for addition information (i.e. man locate).

locate

Locate has got to be the most straight forward way to search for files. It uses a database so it’s blazing fast when searching your entire computer, compared to the ‘find’ we’ll cover later. It’s not available by default on all Linux distributions (it is on Ubuntu) so you might have to install it. Since I’ll be mentioning fstab later, I’ll give my examples with it.

Basic syntax is: locate [filename]

tyler@quadjutsu:~$ locate fstab
/etc/fstab
/etc/fstab.orig
/etc/fstab.pre-ntfs-config
/etc/fstab~
/usr/include/fstab.h
/usr/lib/udev/migrate-fstab-to-uuid.sh
/usr/share/apps/katepart/syntax/fstab.xml
/usr/share/doc/m4/examples/fstab.m4
/usr/share/doc/mount/examples/fstab
/usr/share/doc/util-linux/examples/fstab.example2
/usr/share/man/man5/fstab.5.gz
/usr/share/pysdm/fstab.py
/usr/share/pysdm/fstab.pyc

This database will automatically update itself at various times but to force an update type the following command:

tyler@quadjutsu:~$ sudo updatedb

Folder exclusions can be found (and edited) in /etc/updatedb.conf

By default (at least in ubuntu) /media (your mounted media) is not included in this database. This means if you use extra drives you’ve added to your computer and you want them to be searchable through the locate tool, you’ll have to mount them to a directory like /mnt.

To mount a drive on boot, you’ll need to add a line like the following to your /etc/fstab. The one below mounts an ntfs drive to /mnt/mydrive. That folder must exist for the drive to be mounted.

/dev/sda1 /mnt/mydrive ntfs-3g defaults,locale=en_US.utf8 0 0

I found the /dev/sda1 part by listing my harddrive partitions using the following command:

sudo fdisk -l

find

Find is a little more cryptic than locate but it’s a very powerful tool that should be available on most Linux distributions if not all.

Basic syntax is: find [directory] -name “[string]” -print

Find will search recursively through the folder you’re calling it from. The directory isn’t required but it will show you the full path. A neat trick is to use $(pwd) which creates a string for the “present working directory”. It’s also a good habit to use quotes around your name search because you can’t do regular expressions without it. find does not do matching the same way locate does. You’ll have to specific a wild card (*) for partial searches.

tyler@quadjutsu:~/Desktop$ find -name "notes" -print
tyler@quadjutsu:~/Desktop$ find -name "notes*" -print
./notes.txt~
./notes.txt
tyler@quadjutsu:~/Desktop$ find $(pwd) -name "notes*" -print
/home/tyler/Desktop/notes.txt~
/home/tyler/Desktop/notes.txt
tyler@quadjutsu:~/Desktop$ find -name "no[a-z]*" -print
./notes.txt~
./notes.txt

My Buddy From Belgium, MrBougo has asked I make note that -iname makes it case insensitive.

grep

In the context of searching, grep is like a pocket knife. It’s great for limiting returned results and searching through files, which are my two most common uses of it, though I’m sure there are a million others. First I’ll cover the searching files for strings portion and in combined tools we’ll discuss how to refine search results.

In terms of searching strings in files, basic syntax is: grep “[string]” [filename]

grep is case sensitive but can be changed to insensitive with -i. You can access extended regular expressions (which allow for such functions as use of the + sign to signify 1 or more characters) by calling “egrep”

tyler@quadjutsu:~$ grep "tyler" resume.txt
tyler@detrition.net
tyler@quadjutsu:~$ grep "Tyler" resume.txt
Tyler J. Mulligan
tyler@quadjutsu:~$ grep -i "tyler" resume.txt
Tyler J. Mulligan
tyler@detrition.net
tyler@quadjutsu:~$ grep -i "tyl" resume.txt
Tyler J. Mulligan
tyler@detrition.net
tyler@quadjutsu:~$ egrep -i "tyler [a-z.]+" resume.txt
Tyler J. Mulligan
tyler@quadjutsu:~$ egrep "tyler [a-z.]+" resume.txt

MrBougo also mentioned that, grep returns a 1 exit status if it doesnt find, so grep “foo” && grep “bar” will only grep for bar when foo is found.

Combining the tools

There are two very important techniques for linking together commands in the terminal. The pipe | and &&. The pipe passes the output of one command to the next, the && runs a command after the one before is complete.

Starting off slow, we’ll refine our search of grep with another grep. Note that you don’t have to use the quotes as I’ve shown below.

tyler@quadjutsu:~$ grep -i "nexuiz" resume.txt
    * Web Developer and Interaction Designer for Nexuiz / Alientrap
    * Owner and Creator of Nexuiz Ninjaz
tyler@quadjutsu:~$ grep -i "nexuiz" resume.txt |grep -i ninjaz
    * Owner and Creator of Nexuiz Ninjaz

Not that you would really want to do the follow commands but to emphasize how | and && work, the following example shows how you’re running the command twice rather than refining a search:

tyler@quadjutsu:~$ grep -i "nexuiz" resume.txt && grep -i "ninjaz" resume.txt 
    * Web Developer and Interaction Designer for Nexuiz / Alientrap
    * Owner and Creator of Nexuiz Ninjaz
    * Owner and Creator of Nexuiz Ninjaz

Recalling our first example with fstab, there was a lot of extra results we didn’t want. We know know it was in the etc folder, so we can filter our results by that.

tyler@quadjutsu:~$ locate fstab |grep etc
/etc/fstab
/etc/fstab.orig
/etc/fstab.pre-ntfs-config
/etc/fstab~

Another way would be to EXCLUDE folders we don’t want with the -v flag.

tyler@quadjutsu:~$ locate fstab |grep -v usr
/etc/fstab
/etc/fstab.orig
/etc/fstab.pre-ntfs-config
/etc/fstab~

And filtering out the junk like so:

tyler@quadjutsu:~$ locate fstab |grep etc |grep -v "~" |grep -v "\."
/etc/fstab

~ has a special meaning in the terminal so you must quote it to match it. ~ refers to the user’s home directory, in this case /home/tyler. I’ve also had to escape . because it too has special meaning, in the context of regular expressions, it will match any character… if we’re excluding any character, we’re excluding our results :).

Quick Tricks

Remember commands is sometimes a hard thing to do, especially when it’s a whole string of complicated commands and regexes. Sometimes, I know I don’t have the mind to take notes but that’s okay (for a grace period) because bash keeps track for me. The history command will list all your recently executed commands and utilizing the grep command, we can filter that list.

tyler@quadjutsu:~$ history |grep locate
  613  locate fstab
  614  locate fstab |grep etc
  624  locate fstab |grep etc |grep -v "~" |grep -v "\."

A quick way to search for files in a directory would be to use locate as the path and grep the results

tyler@quadjutsu:~$ locate ~ |grep notes.txt
/home/tyler/Desktop/notes.txt

These are the basics of finding files and searching through them. Linux provides many tools to reformat and replace strings. There are a million different ways to combine commands and always a faster way to do it. Keep playing and you’ll just get better and better.

Ubuntu Window Management with Multiple Monitors, Window Effects and Default File Associations

Multiple Monitors Window Management in Ubuntu

Moving your applications from one monitor to the next with hotkeys

I’ve been using multiple monitors for a while now, Starting with a 17″ CRT with a 19″ CRT and moving up to two 19″ LCD, then 3, then temporarily one wide screen and back to 2. Something I always loved having as a utility in ultramon that I couldn’t find in Ubuntu (Gnome) or any window manager for that matter, was the ability to move applications from monitor to monitor. I had assumed the search futile until I was searching about some questions I had concerning Compiz-fusion with dual monitors and I came about this thread on Ubuntu forums which brightened up my day. A fellow named gfixler posted a bash script that utilizes command line applications to move the windows.

For you multi-monitor users seeking salvation from removing your hand from the keyboard to move your application from one monitor to another, here’s the skinny on getting it setup using compiz-fusion, aka Advanced Desktop Effects, to set my keybinds.

1. Open a terminal and setup your prerequisites with apt-get:

sudo apt-get install wmctrl xprop xwininfo

If you get errors about x11-utils, just ignore them, this package will handle your needs.

2. Next, lets put the script somewhere you can call it, say “~/scripts

mkdir ~/scripts && cd ~/scripts && touch movewin.sh && chmod +x movewin.sh && gedit movewin.sh

2. Paste the following code, find the first function “getNumberOfMonitors” and configure it to the number of monitors you have (default 2).

#!/bin/bash
# swap_monitor.sh (original version)
# Moves the active window to the other screen of a dual-screen Xinerama setup.
#
# movewin.sh (modified version)
# allows movement of windows left and right between multiple monitors
#
# Requires: wmctrl, xprop, xwininfo
#
# Original Author: Raphael Wimmer
# raphman@gmx.de
#
# Modified by: Gary Fixler
# gfixler+bash@gmail.com
 
function getNumberOfMonitors
{
    # simply must be hardcoded
    # e.g. MatroxTripleHead2Go can service 3 screens,
    # but appears as only one monitor to the computer
 
    # change to your number of monitors
    echo 2
}
 
function getMonitorWidth
{
    numberOfMonitors=$(getNumberOfMonitors)
    monitorLine=$(xwininfo -root | grep "Width")
    monitorWidth=$((${monitorLine:8}/$numberOfMonitors ))
    echo $monitorWidth
}
 
function getActiveWindowID
{
    activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
    activeWinID="${activeWinLine:40}"
    echo $activeWinID
}
 
function getActiveWindowHorizontalPosition
{
    activeWinID=$(getActiveWindowID)
    xPosLine=$(xwininfo -id $activeWinID | grep "Absolute upper-left X")
    xPos=${xPosLine:25}
    echo $xPos
}
 
function getActiveWindowWidth
{
    activeWinID=$(getActiveWindowID)
    xWidthLine=$(xwininfo -id $activeWinID | grep "Width")
    xWidth=${xWidthLine:8}
    echo $xWidth
}
 
function getActiveWindowCurrentMonitor
{
    numberOfMonitors=$(getNumberOfMonitors)
    monitorWidth=$(getMonitorWidth)
    activeWinID=$(getActiveWindowID)
    xPos=$(getActiveWindowHorizontalPosition)
    i="0"
    while [ $xPos -gt $monitorWidth ]
    do
        xPos=$[$xPos-$monitorWidth]
        i=$[$i+1]
    done
    echo $i
}
 
function getActiveWindowPositionOneMonitorToTheLeft
{
    monitorWidth=$(getMonitorWidth)
    currentMonitor=$(getActiveWindowCurrentMonitor)
    activeWinID=$(getActiveWindowID)
    xPos=$(getActiveWindowHorizontalPosition)
    xPos=$[$xPos-$monitorWidth]
    echo $xPos
}
 
function getActiveWindowPositionOneMonitorToTheRight
{
    monitorWidth=$(getMonitorWidth)
    numberOfMonitors=$(getNumberOfMonitors)
    currentMonitor=$(getActiveWindowCurrentMonitor)
    activeWinID=$(getActiveWindowID)
    xPos=$(getActiveWindowHorizontalPosition)
    xPos=$[$xPos+$monitorWidth]
    echo $xPos
}
 
function changeActiveWindowMonitor
{
    activeWinID=$(getActiveWindowID)
    if [ $1 -eq "0" ]
    then
        newXPos=$(getActiveWindowPositionOneMonitorToTheLeft)
        newXPos=$[$newXPos-5]
    else
        newXPos=$(getActiveWindowPositionOneMonitorToTheRight)
        newXPos=$[$newXPos-5]
    fi
 
    winState=$(xprop -id ${activeWinID} | grep "_NET_WM_STATE(ATOM)" )
 
    if [[ `echo ${winState} | grep "_NET_WM_STATE_MAXIMIZED_HORZ"` != "" ]]
        then
        maxH=1
        wmctrl -i -r ${activeWinID} -b remove,maximized_horz
    fi
 
    if [[ `echo ${winState} | grep "_NET_WM_STATE_MAXIMIZED_VERT"` != "" ]]
        then
        maxV=1
        wmctrl -i -r ${activeWinID} -b remove,maximized_vert
    fi
 
    if [[ `echo ${winState} | grep "_NET_WM_STATE_FULLSCREEN"` != "" ]]
        then
        fulls=1
        wmctrl -i -r ${activeWinID} -b remove,fullscreen
    fi
 
    # move window (finally)
    wmctrl -i -r ${activeWinID} -e 0,${newXPos},-1,-1,-1
 
    # restore maximization
    ((${maxV})) && wmctrl -i -r ${activeWinID} -b add,maximized_vert
    ((${maxH})) && wmctrl -i -r ${activeWinID} -b add,maximized_horz
    ((${fulls})) && wmctrl -i -r ${activeWinID} -b add,fullscreen
 
    # raise window (seems to be necessary sometimes)
    wmctrl -i -a ${activeWinID}
 
}
 
function moveActiveWindowOneMonitorToTheLeft
{
    changeActiveWindowMonitor 0
}
 
function moveActiveWindowOneMonitorToTheRight
{
    changeActiveWindowMonitor 1
}
 
"$1"
 
exit 0

3. Setup your hot keys with compiz-fusion. Go to System >> Preferences >> Advanced Desktop Effects. Inside “General Options“, click on the command tab (I apologize for my heinous blue links).

Compiz-fusion Hotkeys 1

2008-11-25-210327_900x435_scrot.png

Use

scripts/./movewin.sh moveActiveWindowOneMonitorToTheRight

and

scripts/./movewin.sh moveActiveWindowOneMonitorToTheLeft

respectively

Per Application Window Effects in Ubuntu

Bring character and tickle your soul with per application window effects

Another cool feature Compiz-fusion has is window animations. My friend James Lindsay recently reminded me about Window Effects… which when I first install Ubuntu on my laptop, I experimented my butt off… but being a laptop… I just used simple ones I’d turn off half the time anyway. He asked me why I don’t use them on my desktop and I didn’t have a good reason. Well, now I have 2 good reasons to keep using compiz.

2008-11-25-210749_900x591_scrot.png

I made my Thunderbird use the airplane effect so when I send emails, it flys away and for Geany, I used the magic lamp for open, close, maximize and minimize (different speeds). It’s a fun little effect that breaks up the stiffness of the desktop.

Default File Associations in Ubuntu

geany > gedit

I was tired of gedit popping up when geany’s just as lightweight but more affective. So found a command and altered it a bit to make my default editor geany.

1. Open the terminal and create\open the following file:

gedit ~/.local/share/applications/defaults.list

If it’s blank, add “[Default Applications]“. If it’s not, find “[Default Applications]“.

2. Then, back to the terminal, grep the default files associations and replace gedit with your editor of choice

grep gedit /usr/share/applications/defaults.list | sed s/gedit/geany/g

Copy (ctrl+shift+c) and paste the output into gedit, below the “[Default Applications]” header.

3. Restart nautilus to load the changes (will close all your file managers that are open and blink/freeze your desktop for a second)

pkill nautilus

Good luck, have fun and happy coding :)