LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-06-2010, 02:51 PM   #1
shakazzolo
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Rep: Reputation: 0
Unhappy Launch scripts when VBOX screen is resized?


Why why why did virtualbox devs remove the VBoxRandR.sh script??

http://www.virtualbox.org/changeset/27601

How can I now run scripts when a screen is resized? Is there another way?

Please let me know, I'm currently running a striped down ubuntu 10.04 x86 with fluxbox and we need to do a release ASAP!


Thanks,
RK
 
Old 07-09-2010, 09:22 AM   #2
shakazzolo
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Talking

The following simple bash script solved the problem:
Code:
#! /bin/bash

# this is the script that will start X
COMMAND="startgui.sh"
RES_BACKUP=""
RES=""
JID=""

function updateJID ()
{
 JID=`jobs | grep "$COMMAND" | grep -o -e[0-9]*\] | grep -o -e[0-9]*`
}

function getScreenRes ()
{
  RES=`su -l xuser -c "xdpyinfo -display :0| grep dimensions | grep -o -e[0-9][0-9]*x[0-9]* | head -n 1"`
}

function refreshDesktop ()
{
 echo "Updating screen to $RES_BACKUP"
 su -l xuser -c "DISPLAY=:0.0 fbsetbg -F /home/xuser/.fluxbox/backgrounds/BRN.png"
}

/etc/startgui.sh &

updateJID


while [ $JID ]
 do 
 sleep 1 
 
 # Be sure to update the loop condition variable
 updateJID
 
 # Next make sure that the screen size didn't change
 getScreenRes
 
 if [ ! "$RES" = "$RES_BACKUP" ]; then
    RES_BACKUP="$RES"
    refreshDesktop
 fi

done
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't launch scripts in terminal (ubuntu) plzhelpme Linux - Newbie 5 10-18-2009 07:49 PM
Rhythmbox window cannot be resized, takes up entire screen when launched lqv Linux - Desktop 2 06-25-2009 10:19 AM
Upgrading VBox 2.0.2 on Fedora 9 to VBox 2.0.6 fcquayso Linux - Newbie 2 12-10-2008 04:44 PM
Prg to launch apps in top of screen ? Xeratul Linux - Software 2 05-05-2007 06:35 AM
how to launch two shell scripts at once beeblequix Linux - Newbie 1 10-18-2006 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration