Registered Member
|
I am trying to write a service menu that can search directories for RAR files. I placed the .desktop file in /usr/share/kde4/services/ServiceMenus/ but it does not show up. Where did I go wrong? Here is the contents of the .desktop: http://pastebin.com/2Uubw2vZ
Last edited by Xplorer4x4 on Sun Jun 24, 2012 5:08 pm, edited 1 time in total.
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Registered Member
|
Ok so I realized that the .desktop needed to be in ~/.kde/share/kde4/services/ServiceMenus/ but I am still having trouble with the exec line. I assume I need to change it to first launch Konsole then execute the command but I am not sure how I would do that.
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
For the command, you probably want to alter it to look like this first:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Sorry I forgot to update this with the solution(too much going on today) but here is what the guys on kubuntuforums came up with:
However I have not had time to look in to it, but is it possible to have Konsole only hold/keep the session open if there is an error but close on a sucesful out put? I was also hoping to make it compatible with split archives using the naming scheme of part 01.rar part02.rar and so on but have no idea how to include an if/else type check here.
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
The option "--hold" or "--noclose" may be helpful here.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Aren't those redundant? As you can see I am using --hold currently and that holds the windows open when the process is complete. 1. I also have some more service menu questions, is the Exec line simply bash commands like you would enter in Konsole? 2. Is it possible to execute commands from the exec line in a progressive matter? For example you select 4 folders with split RAR archives. I assume I would need to use ark directly rather then unrar? Would I need to resort to executing a shell script instead? 3.Where is the "move to trash" context menu entry located? I can't seem to find it.
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
Yes, --hold and --noclose are redundant and do the same job. Unfortunately I did not see them in your command when I mentioned it. Sorry about that.
For 1) I am not aware of the exact conditions, but it very possibly is executed under a shell. You would have to test to confirm this (and if it is not, explicitly requesting a shell should work fine). For 3) I believe this is a programmed in action, and does not use the service menus framework to function. For 2) If you had access to a full shell, using '&&' in between each command should achieve this, as long as each command does not fork (in which case, it will execute the next action when it forks). In regards to split archives, I believe if you give unrar the first archive (.001 usually I think) then it will find the other ones as well, if they are in the same directory automatically.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
As for --hold and --noclose, no worries I just wanted to check. 1.Ok I will test something basic tomorrow and see what I can come up with. 2. I am aware of & and && but I am not sure it would work with the command above based on the way it functions. Obviously "sudo apt-get update && sudo apt-get upgrade works fine, but we are dealing with a single action at a time. 3(trash).I have installed one of the "root actions" service menu and the only thing it lacks is a move to recycle bin. Thinking about it though, this would move it to the recycle bin(sorry trash can, after ages of windows usage it sticks in your head ) for the user root rather then my users recycle bin, correct?
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
For the Trash action, yes that would be correct - it would use root's trash folder.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell