Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom scripts don't appear to work #49

Closed
protist opened this issue May 5, 2015 · 19 comments
Closed

Custom scripts don't appear to work #49

protist opened this issue May 5, 2015 · 19 comments

Comments

@protist
Copy link

protist commented May 5, 2015

I'm attempting to use custom scripts, but I can't get them to work. Even the included scripts appear to be broken.

I've created a custom script (DataEngine > Custom scripts > Edit scripts) with command echo foo. I selected prefix = empty, active, has output, redirect = nothing and interval = 1. (I'm not entirely sure what all these options mean.) I then made the widget show $custom0. It's not clear which number matches with which script, so I also tried $custom1 and $custom2. I get no output in all cases.

Also, I tried deleting my script with DataEngine > Custom scripts > Edit scripts > Select my script > Remove, but this did nothing. The script did not disappear.

@arcan1s arcan1s self-assigned this May 5, 2015
@arcan1s
Copy link
Owner

arcan1s commented May 5, 2015

echo is a shell built-it. The correct way is to create a new file (my-script.sh) and specify path to it in Exec:

Exec=/path/to/script/my-script.sh
X-AW-Prefix=bash

Another way is the following:

Exec=\"echo test\"
X-AW-Prefix=bash -c

Also JFYI I plan to change naming and include tag name to the desktop files

@protist
Copy link
Author

protist commented May 11, 2015

Thanks for the response. I tried both methods by manually editing the desktop file at ~/.local/share/awesomewidgets/scripts, but it's still not working. I tried using $custom0, $custom1 and $custom2 again, too.

@protist
Copy link
Author

protist commented May 11, 2015

Also, as stated, I can't even get the bundled get-external-ip.desktop script to work via awesome-widgets, so I don't think it's a syntax error in my scripts or references. The command from the script (curl ip4.telize.com) works fine in isolation.

@arcan1s
Copy link
Owner

arcan1s commented May 11, 2015

ok could you please run widget as

DEBUG=yes plasmawindowed org.kde.plasma.awesomewidget

and post output here? BTW original scripts works fine for me.

@arcan1s
Copy link
Owner

arcan1s commented May 14, 2015

jfyi I plan to tag a new release on this weekend (or maybe on Monday). So it would be great if you may provide me debug information to I may fix it (if there is a bug) before the release.

@protist
Copy link
Author

protist commented May 14, 2015

Sorry, I've been a bit busy. I did try and debug, but I couldn't get it working. For a start, the terminal was spammed by this repeating output, once per second, which made it quite hard to read anything.

Secondly, I could right-click on the plasmoid, and get a context menu, but when I clicked "Awesome Window Settings…", nothing happened. I gave it a few minutes to respond.

Finally, I previously tested with Awesome Widget in a panel. I thought that perhaps I should try testing it as a stand-alone widget. However, after adding it like this, it crashed Plasma for me. FWIW, previous versions have made KDE 4 unstable for me.

@arcan1s arcan1s added bug and removed question labels May 15, 2015
@arcan1s
Copy link
Owner

arcan1s commented May 15, 2015

yeah, it creates a lot of information which will/may help me to understand if there is any error and where it is. But your case, seems that data start is missed, so could you please rerun it again, but post all data to the file and post it:

DEBUG=yes plasmawindowed org.kde.plasma.awesomewidget 2> aw.log

About context menu - if it may be reproduced, so could you please reproduce it and attach log from this case (or part of logs)? =) Usually it shouldn't be because configuration interface painting does not depend on core part and should just give you an exception in the configuration window with the error information (since all ui was written in QML).

About plasma crash - it looks interesting. There is a known issue with crash on exit caused by running child processes, which I plan to fix in the next release, but it should not affect start up. I'll try to reproduce the case.

Also what is your operation system please?

@protist
Copy link
Author

protist commented May 16, 2015

