Difference between revisions of "Talk:Sample Fn-F7 script"

From ThinkWiki
Jump to: navigation, search
m (another suggestion)
Line 14: Line 14:
  
 
Good point, made the changes --seva
 
Good point, made the changes --seva
 +
 +
 +
# This is to figure out which user and X11 display to work on
 +
# TODO there has to be a better way to do this?
 +
SU="su $(w -h -s | grep ":[0-9]" | head -1 | awk '{print $1}') -c"
 +
export DISPLAY=$(w -h -s | grep ":[0-9]" | head -1 | awk '{print $3}'
 +
 +
As the xrandr command can be run by the user is this necessary? if the script called by Fn7 can be run by an ordinary user then is it not equivalent to running the commands in an xterm?
 +
 +
djc@Twingo:~$ xrandr --output LVDS --auto --output VGA --off
 +
 +
djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto
 +
 +
djc@Twingo:~$ xrandr --output LVDS --auto --output VGA --auto

Revision as of 00:25, 13 November 2007

Note: you will need to change the internal and external resolution until someone fixes this script to figure it out from xrandr, you may also need to change output names from "VGA" and "LVDS" to what your xrandr tells you.

why not just use --auto ?

xrandr --output VGA --auto

xrandr --output VGA --off

xrandr --output LVDS --auto

xrandr --output LVDS --off


Good point, made the changes --seva


  1. This is to figure out which user and X11 display to work on
  2. TODO there has to be a better way to do this?

SU="su $(w -h -s | grep ":[0-9]" | head -1 | awk '{print $1}') -c" export DISPLAY=$(w -h -s | grep ":[0-9]" | head -1 | awk '{print $3}'

As the xrandr command can be run by the user is this necessary? if the script called by Fn7 can be run by an ordinary user then is it not equivalent to running the commands in an xterm?

djc@Twingo:~$ xrandr --output LVDS --auto --output VGA --off

djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto

djc@Twingo:~$ xrandr --output LVDS --auto --output VGA --auto