Sep 3, 2011

Disable Startup Sound in Ubuntu 11.04 Natty

Sometimes when I started my notebook at night, the startup music often disturbed my family. It was time-consuming for me to find how to disable the sound, but it takes only 3 minutes to do it. Here you go.

I found that there are two pieces of sound at startup:
  1. Sound for Login Screen
    • Go to the right-upper corner of your desktop
    • Select ‘Menu –> System –> Login Screen 
    • Check the option ‘Play login sound, and close the dialog
    • Go to the dialog Login Screen again, uncheck the option ‘Play login sound, and close out

    The option ‘Play login sound is unchecked by default, but login screen sound is played actually, which should be a bug.
  2. Sound after login
    • Go to the right-upper corner of your desktop
    • Select ‘Menu –> Preference –> Startup Applications 
    • Uncheck the option Gnome Login Sound, and close the dialog
The menu of your system may be a little different, but look for the two dialogs, Login Screen and Startup Applications.

FYI, the two pieces of music are located at /usr/share/sounds/, and you can replace them with your favorites.

Feb 10, 2011

Get back desktop icons

I am using Linux Deepin 10.06, a Chinese community distribution based on Ubuntu 10.04 LTS, using xfce4 as its desktop environment. For some reason, my desktop icons have disappeared. I found a lot of solution like going to

Settings > Settings Manager > Desktop
and selecting

Allow xfce to manage the desktop


However I did not find the option at all. This post mentioned xfdesktop. I tried the command, and the icons came back. There seem to be a lot of people who have problems with their desktop "disappearing" on xfce. Maybe the command xfdesktop can help you get back your xfce desktop icons.

Feb 5, 2011

Weather report powered by python

I would like to insert weather report to my diary automatically, so I googled "weather script python" - yes, I prefer python - and found a python script fetching weather report from Yahoo! Weather written by Thomas Upton

In order to use the script, I looked up the location ID for my city. I searched Yahoo Weather home page. The location ID is in the URL for the forecast page for the city. For example, the forecast page for Los Angeles is http://weather.yahoo.com/united-states/california/los-angeles-2442047/. The location ID of Los Angeles is 2442047.

Unfortunately, the script does not work for me. I checked the python source code, and found the feed URL is "http://xml.weather.yahoo.com/forecastrss?p=", which seems only for US zip code. So I modified the URL to "http://weather.yahooapis.com/forecastrss?w=", which works with the code from Yahoo Weather home page.

You can apply a patch if you would like, which I supply here:

--- weather.py 2011-02-05 21:40:02.000000000 +0900
+++ weather.py 2011-02-05 21:51:43.000000000 +0900
@@ -19,7 +19,8 @@

# Yahoo!'s limit on the number of days they will forecast
DAYS_LIMIT = 2
-WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s'
+#WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s'
+WEATHER_URL = 'http://weather.yahooapis.com/forecastrss?w=%s'
METRIC_PARAMETER = '&u=c'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'