nemoの拡張機能nemo-compareのインストールが上手く行かなかったので、手動で導入した。

(参照記事)
Nemo - ArchWiki

まず、meld、python2-dbus、dbus-glib(これは導入済みだった)をインストール。

$ sudo pacman -S meld python2-dbus

~/.local/share/nemo/actions下にcompare-save-for-later.nemo_action、compare-with-saved.nemo_action、compare.shの3つのファイルを作成。

compare-save-for-later.nemo_action
1
2
3
4
5
6
7
8
9
[Nemo Action]
Active=true
Name=Compare later
Name[ja]=あとで比較する
Comment=Save file for comparison later.
Exec=
Icon-Name=meld
Selection=S
Extensions=any
compare-with-saved.nemo_action
1
2
3
4
5
6
7
8
9
[Nemo Action]
Active=true
Name=Compare with saved element
Name[ja]=比較する
Comment=Compare %F saved file or directory.
Exec=
Icon-Name=meld
Selection=S
Extensions=any
compare.sh
1
2
3
4
5
6
7
8
#!/bin/bash
savedfile=/var/tmp/compare-save-for-later.$USER
comparator=meld
if [ "$1" == "save" ]; then
echo "$2" > "$savedfile"
else
"$comparator" $(cat "$savedfile") "$2"
fi

compare.shはファイルマネージャーもしくはコマンドで実行可能にしておく。

$ chmod +x compare.sh

nemoの右クリックメニューに「比較する」「あとで比較する」が追加された。

ファイル内容だけではなくフォルダの内容も比較出来る。
なにかと重宝しそうだ。

表示   このエントリーをはてなブックマークに追加

Comments

2015年4月3日