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

Thread: how to run program after program?

  1. #1
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default how to run program after program?

    Hi there everyone. I've installed an utility for monitoring web traffic ,called WebScarab. I've set in firefox to use it as proxy server and now I have to start WebScarab before I can start the browser, which is ok, but now I would like to make a shortcut on my desktop, which would first start WebScarab and then firefox, to automate the process. I tried entering the command of the shortcut like this
    Code:
    java -jar "/home/arcull/WebScarab/webscarab.jar" && firefox %u
    but it doesn't work, browser doesn't start. Please help, thanks in advance.

  2. #2
    Join Date
    Jan 2010
    Location
    Albany, NY USA
    Posts
    118

    Default Re: how to run program after program?

    Oh I think you're problem is that it's not running the commands asynchroniously, so it is waiting for the first one to finish. I guess I'm not too sure how to do it in one command, you probably need an & somewhere though and I don't know how to fit it in one command.

    Have you tried launching from a bash script? That's generally my go to solution for launchers, I find they're pretty simple and flexible (i.e. if you need to set environmental variables, or the starting directory, etc. you can). here maybe:

    Code:
    #!/bin/bash
    
    java -jar "/home/arcull/WebScarab/webscarab.jar" &
    firefox
    Actually I don't know what the %u in the command you gave does, so I don't know where it would go. Here the & is what makes the first one run as a different process.

    Then you save it as FILENAME, and for the command in the launch you either use:
    Code:
    sh FILENAME
    or else you first use
    Code:
    chmod +x FILENAME
    from the command line and use as a launch command just
    Code:
    FILENAME
    Hope that helps, there is almost certainly a way to get it into one command also I just don't know what it is.

    Malcolm

  3. #3

    Default Re: how to run program after program?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    The '&&' doesn't work the way you expect it to. Try replacing the '&&'
    with just '&' and I think it will be a little better for you.

    Good luck.





    On 09/11/2010 07:06 AM, arcull wrote:
    >
    > Hi there everyone. I've installed an utility for monitoring web traffic
    > ,called WebScarab. I've set in firefox to use it as proxy server and now
    > I have to start WebScarab before I can start the browser, which is ok,
    > but now I would like to make a shortcut on my desktop, which would first
    > start WebScarab and then firefox, to automate the process. I tried
    > entering the command of the shortcut like this
    > Code:
    > --------------------
    > java -jar "/home/arcull/WebScarab/webscarab.jar" && firefox %u
    > --------------------
    > but it doesn't work, browser doesn't start. Please help, thanks in
    > advance.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJMi4orAAoJEF+XTK08PnB5wnYQAKlcFh8q7Vq2wEc6kMJflJT7
    kIoVzXwdBVcq99BZ1NVOrcCNjNwAG8Fdb6THkEeZqAKXQT1CanvNlH80+E6PUaGp
    fvI39sqhh3VTfsP0L0PLRfuJlwJk/15GK58NNJjDm+YBcVnuBISDscVKAXfqXrwS
    Mfp9JlvnH6BH1qjumgH9pmkTo4GJQCEeGfJfK5ldHp0cvsNDhz3eZsf6Eae0GEA/
    y7sUNgtJo87y8XsQ94T/x0soykYqzn+zk+m69xLS9rwEyzN/aIztxFM3FI3EDBu8
    6WDwGY8TFh6GVDEWKlV3IG0yqblcehftpPhbzFXXwJxY52SZa69UlwtvlJpEq+Nj
    Zo2U/FUzmwbl8XH7WzvDZ2Ss0BDZJK39cpj2DCCr6GNWAg8BQBXi+KnfWbisGP93
    roFnHlKMY4caVe6AjfBxF3i4UBApzZYdLAT4RElHI7gahvLSl1ZjZiqIEM5spnXB
    bSoNoJi2bVX0w85wCqfNEICpN8TacUSH8se6LBprrT24WIvkUp0l69YQPcR1VGsV
    YmFUoZ/lsOcZcWOnqN+N0EtW8GwiYWGrGuKowlRWeI+rOC49KgNRftv7J+EAGYpV
    707gE2rLEyzyX87bZsVxkP33u85iogwhVMzrysiDQeuhdj4c/eXG/23A+ZURuidU
    n8IuFwP48O2xBDht98ZM
    =MNVW
    -----END PGP SIGNATURE-----

  4. #4
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default Re: how to run program after program?

    i tried writing a script with
    Code:
    #!/bin/bash
    
    java -jar "/home/arcull/WebScarab/webscarab.jar" &
    firefox
    as malcolm81 suggested, and then run the script on the shortcut. The results are better, but still not perfect. The problem seems, that starting up WebScarab takes more time than starting up firefox, therefore firefox shows up first, saying it can not connect to proxy. So I guess I should include a few seconds of delay between both commands. So I tried like this
    Code:
    #!/bin/bash
    java -jar "/home/arcull/WebScarab/webscarab.jar" &
    sleep 5 &
    firefox
    but still no go Additional help appreciated

  5. #5
    Join Date
    Jan 2010
    Location
    Albany, NY USA
    Posts
    118

    Default Re: how to run program after program?

    try

    Code:
    #!/bin/bash
    java -jar "/home/arcull/WebScarab/webscarab.jar" &
    sleep 5
    firefox
    without the & after sleep. You want those run in succession, not asynchroniously (they are both starting at the same time in the original.)

    Malcolm

  6. #6
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default Re: how to run program after program?

    malcolm81

    try

    Code:

    #!/bin/bash
    java -jar "/home/arcull/WebScarab/webscarab.jar" &
    sleep 5
    firefox

    without the & after sleep. You want those run in succession, not asynchroniously (they are both starting at the same time in the original.)

    Malcolm
    Works ok, thanks Is there any switch available to run an app minimized? In my case, I would prefer webscarab starting minimized. Thanks again.

  7. #7
    Join Date
    Jun 2008
    Location
    Berlin
    Posts
    2,061

    Default Re: how to run program after program?

    That depends on the windowmanager you use. In case of KWin / KDE it would be

    Code:
    kstart --iconify $command

  8. #8
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default Re: how to run program after program?

    gropiuskalle

    That depends on the windowmanager you use. In case of KWin / KDE it would be

    Code:

    kstart --iconify $command
    I don't know which windowmanager I have I have suse 11.2 with gnome. If I try to run
    Code:
    kstart --iconify nautilus
    it runs nautilus but not minimized. Need more help

  9. #9
    Join Date
    Jun 2008
    Location
    Berlin
    Posts
    2,061

    Default Re: how to run program after program?

    I am not sure there's a likewise command for GNOME / Metacity, but there's a tool called →Devil's Pie which obviously lets you manage it in a convenient way, so give it a shot.

  10. #10
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: how to run program after program?

    Have a look at

    Code:
    man xinetd
    and use xinetd to start webscarab whenever it is needed.
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

Page 1 of 2 12 LastLast

Posting Permissions

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