Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, March 2, 2010

Pausing music when switching users in Ubuntu (Karmic and Lucid)

If you want to have a user, which currently uses the display, to have access to the sound device with all the benefits from pausing upon user switch, you need to uncheck 'Use audio devices' privileges for this user (System->User Settings->Advanced->User Priviledges).

As a matter of fact I unchecked it for all my users. These privileges are very confusing then. I guess their proper interpretation is that if:
- checked: the user locks the audio device as long as he wants, no sound switching upon user switching,
- unchecked: the user which currently uses the display has access to the audio device, sound switching takes place upon user switching.

The problem is more general and it regards permissions to access certain devices (and files in /dev directory). Historically if a user needs access to particular device he is assigned to a group which group-owns the device file. It has worked for ages in the unix world i.e. access to an audio device, cdrom, cd burner etc.

This group based approach has several well known limitations. Now it seems that such an access is controlled by consolekit/policykit/udev, which makes some sense, at least because of the dynamic nature of /dev directory. The gnome-system-tools and especially users-admin seem not to know anything about acl. I'm not sure whether it's good or bad - it depends, espoecially that gnome is cross platform - on other systems /dev might be static or there might be no acl at all.

See  https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/433654 for more details.
And some discussion here: http://ubuntuforums.org/showthread.php?t=1420051

Mind that the sound switching worked fine in previous Ubuntu release (Jaunty).

Thursday, December 10, 2009

Gnome Workspace Switcher and managing (moving) windows.

I have a dual-head setup (NVidia TwinView) where the second screen is an overhead projector. I would find it extremely useful if I could just drag windows using the Workspace Switcher between my screens. This would help a lot especially at times when the projector is blanked or switched off and I would like to move some windows to be projected when switched on/unblanked.

Beware... tadaaaaa...Since yesterday windows can be dragged not only to a different workspace (without altering their relative position) but also within the workspace. I made a modification to libwnck (the library which implements the pager and allows to manipulate windows) which implements this feature and submitted it upstream. I wonder if it is going to be committed to the next Gnome release or not... we'll see.

Anyway you you would like o use this functionality in Ubuntu 9.10 Karmic Koala, here is a link to my PPA: https://launchpad.net/~wojnicki/+archive/ppa

And if you want to compile libwnck by yourself you can find the appropriate patch at the feature request: https://bugzilla.gnome.org/show_bug.cgi?id=604207

Wednesday, November 4, 2009

Enabling laptop VGA output

The following commands enable VGA output (works presumably with any XOrg driver, tested with several ATI Radeon cards). It is especially useful if you want to make your laptop work with a projector connected with a damaged or long cable.
xrandr --newmode 1024x768N 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
xrandr --addmode VGA-0 1024x768N
xrandr --output LVDS --mode 1024x768
xrandr --output VGA-0 --mode 1024x768N
The first command adds a new 1024x768 (60Hz) video mode and names it: 1024x768N. The second command assigns the video mode to the VGA port (VGA-0). While the third and fourth commands switch the LCD display (LVDS) to 1024x768 mode and the VGA port to the newly created one respectively.

Monday, November 2, 2009

Compiling Ubuntu 9.10 (Karmic Koala) Kernel

If you want to compile an Ubuntu linux kernel don't:
  • use make-kpg
  • use make menuconfig
To get the kernel source issue:
apt-get source linux-source

It will download a TAR archive into your working directory. Untar the archive and cd into the directory with the kernel source.

Re/Configure the kernel by issuing:

debian.master/scripts/misc/kernelconfig editconfig

It will ask you to reconfigure all kernel flavours in turn. Reconfigure the flavour you want to alter, not changing the others.

In order to build your kernel (the generic flavour) issue:

CONCURRENCY_LEVEL=2 AUTOBUILD=1 NOEXTRAS=1 skipabi=true skipmodule=true debian/rules binary-generic

After a while you should see deb packages in the parent directory.

If you want to come up with your flavour take a look at: http://mmlinux.wordpress.com/2009/07/30/how-to-compile-kernel-in-karmic/