Change bootsplash images in ubuntu

February 17, 2007

One time I wanted to try out KDE and XFCE4 as my desktop environments, so I installed the kubuntu-desktop and xubuntu-desktop packages. Everything was great until I rebooted my computer. Installing these packages had changed my bootsplash. (The image that appears after linux boots from GRUB & is loading.) Online I found an easy way to change this. Simply run the following command and then press the number of the bootsplash you want to use.

sudo update-alternatives –config usplash-artwork.so

You should also run

sudo dpkg-reconfigure linux-image-`uname -r`

to write the settings into your /boot/grub/menu.lst file.

When you restart your computer, the bootsplash should be the one that you want.

If you want to completely remove the alternative bootsplash that comes with kubuntu & xubuntu and restore the original ubuntu one, run this command in a terminal:

sudo aptitude remove kubuntu-artwork-usplash xubuntu-artwork-usplash && sudo aptitude install usplash-theme-ubuntu


apt-get shortcut commands in ubuntu

January 16, 2007

This is something useful that I discovered last week. It allows you to use shortcuts (aliases) for long commands that you type often. For example, it is much easier and faster to type “agi <package name>” than “sudo apt-get install <package name>”

First, we need to edit our ~/.bashrc file (~/ signifies your home directory).

sudo gedit ~/.bashrc

Now paste the following lines in the bottom of that file:

alias acs=’apt-cache search’
alias agu=’sudo apt-get update’
alias agg=’sudo apt-get upgrade’
alias agd=’sudo apt-get dist-upgrade’
alias agi=’sudo apt-get install’
alias agr=’sudo apt-get remove’
alias agc=’sudo apt-get clean’
alias aga=’sudo apt-get autoremove’

Save the file. To apply the settings, run “source ~/.bashrc” in a terminal. (Thanks to Endpoint for this tip.)

Now once the settings are applied, you can just follow the model I mentioned in the beginning of this post for installing, removing, etc. packages.

Tip suggested by Alex from The Spinning Cortex

If you eventually want to create more aliases and want to store them all in a separate file, you can create a file called .bash_aliases in your home directory:

gksudo gedit ~/.bash_aliases

You now must enable this file in your ~/.bashrc:

gksudo gedit ~/.bashrc

Now find the lines that look like this:

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

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

Uncomment the bottom three, so that they look like this:

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

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

Now you can restart the X server and your aliases will be stored in ~/.bash_aliases instead of ~/.bashrc. This is useful if you have a lot of aliases and don’t want to continually mess with ~/.bashrc since it’s an important file.


Read/write support for ext2/ext3 filesystems in Windows

November 21, 2006

I have been dual booting for a long time, and my shared fat32 partition always gave me trouble. It couldn’t handle two-extension file types like .tar.gz, and I just didn’t like it very much. I recently found this program which enables read/write support on ext2 and ext3 filesystems for Windows. As far as I can tell, it works seamlessly, and is a breeze to install and set up. Now my partitions are set up as follows:

sda1: ntfs windows
sda2: shared ext3 for files/music (/media/data)
sda3: ext3 for linux filesystem (/)
sda4: ext3 for home directory (/home)

I would recommend this program for anyone dual booting their computer with Windows and Linux. You can visit it’s home page here.


Install .rpm packages in ubuntu and any other debian-based distribution

November 17, 2006

Some programs are only available in .rpm format, so this howto will show you how to convert them into .deb packages so that we can install them on our debian based system.

First we need to update our sources and install the package “alien” which will convert our .rpm into a .deb:

sudo apt-get update
sudo apt-get install alien

When that’s done, find your .rpm on your harddrive and enter this command into a terminal, changing the path of where your .rpm is.

sudo alien -i /path/to/package.rpm

This command will convert your .rpm to a .deb and then install it automatically. If you don’t want alien to automatically install and you wish to have the .deb so you can install it manually, then just leave off the “-i” in the above command. It will place a .deb with the same name into your home directory.


Change the color of your username in the terminal in ubuntu

November 17, 2006

Oftentimes when I run a command that outputs a lot of text it is difficult to see the top of it. This will show you how to change the color of your username in gnome-terminal so that you can more easily see divisions between commands. This is quite a lot easier than it looks.

To do this we need to edit the ~/.bashrc file.

sudo gedit ~/.bashrc

Now look for the line that says:

# Comment in the above and uncomment this below for a color prompt

