You are not logged in.

#176 2020-11-02 20:47:11

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,468

Re: Handy command-line stuff for terminals or scripts

Notice my little script does NOT use "pkill -9".

If running shut it down
If not running, start it up  smile


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#177 2020-11-03 01:33:15

sleekmason
Member
Registered: 2018-05-22
Posts: 257

Re: Handy command-line stuff for terminals or scripts

*Ouch! Just saw where I may have inferred such inadvertently. Changed to reflect the ld-hotcorners script;)

Offline

#178 2020-11-03 07:03:46

vasa1
Member
Registered: 2015-09-29
Posts: 196

Re: Handy command-line stuff for terminals or scripts

Sector11 wrote:

...
I also have a SSC.sh file to Start|Stop Conky, various ones, that might help you, adapt it for your need:

#!/bin/bash
## Original idea by: GrouchyGaijin
## This idea by: Stinkeye - Jan 2013
## With another tweak by: arclance
## Final tweak by: Sector11
## click to start, click to stop

if pgrep -f "conky -q -c /media/5/Conky/easysid/MechClock/conkyrc_clock"
then
	pkill -xf "conky -q -c /media/5/Conky/easysid/MechClock/conkyrc_clock"
else
	conky -q -c "/media/5/Conky/easysid/MechClock/conkyrc_clock"
fi

It checks to see if the conky is running:
if yes - it kills it
if no - it starts it

Worth a try. 
Remember the part inside the " " are the exact command to run the program.

Looks like the "pgrep" bit can be left out:

#!/bin/bash

pkill -xf "conky -c /path/to/conky" || conky -c "/path/to/conky"

Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

#179 2020-11-06 22:08:11

ohnonot
...again
Registered: 2015-09-29
Posts: 5,005
Website

Re: Handy command-line stuff for terminals or scripts

sleekmason wrote:

What does the -9 do?

http://turnoff.us/image/en/dont-sigkill.png


Search youtube without a brwoser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#180 2020-11-07 02:27:50

sleekmason
Member
Registered: 2018-05-22
Posts: 257

Re: Handy command-line stuff for terminals or scripts

ohnonot wrote:
sleekmason wrote:

What does the -9 do?

http://turnoff.us/image/en/dont-sigkill.png

Ha!  This is good:)

Offline

Board footer

Powered by FluxBB