beyond compare 增加右键快捷键

声明

郑重声明:博文为原创内容,可以转载或引用,但必须在明显位置标明原文作者和出处,未经同意不得擅自修改本文内容!

博客地址:http://blog.csdn.net/luzhenrong45
软件环境

Ubuntu 15.04 x64
Beyond Compare 64位
安装32位兼容库(ia32-libs)

在Ubuntu系统上面安装64位Beyond Compare,需要32位兼容库的支持,即ia32-libs。在Ubuntu 13.10以前的系统,安装32位兼容库很方便:

sudo apt-get install ia32-libs

    1

但在Ubuntu 13.10以及后续版本已经废弃了ia32-libs。在安装Beyond Compare的时候会提示需要安装ia32-libs:

system@(none):$ sudo dpkg -i bcompare-3.3.8.16340_amd64.deb
Unpacking bcompare (3.3.8-16340) ...
dpkg: dependency problems prevent configuration of bcompare:
 bcompare depends on ia32-libs; however:
  Package ia32-libs is not installed.

dpkg: error processing package bcompare (--install):

    1
    2
    3
    4
    5
    6
    7
    8

而安装ia32-libs的时候系统会提示安装包已经找不到:

system@(none):$ sudo apt-get install ia32-libs
sudo: unable to resolve host (none)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

因此,下面先解决Ubuntu 15.04系统上ia32-libs的安装问题:

sudo apt-get install libc6:i386

#切换到root权限
su

#进入apt源列表
cd /etc/apt/sources.list.d

#添加ubuntu 13.04的源,因为13.10的后续版本废弃了ia32-libs
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list

#更新源并安装ia32-libs
apt-get update
apt-get install ia32-libs

#删除ubuntu 13.04的源
rm /etc/apt/sources.list.d/ia32-libs-raring.list
apt-get update

exit

sudo apt-get install gcc-multilib

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

安装beyond compare

sudo dpkg -i bcompare-3.3.8.16340_amd64.deb

    1

这样就可以安装成功了,通过bcompare命令或图标, 即可启动beyond compare
添加右键菜单

安装beyond compare之后,如果想像windows系统那样, 选中文件后通过右键菜单启动beyond compare进行对比,也是可以的,做法如下:

1、新建3个脚本,compare,select_for_compare和compare_to_selected,内容分别如下:

    [ compare ]

#!/bin/sh
quoted=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | awk 'BEGIN { FS = "\n" } { printf "\"%s\" ", $1 }' | sed -e s#\"\"##)
bcompare $quoted

    1
    2
    3

    [ select_for_compare ]

#!/bin/sh
quoted=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | awk 'BEGIN { FS = "\n" } { printf "\"%s\" ", $1 }' | sed -e s#\"\"##)
echo "$quoted" > $HOME/.beyondcompare/nautilus

    1
    2
    3

    [ compare_to_selected ]

#!/bin/sh
arg2=$(cat $HOME/.beyondcompare/nautilus)
arg1=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | awk 'BEGIN { FS = "\n" } { printf "\"%s\" ", $1 }' | sed -e s#\"\"##)
bcompare $arg1 $arg2

    1
    2
    3
    4

2、将以上3个脚本拷贝到以下目录:

~/.local/share/nautilus/scripts

    1

这样, 就可以选中对比文件后, 通过 右键–> script –> compare 的方式启动beyond compare来对比文件了!

另外:

1、ubuntu13.04以前的目录是 ~/.gnome2/nautilus-scripts/

2、如果没有nautilus目录,可能是系统没有安装nautilus文件管理器:

sudo add-apt-repository ppa:vascofalves/gnome-backports
sudo apt-get update
sudo apt-get install nautilus

    1
    2
    3

修改说明
作者     版本     修改时间     修改说明
WalkAloner     V1.0     2017/11/27     
---------------------
作者:包老头子
来源:CSDN
原文:https://blog.csdn.net/luzhenrong45/article/details/78648301
版权声明:本文为博主原创文章,转载请附上博文链接!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值