Results 1 to 8 of 8

Thread: How to change workspaces using the terminal

  1. #1
    Join Date
    Oct 2008
    Beans
    48

    Question How to change workspaces using the terminal

    Hey guys, got a noob question for you. How do you use the terminal to change to a different workspace. I am writing some .sh shell scripts to run some commands I need. The problem is they both run continuously so I would like to have them both open in two different workspaces. Any clue on how to do this???

    Thanks

  2. #2
    Join Date
    Jan 2008
    Beans
    6

    Re: How to change workspaces using the terminal

    It sounds like what you really want to do is run them in the background

    the following script would print "hi" very quickly...

    Code:
    longCommand1&
    longCommand2&
    echo "hi"
    the & instructs the shell to run the process in the background and not wait for it to terminate.

  3. #3
    Join Date
    Oct 2008
    Beans
    48

    Re: How to change workspaces using the terminal

    If I run the process in the background how do I pull it up to see what it is doing ex. my script will be running commands verbosely so I would like to see some of that output

  4. #4
    Join Date
    Nov 2008
    Beans
    92

    Re: How to change workspaces using the terminal

    you're looking for wmctrl

  5. #5
    Join Date
    Oct 2008
    Beans
    48

    Re: How to change workspaces using the terminal

    im having some trouble getting wmctrl to work the way a would like it to, it seems to work on a basis of having multiple "Desktops" not so much for workspaces. I dont belive that this program has full support for what I need, I even had problems getting it to maximize a window. Any suggestions?

  6. #6
    Join Date
    Nov 2007
    Location
    Belgium
    Beans
    119

    Re: How to change workspaces using the terminal

    Try using GNU screen (I think it's installed by default) or just use a tabbed terminal emulator. Heck, you could even use your virtual terminals if you want (Ctl+Alt+F* and replace * with a number from 1 to 6).

  7. #7
    Join Date
    Jan 2008
    Beans
    6

    Re: How to change workspaces using the terminal

    Quote Originally Posted by Blackdragon1400 View Post
    If I run the process in the background how do I pull it up to see what it is doing ex. my script will be running commands verbosely so I would like to see some of that output
    You could redirect the output. e.g.
    Code:
    chris@serenity:~$ cat blah.sh
    sleep 2
    echo "hi"
    sleep 2
    echo "hi again"
    exit
    Code:
    chris@serenity:~$ sh blah.sh>blah.txt &
    [2] 31827
    chris@serenity:~$ tail -f blah.txt
    hi
    hi again
    Take a look at the TLDP documentation for Bash I/O redirection if you need to do something fancier.

  8. #8
    Join Date
    May 2007
    Location
    Canada
    Beans
    581

    Re: How to change workspaces using the terminal

    Actually, if you are using compiz, there is a way to do this... First write your shell scripts so that each separate process opens in a specific terminal (in gnome, you can create terminal profiles with unique names). The command to run a script in a specific terminal would look like this:
    Code:
    gnome-terminal --window-with-profile=asdf
    Then in compiz, use the place plugin to place that window in a specific viewport... then everytime you run your shells, the new terminal windows will automatically be placed where you want them..


    hope I explained this ok...good luck


    64-Bit Ubuntu! Join the future of computing.

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
  •