Script for switching between LCD/CRT on Thinkpads

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 338
Joined: Tue Nov 12, 2013 2:05 am

Script for switching between LCD/CRT on Thinkpads

Post by peter_b »

In most cases, the monitor-output-toggle button on Thinkpad notebooks works fine on Ubuntu.
However, I've had the case in the past that it didn't work anymore as expected (after Kernel update), so here's a small bash-script that does the trick:

Code: Select all

#!/bin/bash
# @date: 2012-11-05
# @author: Peter B.

LCD_ON="lcd_enable"
CRT_ON="crt_enable"
CRT_OFF="crt_disable"
SWITCH="video_switch"

PROC_VIDEO="/proc/acpi/ibm/video"

echo "$SWITCH" > $PROC_VIDEO
sleep 60
echo "$SWITCH" > $PROC_VIDEO

# read -p "Press any key to switch CRT on"
# echo $CRT_ON > $PROC_VIDEO
read -p "Press any key to switch CRT off"
echo $CRT_OFF > $PROC_VIDEO
echo $LCD_ON > $PROC_VIDEO
Not sophisticated, but worked on my machine - and I keep it here so it doesn't get lost ;)
Post Reply