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,479

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
From: Ozarks
Registered: 2018-05-22
Posts: 359
Website

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: 204

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,153
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 browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

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

sleekmason
Member
From: Ozarks
Registered: 2018-05-22
Posts: 359
Website

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

#181 2020-12-11 18:30:27

sleekmason
Member
From: Ozarks
Registered: 2018-05-22
Posts: 359
Website

Re: Handy command-line stuff for terminals or scripts

Made this bit to find which window manager to display in Conky.

wmctrl -m | head -n1 | cut -d" " -f2

Offline

#182 2020-12-11 20:37:05

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 856

Re: Handy command-line stuff for terminals or scripts

How do you manage the need to run as root or with sudo, when in conky?


// Regards rbh

Online

#183 2020-12-11 21:17:02

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

Re: Handy command-line stuff for terminals or scripts

rbh wrote:

How do you manage the need to run as root or with sudo, when in conky?

It comes down to being able to execute commands with superuser privileges without the need of entering a password (interactively).
Several approaches exist: with PAM I guess, or with adding certain commands to your sudoers config files under /etc.
For the latter, see: https://wiki.archlinux.org/index.php/Su … le_entries


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

Offline

Board footer

Powered by FluxBB