Automatically switch between internal and external screens when using a laptop and a dock station

Assuming that the internal screen is LVDS and the external screen is DVI-0. inotifywait comes from the inotify-tools package.

# Wait for the changes detected by the kernel laptop mode.
while inotifywait -e modify /proc/sys/vm/laptop_mode
do
laptop_mode=`cat /proc/sys/vm/laptop_mode`
  # If on battery, switch on the internal screen.
  if [[ $laptop_mode -gt 0 ]]; then
    xrandr --output LVDS --mode 1280x800
    xrandr --output DVI-0 --off
  # Otherwise,
  elif [[ $laptop_mode = 0 ]]; then
     # if the external screen is connected, switch it on.
     if [[ `xrandr -q|grep DVI-0|cut -f2 -d\ ` = connected ]]; then
       xrandr --output DVI-0 --mode 1920x1200
       xrandr --output LVDS --off
     fi
  fi
done

Mplayer package with VDPAU support on Debian Lenny

I recently bought an Asrock ION 330 Pro HTPC which supports VDPAU, an NVIDIA API for Linux that offloads parts of video processing to the GPU. The upgrade from the old HTPC went smoothly with a mere dd if=/dev/sda of=/dev/sdb and a few system tweaks. However, it turned out that Mplayer in Debian Lenny that I was running on my new HTPC box did not support VDPAU. Checking the usual places, like backports and debian-multimedia did not help, either.

Tags: 

О стереотипах в кино

Вчера смотрел последнюю серию Lie to me, там Лайтман вымучивал из себя книгу на новеньком макбуке, параллельно расследуя некое происшествие на конкурсе красоты. Вымучивал он книжку на протяжении всей серии, а под конец показали кадр, в котором он сидит за ноутом с виндовс и упоённо строчит текст новой книжки.

«Сядь за венду, займись делом.» © popular stereotype

Tags: 

Tell me, Sodexo, tell me, Accor, where those unused 7 mln € go each year?

Even Metro can be source of insightful information. Look, 1.4 mln belgians get luncheon vouchers, 0.35% of luncheon vouchers stay unused, so how much do the distribution companies pocket each year on these unused luncheon vouchers?

1.4 mln people * 6€ *22 days *11 months * 0.35% = 7 114 800 € per year

And what if Fedis is right and 5% of luncheon vouchers get unused? Then, Sodexo and Accor would make a whopping 100 mln per year out of the holes in our pockets!

Pages