Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Bash - Run command on click without waiting for previous instance
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Bash - Run command on click without waiting for previous instance
Guest English 4 fabounet [Read]
31 January 2012 à 13:43

Guest, Friday 27 January 2012 à 02:11

Hello!
I've been trying to learn how to make an applet in bash, based on demo_bash.
As an example, I did something simple, run leafpad on click.

on_click()
{
    leafpad
}


When I load it, the first time I click on it, a leafpad window appears. I click on it again (without closing leafpad), but nothing happens. However as soon as I close the first window, a second one appears, so it seems the applet is working, but waiting for the process to end.
How can I make it so it runs the command each time i click on it without waiting for the previous instance to finish?
Cheers!

fabounet, Friday 27 January 2012 à 13:04


Subscription date : 30 November 2007
Messages : 17118
Hi, and sorry I couldn't answer you on IRC, I was about to go when I read your message

the solution is actually simple, you have to add a "&" after the commande:
on_click()
{
leafpad&
}


that tells bash to continue the script.

Guest, Friday 27 January 2012 à 18:15

Hi!
I've tried that, but I get the same result, the applet waits until the first instance finishes.

Guest, Sunday 29 January 2012 à 02:53

In case someone is having this problem, fabounet solved this for me on the IRC channel:
fabounet :
you should write leafpad>/dev/null&


Thank you fabounet!

fabounet, Tuesday 31 January 2012 à 13:43


Subscription date : 30 November 2007
Messages : 17118
and I've also pushed a patch on BZR to fix this

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Bash - Run command on click without waiting for previous instance
Guest English 4 fabounet [Read]
31 January 2012 à 13:43


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Bash - Run command on click without waiting for previous instance Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.