Page 4 of 4 FirstFirst ... 234
Results 31 to 37 of 37

Thread: [SOLVED] Turning off Compiz for Games Script

  1. #31
    Join Date
    Nov 2007
    Location
    india
    Beans
    485
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [SOLVED] Turning off Compiz for Games Script

    Quote Originally Posted by anotherdisciple View Post
    ... and yes, the sleep 3 after compiz --replace & is necessary. Without it... the terminal closes before it gets a chance to switch to compiz.... weird eh?
    in my system, i am not facing this problem ; maybe mine is a bit faster.

    Quote Originally Posted by anotherdisciple View Post
    The good news is that your script works... the bad news.... well.. it does the same thing as killall gnome-terminal! I opened a few gnome-terminals just to test it.... it killed all of them... not just the one I ran the script in. Any more ideas on how to sort it even further?
    i already tested this script before testing, and i retested now..it works man ; only the parent terminal is closed, not the others...theres no logic for closing others.

    and yes, $$ means the pid of the current process.

  2. #32
    Join Date
    Oct 2007
    Location
    USA - Indiana
    Beans
    557
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [SOLVED] Turning off Compiz for Games Script

    hmmm... you opened more than one terminal? Maybe it has something to do with how the gnome-terminal works. When I open two gnome-terminals and check my processes.... it has created 2 new bash processes and 1 terminal process.... so when we are filtering out the terminal... it closes all of them... because they both run under the same id. Even if I close only one terminal id... it closes all gnome-terminals.

  3. #33
    Join Date
    Feb 2007
    Location
    Germany, Nuremburg
    Beans
    1,019
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [SOLVED] Turning off Compiz for Games Script

    Quote Originally Posted by anotherdisciple View Post
    hmmm... you opened more than one terminal? Maybe it has something to do with how the gnome-terminal works. When I open two gnome-terminals and check my processes.... it has created 2 new bash processes and 1 terminal process.... so when we are filtering out the terminal... it closes all of them... because they both run under the same id. Even if I close only one terminal id... it closes all gnome-terminals.
    Did anybody try to kill one bash process?
    ... put your money where your mouth is ...
    stop sustaining Microsoft (and its pet named Apple)!
    Use the Thanks-button if you feel like!

  4. #34
    Join Date
    Oct 2004
    Beans
    166

    Re: [SOLVED] Turning off Compiz for Games Script

    Why does this have [SOLVED] on it.. I can't see a completd solution here yet.. ?


    It's a great idea... I'd love to try it out...
    Ubuntu 9.10

  5. #35
    Join Date
    Oct 2007
    Location
    USA - Indiana
    Beans
    557
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [SOLVED] Turning off Compiz for Games Script

    Well, It was solved in my mind. I was fine with it closing all of the gnome-terminals that were open.

    Here is the final script that closes all the terminals...

    Code:
    #!/bin/bash
    
    read -p "What game would you like to play?" GAME
    metacity --replace &
    sleep 1
    $GAME
    compiz --replace &
    sleep 2
    killall gnome-terminal
    If you don't want to run a terminal and just want to have a GUI change it to use zenity for the gui...

    Code:
    #!/bin/bash
    GAME=$(zenity --entry --title "Game Runner" --text "What game would you like to play?)
    metacity --replace &
    sleep 1
    $GAME
    compiz --replace &
    sleep 2
    exit 1
    Let me know if any of that doesn't work for you.

  6. #36

    Re: [SOLVED] Turning off Compiz for Games Script

    I do not use compiz, just normal metacity but i use this script for playing games (just named it 'game' )

    Code:
    #! /bin/sh
    
    [ -x "`which aoss`" ] && aoss=aoss
    if [ -x "`which gnome-screensaver-command`" ]; then
    	gnome-screensaver-command -i &
    	inhibit=$?
    fi
    
    loadkeys -c -u -s us
    setxkbmap -symbols "pc(pc105)+us"
    synclient touchpadoff=1
    
    $aoss "$@"
    
    xgamma -gamma 1
    synclient touchpadoff=0
    setxkbmap -symbols "pc(pc105)+us(intl)+group(alts_toggle)"
    loadkeys -c -u -s us-intl.iso15
    
    [ -n "$inhibit" ] && kill $inhibit
    Seems some games have problems with non-us keyboard layouts or deadkeys.

  7. #37
    Join Date
    May 2007
    Beans
    3

    Re: [SOLVED] Turning off Compiz for Games Script

    Nobody figured this out ?

Page 4 of 4 FirstFirst ... 234

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •