You're probably right that the DISPLAY is always :0.0. You need another way to toggle between 0 and 1. Try this:#!/bin/bash swfile=/tmp/sw-file if [ ! -f $swfile ]; then echo 0 > $swfile ; fi echo $(( ! `cat $swfile` )) > $swfile echo exec switchscreen `cat $swfile`Note that I just echo-ed the command because I don't have switchscreen installed. The $(( ... )) syntax allows you to evaluate mathematical expressions. Read "man bash"HTH
Works perfectly! Thanks HTH :) KC.