Monday, 15 February 2010

Karmic, openbox, and messed up desktop numbers

See this.

Karmic and Pulseaudio

I have been bitten by the bug reported at https://bugs.launchpad.net/pulseaudio/+bug/352732 . In fact, I was bitten by this back in Jaunty. There the problem was isolated to logging out of a non-Gnome session (and into Gnome? I forget exactly). In Jaunty I solved the problem by killing pulseaudio before terminating non-Gnome sessions. Now in Karmic this solution doesn’t seem to work in all situations, so I am trying the suggestion in post #77. Namely, in /etc/pulse/default.pa, comment out the line load-module module-device-restore

Here is the snippet from my /etc/pulse/default.pa:

### mfk addition: comment out "load-module module-device-restore"
### see https://bugs.launchpad.net/pulseaudio/+bug/352732 #77
#load-module module-device-restore

We’ll see how it goes.

Saturday, 13 February 2010

Tk and Tkinter

There is really good online documentation and superb tutorials on Tk (including Tkinter) at TkDocs. In fact, this site had me re-evaluate my decision not to learn/use Tkinter for anything.

Unfortunately, about three seconds with IDLE was enough to change my mind back. In particular, Tk’s use of menu bars and menus doesn’t fit with Win/GTK/Qt/OS X standards at all.

python3 basics

I discovered a couple of gotchas in getting python3 up and running in Ubuntu 9.10 (and probably Lenny and Squeeze as well).

Install python3.

Install python3-tk. (This one is easy to miss.)

Add to source files:

#!/usr/bin/python3

To invoke, at the command line do

$ python3 foobar.py

Geany’s F5 doesn’t work because it makes compile and execute calls using python rather than python3. I am loathe to change it at this point because it may wreak havok on python2.6 stuff.

As potential alternatives there are idle-python3.0 and idle-python3.1 packages, which I will be evaluating todayish.

Monday, 1 February 2010

Sourcing .profile

In an earlier post I mentioned that XDM doesn’t source ~/.profile. Here is a collage of stuff that describes and solves the problem.

According to Jason Jesso, the basic problem is mentioned in the KDE FAQ:

9.11. KDE (kdm) does not read my .bash_profile!

Well, xdm (and kdm) does not run a login shell, so .profile, .bash_profile, etc. are not sourced. When the user logs in, xdm runs Xstartup as root and then Xsession as user. So the normal practice is to add statements in Xsession to source the user profile. Please edit your Xsession and .xsession files.

Useful details and a solution are offered by Bill Hassel:

Normally, when you run a script, the shell firks a new copy of the shell which then runs the script. All changes to shell environment are left with this shell. When the script terminates, the forked shell also terminates and nothing is passed back to the current shell except a numeric exit code.

Sourcing causes the current shell to run all the instructions locally, which leaves all the changes in the current environment. Any script can be sourced. The source command is just the character . (dot or period). You put the dot in front of the script with at least one space.

In other words, add

. ~/.profile

to .xsession

Another way is described by James Richard Tyrer

You can also change the first line of “/etc/X11/xdm/Xsession”:

#!/bin/bash -login

I’ll try this on a SD installation soon.