Dim the screen at dark

Are there times of the night that you find yourself adjusting your screen brightness lower, either to help your eyes or not bother someone else? It can be annoying have to tweak brightness settings all of the time. We'll show you how to set your brightness automatically during the night. Read on.

To start, you need to have a laptop or a display that supports software brightness configuration. You'll also need to make sure that your GNOME brightness settings are working. (KDE fan? Submit a relevant article.) Also, take note that if your system is not on when brightness settings change, they will not be updated.

Now, pop open a terminal to edit your crontab:

crontab -e

Now you'll want to add some time and brightness settings. Use this as a template:

0 22 * * * gconftool-2 --type int --set /apps/gnome-power-manager/backlight/brightness_ac 10
0 7 * * * gconftool-2 --type int --set /apps/gnome-power-manager/backlight/brightness_ac 100

The first line will set the brightness value to 10% at 22:00; the second sets it to full brightness at 07:00. Note that these are not hardware brightness values, but power manager values that scale from 0 to 100. You can add as many lines as you want. If you're proficient in your crontab syntax, then you can even use settings that only apply on weekends or weekdays.

Find the package a file is from

A quick tip today for all Debian (and derivative) users:

Have a file on in your system that you just can’t figure out where it came from? Searching for the name in Synaptic doesn’t help? About ready to heave your weary keyboard out the window in an administrative rage? Fear not, dpkg to the rescue!

Let’s say you are trying to find out where in the world /usr/share/epiphany-browser/glade/epiphany.glade came into existence. You’ve checked epiphany-browser, but it’s not there. Let’s ask dpkg-query:

$ dpkg-query -S /usr/share/epiphany-browser/glade/epiphany.glade
epiphany-browser-data: /usr/share/epiphany-browser/glade/epiphany.glade

Okay, so it was in epiphany-browser-data. Let’s ask dpkg-query to do the reverse this time, and find all files included in that package:

$ dpkg-query -L epiphany-browser-data
/usr/share/epiphany-browser
/usr/share/epiphany-browser/components
/usr/share/epiphany-browser/components/epiphany.xpt
/usr/share/epiphany-browser/art
/usr/share/epiphany-browser/chrome
# ...

A good trick I use instead of remembering dpkg-query switches is to simply add aliases to my .bashrc:

alias dpkgs="dpkg-query -S"
alias dpkgl="dpkg-query -L"

The above example could then be shortened to dpkgl epiphany-browser-data.

Not all files are managed by packages, and so this may not always get you the results you wanted. Obviously, user-created files in /home will not be from any packages, nor will most files in /etc. But it’s still a handy way to figure out where a file came from.

In one last example, you can take advantage of shell command nesting to figure out which package contains a binary:

$ dpkg-query -S `which firefox`
firefox-3.0: /usr/bin/firefox

(Those are backticks, by the way, not regular quotes.)

Make X.Org pretty with DRI2 and UXA

That’s a scary headline. Chances are, after seeing that, you might not care about the rest of this article. But hang on for a second: Have an Intel graphics chipset, or use an ATI graphics card (open-source drivers or not)? Then this image might be familiar to you:

If you don’t notice it right away, the glxgears window is below the other two. Ugly. This is a problem with the current X.Org stack using a rendering mode known as DRI1. I won’t go in to technical details of why this happens, but it all boils down to this: Using DRI1, 3D applications are given a space of the screen to draw into, and this is then sent directly to the display. That sounds somewhat logical, but when you throw in more fancy operations, such as Compiz and desktop effects, things get tricky. Keith Packard of Intel does a good job explaining this and other problems with X acceleration.

Keith mentions a golden combination that can be used right now. Fedora 11, arriving in one week, will include everything needed for a pleasant X experience. Ubuntu 9.04 does ship UXA, but it is not on by default due to stability issues at the time it was released. Instead, EXA is used, the same mode included with 8.10.

If you’re using Ubuntu 9.04 or another distribution with UXA support that is almost ready, there is a one-liner you can add to /etc/X11/xorg.conf. In the Device section, add Option “AccelMethod” “uxa” as it is below:

bc.
Section “Device” Identifier “Configured Video Device” Option “AccelMethod” “uxa”
EndSection

Be prepared to revert the change later: without a newer kernel or X server, UXA mode has proven to be a little crashy. I’ve had good experiences while using at a 2.6.30 kernel, though I still do not use it for day-to-day computing. Even if you can’t get it to work for extended amounts of time yet, it still is nice to see this:

The glxgears test is positioned neatly in the background; you can see it through the semi-transparent terminal. And if that’s not enough proof that this works:

  1. 1
  2. 2
  3. 3
  4. 4
  5. ...
  6. Go to

Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe