Tag Archives: Run command

Changing the default text editor on Ubuntu

There is a few software that will use the editor command to find out what text editor to use. Example commands will be dch to add a new .deb changelog entry, revision control softwares when prompting for commit a message …
There is basically 2 ways for changing the default editor:

1. System Wide
Run Terminal and type:
$ sudo update-alternatives –config editor
And then choose whichever editor you want to be default.

2. User Level
As a user, you cannot change the setting for the whole system, but you can add an alias for editor to let say vim.
Open and edit ~/.bashrc and add:
alias editor=vim
Next time you will open a bash prompt, your default editor will be vim. AddThis

Enable Windows 7 Aero Snap in Ubuntu

In Windows 7, you can click and drag a window to the left or right edge of the desktop and it will fill half of the screen, or snap a window to the top edge of the desktop and it will be maximized.

In Ubuntu, you can click and drag a window to the left, right or top edge of the desktop to achieve the same result.

In addition to CompizConfig Settings Manager, install WmCtrl if not added:
– go to Applications (or Main Menu) > Accessories > Terminal.
– enter sudo apt-get install wmctrl
– enter password when prompted.
– go To System > Preferences > CompizConfig Settings Manager.
– select “General” from the left panel and click “Commands”.
In Command line 0, 1 and 2, paste the following codes:

Command line 0, paste:

WIDTH=`xdpyinfo | grep ‘dimensions:’ | cut -f 2 -d ‘:’ | cut -f 1 -d ‘x’` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1

Command line 1, paste:

WIDTH=`xdpyinfo | grep ‘dimensions:’ | cut -f 2 -d ‘:’ | cut -f 1 -d ‘x’` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1

Command line 2, paste:

wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

In the same window, click “Edge Bindings” tab.
Change Run Command 0, 1 and 2 from “None” to “Left”, “Right” and “Top” respectively.
Click “Back” button and select “General Options”, change “Edge Trigger Delay” to about 500. AddThis mp3 link