Skip to main content
Elaboration, small grammatical fixes.
Source Link

So, my situation is this: I have created a launcher, key bindings and an alias that opens GLava and C*MusCMus in a drop-down terminal at the same time, using this shell script:

    #!/bin/bash

c=$(ps -e | grep -c xfce4-terminal)

if [ $c -gt 0 ]
    then
        xfce4-terminal --tab --drop-down -x cmus | glava --desktop & $1
    else
        xfce4-terminal --drop-down -x cmus | glava --desktop & $1
fi

It is perfect and glorious, but for one small problem. I'd very much like for both programs to also CLOSE at the same time. Is there a way to have one programsprograms' termination trigger another? Specifically, if I have CMus and GLava open, I'd like to be able to close CMus (say, by simply pressing 'q' and quitting CMus or by closing the terminal, or killing the program, OR a special key binding, etc.) and have GLava immediately close/terminate as well. As it stands, I have a separate key binding to pkill GLava after I've closed CMus, which works fine, I suppose, but is certainly a little clunkier than I'd like. Maybe there's a way for GLava to only get triggered if CMus is running, a sort of whitelist maybe? A simple shell that closes both programs that I can bind? Or another thought perhaps? I'm open to any suggestions, being the noob that I am. Any help is much appreciated.

So, my situation is this: I have created a launcher, key bindings and an alias that opens GLava and C*Mus in a drop-down terminal at the same time, using this shell script:

    #!/bin/bash

c=$(ps -e | grep -c xfce4-terminal)

if [ $c -gt 0 ]
    then
        xfce4-terminal --tab --drop-down -x cmus | glava --desktop & $1
    else
        xfce4-terminal --drop-down -x cmus | glava --desktop & $1
fi

It is perfect and glorious, but for one small problem. I'd very much like for both programs to also CLOSE at the same time. Is there a way to have one programs termination trigger another? Or another thought perhaps? I'm open to any suggestions, being the noob that I am. Any help is much appreciated.

So, my situation is this: I have created a launcher, key bindings and an alias that opens GLava and CMus in a drop-down terminal at the same time, using this shell script:

    #!/bin/bash

c=$(ps -e | grep -c xfce4-terminal)

if [ $c -gt 0 ]
    then
        xfce4-terminal --tab --drop-down -x cmus | glava --desktop & $1
    else
        xfce4-terminal --drop-down -x cmus | glava --desktop & $1
fi

It is perfect and glorious, but for one small problem. I'd very much like for both programs to also CLOSE at the same time. Is there a way to have one programs' termination trigger another? Specifically, if I have CMus and GLava open, I'd like to be able to close CMus (say, by simply pressing 'q' and quitting CMus or by closing the terminal, or killing the program, OR a special key binding, etc.) and have GLava immediately close/terminate as well. As it stands, I have a separate key binding to pkill GLava after I've closed CMus, which works fine, I suppose, but is certainly a little clunkier than I'd like. Maybe there's a way for GLava to only get triggered if CMus is running, a sort of whitelist maybe? A simple shell that closes both programs that I can bind? Or another thought perhaps? I'm open to any suggestions, being the noob that I am. Any help is much appreciated.

Source Link

Is there a way to trigger the closing of one program by closing another? A shell script perhaps?

So, my situation is this: I have created a launcher, key bindings and an alias that opens GLava and C*Mus in a drop-down terminal at the same time, using this shell script:

    #!/bin/bash

c=$(ps -e | grep -c xfce4-terminal)

if [ $c -gt 0 ]
    then
        xfce4-terminal --tab --drop-down -x cmus | glava --desktop & $1
    else
        xfce4-terminal --drop-down -x cmus | glava --desktop & $1
fi

It is perfect and glorious, but for one small problem. I'd very much like for both programs to also CLOSE at the same time. Is there a way to have one programs termination trigger another? Or another thought perhaps? I'm open to any suggestions, being the noob that I am. Any help is much appreciated.