{"id":136230,"date":"2019-02-27T10:46:40","date_gmt":"2019-02-27T02:46:40","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=136230"},"modified":"2019-02-20T15:47:27","modified_gmt":"2019-02-20T07:47:27","slug":"sixel-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/sixel-linux.html","title":{"rendered":"\u4f7f\u7528 Sixel \u56fe\u5f62\u683c\u5f0f\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7f29\u7565\u56fe"},"content":{"rendered":"
\u4e0d\u4e45\u524d\uff0c\u6211\u4eec\u8ba8\u8bba\u4e86 Fim\uff0c\u8fd9\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u547d\u4ee4\u884c\u56fe\u50cf\u67e5\u770b\u5668\u5e94\u7528\u7a0b\u5e8f\uff0c\u7528\u4e8e\u4ece\u547d\u4ee4\u884c\u663e\u793a\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u50cf\uff0c\u5982 bmp\u3001gif\u3001jpeg \u548c png \u7b49\u3002\u4eca\u5929\uff0c\u6211\u5076\u7136\u53d1\u73b0\u4e86\u4e00\u4e2a\u540d\u4e3a\u00a0 lsix\u7684\u7c7b\u4f3c\u5de5\u5177\u3002\u5b83\u7c7b\u4f3c\u4e8e\u7c7b Unix \u7cfb\u7edf\u4e2d\u7684\u00a0 ls\u547d\u4ee4\uff0c\u4f46\u4ec5\u9002\u7528\u4e8e\u56fe\u50cf\u3002lsix \u662f\u4e00\u4e2a\u7b80\u5355\u7684\u547d\u4ee4\u884c\u5b9e\u7528\u7a0b\u5e8f\uff0c\u65e8\u5728\u4f7f\u7528 Sixel \u56fe\u5f62\u683c\u5f0f\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7f29\u7565\u56fe\u3002\u5bf9\u4e8e\u90a3\u4e9b\u60f3\u77e5\u9053\u7684\u4eba\u6765\u8bf4\uff0cSixel \u662f\u516d\u50cf\u7d20six pixels\u7684\u7f29\u5199\uff0c\u662f\u4e00\u79cd\u4f4d\u56fe\u56fe\u5f62\u683c\u5f0f\u3002\u5b83\u4f7f\u7528 ImageMagick\uff0c\u56e0\u6b64\u51e0\u4e4e\u6240\u6709 imagemagick \u652f\u6301\u7684\u6587\u4ef6\u683c\u5f0f\u90fd\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n
\u5173\u4e8e lsix\u00a0\u7684\u529f\u80fd\uff0c\u6211\u4eec\u53ef\u4ee5\u5217\u51fa\u5982\u4e0b\uff1a<\/p>\n
\u7531\u4e8e lsix\u00a0\u4f7f\u7528 ImageMagick\uff0c\u8bf7\u786e\u4fdd\u5df2\u5b89\u88c5\u5b83\u3002\u5b83\u5728\u5927\u591a\u6570 Linux \u53d1\u884c\u7248\u7684\u9ed8\u8ba4\u8f6f\u4ef6\u5e93\u4e2d\u90fd\u53ef\u7528\u3002 \u4f8b\u5982\uff0c\u5728 Arch Linux \u53ca\u5176\u53d8\u4f53\u5982 Antergos\u3001Manjaro Linux \u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5ImageMagick\uff1a<\/p>\n
$ sudo pacman -S imagemagick<\/pre>\n\u5728 Debian\u3001Ubuntu\u3001Linux Mint\uff1a<\/p>\n
$ sudo apt-get install imagemagick<\/pre>\nlsix\u00a0\u5e76\u4e0d\u9700\u8981\u5b89\u88c5\uff0c\u56e0\u4e3a\u5b83\u53ea\u662f\u4e00\u4e2a Bash \u811a\u672c\u3002\u53ea\u9700\u8981\u4e0b\u8f7d\u5b83\u5e76\u79fb\u52a8\u5230\u4f60\u7684 $PATH\u00a0\u4e2d\u3002\u5c31\u8fd9\u4e48\u7b80\u5355\u3002
\n\u4ece\u8be5\u9879\u76ee\u7684 GitHub \u4e3b\u9875\u4e0b\u8f7d\u6700\u65b0\u7684 lsix \u7248\u672c\u3002\u6211\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4e0b\u8f7d lsix\u00a0\u5f52\u6863\u5305\uff1a<\/p>\n$ wget https:\/\/github.com\/hackerb9\/lsix\/archive\/master.zip<\/pre>\n\u63d0\u53d6\u4e0b\u8f7d\u7684 zip \u6587\u4ef6\uff1a<\/p>\n
$ unzip master.zip<\/pre>\n\u6b64\u547d\u4ee4\u5c06\u6240\u6709\u5185\u5bb9\u63d0\u53d6\u5230\u540d\u4e3a lsix-master\u00a0\u7684\u6587\u4ef6\u5939\u4e2d\u3002\u5c06 lsix \u4e8c\u8fdb\u5236\u6587\u4ef6\u4ece\u6b64\u76ee\u5f55\u590d\u5236\u5230 $PATH\u00a0\u4e2d\uff0c\u4f8b\u5982 \/usr\/local\/bin\/\u3002<\/p>\n
$ sudo cp lsix-master\/lsix \/usr\/local\/bin\/<\/pre>\n\u6700\u540e\uff0c\u4f7f lsix\u00a0\u4e8c\u8fdb\u5236\u6587\u4ef6\u53ef\u6267\u884c\uff1a<\/p>\n
$ sudo chmod +x \/usr\/local\/bin\/lsix<\/pre>\n\u5982\u6b64\uff0c\u73b0\u5728\u662f\u5728\u7ec8\u7aef\u672c\u8eab\u663e\u793a\u7f29\u7565\u56fe\u7684\u65f6\u5019\u4e86\u3002<\/p>\n
\u5728\u5f00\u59cb\u4f7f\u7528 lsix\u00a0\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u4f60\u7684\u7ec8\u7aef\u652f\u6301 Sixel \u56fe\u5f62\u683c\u5f0f\u3002<\/p>\n
\u5f00\u53d1\u4eba\u5458\u5728 vt340 \u4eff\u771f\u6a21\u5f0f\u4e0b\u7684 Xterm \u4e0a\u5f00\u53d1\u4e86 lsix\u3002 \u7136\u800c\uff0c\u4ed6\u58f0\u79f0 lsix \u5e94\u8be5\u9002\u7528\u4e8e\u4efb\u4f55Sixel \u517c\u5bb9\u7ec8\u7aef\u3002<\/p>\n
Xterm \u652f\u6301 Sixel \u56fe\u5f62\u683c\u5f0f\uff0c\u4f46\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u542f\u7528\u3002<\/p>\n
\u4f60\u53ef\u4ee5\u4ece\u53e6\u5916\u4e00\u4e2a\u7ec8\u7aef\u4f7f\u7528\u547d\u4ee4\u6765\u542f\u52a8\u4e00\u4e2a\u542f\u7528\u4e86 Sixel \u6a21\u5f0f\u7684 Xterm\uff1a<\/p>\n
$ xterm -ti vt340<\/pre>\n\u6216\u8005\uff0c\u4f60\u53ef\u4ee5\u4f7f vt340 \u6210\u4e3a Xterm \u7684\u9ed8\u8ba4\u7ec8\u7aef\u7c7b\u578b\uff0c\u5982\u4e0b\u6240\u8ff0\u3002<\/p>\n
\u7f16\u8f91 .Xresources \u6587\u4ef6\uff08\u5982\u679c\u5b83\u4e0d\u53ef\u7528\uff0c\u53ea\u9700\u521b\u5efa\u5b83\uff09\uff1a<\/p>\n
$ vi .Xresources<\/pre>\n\u6dfb\u52a0\u5982\u4e0b\u884c\uff1a<\/p>\n
xterm*decTerminalID : vt340<\/pre>\n\u6309\u4e0b ESC \u5e76\u952e\u5165 :wq \u4ee5\u4fdd\u5b58\u5e76\u5173\u95ed\u8be5\u6587\u4ef6\u3002<\/p>\n
\u6700\u540e\uff0c\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u6765\u5e94\u7528\u6539\u53d8\uff1a<\/p>\n
$ xrdb -merge .Xresources<\/pre>\n\u73b0\u5728\uff0c\u6bcf\u6b21\u542f\u52a8 Xterm \u5c31\u4f1a\u9ed8\u8ba4\u542f\u7528 Sixel \u56fe\u5f62\u652f\u6301\u3002<\/p>\n
\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7f29\u7565\u56fe<\/strong><\/div>\n\u542f\u52a8 Xterm\uff08\u4e0d\u8981\u5fd8\u8bb0\u4ee5 vt340 \u6a21\u5f0f\u542f\u52a8\u5b83\uff09\u3002\u4ee5\u4e0b\u662f Xterm \u5728\u6211\u7684\u7cfb\u7edf\u4e2d\u7684\u6837\u5b50\u3002<\/p>\n
<\/p>\n
\u5c31\u50cf\u6211\u5df2\u7ecf\u8bf4\u8fc7\u7684\u90a3\u6837\uff0clsix\u00a0\u975e\u5e38\u7b80\u5355\u5b9e\u7528\u3002\u5b83\u6ca1\u6709\u4efb\u4f55\u547d\u4ee4\u884c\u9009\u9879\u6216\u914d\u7f6e\u6587\u4ef6\u3002\u4f60\u6240\u8981\u505a\u7684\u5c31\u662f\u5c06\u6587\u4ef6\u7684\u8def\u5f84\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n
$ lsix ostechnix\/logo.png<\/pre>\n<\/p>\n
\u5982\u679c\u5728\u6ca1\u6709\u8def\u5f84\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u5b83\uff0c\u5b83\u5c06\u663e\u793a\u5728\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e2d\u7684\u7f29\u7565\u56fe\u56fe\u50cf\u3002\u6211\u5728\u540d\u4e3a ostechnix \u7684\u76ee\u5f55\u4e2d\u6709\u51e0\u4e2a\u6587\u4ef6\u3002<\/p>\n
\u8981\u663e\u793a\u6b64\u76ee\u5f55\u4e2d\u7684\u7f29\u7565\u56fe\uff0c\u53ea\u9700\u8fd0\u884c\uff1a<\/p>\n
$ lsix<\/pre>\n<\/p>\n
\u770b\u5230\u4e86\u5417\uff1f\u6240\u6709\u6587\u4ef6\u7684\u7f29\u7565\u56fe\u90fd\u663e\u793a\u5728\u7ec8\u7aef\u91cc\u3002<\/p>\n
\u5982\u679c\u4f7f\u7528 ls\u547d\u4ee4\uff0c\u5219\u53ea\u80fd\u770b\u5230\u6587\u4ef6\u540d\uff0c\u800c\u4e0d\u662f\u7f29\u7565\u56fe\u3002<\/p>\n
<\/p>\n
\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26\u663e\u793a\u7279\u5b9a\u7c7b\u578b\u7684\u6307\u5b9a\u56fe\u50cf\u6216\u4e00\u7ec4\u56fe\u50cf\u3002<\/p>\n
\u4f8b\u5982\uff0c\u8981\u663e\u793a\u5355\u4e2a\u56fe\u50cf\uff0c\u53ea\u9700\u63d0\u53ca\u56fe\u50cf\u7684\u5b8c\u6574\u8def\u5f84\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n
$ lsix girl.jpg<\/pre>\n<\/p>\n
\u8981\u663e\u793a\u7279\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u56fe\u50cf\uff0c\u4f8b\u5982 PNG\uff0c\u8bf7\u4f7f\u7528\u5982\u4e0b\u6240\u793a\u7684\u901a\u914d\u7b26\u3002<\/p>\n
$ lsix *.png<\/pre>\n<\/p>\n
\u5bf9\u4e8e JEPG \u7c7b\u578b\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n
$ lsix *jpg<\/pre>\n\u7f29\u7565\u56fe\u7684\u663e\u793a\u8d28\u91cf\u975e\u5e38\u597d\u3002\u6211\u4ee5\u4e3a lsix \u4f1a\u663e\u793a\u6a21\u7cca\u7684\u7f29\u7565\u56fe\u3002\u4f46\u6211\u9519\u4e86\uff0c\u7f29\u7565\u56fe\u6e05\u6670\u53ef\u89c1\uff0c\u5c31\u50cf\u5728\u56fe\u5f62\u56fe\u50cf\u67e5\u770b\u5668\u4e0a\u4e00\u6837\u3002<\/p>\n
\u800c\u4e14\uff0c\u8fd9\u4e00\u5207\u90fd\u662f\u553e\u624b\u53ef\u5f97\u3002\u5982\u4f60\u6240\u89c1\uff0clsix\u00a0\u4e0e ls\u00a0\u547d\u4ee4\u975e\u5e38\u76f8\u4f3c\uff0c\u4f46\u5b83\u4ec5\u7528\u4e8e\u663e\u793a\u7f29\u7565\u56fe\u3002\u5982\u679c\u4f60\u5728\u5de5\u4f5c\u4e2d\u5904\u7406\u5f88\u591a\u56fe\u50cf\uff0clsix \u53ef\u80fd\u4f1a\u975e\u5e38\u65b9\u4fbf\u3002\u8bd5\u4e00\u8bd5\uff0c\u8bf7\u5728\u4e0b\u9762\u7684\u8bc4\u8bba\u90e8\u5206\u544a\u8bc9\u6211\u4eec\u4f60\u5bf9\u6b64\u5b9e\u7528\u7a0b\u5e8f\u7684\u770b\u6cd5\u3002\u5982\u679c\u4f60\u77e5\u9053\u4efb\u4f55\u7c7b\u4f3c\u7684\u5de5\u5177\uff0c\u4e5f\u8bf7\u63d0\u51fa\u5efa\u8bae\u3002\u6211\u5c06\u68c0\u67e5\u5e76\u66f4\u65b0\u672c\u6307\u5357\u3002<\/p>\n
\u66f4\u591a\u597d\u4e1c\u897f\u5373\u5c06\u5230\u6765\u3002\u656c\u8bf7\u5173\u6ce8\uff01<\/p>\n
\u5e72\u676f!<\/p>\n
\nvia: https:\/\/www.ostechnix.com\/how-to-display-thumbnail-images-in-terminal\/<\/a><\/p>\n
\u4f5c\u8005\uff1aSK<\/a> \u9009\u9898\uff1alujun9972<\/a> \u8bd1\u8005\uff1awxy<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n
\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"
\u4e0d\u4e45\u524d\uff0c\u6211\u4eec\u8ba8\u8bba\u4e86 Fim\uff0c\u8fd9\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u547d\u4ee4\u884c\u56fe\u50cf\u67e5\u770b\u5668\u5e94\u7528\u7a0b\u5e8f\uff0c\u7528\u4e8e\u4ece\u547d\u4ee4\u884c\u663e\u793a\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u50cf\uff0c\u5982 bm […]<\/p>\n","protected":false},"author":323,"featured_media":129725,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-136230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/136230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=136230"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/136230\/revisions"}],"predecessor-version":[{"id":136979,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/136230\/revisions\/136979"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/129725"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=136230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=136230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=136230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}