Closed Hamspiced closed 5 years ago
The problem with using ping
for this is that it never really returns the process until you kill it. It just runs forever and never dumps the output by default. If you change your args to ["-c3", "www.google.com"]
you'll see that it now displays output because the process terminates after pinging three times and returns the result to WTF.
Turns out no matter what command is used, the widget doesn't show up at all. Re-opening until resolution.
@Hamspiced
What OS are you running on?
If it is Windows, you don't have ping
, you have PING.EXE
. Not sure the code is taking this into consideration...
# This is the correct PowerShell code (if Windows PATH is correct)
PING.EXE -n 3 google.com
Thus the cmdrunner Widget execution code must be equivalent to:
//cmd := exec.Command(widget.cmd, widget.args...)
cmd := exec.Command("PING.EXE", "-n", "3", "google.com")
(Pulled from the top of my head without testing.)
# This is the correct PowerShell code (if Windows PATH is correct) PING.EXE -n 3 google.com
Thus the cmdrunner Widget execution code must be equivalent to:
//cmd := exec.Command(widget.cmd, widget.args...) cmd := exec.Command("PING.EXE", "-n", "3", "google.com")
(Pulled from the top of my head without testing.)
OSX, Maybe its my config. IDK at this point, because some of the newer widgets that have been added i cannot get to display either, like the Spotify one.
If you want to email me your config, I'll give it a try: chriscummer@me.com
Be sure to remove any API keys, etc. that might be in it.
Found it. It's an indenting issue. Your config has the following:
cmdrunner:
args: []
cmd: "uptime"
enabled: true
position:
top: 1
left: 9
height: 1
width: 4
refreshInterval: 300
but it needs to be
cmdrunner:
args: []
cmd: "uptime"
enabled: true
position:
top: 1
left: 9
height: 1
width: 4
refreshInterval: 300
I've opened https://github.com/wtfutil/wtf/issues/389 to improve this.
is the positions the only arguments in the config that need offsets?
No, lots of them do. For example, GitHub requires repositories to be nested: https://wtfutil.com/modules/github/
If a module is not working for you, I suggest taking a look at the docs to see the config reference implementation for that module to see how it should be configured.
What problem are you having and how can we help?
I simply cannot get CMDRunner to work at all.
I have the rest of the dashboard setup fine.
However i cannot get the Cmdrunner module to display at all. even by itself. WTF runs and loads and doesnt throw any error. it just doesnt display anything.