Custom XTerm Colors

""

How would you like to be able to change the colors of your XTerm client? I learned how to years ago and rediscovered the notes on my computer. It wasn’t easy to learn how to do it, so I thought it would be useful to post the directions. You may have to experiment a little or read the man page on XTerm. However, if all you want is an XTerm with a black background and white foreground just follow these directions.

Changing XTerm Colors:

  1. Bring up a terminal and sign in as root ( Ubuntu users can do this with sudo bash )
  2. Go to /etc/X11/app-defaults
  3. Bring up the file XTerm in a text editor
  4. Copy this to the bottom of the file & save the file:
! Change the background and foreground colors to black and white
xterm*background: Black
xterm*foreground:       White
xterm.eightBitInput: true
! xterm*font: -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1
xterm*SaveLines: 2000
! xterm*VisualBell: true
xterm*appcursorDefault: true
*XTerm*saveLines: 1000

XTerm With A Scrollbar

""
XTerm with a veritcal scroll bar

Though many people use the terminal clients that come with GNOME and KDE to do command line work, many people still use the simple and older XTerm client. It loads much faster. Many GUI apps that have an option to call a terminal call an XTerm.

People new to Linux/Unix environments do not know that they can scroll up and down in command line output. There are keyboard commands for that, but who will remember those commands unless they use those commands all of the time? Well, about a ZILLION years and many, many Linux distributions ago I figured out how to add a GUI scrollbar to an XTerm. I was going through my old Linux notes this weekend and had the thought other people might find it useful.

Adding A Scrollbar To XTerm

  1. Bring up a terminal and sign in as root ( Ubuntu users can do this with sudo bash )
  2. Go to /etc/X11/app-defaults
  3. Bring up the file XTerm in a text editor
  4. Copy the snippet below to the bottom of the file & save the file:
  5. execute the command: xrdb -merge /etc/X11/app-defaults/XTerm
! Set up scrollbars - get them, get them on the right side, and be
! able to scroll them with the right,left, or middle mouse button
xterm*ScrollBar: on
*XTerm*scrollBar: true
xterm*rightScrollBar: true
xterm*multiScroll: on
xterm*jumpScroll: on

xterm*scrollbar.Translations: #override \n\
  :StartScroll(Continous) MoveThumb() NotifyThumb()\n\
  :MoveThumb() NotifyThumb() \n\
  :StartScroll(Continous) MoveThumb() NotifyThumb()\n\
  :MoveThumb() NotifyThumb() \n\
  :StartScroll(Continous) MoveThumb() NotifyThumb()\n\
  :MoveThumb() NotifyThumb() \n\
  :NotifyScroll(Proportional) EndScroll()

HTH 🙂

Ubuntu: Making Monday The First Day Of The Week

If you are an American Ubuntu user the GNOME Calendar Applet pictured above will default to Sunday being the first day of the week. There is no UI to change it. The reasoning from the people at GNOME is that starting the week with Sunday is a U.S. standard.

I’m an American and I’ve spent my whole life with calendars that start the week with Monday. I like to click on the calendar applet to see what day of the week a date I’m thinking about falls on. I find it annoying to bring the calendar applet up and see Sunday on the far left.

There are two ways this can be changed.

I found “Method #2” years ago, the information was not easy to find. The change is undone when Ubuntu updates for Daylight Savings Time. “Method #2” also stopped working for me when I upgraded to Ubuntu 10.10. I’m including it here for people for who “Method #1” does not work.

“Method #1” works with Ubuntu 10.10, is shorter and may not need to be done more than once ( I’ll find out with the next update for daylight savings time ). Basically, what you are doing is setting up Ubuntu to use British time standards instead of American time standards.


Method #1


  1. Bring up a terminal, enter the command sudo bash and enter your root password
  2. Change to your default setting directory with this command: cd /etc/default
  3. Open the file “locale” in a text editor
  4. Enter the following line: LC_TIME=”en_GB.UTF-8″
  5. Save the file and exit your editor
  6. Execute this command ( may not be necessary, but it can’t hurt ): locale-gen
  7. Restart Ubuntu

Method #2


Since Method #2 gets undone whenever Ubuntu updates for daylight savings time I decided to make myself a BASH script to make the change convenient. You can use it too.

If you feel nervous about using a script, you can just type the commands into a terminal yourself. I put step by step comments above each command.

To use the script below do the following:

  1. Copy and paste the code below into a text editor.
  2. Save the file as “makeMondayTheFirstDayOfTheWeek.sh”
  3. Change the permissions to make the script executable with this command:
    chmod 777 makeMondayTheFirstDayOfTheWeek.sh
  4. Login as root, Ubuntu users can do this with this command:
    sudo bash

  5. Run the script with the following command:
    bash ./makeMondayTheFirstDayOfTheWeek.sh
  6. Press your Enter Key after typing the command
  7. Wait for the script to finish.
  8. Restart your computer
# Switch to your home directory
cd ~


# Remove old files and directories from the last time you had to do this
rm -rf ~/en_US_modified 
rm -rf ~/locale
rm -rf /usr/lib/locale/en_US_.utf8_BACKUP


# Make a copy of your locale file, en_US in your home directory
cp /usr/share/i18n/locales/en_US en_US_modified

# Create a directory called "locale"
mkdir locale

# Search en_US_modified. Replace "first_weekday 1" with "first_weekday 2" 
sed -i 's/first_weekday\t1/first_weekday\t2/g' en_US_modified

# Create a directory full of new locale settings inside of the "locale" 
# directory you made in your home directory:
localedef -c -i en_US_modified -f UTF-8 locale/en_US.utf8

#Backup your current locale settings
cp -R /usr/lib/locale/en_US.utf8  /usr/lib/locale/en_US.utf8_BACKUP


# Copy the new en_US.utf8 directory your created in your home directory in the subdir "locales" to
rm -rf /usr/lib/locale/en_US.utf8
cp -R ~/locale/en_US.utf8 /usr/lib/locale

# Update the locales
locale-gen

# Restart the GNOME desktop
killall gnome-panel

#Restart your Ubuntu system for the change to take effect
echo Please Restart Ubuntu Linux To See The Change

HTH 🙂