惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
月光博客
月光博客
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
罗磊的独立博客
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
博客园 - 聂微东
V
V2EX

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Install feh Image Viewer from Source on CentOS 7
2017-05-06 · via jdhao's digital space

On my CentOS system, I usually use eog to view images in the console. But I am a little upset by its speed of opening an image. I do not need such functionality besides viewing an image. So I decided to find another lightweight replacement.

After searching the internet, I found a post on stackexchange. According to the answers in the post, I decided to install feh on my CentOS 7 system. The install process turns out to be a little bumpy.

Feh is not in the official yum repo. So we have to build it from source. Unfortunately, the offical page only gives instructions on how to install it on Debian-based systems. What is worse, some of the package names are different on CentOS. After some trial and error, I succeeded in installing it on my system. Here is how.

First, we need to install some dependencies:

yum -y install libcurl-devel libX11-devel libXt-devel libXinerama-devel libpng-devel

Then we need to manually download other packages and install them:

wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/Kenzy:/modified:/C7/CentOS_7/x86_64/imlib2-1.4.6-2.1.x86_64.rpm
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/Kenzy:/modified:/C7/CentOS_7/x86_64/imlib2-devel-1.4.6-2.1.x86_64.rpm
wget https://jaist.dl.sourceforge.net/project/libjpeg-turbo/1.5.1/libjpeg-turbo-official-1.5.1.x86_64.rpm
yum --nogpgcheck localinstall imlib2-1.4.6-2.1.x86_64.rpm imlib2-devel-1.4.6-2.1.x86_64.rpm libjpeg-turbo-official-1.5.1.x86_64.rpm

After that, get the latest feh release from official github repo, compile and install (make sure that you have root privilege, or you have to install it on other directories which you have write access):

git clone git://github.com/derf/feh.git
cd feh
make -j${nproc} && make install

I have put all the command into a bash script, you can find it here. Simply run the script to install feh.

If nothing went wrong, you should be able to use feh right away.

Usage#

Limit the window size to a specific size#

We can use -g or --geometry option:

-g, –geometry WxH[+X+Y] Limit the window size to DIMENSION[+OFFSET]

For example, to show image with maximum window size of 400x500, use the following command:

feh --geometry 400x500 /home/images/

Keep the image viewing window to screen size#

We can use -. or --scale-down to scale the image to fit the screen size:

feh --scale-down /home/images/

Display the image info without showing the image#

We can use -l or --list to show image info (it width, height, etc.) without showing the image.


References#