Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
159
views
Viewing bitmap without interpolation (with Feh or otherwise)
My preferred image viewer is Feh. When I open a small image with Feh, there is very intrusive interpolation between pixels. I would like to turn this off and just view the raw pixels. How can I do this with Feh? Or will another program be in order? Edit: I realise the original post was ambiguous. My...
My preferred image viewer is Feh. When I open a small image with Feh, there is very intrusive interpolation between pixels. I would like to turn this off and just view the raw pixels. How can I do this with Feh? Or will another program be in order?
Edit: I realise the original post was ambiguous. My question is better stated as "how can I view the image zoomed in with an interpolation which preserves the original blockiness?"; e.g., zooming x and y by 2 should render a single blue pixel as a 4-pixel large blue block. This intention was inferred from my OP and I have accepted an answer :)
tom894
(143 rep)
Dec 21, 2024, 09:26 AM
• Last activity: Dec 28, 2024, 08:27 PM
1
votes
1
answers
216
views
viewing a tiff stack as a movie in feh
How can a stack of images (.tif format) be viewed in feh as a slideshow? When I open such a file, only the first frame in the stack is displayed. The arrow keys do not allow cycling through the other images in the stack.
How can a stack of images (.tif format) be viewed in feh as a slideshow? When I open such a file, only the first frame in the stack is displayed. The arrow keys do not allow cycling through the other images in the stack.
user001
(3808 rep)
Oct 19, 2016, 04:06 AM
• Last activity: Nov 22, 2024, 04:11 PM
0
votes
4
answers
4717
views
Feh on auto start from rc.local ERROR: Can't open X display. It *is* running, yeah?
I'm trying to run my dotnet app from rc.local file. Where i start playing video(working) or show image slide show with feh player. If i run my scrip manually from bash is working how it' should. When i try to run feh player i get: feh ERROR: Can't open X display. It *is* running, yeah? From rc.local...
I'm trying to run my dotnet app from rc.local file. Where i start playing video(working) or show image slide show with feh player. If i run my scrip manually from bash is working how it' should.
When i try to run feh player i get:
feh ERROR: Can't open X display. It *is* running, yeah?
From rc.local
$(cd /home/pi/DigitalSignage/ ; sh startUpDigitalSignage.sh) &
startUpDigitalSignage.sh
#!/bin/bash
echo "Start Digital Signange"
sudo DISPLAY=:0 dotnet DigitalSignage.dll
I try to add DISPLAY=:0 before starting my app but no help.
From dotnet app i'm using Process call and i don't know how to add to call Display settings.
process = new Process();
process.StartInfo.FileName = "feh";
process.StartInfo.UseShellExecute = false;
string geometry = screenType == ScreenOutputType.HDMI_1 ? "1920x1080" : "1920x1080+1920";
string textInfo = string.IsNullOrEmpty(outputText) ? "" : "--font yudit/48 --info \"echo " + outputText + "\"";
process.StartInfo.Arguments = " -Y -z "+ textInfo + " --geometry=" + geometry + " -x --zoom fill \"" + path + "\" ";
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
MiselMoj
(11 rep)
Nov 3, 2021, 07:44 AM
• Last activity: Dec 18, 2023, 03:00 PM
10
votes
3
answers
4592
views
How do I delete images from disk using feh?
I use feh to view images on my hard drive. However, if I hit [delete] the images are removed from the current slideshow, but not from the disk. What is the right way of removing images from the drive straight from feh?
I use feh to view images on my hard drive. However, if I hit [delete] the images are removed from the current slideshow, but not from the disk. What is the right way of removing images from the drive straight from feh?
user151785
Jan 16, 2016, 08:42 AM
• Last activity: Nov 17, 2023, 12:40 PM
0
votes
2
answers
448
views
How can I preview image data urls in linux (e.g. data:image/png;base64, <data>)?
I opened some json-based configuration file and I see that there is a `favicon` key whose value is a [data url](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#datatextplainbase64sgvsbg8sifdvcmxkiq) representing a `png`: "favicon": "data:image/png;base64,iVBORw... I am loo...
I opened some json-based configuration file and I see that there is a
favicon
key whose value is a [data url](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#datatextplainbase64sgvsbg8sifdvcmxkiq) representing a png
:
"favicon": "data:image/png;base64,iVBORw...
I am looking for a way to preview this data url using command-line, e.g. by opening in [feh](https://feh.finalrewind.org/)
Is there an image viewer that supports this out of the box? Otherwise how should I pre-process image urls so that I can preview the corresponding images?
Ideally I want to have a command preview-image-url
to which I can pass an image urls via stdin or at least as a file argument.
Marinos An
(889 rep)
Oct 26, 2023, 07:43 AM
• Last activity: Oct 26, 2023, 09:27 AM
2
votes
1
answers
195
views
How do I open multiple links using feh?
I'm writing a program that gets a bunch of images from Librex' API, then opens them in feh. Here's the source: args = sys.argv[1:] for i in args: if "-" in i: args.remove(i) sch = quote("+".join(args).replace(" ", "+")).replace("%2B", "+") sts = ["librex.extravi.dev", "librex.beparanoid.de", "search...
I'm writing a program that gets a bunch of images from Librex' API, then opens them in feh.
Here's the source:
args = sys.argv[1:]
for i in args:
if "-" in i:
args.remove(i)
sch = quote("+".join(args).replace(" ", "+")).replace("%2B", "+")
sts = ["librex.extravi.dev",
"librex.beparanoid.de",
"search.davidovski.xyz",
"search.madreyk.xyz",
"librex.catalyst.sx"]
st = random.choice(sts)
def images(search, site):
URL = f"https://{site}/api.php?q={search}&p=0&type=1 "
data = requests.get(url=URL).json()
imgList = str()
for i in data[:2]:
imgList += f" {i['thumbnail']}"
subprocess.Popen(["feh", imgList])
images(sch, st)
But when I run the final "feh" command with multiple options, I get an error message along the lines of
feh WARNING:
https://s2.qwant.com/thumbr/example2 does not exist - skipping
I've tried running feh alone with each link, so it isn't something wrong with the links. But then if I re run feh with all the links, I get the same error.
Is there a way to run feh with multiple URLs?
ecjwthx
(21 rep)
Oct 14, 2022, 09:31 PM
• Last activity: Oct 18, 2023, 08:38 PM
1
votes
0
answers
302
views
Using feh --keep-zoom-vp and --zoom fit at the same time?
If I run: `feh --keep-zoom-vp *` Then `feh` will keep the zoom and viewport positioning when browsing through images, as explained in the [manual][1]. This works as expected If I run: `feh --zoom "fill" *` Then it will open my images to fit the window. This too works as expected. [Manual][2] However...
If I run:
feh --keep-zoom-vp *
Then feh
will keep the zoom and viewport positioning when browsing through images, as explained in the manual . This works as expected
If I run:
feh --zoom "fill" *
Then it will open my images to fit the window. This too works as expected. Manual
However, if I combine them:
feh --keep-zoom-vp --zoom "fill" *
Then it does NOT fit the images to the window size, and it starts out at 100%. The 'zoom fill' parameters are ignored. Any way to make them both work?
anon
Jul 19, 2023, 06:37 PM
• Last activity: Jul 25, 2023, 05:07 AM
2
votes
1
answers
457
views
How to display image width and height in FEH?
I want FEH to display image's width and height in bottom-left corner (like: 1920x1080) But feh --info "%wx%h" doesn't work, and terminal says: sh: 1: 1920x1080: not found
I want FEH to display image's width and height in bottom-left corner (like: 1920x1080)
But
feh --info "%wx%h"
doesn't work, and terminal says:
sh: 1: 1920x1080: not found
helloyes20
(21 rep)
Jul 29, 2022, 05:41 PM
• Last activity: Jul 23, 2023, 02:55 PM
0
votes
0
answers
943
views
Editing images with feh
According to the `feh` man page: > `--edit` Enable basic editing of files. This makes rotation and mirroring (bound to " ", "|", and "_" by default) change the underlying file and not just its displayed content. So based on my understanding of this, I should be able to use, for example, `feh --edit...
According to the
feh
man page:
> --edit
Enable basic editing of files. This makes rotation and mirroring (bound to "", "|", and "_" by default) change the underlying file and not just its displayed content.
So based on my understanding of this, I should be able to use, for example, feh --edit "<" image.png
to rotate an image. But when I try this, I get the message
feh WARNING: < does not exist - skipping
And when I try feh --edit < image.png
, it opens a different image.
Does anyone know how to use the editing features of feh?
Yehuda
(331 rep)
Jun 9, 2021, 02:48 PM
• Last activity: Jul 23, 2023, 07:19 AM
7
votes
1
answers
4502
views
feh: maintain zoom setting
When browsing through the images in a directory with `feh`, the magnification can be changed by use of the up/down arrow keys, but the setting is lost as soon as the next image in the series is loaded. Is there a way to apply the magnification setting selected for image i to image i+1? If not, is th...
When browsing through the images in a directory with
feh
, the magnification can be changed by use of the up/down arrow keys, but the setting is lost as soon as the next image in the series is loaded. Is there a way to apply the magnification setting selected for image i to image i+1? If not, is this possible in another lightweight image viewer?
user001
(3808 rep)
Sep 9, 2014, 12:40 AM
• Last activity: Jul 20, 2023, 06:01 PM
0
votes
1
answers
207
views
feh on linux keeps looping despite of --cycle-once
I am using a le potato running raspbian, to display pictures on a screen. These pictures are in a shared folder I can access from my windows pc. The input is where the pictures go, and output is scaled so they are actually fullscreen. I have some code to check if any changes are made in the input fo...
I am using a le potato running raspbian, to display pictures on a screen. These pictures are in a shared folder I can access from my windows pc. The input is where the pictures go, and output is scaled so they are actually fullscreen. I have some code to check if any changes are made in the input folder, so it will adjust the output folder.
My problem:
I need the slideshow to loop once, then close, revealing google chrome underneath. Wait for a set amount of time (10 minutes) and then play the slideshow again.
For some reason, the slideshow keeps playing even though I use --cycle-once.
I have tried to use a loop count, but this did not do anything. T tried to have the code delete the pictures in output after vieuwing them, and then after output is empty sleep and restart, but it didn't *see* when a picture was viewed.
Sadly im pretty new to linux and coding, and have used chatGPT for most of my work. I have been bashing my head against this for 3 days now, and hope someone can help me.
Current code:
#!/usr/bin/bash
input_folder="/home/power/Public/screen/input/"
output_folder="/home/power/Public/screen/output/"
slideshow_pid=""
### Function to upscale and copy images from the input folder to the output folder
upscale_and_copy() {
local file_path="$1"
local file_name=$(basename "$file_path")
local output_path="$output_folder/$file_name"
convert "$file_path" -resize 1920x1080^ "$output_path"
}
### Function to remove images from the output folder
remove_from_output_folder() {
local file_path="$1"
local file_name=$(basename "$file_path")
local output_path="$output_folder/$file_name"
rm "$output_path"
}
### Function to restart the slideshow
restart_slideshow() {
if [[ -n "$slideshow_pid" ]]; then
kill "$slideshow_pid"
fi
### Function that plays the actual slideshow
feh --quiet --fullscreen --cycle-once --slideshow-delay 3 "$output_folder" &
slideshow_pid=$!
}
### Upscale and copy existing images from input to output folder
for file in "$input_folder"/*; do
upscale_and_copy "$file"
done
### Display the images from the output folder in a slideshow
restart_slideshow
### Monitor input folder for changes and update the output folder accordingly
inotifywait -m -r -e create -e delete -e move -e modify "$input_folder" |
while read -r directory event filename; do
if [[ $event == "CREATE" || $event == "MODIFY" || $event == "MOVED_TO" ]]; then
upscale_and_copy "$input_folder/$filename"
restart_slideshow
elif [[ $event == "DELETE" || $event == "MOVED_FROM" ]]; then
remove_from_output_folder "$input_folder/$filename"
restart_slideshow
fi
done
I have tested the following,
When I run JUST the following code, it STILL keeps looping endlessly, so it's feh itself that's causing the problem somehow:
feh --quiet --fullscreen --cycle-once --slideshow-delay 3 /home/power/Public/screen/output/ &
Michael van der Beek
(1 rep)
Jul 18, 2023, 03:07 PM
• Last activity: Jul 20, 2023, 12:56 PM
6
votes
6
answers
19306
views
How to permanently set default color of feh's background to black?
Whenever I open an image in feh, the background is set to the standard, dark gray and gray checkboard pattern like this: [![enter image description here][1]][1] [1]: https://i.sstatic.net/tlKUQ.png **As you can see, it's the checkboard background. How do I permanently change this to black?** I've se...
Whenever I open an image in feh, the background is set to the standard, dark gray and gray checkboard pattern like this:
**As you can see, it's the checkboard background. How do I permanently change this to black?**
I've search Google and other places, but I can't seem to find a straight answer. I'm **guessing feh's config file** is involved, but I can't find any examples of how to do it in the config file. I know you can do it in the command line with

--bg-color black
*(or something)* but I'd like to just have it set to black by default.
M. Knepper
(421 rep)
Feb 25, 2018, 08:05 PM
• Last activity: Jun 1, 2023, 07:16 AM
0
votes
2
answers
388
views
feh image viewer: toggle frameless/move window
With the feh image viewer I can open a frameless window on an image. This is good. However now I want to move the window on the screen and to do that I guess I will need a frame. So is there a way of moving a window or of toggling the `frameless` feature. I don't see the option in `~/.config/feh/key...
With the feh image viewer I can open a frameless window on an image. This is good.
However now I want to move the window on the screen and to do that I guess I will need a frame.
So is there a way of moving a window or of toggling the
frameless
feature.
I don't see the option in ~/.config/feh/keys
or in man feh
.
Stephen Boston
(2526 rep)
Apr 23, 2023, 07:50 AM
• Last activity: Apr 23, 2023, 12:23 PM
1
votes
0
answers
2561
views
feh ERROR: Can't open X display. It *is* running, yeah?
Followed this tutorial to try and get a photo album running on my raspberry pi 3: https://pimylifeup.com/raspberry-pi-photo-frame/ Using feh to try and run `DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh --quiet --preload --randomize --full-screen --reload 60 -Y --slideshow-delay 15.0 /ho...
Followed this tutorial to try and get a photo album running on my raspberry pi 3: https://pimylifeup.com/raspberry-pi-photo-frame/
Using feh to try and run
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh --quiet --preload --randomize --full-screen --reload 60 -Y --slideshow-delay 15.0 /home/pi/Photos-001/
But keep getting the error feh ERROR: Can't open X display. It *is* running, yeah?
.
I've tried export DISPLAY=:0
but that doesn't seem to have any affect
Open to any solutions, or alternatives to feh
Running on Raspbian GNU/Linux 11 (bullseye) on a Raspberry Pi 3
Alex Reed
(11 rep)
Feb 4, 2023, 02:53 AM
• Last activity: Feb 4, 2023, 10:23 AM
2
votes
2
answers
1031
views
Get the Absolute Path from feh
The [feh][1] command allows you to view images within a folder recursively: feh --recursive --auto-zoom While viewing images, it also allows you to associate custom commands with keys 0-9 on your keyboard. For example, if I wanted the terminal to output the filename of the image I was viewing (to th...
The feh command allows you to view images within a folder recursively:
feh --recursive --auto-zoom
While viewing images, it also allows you to associate custom commands with keys 0-9 on your keyboard. For example, if I wanted the terminal to output the filename of the image I was viewing (to the terminal), I could make it do that by pressing the zero key while the image is being displayed by running
feh
with an --action
argument like this:
feh --recursive --auto-zoom --action "echo '%f'"
--action
binds the command echo '%f'
to the zero key. %f
is the relative path and looks like this when outputted ./filename.jpg
.
However, I need feh
to give me the absolute path instead of a relative path. So, I need to cut off that dot and then append what's left onto the pwd
.
This is my attempt to do that:
feh --recursive --auto-zoom --cache-size 2048 --action "echo $(pwd)$(echo '%f' | cut -c 2-)}"
but the output looks like this:
/absolute/pathf
(notice the 'f' on the end of the pwd)
How can I instead achieve an output like this? :
/absolute/path/filename.jpg
Lonnie Best
(5415 rep)
Jan 3, 2022, 11:10 AM
• Last activity: Nov 5, 2022, 09:17 PM
0
votes
1
answers
909
views
feh image viewer in thumbnail mode want scrollable window
If I go `feh --thumbnails ` I get a nice clickable screen of thumbnails for the images in ` `. But - I can't scroll that screen - If I close an image I raise, the thumbnail display closes too. What am I missing?
If I go
feh --thumbnails
I get a nice clickable screen of thumbnails for the images in ``.
But
- I can't scroll that screen
- If I close an image I raise, the thumbnail display closes too.
What am I missing?
Stephen Boston
(2526 rep)
Oct 22, 2022, 02:02 AM
• Last activity: Oct 22, 2022, 06:13 AM
0
votes
1
answers
4320
views
Change window size to fit current image size with feh from CLI
I have read the feh manual but could not find a command line option to change window size to fit current image size : $ qrencode -o- https://youtu.be/JrLYOJqe22U | feh --zoom 300 - Can you help me ?
I have read the feh manual but could not find a command line option to change window size to fit current image size :
$ qrencode -o- https://youtu.be/JrLYOJqe22U | feh --zoom 300 -
Can you help me ?
SebMa
(2433 rep)
Mar 11, 2022, 12:32 AM
• Last activity: Aug 8, 2022, 10:18 PM
4
votes
2
answers
2223
views
Is there an approach to have feh --thumbnails do not display filename?
I have many pictures which are screen shots created from shutter and downloaded from web. These pictures have long file names. When I create thumbnails on these pictures via `feh -t`, these long file name will prevent `feh` to display many pictures in one row. And I did not find a solution for this...
I have many pictures which are screen shots created from shutter and downloaded from web. These pictures have long file names. When I create thumbnails on these pictures via
feh -t
, these long file name will prevent feh
to display many pictures in one row.
And I did not find a solution for this on the feh
man page. What can
I do to display many pictures in a row?
David Young
(81 rep)
Feb 22, 2014, 04:22 PM
• Last activity: Apr 11, 2022, 09:03 PM
1
votes
2
answers
1663
views
Feh show custom text on image
I'm trying to find an example for `feh` image viewer that you can use to show on screen your custom text. I wrote my own application which is doing some action and one of them is to show on the image screen and upon the image some additional text is also displayed, which I get from a server response...
I'm trying to find an example for
feh
image viewer that you can use to show on screen your custom text.
I wrote my own application which is doing some action and one of them is to show on the image screen and upon the image some additional text is also displayed, which I get from a server response.
All of the documentation that I found does not have enough information.
--info [flag]command_line
Execute command_line and display its output in the bottom left
corner of the image. Can be used to display e.g. image dimensions or
EXIF information. Supports FORMAT SPECIFIERS. If flag is set to “;”,
the output will not be displayed by default, but has to be enabled
by the toggle_info key.
Does anyone have a command to show text as input or can also be read from a specified file.
MiselMoj
(11 rep)
Nov 2, 2021, 09:26 AM
• Last activity: Nov 2, 2021, 06:09 PM
3
votes
2
answers
11833
views
How can I get feh to set wallpaper to each monitor according to its size?
I have a directory filled with `png` files $ tree ~/wallpaper/ ~/wallpaper/ ├── foo--1366x768.png ├── foo--1920x1080.png ├── foo--2048x1080.png ├── foo--3440x1440.png └── foo--3840x2160.png 0 directories, 5 files I'm often changing monitors, sometimes with multiple attached. I want a script that det...
I have a directory filled with
png
files
$ tree ~/wallpaper/
~/wallpaper/
├── foo--1366x768.png
├── foo--1920x1080.png
├── foo--2048x1080.png
├── foo--3440x1440.png
└── foo--3840x2160.png
0 directories, 5 files
I'm often changing monitors, sometimes with multiple attached. I want a script that detects the sizes of the monitors attached to my computer and sets the wallpaper from ~/wallpaper
according to the monitor's size.
So, if monitors with resolutions 1366x768
and 3440x1440
are connected, I want the script to set the wallpapers to ~/wallpaper/foo--1366x768.png
and ~/wallpaper/foo--3440x1440.png
respectively. In this particular example, I know that issuing the command
feh --bg-fill ~/wallpaper/foo--1366x768.png ~/wallpaper/foo--3440x1440.png
will set the wallpapers correctly.
To solve the general problem, I know I can issue
xrandr | grep ' connected' | awk '{print $3}' | cut -f1 -d"+"
to get the dimensions of the monitors attached. In our running example, the output here is:
1366x768
3440x1440
I want to now somewhow pipe this into a command to set the wallpaper with feh
. How can I do this?
Brian Fitzpatrick
(2907 rep)
Sep 4, 2019, 06:30 PM
• Last activity: May 28, 2021, 06:01 AM
Showing page 1 of 20 total questions