![]() Registered Member ![]()
|
I have a Service menu entry that executes a script . The script creates a directory based on a imgur album url and download the images to it. I did not create the script. The servicemenu entry basically makes it easy for me to right-click and execute the script in the current directory with an imgur url in klipper.
I like the notification dialog that appears in the tray icon which shows a download/copy progress with the number of files, download speed and when it's complete. I'd like to add that to the script but I don't know how. I tried "kiolient download" to replace "curl -so" in the download portion of the code and it worked to an extent. I got the file file dialog for each and every image in the imgur album with the correct filenames. I just want it to download silently without user intervention. How can I make this possible? Ideally, this is the kind of notification i'm referring to. http://i.imgur.com/9GkfE.jpg album url to work with: http://imgur.com/a/hJr2R albumr.sh https://github.com/nkouevda/albumr/raw/master/albumr.sh this is the portion i changed:
Service menu entry http://pastebin.com/CAP7kuny
All answers are all replies, but not all replies are answers.
|
![]() Administrator ![]()
|
Do you have "File transfers and jobs" checked in the Notifications applet settings?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I don't see that option available. I'm using KDE 4.9.2. I right-clicked on system tray settings and looked at "entries".
All answers are all replies, but not all replies are answers.
|
![]() Administrator ![]()
|
You have probably ended up in the System Tray applet settings rather than the Notification applet settings. Can you please double check? (I was having trouble accessing it yesterday - expanding a notification and right clicking on that was more reliable - although it has been behaving today).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Yes "File transfers and jobs is checked. how can i incorporate it into my script though?
All answers are all replies, but not all replies are answers.
|
![]() Administrator ![]()
|
Your script should automatically incorporate it - assuming it has D-Bus / X access, which if it is invoked from service menus, it should have.
For me, I tested this by running the following in Konsole, which did lead to the behaviour you desired. Note: only large files seem to trigger the progress bar, small files get a small pause before a download complete notification is shown.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I'm trying to bypass the save as kdialog altogether and have the file automatically save to the directory the script(via service menu) was ran from(i think like this : %f). I notification is the intended effect but the dialog is what I want to avoid.
All answers are all replies, but not all replies are answers.
|
![]() Administrator ![]()
|
You probably want "kioclient copy" instead then.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
i tried from my ~/tmp folder and it saved the file as "%f" .. How can I save it to the current folder the command was launched from with the original filename? How can I incorporate it into this script?
All answers are all replies, but not all replies are answers.
|
![]() Administrator ![]()
|
If you pass "./filename.ext" then it should save it in the current directory as intended (assuming you want to name it filename.ext)
Otherwise, you can lookup the current working directory using the "pwd" command and generate a absolute path with that output.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]