Wednesday, October 31, 2007

xcalib and Linux screen savers

I was asked how you can start xcalib when the Linux screen saver deactivates.

Let's first talk about what the reason for this question may have been: Probably the screen saver alters the LUTs and resets them to their default value. It could also be possible that a 3D screen saver does some weird things with the LUTs. In any case, it seems like some screen savers require to load the LUTs again after the screen saver is disabled.

Unfortunately, there's no single screen saver program on Linux. There is the good old xscreensaver and the rather new gnome-screensaver. The later one supports D-Bus, so we can monitor a certain signal and issue the xcalib command when the screen saver deactivates. For the first one unfortunately no D-Bus signals exist (there's only a hack which is not integrated in the current xscreensaver).

So let's try to modify the FAQ Perl scripts of both screensavers for running xcalib when the screensaver unblanks.

xscrensaver:
#!/usr/bin/perl
my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while () {
if (m/^(BLANK|LOCK)/) {
if (!$blanked) {
$blanked = 1;
}
} elsif (m/^UNBLANK/) {
system "xcalib myprofile.icm";
$blanked = 0;
}
}

gnome-screensaver:
#!/usr/bin/perl
my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver',member='SessionIdleChanged'\"";
open (IN, "$cmd |");
while () {
if (m/^\s+boolean true/) {
} elsif (m/^\s+boolean false/) {
system "xcalib myprofile.icm";
}
}
I must admit that I haven't checked the scripts - but keep me informed if they don't work and I will modify them. As always, it should work with dispwin as well.

Sunday, October 28, 2007

Compiling ArgyllCMS on Ubuntu 7.10 Gutsy Gibbon

That's my log of what I had to do to build ArgyllCMS 0.7b7 from source on my laptop with Ubuntu 7.10.
  1. add yourself to the src group
    # sudo vim /etc/group
    change the line
    src:x:40:
    to
    src:x:40:yourusername
    note that yourusername is just a placeholder for your Ubuntu username
  2. install the jam build tool - use FTJam
    # sudo apt-get install ftjam
  3. install the X11 XVidMode development package
    # sudo apt-get install libxxf86vm-dev
  4. create a directory for Argyll in /usr/src , e.g.
    # mkdir argyllcms
    and enter it
    # cd argyllcms
  5. download latest Argyll version (use a beta version if available)
    # wget http://www.argyllcms.com/argyllV0.70Beta7_src.zip
    Always watch out on the Argyll website (http://www.argyllcms.com) what the latest version is and exchange the name in the above command
  6. unzip the downloaded file - watch out: there's no folder created and the content is extracted into your current directory!
    # unzip argyllV0.70Beta7_src.zip
  7. Run the build script
    # sh makeall.ksh
Now you should have your own Argyll binaries in the respective subfolders.