Feh The Image Viewer For Your Terminal And Easy Viewing
Feh: The Powerful Terminal Image Viewer
Feh is a lightweight yet powerful image viewer designed for the Linux terminal, offering a range of features that make it an ideal choice for users seeking a flexible and customizable image viewing experience. Here’s a detailed look at how to use Feh and its advanced capabilities.
Installation
Installing Feh is straightforward and can be done using the package manager of your Linux distribution. Here are the commands for some popular distributions:
-
Arch Linux:
sudo pacman -S feh
-
Debian and Ubuntu:
sudo apt-get install feh
-
FreeBSD and OpenBSD:
pkg install feh
If you prefer to compile it from source, you can download the package source with git
and use make
and make install
to install the program.
Basic Usage
Using Feh is simple and intuitive. Here’s how you can get started:
-
Opening an Image:
To open an image, simply typefeh
followed by the path to the image file:feh ~/Downloads/myimage.png
-
Opening Multiple Images:
You can open multiple images or an entire directory by specifying multiple paths or a directory:feh ~/Downloads
-
Navigation:
Once the images are open, you can navigate through them using the arrow keys. To zoom in and out, use the up and down arrow keys. Pressing Esc
will close Feh.
Slideshow Mode
Feh’s default operation is slideshow mode. When you enter a directory and type feh
, it begins a slideshow of all the images in that directory. Here are some key features of slideshow mode:
-
Automatic Slideshow:
Feh will display each image in a new window, starting with the first recognizable item in the directory. You can flip through the slideshow using the arrow keys. -
Customizing the Slideshow:
You can customize the slideshow by adding options such as--hide-pointer
to hide the mouse pointer,--sort name
to sort images by name, and--version-sort
for version-based sorting. For example:feh -F -D 3 --hide-pointer --sort name --version-sort
This command will display images in full-screen mode, hide the mouse pointer, and sort images by name.
Montage Mode
For viewing multiple images at once, Feh offers Montage mode:
-
Displaying Thumbnails:
To display a montage of thumbnails, use the-m
option:feh -m
This command shows a list of thumbnails that you can view or save.
-
Customizing Thumbnails:
You can specify the size of the thumbnails using options like--thumb-height
and--thumb-width
. For example:feh -m --thumb-height 150 --thumb-width 200
This command sets the thumbnail height to 150 pixels and the width to 200 pixels.
Index Mode
Index mode provides more detailed information about the images:
- Displaying Thumbnails with Information:
Use the-i
option to display thumbnails with file names and other descriptions:feh -i
You can customize the information displayed using the
--index-info
operator. For example:feh -i --index-info '%hx%w-%n'
This command displays the height, width, and file name of each image.
Thumbnail Mode
Thumbnail mode is similar to Index mode but allows you to click on thumbnails to open the respective image in a new window:
- Entering Thumbnail Mode:
Use the-t
option to enter Thumbnail mode:feh -t
This mode accepts the same parameters as Index mode.
Multiwindow Mode
For opening all files in a directory in separate windows, use Multiwindow mode:
- Opening Multiple Windows:
Use the-w
option to open all files in separate windows:feh -w
This mode is useful for comparing multiple images simultaneously.
Advanced Customization
Feh offers extensive customization options, making it highly adaptable to different user needs:
-
Creating Custom Scripts:
You can create custom scripts to automate specific tasks. For example, you can create a script to display images in full-screen mode with customizable settings:feh -F -D 3 --hide-pointer --sort name --version-sort | sudo tee /usr/local/bin/fehshow > /dev/null sudo chmod 755 /usr/local/bin/fehshow
This script creates a command that can be used to display images in full-screen mode with specific settings.
-
Desktop Integration:
You can integrate Feh with your desktop environment by creating desktop entries for easy access to different viewing modes. For example:echo '[Desktop Entry] Type=Application Name=Image Viewing Settings Exec=bash -c "sudo mousepad /usr/local/bin/fehview" Icon=/usr/local/share/icons/hicolor/48x48/apps/feh.png Terminal=false' > /home/pi/Desktop/edit-fehview.desktop sleep 1 echo '[Desktop Entry] Type=Application Name=Slideshow Settings Exec=bash -c "sudo mousepad /usr/local/bin/fehshow" Icon=/usr/local/share/icons/hicolor/48x48/apps/feh.png Terminal=false' > /home/pi/Desktop/edit-fehshow.desktop
These commands create desktop entries for easy access to image viewing and slideshow settings.
By leveraging these features, Feh becomes an indispensable tool for anyone looking for a powerful and customizable image viewer in the Linux terminal.