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

From ThinkWiki
Jump to: navigation, search
(detecting what is active)
m
Line 8: Line 8:
  
 
xrandr --output LVDS --auto
 
xrandr --output LVDS --auto
 
+
 
xrandr --output LVDS --off
 
xrandr --output LVDS --off
 
+
 
----
 
----
  
Line 22: Line 22:
  
 
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?
 
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 --auto --output VGA --off
+
djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto
 
+
djc@Twingo:~$ xrandr --output LVDS --auto --output VGA --auto
djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto
 
 
 
djc@Twingo:~$ xrandr --output LVDS --auto --output VGA --auto
 
  
  
 
concerning detecting what is currently active from xrandr. with VGA off xrandrq shows
 
concerning detecting what is currently active from xrandr. with VGA off xrandrq shows
  
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 2048
+
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 2048
VGA connected (normal left inverted right)
+
VGA connected (normal left inverted right)
 
   1600x1200      60.0 +  59.9   
 
   1600x1200      60.0 +  59.9   
 
   1280x1024      75.0    59.9   
 
   1280x1024      75.0    59.9   
Line 41: Line 38:
 
   640x480        75.0    60.0   
 
   640x480        75.0    60.0   
 
   720x400        70.1   
 
   720x400        70.1   
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
+
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
 
   1024x768      60.0*+  50.0   
 
   1024x768      60.0*+  50.0   
 
   800x600        60.3   
 
   800x600        60.3   
Line 55: Line 52:
 
   640x480        75.0    60.0   
 
   640x480        75.0    60.0   
 
   720x400        70.1   
 
   720x400        70.1   
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
+
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
 
   1024x768      60.0*+  50.0   
 
   1024x768      60.0*+  50.0   
 
   800x600        60.3   
 
   800x600        60.3   
Line 63: Line 60:
  
  
djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto
+
djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto
djc@Twingo:~$ xrandr -q
+
djc@Twingo:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 2048 x 2048
+
Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 2048 x 2048
VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
+
VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
 
   1600x1200      60.0*+  59.9   
 
   1600x1200      60.0*+  59.9   
 
   1280x1024      75.0    59.9   
 
   1280x1024      75.0    59.9   
Line 74: Line 71:
 
   640x480        75.0    60.0   
 
   640x480        75.0    60.0   
 
   720x400        70.1   
 
   720x400        70.1   
LVDS connected (normal left inverted right)
+
LVDS connected (normal left inverted right)
 
   1024x768      60.0 +  50.0   
 
   1024x768      60.0 +  50.0   
 
   800x600        60.3   
 
   800x600        60.3   
Line 80: Line 77:
  
 
so detection should be possible on the differences between
 
so detection should be possible on the differences between
VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
+
VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
 
+
VGA connected (normal left inverted right)
and
+
LVDS connected (normal left inverted right)
 
+
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
VGA connected (normal left inverted right)
 
 
 
and
 
 
 
LVDS connected (normal left inverted right)
 
 
 
and
 
 
 
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
 
 
 
  
 
eg between "xxxx connected nnnnxnn+0+0 (" and "xxxx connected ("
 
eg between "xxxx connected nnnnxnn+0+0 (" and "xxxx connected ("

Revision as of 00:49, 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


concerning detecting what is currently active from xrandr. with VGA off xrandrq shows

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 2048
VGA connected (normal left inverted right)
  1600x1200      60.0 +   59.9  
  1280x1024      75.0     59.9  
  1152x864       74.8  
  1024x768       75.1     60.0  
  800x600        75.0     60.3  
  640x480        75.0     60.0  
  720x400        70.1  
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
  1024x768       60.0*+   50.0  
  800x600        60.3  
  640x480        60.0     59.9 

with VGA on

VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
  1600x1200      60.0*+   59.9  
  1280x1024      75.0     59.9  
  1152x864       74.8  
  1024x768       75.1     60.0  
  800x600        75.0     60.3  
  640x480        75.0     60.0  
  720x400        70.1  
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm
  1024x768       60.0*+   50.0  
  800x600        60.3  
  640x480        60.0     59.9  

with LVDS off:


djc@Twingo:~$ xrandr --output LVDS --off --output VGA --auto
djc@Twingo:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 2048 x 2048
VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
  1600x1200      60.0*+   59.9  
  1280x1024      75.0     59.9  
  1152x864       74.8  
  1024x768       75.1     60.0  
  800x600        75.0     60.3  
  640x480        75.0     60.0  
  720x400        70.1  
LVDS connected (normal left inverted right)
  1024x768       60.0 +   50.0  
  800x600        60.3  
  640x480        60.0     59.9  

so detection should be possible on the differences between

VGA connected 1600x1200+0+0 (normal left inverted right) 367mm x 275mm
VGA connected (normal left inverted right)
LVDS connected (normal left inverted right)
LVDS connected 1024x768+0+0 (normal left inverted right) 304mm x 228mm

eg between "xxxx connected nnnnxnn+0+0 (" and "xxxx connected ("