You are not logged in.

#26 2020-08-24 06:59:31

ohnonot
...again
Registered: 2015-09-29
Posts: 4,875
Website

Re: FEH is multi purpose: background setting GUI, folder image viewer, ...

ohnonot wrote:

but what about the nice gui that nitrogen provides, browsing a dedicated folder, generating previews...?

try this:

feh -r -t -P -N --scale-down -W 1008 -E 105 -y 168 -J 100 --index-info "%n" --title "Wallpapers" --action "feh -g 1008x630 %F" "$HOME/Pictures/wallpapers"

it will create a sheet of clickable thumbnails from the Pictures/wallpapers folder. clicking opens a larger view, upon which you can perform the above mentioned action to set it as a wallpaper, or just close it.

Things have evolved, I now use this script to create a sheet of clickable thumbnails:

#!/bin/sh

# $@ = list of folders to be searched for images

# tested with
# feh version 3.1.3
# Compile-time switches: curl exif help stat64 verscmp xinerama
#
# feh version 3.4.1
# Compile-time switches: curl exif inotify help stat64 verscmp xinerama 

# NOTE: feh distiguishes between closing a window and exiting completely.
# the default key for closing a window is x
# the default key for exiting is q
# so if you look at a wallpaper full size, then press 'q', feh will close completely, incl. the thumbnail window.
# you could change this by unsetting the quit action and assigning 'q' to the close action:
# quit
# close q
# (add this to ~/.config/feh/keys)
# that way you have to press 'q' twice to exit completely.

# NOTE 2:
# scrolling up and down works with arrow keys Up/Down.
# the Left/Right arrow keys do not work in an intuitive way.
# you can scroll up and down with keys but will need to click on the desired image.

# get screen resolution
width="$(xwininfo -root | awk '/Width/ {print $2}')"
height="$(xwininfo -root | awk '/Height/ {print $2}')"
# limit window size to 90% of screen size
width="$(((width/10)*9))"
height="$(((height/10)*9))"

# how many rows and columns of thumbnails?
divider=8
thumbheight=$((height/divider))
thumbwidth=$((width/divider))

# feh adds 5 pixels of background below each thumbnail
fehquirk=5

# it scrolls down 1 row of images at a time
scrollstep=$(( (thumbheight+fehquirk) * 1 ))

# recursive? add -r
feh -r -t --cache-thumbnails --no-menus --index-info '' --ignore-aspect --stretch \
-g ${width}x$height --limit-width $width --thumb-width $thumbwidth --thumb-height $thumbheight \
--scroll-step $scrollstep --action ";feh --title='%f --- %wx%hpx' -g ${width}x$height %F" "$@"
#--bg $HOME/.config/scripts/feh/grey.gif

Feh now (3.4.1) also has a " --start-at" option which loads all images inside a folder even if it was invoked on only one image.
This makes some of the wrapper scripts discussed in this thread unnecessary.


BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#27 2020-08-28 21:05:47

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 976
Website

Re: FEH is multi purpose: background setting GUI, folder image viewer, ...

A fine work as always ohnonot, been for a while on a old feh version, so now that i have new package i have chance to do some testing regarding new feh features. I'm sucker for that simple image viewer.


OS: Devuan GNU/Linux 4 (chimaera/ceres)
WM: Openbox / Tint2

Studio Ghibli

Offline

#28 2020-08-29 20:50:53

ohnonot
...again
Registered: 2015-09-29
Posts: 4,875
Website

Re: FEH is multi purpose: background setting GUI, folder image viewer, ...

^ thanks!

Here's another one:
feh can display images straight from the interwebz:

feh https://dt.iki.fi/stuff/scrot/scrot-2020-08-29_23:21:36.png

Use it with a keybind:

    <keybind key="C-A-f">
      <action name="Execute">
        <command>sh -c 'feh "$(xclip -o)"'</command>
      </action>
    </keybind>

to view images straight from your browser (Copy link location, press hotkey)!

Last edited by ohnonot (2020-08-29 20:54:52)


BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#29 2020-08-30 12:07:10

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 976
Website

Re: FEH is multi purpose: background setting GUI, folder image viewer, ...

Awesome! straight to the rc ^that one. Thanks!


OS: Devuan GNU/Linux 4 (chimaera/ceres)
WM: Openbox / Tint2

Studio Ghibli

Offline

Board footer

Powered by FluxBB