Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-03-10 03:20:12

fixit
Member
Registered: 2015-01-19
Posts: 115

Custom action for comparing files

Trying to make a custom action to compare 2 files.

This does not work.

diff %F %F


Ubuntu-Mate 22.04

Offline

#2 2019-03-10 04:07:11

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,006

Re: Custom action for comparing files

Use a script like this (requires zenity):

#!/bin/bash

if [ $# -ne 2 ]
then 
	zenity --error --title "DiffViewer" --text "Select only two files to compare" --no-wrap
	exit 1
fi

diff "$1" "$2"  | zenity --text-info --title "DiffViewer" --height=500 --width=500

In the custom action, set the command to

/path/to/this/script %F

On the Appearance tab, select "Text Files"


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-03-10 10:33:06

Spass
Member
From: Poland
Registered: 2016-12-07
Posts: 133

Re: Custom action for comparing files

You could also do it with meld (graphical tool to diff and merge files). It requires "meld" package to be installed on your system and then:

meld %F

(* file pattern, text files only)

This is how it looks: https://screenshots.debian.net/package/meld

Last edited by Spass (2019-03-10 10:39:53)

Offline

#4 2019-03-11 17:01:28

yurbev
Member
Registered: 2016-04-18
Posts: 54

Re: Custom action for comparing files

Is comparing two files something only a professional computer person would need to use? I'm trying to think of practical applications for this type of command, for regular Linux users.

Offline

#5 2019-03-11 19:15:04

fixit
Member
Registered: 2015-01-19
Posts: 115

Re: Custom action for comparing files

Spass wrote:

You could also do it with meld (graphical tool to diff and merge files). It requires "meld" package to be installed on your system and then:

meld %F

(* file pattern, text files only)

This is how it looks: https://screenshots.debian.net/package/meld

Thanks. I really like meld.


Ubuntu-Mate 22.04

Offline

Board footer

Powered by FluxBB