On Thursday January 20, 2011, Joachim Ott wrote:
> On 20 January 2011 14:53, Josh Thompson <[email protected]> wrote:
> > I use my own script to do screen rotation when I need it.  I discovered
> > this same issue a while ago.  I found adding this command to my script
> > to get run after rotating back to portrait mode fixes the problem:
> > 
> > xrandr --dpi 284x280
> > 
> > I don't know if there's a way to add that to omnewrotate, but you could
> > at least put that in a script and create .desktop file for it to show up
> > as a program in the launcher so you could manually run it.
> 
> Your script can't be that big. Could you post it, I could use that too.

Well, I was generalizing a bit.  I have a script to be able to view some 
webcams on my home LAN that rotates the screen before/after displaying them.  
However, this should work:

------------ /home/root/togglerotate.sh --------------
#!/bin/sh
pos=`xrandr --verbose | grep LVDS | awk '{print $5}'`

if [[ $pos == 'normal' ]]; then
   xrandr -o 1
else
   xrandr -o 0
   xrandr --dpi 284x280
fi
------------------------------------------------------

---- /usr/share/applications/togglerotate.desktop ----
[Desktop Entry]
Name=Toggle Rotation
Comment=rotate screen
Encoding=UTF-8
Version=1.0
Type=Application
Exec=/home/root/togglerotate.sh
Icon=vala-terminal
Terminal=false
Categories=GTK;Network;Main;
SingleInstance=true
StartupNotify=true
------------------------------------------------------


I think you have to restart X to get it to pick up the new .desktop file.

If anyone knows of a more correct value for dpi, please post it.  I just found 
284x280 by trial and error.  Also, I couldn't find a value that works for 
landscape mode; so, the script only sets it when switching back to portrait 
mode.

Josh
_______________________________________________
Shr-User mailing list
[email protected]
http://lists.shr-project.org/mailman/listinfo/shr-user

Reply via email to