feh alternative that animates .gif files

12,208

Solution 1

It seems that there is no program that can do such thing... so I decided to make my own script, goes as follows (using feh and gifview) :

while read i; do
    file+=( "$i" )
done < <(ls | sort -R)

for i in $(seq 0 "${#file[@]}");do
    if [[ "${file[$i]}" =~ .*.gif ]];then
        gifview -a "${file[$i]}"
        read -s -n 1 choice
        case $choice in
            1)    //Command to execute//
                  ;;
            2)    //Other Command to execute//
                  ;;
        esac
    else
        feh -rqzZFVY --cycle-once --action1 "//Comand to execute//" --action2 "//Other command to execute// "${file[$i]}"
    fi
done

The script first loads the files into the array file, then it loops through those files with the for loop. if the file is a gif the first conditional is triggered, then a read command gets the option you want to do with the file and executes the command under the case option, else it executes feh

Solution 2

Try sxiv with the -animate flag.

sxiv -a

Simple X Image Viewer

The primary goal of sxiv is to create an image viewer, which only has the most basic features required for fast image viewing (the ones I want). It has vi key bindings and works nicely with tiling window managers. Its code base should be kept small and clean to make it easy for you to dig into it and customize it for your needs.

Solution 3

Another lightweight image viewer that seemed to come preinstalled on my Ubuntu device is Eye of Gnome (eog). It supports GIF animation out of the box and has a (very) small number of commands that can be performed with shortcut keys.

Share:
12,208

Related videos on Youtube

Vndtta
Author by

Vndtta

Updated on September 18, 2022

Comments

  • Vndtta
    Vndtta over 1 year

    I love using feh to organise my image collections. I've set the actions to move the current image to a certain directory, but when trying to open gifs, feh doesn't animate them.

    Therefore I was searching a lightweight image/gif viewer with the possibility to execute commands with simple key strokes like --action in feh.

    Thank you


    I've found a program that might be good enough. It's called gifview and it's an old version of gifsicle; you can get it by installing gifsicle. The really interesting option is -w where you specify the window to open the gifs (so you can make all go to the same acting pretty much like feh), it still doesn't accept command inputs but it's close enough.

    • Braden Best
      Braden Best over 9 years
      If you have imagemagick installed, you can run animate -loop 0 file.gif