Now you need to comment out (#) the line ABOVE it that begins with PS1, and uncomment (remove the #) the line BELOW it that also begins with PS1.

Once you do this, you need to save the file, and restart gnome-terminal. It’s that simple. You should now see your username in gnome-terminal like normal, only colored. You can change its color by going to Edit, Current Profile, going to the colors tab, and changing the various colors on the bottom of the dialog box.


Create custom keyboard shortcuts in ubuntu (also for multimedia keys)

November 13, 2006

If you’re like me, you like to open your programs and run with keyboard shortcuts rather than clicking on an icon in the toolbar. It’s much faster and keeps your desktop & toolbars less cluttered. This method can also get your multimedia buttons on your laptop/keyboard working in gnome if the music player you’re using has commands for play, pause, etc. To find out, type the name of your music player and then –help, e.g. “amarok –help” (EDIT: Those are two dashes, not one big dash. WordPress automatically converts two dashes into that other dash character, which won’t work.)

First open a terminal and run gconf-editor. Then browse to apps/metacity/keybinding_commands. Here, you can enter up to 12 commands that will correspond to 12 different keyboard shortcuts that you will define in the next step. For example, for command_1 I have “gnome-terminal” and for command_2 I have “firefox” which opens my firefox browser.

Next we need to define the keyboard shortcuts that are used to activate the commands we set up in the previous step. In gconf-editor, browse to apps/metacity/global_keybindings and enter the keyboard shortcuts you would like to correspond to the commands that you entered previously. For example, for run_command_1 I have “<Mod4>t” which runs command_1 which is gnome-terminal, therefore opening a Gnome terminal window. Continue through the rest of the commands you defined earlier.

In case you were wondering, “<Mod4>” is the name of my start menu button on my keyboard. I prefer to use it for keyboard shortcuts since it’s useless for anything else. To use your start button like I do for keyboard shortcuts, go to System, Preferences, Keyboard, then go to the Layout Options tab, then go to the Alt/Win key behavior section, and make sure “Super is mapped to the Win-keys (default)” is selected. Now you should be able to use the “<Mod4>” name for your start button. If not, you can still use ctrl + alt + or similar. Just follow the syntax of the other shortcuts. For example, if you wanted Ctrl+Alt+f to start firefox, you would enter <ctrl><alt>f in the run_command_x box that corresponds to the command_x box that you entered “firefox” into in the last step.

If you don’t know the names of your multimedia/shortcut buttons you can open up System, Preferences, Keyboard Shortcuts, setting them to something to find out their names, disabling them again, and typing the names you found out in gconf-editor.


Turn off annoying touchpad tap-to-click or change the touch sensitivity in ubuntu

November 4, 2006

[update] Since gutsy, touchpad options have been included in the Touchpad tab of the Mouse preferences window. To find them, go to System > Preferences > Mouse, and then click on the “Touchpad” tab. You can then simply uncheck “Enable mouse clicks with touchpad.”

I don’t know if this bothers everyone, but I always seem to accidentally hit my touchpad when I’m typing, putting the cursor somewhere else while I’m still typing. This can be very frustrating. So I just turned off the tap-click “feature” of my Synaptics touchpad.

Before we start, it is important to make a backup of the file we are going to edit. If you make a mistake it is possible that your desktop environment will not start. So, open a terminal (Applications, Accessories, Terminal) and run the following command:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup_touchpad

If you do make a mistake and end up without a desktop environment (X won’t start) then simply hit ctrl+alt+F1 to get to a virtual terminal and run the following commands:

sudo cp /etc/X11/xorg.conf.backup_touchpad /etc/X11/xorg.conf
sudo /etc/init.d/gdm restart

You should probably write down the above commands if you don’t know what they mean.

Now that we’ve backed up the file, we can edit it:
sudo gedit /etc/X11/xorg.conf

Next find the Synaptics Touchpad Section. It will look something like this:

Section “InputDevice”
Identifier “Synaptics Touchpad”
Driver “synaptics”
Option “SendCoreEvents” “true”
Option “Device” “/dev/psaux”
Option “Protocol” “auto-dev”
EndSection

Simply add the following line before “EndSection” just like the other options:
Option "MaxTapTime" "0"

Save the file (Ctrl+S) and restart your X server by hitting Ctrl+Alt+Backspace, and tap-to-click should be disabled.

If you want to just make it less sensitive, increase the value from 0.


Change touchpad movement sensitivity in ubuntu

November 4, 2006

Before we start, it is important to make a backup of the file we are going to edit. If you make a mistake it is possible that your desktop environment will not start. So, open a terminal (Applications, Accessories, Terminal) and run the following command:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup_touchpad

If you do make a mistake and end up without a desktop environment (X won’t start) then simply hit ctrl+alt+F1 to get to a virtual terminal and run the following commands:

sudo cp /etc/X11/xorg.conf.backup_touchpad /etc/X11/xorg.conf
sudo /etc/init.d/gdm restart

You should probably write down the above commands if you don’t know what they mean.

Now that we backed up our xorg.conf file, we can get down to editing it. Run this command in a terminal:

sudo gedit /etc/X11/xorg.conf

Now find the place where it says something similar to:

Section "InputDevice"
Identifier  "Synaptics Touchpad"
Driver      "synaptics"
Option        "SendCoreEvents" "true"
Option        "Device" "/dev/psaux"
Option        "Protocol" "auto-dev"
EndSection

Add the following options before the “EndSection” text:

Option        "MinSpeed" "0.1"
Option        "MaxSpeed" "0.3"
Option        "AccelFactor" "0.0017"

Save the file and then restart X. You can restart X quickly with Ctrl + Alt + Backspace.

For more information about synaptic touchpads and more tweaking options check out this wiki.


Change the menu bar and main menu logos in ubuntu

October 16, 2006

UPDATE: I updated this post for gutsy. Thanks to gnuman for the information.

This would be useful for someone wanting to make their desktop look like OS X or something of that sort.

First make a .svg icon that you want to use. Name it start-here.svg. I have provided mine for you to download here. On the page that opens up, click “Free” at the bottom of the page, enter the code shown in the box, and then click download.

Now that you have your logo, put it into the /scalable/places folder inside your icon set’s directory. If you are using an icon set included with edgy, all the icon set directories are in /usr/share/icons/. Custom icon sets are located in ~/.icons/. If you don’t know which icon set you are using, you can check by going to System, Preferences, Theme, and then clicking the “Icons” tab.

These examples may help you locate the proper directory for your icon. If you are using the default (human) icon set that comes with gutsy, the directory where you would place start-here.svg is /usr/share/icons/Human/scalable/places/. One of my old custom icon sets is called “Glass Icons” so I went to my ~/.icons/ folder and found that my icons were stored in the folder ~/.icons/glass-icons. So my directory for start-here.svg is ~/.icons/glass-icons/scalable/places. I had to create the /places folder. Note that the folder name’s syntax is different from the icon set’s name. (Glass Icons vs. glass-icons)

Be aware that many custom themes also use the “GNOME” icon set by default.
Once you have placed start-here.svg in the correct directory, run:

killall gnome-panel

You should now see your logo in your menu bar, like in this screenshot:

start-here.svg screenshot

If you have any problems with this guide or can’t figure it out, feel free to ask me.


Clean up unnecessary packages on ubuntu

October 16, 2006

Sometimes it seems like packages get messy, so here are a few ways I have found to keep your system clean.

First, we are going to remove residual config packages. Go to System –> Administration –> Synaptic Package Manager. On the bottom left corner of this window, there are four buttons, one of which says “Status.” Click it, and on the left column there should be a list of items such as Installed, Installed (local or obsolete), Not Installed, Not Installed (residual config). That last one is the one we want. Click on it, and it will bring up a few packages in the package selector part of the window. Right click on these packages and select “Mark for Complete Removal.” You can also click on one of them and hit Ctrl + A to select them all, then right click once instead of doing them all individually. When you’re done hit “Apply” at the top of the screen, and it will remove all those unnecessary packages from your system.

Second, install localepurge. This works automatically whenever you install any packages. To get it, type in a terminal:

sudo apt-get install localepurge

Third is just one command that you should enter periodically:

sudo apt-get autoclean

Fourth is a way to remove orphaned packages. These are packages that aren’t used by any other programs on your computer. I believe the extra repositories must be enabled for this to work. If you don’t already have them enabled click here for edgy or here for dapper.

Now that you have that done you need to install deborphan:

sudo apt-get install deborphan

Once that’s done you can now enter the following command into the terminal periodically to remove all orphaned packages automatically:

sudo deborphan | xargs sudo apt-get -y remove --purge

I find it is helpful to put these commands (sudo deborphan | xargs sudo apt-get -y remove –purge && sudo apt-get autoclean) into a sticky note on my desktop so that I can use them easily all the time.