Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Xswitch - a script to easily run applications in another xserver

  1. #1
    Join Date
    Feb 2006
    Beans
    143

    Xswitch - easily run applications in another xserver

    This script tries to make it as easy as possible to run applications in another xserver - just add "xswitch" before a program's name - up to eleven at a time - and it will be automatically started in a new xserver. Plus, when the program exits you won't be stranded in the grey void of an empty xserver - you'll be prompted as to how to get back to your original desktop.

    It also has the ability to shut down the old xserver after starting the new, making it useful for setting up minimal gaming desktops. For example, the command
    Code:
    xswitch -s gnome-terminal metacity nautilus
    starts up a terminal, window manager and file-manager and then, because of the -s flag, shuts down the original xserver.

    You can also run more then two xservers - the "-d" flag to specifies which display they are started on. "1" is the first display after you current desktop (tty 7), "2" the second and so on.

    To install, grab the script, download it to your home directory, and enter the following command in a terminal:

    Code:
    sudo tar -xvvzf xswitch_0.9.tar.gz -C /usr/bin/
    You'll also need to have zenity installed, so if you haven't,
    Code:
    sudo apt-get install zenity
    A word of thanks - credit for this goes to cogadh, as this script is largely an automated version of his discoveries in this thread .

    ############
    # Other stuff #
    ############

    If you use a program with either spaces in the name or command line arguments, surround it in quotes, like this -
    Code:
    xswitch "winefix -d 1 /home/jack/.wine/drive_c/Program Files/df_suba/dwarfort.exe" metacity
    If a program is using the one after it as a command line argument, add two quotes ( "" ) between them.

    When the script is first started, unless you've run multiple xservers before, the first thing you'll see is this:



    Answer yes and the script will change a line in /etc/X11/Xwrapper.config that allows xservers to be started without root permissions, and then immediately changes it back after a xserver is launched. If you never want to be bothered by it again, though, just edit the file yourself and change the line "allowed_users=console" to "allowed_users=anybody".
    If you answer no, you will still be able to launch xservers - just as root. The other method is recommend.

    Let me know if there are any bugs or problems.

    Full command line options:
    [CODE]-c Specify a custom xorg.conf to use with new xservers.
    -d Specify the tty used to display the new xserver.
    -s Set to stop the display manager after a new xserver
    is executed. Supports both GDM and KDM.
    -u Display this usage message.

    #############
    # Useful apps #
    #############

    If you experience screen flickering or would like to move windows around, add a window manager:
    metacity
    xfwm4

    If you'd like to bring theme settings along:
    gnome-settings-daemon
    xfce-mcs-manager

    Light file managers:
    thunar
    pcmanfm

    Screens:
    1) Geany and Metacity - Oh, the wild abandon!
    2) Compiz, terminal, and a random Wine app.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by deadlydeathcone; June 15th, 2008 at 04:49 AM. Reason: New version 0.9

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Beans
    61

    Re: Xswitch - a script fpr easily running applications in another xserver

    so um...where can i download this from?

  3. #3
    Join Date
    Feb 2006
    Beans
    143

    Re: Xswitch - a script to easily run applications in another xserver

    Oh... right. That's probably important.

    Here you go.

  4. #4
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Beans
    61

    Re: Xswitch - a script to easily run applications in another xserver

    Thanks

  5. #5
    Join Date
    Feb 2006
    Beans
    143

    Re: Xswitch - a script to easily run applications in another xserver

    I uploaded a new version with one change - it now, when run via terminal, doesn't spam it like crazy with status messages. Sorry about that.

  6. #6
    Join Date
    Mar 2007
    Location
    Michigan
    Beans
    6
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Xswitch - a script to easily run applications in another xserver

    I have Wow running with winefix and a nice value of 10, and have a couple of questions about the program Xswitch to go with it. Does it only work with Nvidia cards or Ati also? Also when you run Xswitch is it still possible to change the nice value? I've tried to get it to work a few times this morning, and says Wow cannot start 3d rendering. I have ati X330 video card.

    Thanks,
    Joseph

  7. #7
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Xswitch - a script to easily run applications in another xserver

    Hi there

    I love your work with Winefix, and discovered this is an awesome script too! Especially for playing fullscreen games on one monitor, whilst having a dual monitor setup for desktop work. However, I have a couple of requests:

    1) would it be possible to include a commandline option to suppress the "Ctrl Alt Backspace" message? this is the only reason I see for loading a window manager in a new fullscreen X, it would be handy to just not have it

    2) is it possible to specify a different xorg.conf for the new X server? as above, useful for dual screen desktop, but single screen games

    at the moment, i'm using this script to overcome it (eg: unreal tournament)
    Code:
    #!/bin/bash
    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
    sudo cp /etc/X11/xorg.conf-single /etc/X11/xorg.conf
    xswitch "nvidia-settings --load-config-only" metacity /home/superjamie/ut/ut
    sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
    but it's not particularly ideal

  8. #8
    Join Date
    Jul 2007
    Beans
    28
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Xswitch - a script to easily run applications in another xserver

    This is great THANX!!!!

    When I start a second Xserver for gaming and switch back to my first (Original) Xserver I am able to hear sound from the 2nd Xserver on the first Xserver, but I am unable to hear sound from the 1st Xserver on the 2nd Xserver.

    Anyone know of a way to get the sound from my 1st Xserver to play on the 2nd Xserver???

    I need to be able to hear Email notification sounds.

    Update!!! ################################################## #################

    I found a Deb package here on ubuntuforums that fixed my problems with sound not passing in both directions between the two Xservers.

    Not really sure how or why this fixed the issue, but I have tested it on 3 different computers and if fixed the sound on all three.

    The PulseAudio Deb package can be found here
    http://ubuntuforums.org/showthread.php?t=759147
    Last edited by biriachan; August 11th, 2008 at 07:45 PM. Reason: Found a Fix

  9. #9
    Join Date
    Feb 2006
    Beans
    143

    Re: Xswitch - a script to easily run applications in another xserver

    Hello everyone, sorry for my extended absence. My computer died and I haven't been able to get on the forums for a while.

    Long overdue answers:

    Joebob06 - It's still possible to change the nice value when using winefix along with this script. I don't have an ATI card to test with, but Nvidia cards work perfectly.

    Super Jamie - Thanks for the encouraging words! I added a command line option to use custom xorg.conf files in the new version. Use it like this:
    Code:
    xswitch -c "path/to/xorg.conf" gamefoo
    . If the file's already in the /etc/X11 folder you can omit the full path.

    biriachan - I think that's a pulseaudio problem, as it by default publishes the audio output of applications to their parent xserver. I'll try to figure out how to fix it sometime soon, as it IS pretty annoying.

  10. #10
    Join Date
    Apr 2008
    Beans
    61

    Re: Xswitch - a script to easily run applications in another xserver

    I have been trying to run this: xswitch "winefix C:\Program Files\World of Warcraft\Launcher.exe" and have been getting this
    "/usr/bin/xswitch: line 276: nvidia-settings: command not found" Anyone know what is causing that?

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •