You are not logged in.

#1 2012-02-16 17:30:53

stonix_015
Member
Registered: 2012-02-13
Posts: 20

Scipt which starts a Program only when another program is running

Hello again.
I want to activate compiz-fusion, but reactivate kwin when playing games on wine (caus fps will break down very hard when compiz is running).

Ive read lots of forums and tutorials and scripted this scipt, which runs fine and smoothy.
BUT when he activates for example "kwin --repalce", the output from kwin blocks further walking thrugh the script and it "hangs"
Do anyone of you has ideas to solve my problem. I welcome completly other ideas of solving my quest, too.
Thanks a lot !

#!/bin/bash
while [ '1' = '1' ]
do

  if [ $( ps aux | grep -c wineserver ) = '1' ]
  then
  #WINE LÄUFT NICHT   
    if [ $( ps aux | grep -c compiz ) = '1' ]
    then 
      echo Wine lauft nicht und compiz soll gestartet werden
      compiz --replace --sm-disable --ignore-desktop-hints ccp
    fi

  else
  #WINE LÄUFT 
    if [ $( ps aux | grep -c kwin ) = '1' ]
    then
      echo Wine lauft und kwin soll gestartet werden
      kwin --replace
    fi
  
  fi
  sleep 2

done

Last edited by stonix_015 (2012-02-16 19:59:06)

Offline

#2 2012-02-16 17:41:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Scipt which starts a Program only when another program is running

Not sure which tutorials did you read, but have a look at pgrep. It won't help you with 'kwin --replace', but will make your script nicer.


Please use [ code ] tags for posting snippets of code.

like this

Offline

#3 2012-02-16 20:39:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,334

Re: Scipt which starts a Program only when another program is running

pmd wrote:

This can solve your problem:

kwin --replace &

But I'm not sure if it will smile

If you are wondering where your post went; It seems you hit the 'report' link, not the 'reply' link.  smile  (about 15 minutes ago)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2012-02-18 12:36:09

stonix_015
Member
Registered: 2012-02-13
Posts: 20

Re: Scipt which starts a Program only when another program is running

kwin --replace & 

was my first idea, but didint helped. Dont now why, i think "start process in background" does have another meaning then "start process and go further in this script"

Offline

Board footer

Powered by FluxBB