You are not logged in.
Hi,
I'm trying to customize https://store.kde.org/p/1541201 (there's a link to the source) so that it offers the possibility to temporarily store 2 files or directories to perform a 3-way comparison in the end. Currently I have the following in ~/.local/share/kio/servicemenus/compare-using-meld.desktop:
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;application/octet-stream;
Icon=org.gnome.meld
Actions=a_setArg1;b_setArg2;c_diff;
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false
X-KDE-Submenu=Compare using meld
X-KDE-Submenu[de]=Mit meld vergleichen
[Desktop Action a_setArg1]
Icon=document-compareleft
Exec=echo "%U" > /tmp/meld-menu-arg1; echo "" > /tmp/meld-menu-arg2
Name=Mark for use in left column
Name[de]=Für linke Spalte merken
[Desktop Action b_setArg2]
Exec=echo "%U" > /tmp/meld-menu-arg2
Name=Mark for use in middle column
Name[de]=Für mittlere Spalte merken
[Desktop Action c_diff]
Icon=document-compareright
Exec=ARG1=$(cat /tmp/meld-menu-arg1); ARG2=$(cat /tmp/meld-menu-arg2); meld "$ARG1" "$ARG2" %U; rm -f /tmp/meld-menu-arg1; rm -f /tmp/meld-menu-arg2;
Name=Mark for use in right column and open meld
Name[de]=Für rechte Spalte merken und vergleichen
The idea was to have $ARG2 with an empty string if only left and right were selected. When I start meld in console with 2 folders as arguments it doesn't matter how many spaces are between those 2. Therefore any number of spaces caused by $ARG2 shouldn't matter.
The above works well for 3-way merges, but not for 2-way merges with left and right column:
- when I select files for left and right column, meld doesn't open up at all
- when I select folders for left and right column, the parent directoy of the right folder shows up in the middle pane in addition to the 2 selected folders
I have never worked with dolphin actions, yet. Has anyone any idea what could be wrong?
Last edited by myscha (2023-01-14 19:15:06)
Offline
Solved with
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;application/octet-stream;
Icon=org.gnome.meld
Actions=a_setArg1;b_setArg2;c_diff;
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false
X-KDE-Submenu=Compare using meld
X-KDE-Submenu[de]=Mit meld vergleichen
[Desktop Action a_setArg1]
Icon=document-compareleft
Exec=echo "%U" > /tmp/meld-menu-arg1;
Name=Mark for use in left column
Name[de]=Als linke Spalte merken
[Desktop Action b_setArg2]
#Icon=document-compareleft
Exec=echo "%U" > /tmp/meld-menu-arg2;
Name=Mark for use in middle column
Name[de]=Als mittlere Spalte merken
[Desktop Action c_diff]
Icon=document-compareright
Exec=ARG1=$(cat /tmp/meld-menu-arg1); ARG2=$(cat /tmp/meld-menu-arg2); rm -f /tmp/meld-menu-arg1; rm -f /tmp/meld-menu-arg2; if [ "$ARG1" != "" ]; then if [ "$ARG2" != "" ]; then meld "$ARG1" "$ARG2" %U; else meld "$ARG1" %U; fi; else if [ "$ARG2" != "" ]; then meld "$ARG2" %U; fi; fi;
Name=Use in right column and compare
Name[de]=Als rechte Spalte merken und vergleichen
Works for all cases:
- left, middle and right
- left and right
- middle and right
Last edited by myscha (2023-01-14 19:17:10)
Offline