You are not logged in.

#21 2016-04-09 09:47:27

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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

I wrote a scipt to view through a folder with tiles (usually small, seamlessly tileable images), apply some manipulation, and set as a background with feh.

I was inspired to write this script after downloading a large collection of transparent textures from http://www.transparenttextures.com/

Last edited by ohnonot (2021-07-03 10:56:07)

Offline

#22 2016-04-09 15:11:28

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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

i had to fix some things, and just pushed again.

Last edited by ohnonot (2021-07-03 10:55:38)

Offline

#23 2016-04-11 04:47:50

Snap
Member
Registered: 2015-10-02
Posts: 465

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

^ Love it! Thanks for this, ohnonot.

Offline

#24 2016-04-26 06:12:59

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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

I added a single image mode, so if the argument passed on the command line is a file (not a dir), then tileset just opens that one file.
especially useful if you get it to work in your filemanager.

i guess most filemanagers have an option to create a custom "Open with..." (remember to tick "open in terminal").
i provided a tileset.desktop but can't get it to work with pcmanfm. hrmph. still investigating.

also fixed some things (handling spaces in filenames; how embarrassing).

Last edited by ohnonot (2021-07-03 10:53:39)

Offline

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

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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.

Offline

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

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 1,045
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.


Fedora GNOME / Devuan XFCE
Roots heritage #!

Offline

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

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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://spam.com/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 (2021-05-27 18:57:46)

Offline

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

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

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

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


Fedora GNOME / Devuan XFCE
Roots heritage #!

Offline

#29 2020-11-27 15:54:37

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

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

This feature kills right click menu instantly also exit photo aswell.

quit
toggle_menu
quit 3

Create a textfile called "buttons" on your $HOME/.config/feh then paste the above commands inside.

A simple script to draw info about file name, file size and file dimension.

#!/bin/bash

# ______________________ ___ ___  
# \_   _____/\_   _____//   |   \ 
#  |    __)   |    __)_/    ~    \
#  |     \    |        \    Y    /
#  \___  /   /_______  /\___|_  / 
#      \/            \/       \/  
#        IMAGE VIEWER
                                                                                                                     
feh \
--start-at "$1" \
--quiet \
--fontpath /usr/share/fonts/cantarell \
--font Cantarell-ExtraBold.otf/12 \
--auto-rotate \
--image-bg "#0d0e11" \
--fullscreen \
--info "printf '%%s\n' \ Filename:\ '%n' \ Size:\ '%S' \ Dimension:\ '%wx%h'" \
#--draw-filename \
#--draw-exif \
#--hide-pointer \
#--borderless \

Sample

Filename: Testphoto.jpg
Filesize:  8M
Resolution: 3000x2000

Edit: Because of the removing right-click menu someone may found useful those mini details.

The info can be shown/hidden with keybind "i", unfortunately there is a conflict with keybind "e" that draw-exif at the same position.
I did not find a way to move to another place bottom/top-right at least with my modest research.

Last edited by Nili (2022-03-19 21:23:46)


Fedora GNOME / Devuan XFCE
Roots heritage #!

Offline

#30 2021-09-19 16:54:53

sleekmason
zoom
Registered: 2018-05-22
Posts: 871
Website

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

Thank you for this.  I made a small adjustment for use in my menu, that allows to just click on the image to "set as wallpaper".

Made a script to place in /usr/local/bin named feh-set-wallpaper

#!/bin/sh

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

and just call it from the menu.  Works really good. Only caveat for me was that I couldn't figure out how to keep the chosen image from being "X"ed out?  Being able to flip back again after choosing an image seems to me to be a better option. Seems this is a feh thing though, rather than a chosen option. Anyhow. very cool:)

Found the fix to the "X"ing out from @ohnonot here: https://forums.bunsenlabs.org/viewtopic.php?id=5773

if you use thumbnail mode and see blue-tinted thumbnails with an X after clicking on them, prepend a semicolon to your action

Thank you and howdy ohnonot!

Last edited by sleekmason (2021-09-27 16:23:35)

Offline

#31 2021-09-20 10:15:42

ceeslans
Member
Registered: 2015-09-30
Posts: 130

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

@sleekmason (and @ohnonot of course) thanks for the wallpaper selection script.

I made a few changes and additions to it, so that multiple image directories can be sourced - and the selected image path + preferred bg-setting mode can be written to $HOME/.fehbg file.
It works a treat as wallpaper changer on my single-user MX fluxbox session.

#!/bin/sh

### select wallpaper directories to be shown 
BGDIR1="$HOME/Pictures/wallpapers"
#BGDIR2="$HOME/Pictures/wildflowers"
BGDIR3="/usr/share/backgrounds"

### uncomment if selection should NOT be written to ~/.fehbg 
#FEHBG="--no-fehbg"	

### select background setting mode
#BGSET="--bg-scale"
BGSET="--bg-fill"
#BGSET="--bg-max"
#BGSET="--bg-tile"

feh -r -t -P -N --scale-down -W 960 -E 100 -y 160 -J 100 --title "Wallpaper" \
--fontpath /usr/share/fonts/truetype/dejavu/ --font DejaVuSansCondensed.ttf/8 \
--index-info "%n" \
--action ";feh $FEHBG $BGSET %F" $BGDIR1 $BGDIR2 $BGDIR3

Last edited by ceeslans (2021-09-21 05:52:24)

Offline

#32 2021-09-28 05:19:50

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

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

Thanks both.

I am still using the wallpaper selector.

About the first Bonus in my OP:
By now, feh has a "--start-at" option, which does exactly what most image viewers do: allow to browse all images in that folder.
On my system, /usr/share/applications/feh.desktop even uses "Exec=feh --start-at %u" by default.

Last edited by ohnonot (2021-09-28 05:20:30)

Offline

#33 2021-12-29 17:32:57

sleekmason
zoom
Registered: 2018-05-22
Posts: 871
Website

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

ceeslans wrote:

@sleekmason (and @ohnonot of course) thanks for the wallpaper selection script.

I made a few changes and additions to it, so that multiple image directories can be sourced - and the selected image path + preferred bg-setting mode can be written to $HOME/.fehbg file.
It works a treat as wallpaper changer on my single-user MX fluxbox session.

#!/bin/sh

### select wallpaper directories to be shown 
BGDIR1="$HOME/Pictures/wallpapers"
#BGDIR2="$HOME/Pictures/wildflowers"
BGDIR3="/usr/share/backgrounds"

### uncomment if selection should NOT be written to ~/.fehbg 
#FEHBG="--no-fehbg"	

### select background setting mode
#BGSET="--bg-scale"
BGSET="--bg-fill"
#BGSET="--bg-max"
#BGSET="--bg-tile"

feh -r -t -P -N --scale-down -W 960 -E 100 -y 160 -J 100 --title "Wallpaper" \
--fontpath /usr/share/fonts/truetype/dejavu/ --font DejaVuSansCondensed.ttf/8 \
--index-info "%n" \
--action ";feh $FEHBG $BGSET %F" $BGDIR1 $BGDIR2 $BGDIR3

Just now getting back to this!  nicely done.  I like the additions:)

Offline

Board footer

Powered by FluxBB