Ubuntu 14.04 LTS Meld对比工具添加到右键菜单方法

安装Meld: sudoapt-getinstallmeld


添加到右键菜单方法

将两个脚本(set-as-Meld-leftcompare-to-left)拷贝到 ~/.local/share/nautilus/scripts目录即可


PS: 这个脚本是在网上找到的


set-as-Meld-left脚本内容

#!/bin/bash
#
# This script opens a compare tool with selected files/directory by 
# script "set-as-*-left".
# so you should run "set-as-*-left" first
# copyright (C) 2010  ReV Fycd
# distributed under the terms of GNU GPL version 2 or later
#
# Install in ~/.gnome2/nautilus-scripts or ~/Nautilus/scripts
# or ~/.local/share/nautilus/scripts (ubuntu 14.04 LTS)
# You need to be running Nautilus 1.0.3+ to use scripts.
# You also need to install one compare tools to use scripts(such like meld)
# You can change the $comparetool to other compare tools(like "Kdiff3") that 
# you have already installed before.

comparetool="meld"
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
    set $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
    if [ $# -eq 1 ]; then
        file1="$1"
        echo "set-as-Meld-left copyright (C) 2010  ReV Fycd"
        echo "${comparetool} ${file1} \\"> ~/.startcompare
    fi
fi

compare-to-left 脚本内容

#!/bin/bash
#
# This script opens a compare tool with selected files/directory by 
# script "set-as-*-left".
# so you should run "set-as-*-left" first
#
# copyright (C) 2010  ReV Fycd
# distributed under the terms of GNU GPL version 2 or later
#
# Install in ~/.gnome2/nautilus-scripts or ~/Nautilus/scripts
# or ~/.local/share/nautilus/scripts (ubuntu 14.04 LTS)
# You need to be running Nautilus 1.0.3+ to use scripts.
# You also need to install one compare tools to use scripts(such like meld)

if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
    set $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
fi
if [ $# -eq 1 ]; then
    file2="$1"
    echo "Compare-to-left copyright (C) 2010  ReV Fycd"
    echo $file2 >> ~/.startcompare
fi

chmod +x ~/.startcompare
exec ~/.startcompare

脚本放置位置:



此时右键点击文件文件夹,右键菜单会出现"脚本--set-as-Meld-left 和 compare-to-left 及打开脚本文件夹"三项


使用方法

1.选中meld左侧想要对比的文件文件夹,然后选择"set-as-Meld-left"

2.再选中meld右侧想要对比的文件文件,然后选择"compare-to-left",此时Meld工具会自动打开




脚本

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...