I'm trying to run the command, but for some bizarre reason, when I redirect stderr to aw.log, I'm being asked for sudo permissions. I have no idea why this would change anything. Running it without the redirect works fine (and doesn't request sudo). I'm writing to a directory that I have permissions in (and tried writing to /tmp too).

I'm using Arch Linux.

@arcan1s
Copy link
Owner

arcan1s commented May 16, 2015

Interesting. So could you please try the following:

DEBUG=yes plasmawindowed org.kde.plasma.awesomewidget 2>&1 | grep ExtScript 

It should produce less messages and should contain all what I want to see.

@protist
Copy link
Author

protist commented May 16, 2015

This also asks for sudo! Also, I re-ran the other commands, and I missed the request for sudo in the flood of text. I also tried a straight plasmawindowed org.kde.plasma.awesomewidget and this too asked for sudo!

@protist
Copy link
Author

protist commented May 17, 2015

I've also noticed that there are two entries for Awesome Widget when I try and add a new plasmoid. They are titled Awesome Widget and Desktop Panel. AFAIK I only installed awesome widget once, via the AUR package. I'm not sure if this is related.

screenshot_at_20150517_13 03 59

@arcan1s
Copy link
Owner

arcan1s commented May 17, 2015

oh, understood. Probably it asks sudo to run hddtemp/smartctl to get hdd temperature, because they require additional permissions. To avoid it you may:

  1. allow user to run cmd sudo hddtemp or sudo smartctl w\o password.
  2. disable this monitor by selecting disable (afair there was en error in the configuration with it, so I suggest you to edit ~/.config/plasma-dataengine-extsysmon.conf and place HDDDEV=disable

And yes, widget package provides three components:

  • additional backend
  • main frontend (Awesome Widget)
  • and Desktop Panel which is written in the same concept but provides another functions.

@protist
Copy link
Author

protist commented May 17, 2015

Oh interesting! I followed the second suggestion, and it launches fine without sudo now.
I already had the content of the plasmoid as 0 $custom0 1 $custom1 2 $custom2, but I opened the settings and closed them again, just in case. The output is here. Let me know if there's something more specific I should be doing.

Ah, I just read your links in the readme regarding "Desktop Panel". Apologies for not reading them earlier! However, I wonder if you might consider renaming it to something else? "Desktop Panel" sounds very generic, and not descriptive. Since you are branding as "Awesome Widget", maybe you could integrate that name into it. Anyway, just a minor suggestion!

@arcan1s
Copy link
Owner

arcan1s commented May 17, 2015

Ok, I've found a part in which there is an error. It should be already fixed in fd8f212. As a temporary fix try to avoid use interval==1 (use 2 or more).

BTW as I noted above, there was an error in configuration saving with which dataengine params GPUDEV and HDDDEV after opening configuration UI will override to NULL which means auto and all respectively.

Also thanks you for the suggestion, I'll look on second widget renaming.

@protist
Copy link
Author

protist commented May 19, 2015

Ah excellent! Yes, changing interval to 2 works perfectly. Thanks for the fix.

Also, could I please ask when you were thinking of tagging a new release, mainly for the HDDDEV issue? If it's not too soon, I'll just create a PKGBUILD for the git version.

Thanks again for all your help, troubleshooting and quick fix!

@protist protist closed this as completed May 19, 2015
@arcan1s
Copy link
Owner

arcan1s commented May 19, 2015

Unfortunately I've faced with some problems so seems the new release will not be tagged before the new weekend (again :/). Well, I've created a git PKGBUID (it builds a regular package, but from git with version fetched from git).

@protist
Copy link
Author

protist commented May 19, 2015

Okay no worries. I can wait a few days.

Do you mean the kdeplasma-applets-awesome-widgets package? If so, sorry, I was unclear. I meant a -git package that builds off the master branch, and hence contains all the fixes. No matter, I can wait eagerly. :)

@arcan1s
Copy link
Owner

arcan1s commented May 19, 2015

I meant this pkgbuild =) to provide a smooth update to the new release it is named the same as the main package (plasma5-applets-awesome-widgets)

@protist
Copy link
Author

protist commented May 19, 2015

Oh great! Thanks for that. There's just one small error in line 42, which should be cd "${srcdir}/${_pkgname}/build".

I can confirm that custom commands work perfectly in this, as does the fix for issue #47. Thanks so much for these fixes! IMO awesome widgets is now officially awesome! :D

@arcan1s arcan1s added this to the Release 2.3.0 milestone May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants