Description: A complete service menu to compare your files or folders with meld.
Functioning To handed the files to meld, you have two choices.
variant A Clicking the right mouse button on a file or folder using the menu item "Set file/folder" the first argument set to compare. In the background, the file/folder is stored as a variable in the /tmp directory. In another file or another folder will now be using the menu option "Compare with file/folder" is a 2-way comparison of these two starts. For this purpose, in the background, the first argument is read and compared to the currently specified. pros: - The files/folders can be located in different places. Cons: - Only a 2-way comparison. - Somewhat more complicated in the input.
variant B This variation in Dolphin initially up to three files or folders selected. With the menu item "selected comparisons files/folders" this selection is passed to meld. pros: - A 3-way comparison is possible. - Easier to enter. Cons: - The files/folders must be in the same folder.
Install
The file is dependent on meld. This can be easily installed via the package manager.
KDE Framework 5 Storage location as there are 2 paths to choose from. Copy the file to: ~/.local/share/kservices5/ServiceMenus/ (current user) or /usr/share/kservices5/ServiceMenus/ (all users)
With the command "kf5-config --path services", the paths could be checked.
KDE 4 Storage location as there are 2 paths to choose from. Copy the file to: ~/.kde4/share/kde4/services/ServiceMenus/ (current user) or /usr/share/services/ServiceMenus/ (all users)
With the command "kde4-config --path services", the paths could be checked.
Troubleshoot
Using "Download New Services" in Dolphin
The function within "Dolphin Preferences > Servives" now saves the files in another folder when you download them. Just copy the file into the desired path (~/.local/share/kservices5/ServiceMenus/ ). If the path not available, simply create a new one.
Translation If your language is not included? Please translate it and send me a message or write a comment. Then I take the language into the script.
Vote A positive assessment encourages progress to the development. Don't forget the vote please.Last changelog:
Version 0.7
Translations for French added. (Thanks to Cherkah)
Hi,
It $ARG1 should probably be escaped with quotes, otherwise paths containing spaces etc do not work.
Exec=ARG1=$(cat /tmp/meld-menu-arg1);meld "$ARG1" %U;
Otherwise works nicely, thanks.
I'm a KDE user so I don't have meld installed (I use kompare), so I made a kompare version (just find and reemplace meld with kompare).
This is the code in case yo would like to post it:
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;application/octet-stream;
Actions=setArg1;diff;_SEPARATOR_;selected;
X-KDE-Priority=TopLevel
X-KDE-Submenu=Kompare menu
X-KDE-Submenu[de]=Kompare Menü
X-KDE-Submenu[es]=Kompare menú
[Desktop Action setArg1]
Icon=kompare
Exec=echo "%U" > /tmp/kompare-menu-arg1
Name=Set file/folder
Name[de]=Setze Datei/Ordner
Name[es]=Marcar archivo/carpeta
[Desktop Action diff]
Icon=kompare
Exec=ARG1=$(cat /tmp/kompare-menu-arg1);kompare $ARG1 %U;
Name=Compare with file/folder
Name[de]=Vergleiche mit Datei/Ordner
Name[es]=Comparar con el archivo/carpeta marcado
[Desktop Action selected]
Icon=kompare
Exec=kompare %U;
Name=Compare selected files/folder
Name[de]=Vergleiche ausgewählte Dateien/Ordner
Name[es]=Comparar los archivos/carpetas seleccionadas
Thanks for the note. Unfortunately, in my opinion kompare can not compete with meld. Therefore, I also use meld and not kompare. As far as I know, by kompare is already a service menu integrated (I'm not sure it's been so long ago).
Is it advisable to take up the code here? Or is it better to set its own app? I think the latter is probably better to avoid mixing, since it deals with a different program. I can then set a reference to kompare-menu.
Regards, Roman
Hello,
first of all thank you for the advice. I will customize the menu nor accordingly.
@spikyatlinux:
At first glance, it looks simple, but your solution has a downside. When I compare folders or files, I'm not often into the same directory and have jump back and forth. Then I can not use your variant. A menu of both types, but I find good and I will implement yet.
@ msx
I do not know how the others feel, but I find it unnecessary to open another fork. This results in only confusing entries. I will merge the changes into the menu and then the menu exists twice.
Regards, Roman
Done!
The only thing I think it's left to change is the description of the ServiceMenu since it's more powerful now than the first version, I've used this description on the fork I did create, should you like it:
"A complete service menu to Meld your files and folders."
Cheers,
Martin
Sure, I planned to adjust the description, if I change the screen shots. For that I want to take more time. The functionality I want because even describe a little.
Regards, Roman
Okay, this it what I'm gonna do: I will merge your idea with the original package, this way we will have a full-featured Meld ServiceMenu.
Why merging both methods? Easy:
Scenario A) you want to Meld two or more files or directories in the same directory, just select all of them and use the appropiate ServiceMenu.
Scenario B) you want to Meld two files or directories from _different directories_ so you selecte folder/file #1, set it and then go to the other one and Meld it.
Any suggestions and comments are welcomed :)
Ratings & Comments
19 Comments
9 9 excellent
8 8 great
Hi, It $ARG1 should probably be escaped with quotes, otherwise paths containing spaces etc do not work. Exec=ARG1=$(cat /tmp/meld-menu-arg1);meld "$ARG1" %U; Otherwise works nicely, thanks.
Thanks for the hint. I'll change the code accordingly.
I'm a KDE user so I don't have meld installed (I use kompare), so I made a kompare version (just find and reemplace meld with kompare). This is the code in case yo would like to post it: [Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin MimeType=inode/directory;application/octet-stream; Actions=setArg1;diff;_SEPARATOR_;selected; X-KDE-Priority=TopLevel X-KDE-Submenu=Kompare menu X-KDE-Submenu[de]=Kompare Menü X-KDE-Submenu[es]=Kompare menú [Desktop Action setArg1] Icon=kompare Exec=echo "%U" > /tmp/kompare-menu-arg1 Name=Set file/folder Name[de]=Setze Datei/Ordner Name[es]=Marcar archivo/carpeta [Desktop Action diff] Icon=kompare Exec=ARG1=$(cat /tmp/kompare-menu-arg1);kompare $ARG1 %U; Name=Compare with file/folder Name[de]=Vergleiche mit Datei/Ordner Name[es]=Comparar con el archivo/carpeta marcado [Desktop Action selected] Icon=kompare Exec=kompare %U; Name=Compare selected files/folder Name[de]=Vergleiche ausgewählte Dateien/Ordner Name[es]=Comparar los archivos/carpetas seleccionadas
Thanks for the note. Unfortunately, in my opinion kompare can not compete with meld. Therefore, I also use meld and not kompare. As far as I know, by kompare is already a service menu integrated (I'm not sure it's been so long ago). Is it advisable to take up the code here? Or is it better to set its own app? I think the latter is probably better to avoid mixing, since it deals with a different program. I can then set a reference to kompare-menu. Regards, Roman
Nice to see that i can help you, yes you´re right youre solution is good. Thx for naming me ;-) Regards
Hello, first of all thank you for the advice. I will customize the menu nor accordingly. @spikyatlinux: At first glance, it looks simple, but your solution has a downside. When I compare folders or files, I'm not often into the same directory and have jump back and forth. Then I can not use your variant. A menu of both types, but I find good and I will implement yet. @ msx I do not know how the others feel, but I find it unnecessary to open another fork. This results in only confusing entries. I will merge the changes into the menu and then the menu exists twice. Regards, Roman
Hello Roman! As soon as you update Meld Menu I will gladly drop the fork and use your new .desktop file, just let me know :)
The update has already been made. Only the screenshot are not changed (I'll do tonight). Thanks
Done! The only thing I think it's left to change is the description of the ServiceMenu since it's more powerful now than the first version, I've used this description on the fork I did create, should you like it: "A complete service menu to Meld your files and folders." Cheers, Martin
Sure, I planned to adjust the description, if I change the screen shots. For that I want to take more time. The functionality I want because even describe a little. Regards, Roman
hey, why so difficult? I use the following code for meld, works with files and folders. for folders Quote:
[Desktop Action CompareFolder]
Exec=meld %U
Icon=meld
Name=Compare folders
Name[de]=Unterschiede in Ordnern
and for files
Quote:
[Desktop Action CompareFiles]
Exec=meld %U
Icon=meld
Name=Compare files
Name[de]=Unterschiede in Dateien
regards ;-)
So then -I presume- you just select the directories or files you want to compare and pick one of the ServiceMenu option?
Forget the above comment, works like charm, I will package a service with your method too.
Okay, this it what I'm gonna do: I will merge your idea with the original package, this way we will have a full-featured Meld ServiceMenu. Why merging both methods? Easy: Scenario A) you want to Meld two or more files or directories in the same directory, just select all of them and use the appropiate ServiceMenu. Scenario B) you want to Meld two files or directories from _different directories_ so you selecte folder/file #1, set it and then go to the other one and Meld it. Any suggestions and comments are welcomed :)
[Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin MimeType=inode/directory;application/octet-stream; Actions=CompareFiles;CompareFolder;setArg1;diff; X-KDE-Priority=TopLevel X-KDE-Submenu=Meld Menu [Desktop Action setArg1] Name=Set file/folder Name[de]=Setze Datei/Ordner Name[es]=Marcar archivo/carpeta Icon=meld Exec=echo "%U" > /tmp/meld-menu-arg1 [Desktop Action diff] Name=Diff with file/folder Name[de]=Vergleiche mit Datei/Ordner Name[es]=Diff con el archivo/carpeta marcado Icon=meld Exec=ARG1=$(cat /tmp/meld-menu-arg1);meld $ARG1 %U; [Desktop Action CompareFolder] Exec=meld %U Icon=meld Name=Compare folders Name[de]=Unterschiede in Ordnern Name[es]=Comparar carpetas [Desktop Action CompareFiles] Exec=meld %U Icon=meld Name=Compare files Name[de]=Unterschiede in Dateien Name[es]=Comparar archivos I tidied it up and added spanish translations. Here's a screenshot: http://i.imgur.com/BCg9j.png
Forked and posted here with all correspondent credits given: http://kde-look.org/content/show.php?content=155509
Nice go! I packaged it for Arch Linux: https://aur.archlinux.org/packages/kde-servicemenus-meld-menu/