[~/Pictures/wall] > feh archlinux.png
feh ERROR: Can't open X display. It is running, yeah?
Assistant
The error message you're encountering indicates that is trying to open an X display, but it cannot find one. This is typical when you are using a Wayland compositor like Sway, as is a native X11 application and requires X11 support.
User
image viewer for sway archlinux
Assistant
Viewnior is a lightweight image viewer designed for simplicity and speed. It's commonly used in various Linux distributions, including Arch Linux, and integrates well with desktop environments like Sway, which is a Wayland compositor. If you're using Sway or looking for alternatives to Viewnior in an Arch Linux setup, here are some options:
Viewnior Features
Simple and clean user interface
Fast image loading and browsing
Supports common image formats (JPEG, PNG, GIF, etc.)
Basic image manipulation features (zooming, rotation)
Slideshow feature
Alternatives to Viewnior
Sxiv (Simple X Image Viewer)
Lightweight and minimalistic.
Supports basic image manipulation.
Uses the keyboard for navigation, making it fast once you're accustomed to the controls.
Feh
Highly configurable and efficient.
Can function as a standalone viewer or as a component for scripts.
Supports image manipulation and displays images in a variety of ways (browsing, slideshows).
GPicView
Lightweight and easy to use.
Offers basic image editing features along with viewing capabilities.
Good integration with various desktop environments.
Mirage
Simple image viewer that supports various image formats.
Supports basic operations like zooming and rotating images.
Offers a clean interface without unnecessary features.
Shotwell
A more feature-rich alternative that includes image management capabilities.
Suitable for users who not only want to view images but also organize and edit them.
Gwenview
Part of the KDE suite, it provides a more comprehensive image viewer experience.
Offers editing capabilities and supports a wide range of image formats. However, it may be more resource-intensive than Viewnior.
Nomacs
Free and open-source image viewer.
Offers various features like image editing, metadata viewing, and support for several file formats.
Compatibility with Sway
When using Sway (a Wayland compositor), it's essential to ensure the selected image viewer supports Wayland or is compatible through XWayland. Most of the above options, like Sxiv and Feh, are X11 applications, and they will work under Sway using XWayland, although potential performance and feature differences may exist.
Conclusion
When choosing an image viewer to use with Sway on Arch Linux, consider the following factors:
Resource usage: If you need something lightweight, Feh or Sxiv might be ideal.
Features: If you want additional management capabilities, you might prefer Shotwell or Gwenview.
Ease of use: For a balance between simplicity and functionality, GPicView or Mirage is a great choice.
You can install these applications from the Arch Linux repositories using the pacman package manager. For example:
bash
sudo pacman -S feh
or for Sxiv:
bash
sudo pacman -S sxiv
Ultimately, the best choice will depend on your specific needs and preferences.
feh
feh
To run legacy X11 applications on a Wayland session (like Sway), you can use XWayland. Here are some steps to troubleshoot the issue and potential solutions:
1. Ensure XWayland is Installed
Check that XWayland is installed on your system since it allows X11 applications to run on Wayland. You can verify its installation by running:
bash
pacman -Q xorg-xwayland
If it’s not installed, you can install it with:
bash
sudo pacman -S xorg-xwayland
2. Double-Check Display Environment Variables
When running under Sway, ensure that the display variable is set correctly. It typically should not be necessary to set it manually, but you can check it as follows:
bash
echo $DISPLAY
In a Wayland session, it will typically be empty or not set as it uses a different system than the traditional X DISPLAY.
3. Using Wayland-compatible Applications
If feh continues to give you issues, consider using Wayland-compatible image viewers. Some options include:
1. sxiv:
You may try sxiv as it has Wayland support through XWayland:
bash
sxiv archlinux.png
2. viewnior:
You already mentioned using Viewnior. This application can run under Wayland natively:
bash
viewnior archlinux.png
3. gthumb:
Another option that supports Wayland is gthumb. Install it with:
bash
sudo pacman -S gthumb
And run it:
bash
gthumb archlinux.png
4. Use wl-clipboard
If you just want to open images with a simple viewer and you don't have a preference, consider using the Wayland-compatible viewer or use applications incorporating native support for Wayland. For instance, wl-clipboard is a utility that works well under Wayland and can streamline your user experience.
5. Check Sway Configuration
Make sure Sway or your configuration files aren’t blocking any necessary environment variables or application launches.
Summary
While feh is a great tool for X11, it's best to use native Wayland applications like viewnior, sxiv, or other image viewers compatible with Wayland. If the problem persists despite these attempts, you may want to consult the documentation or community forums for your specific version of Sway and Arch Linux for additional insights or potential bugs.
If you're using Sway on Arch Linux and looking for image viewers that work well under Wayland, there are several options available that should provide good functionality without the issues associated with X11 applications. Here are some recommended image viewers for your setup:
1. Viewnior
Description: A simple, lightweight image viewer that offers a clean interface and supports basic image manipulation, like zooming and rotating.
Installation:
bash
sudo pacman -S viewnior
Usage: Run it with the command:
bash
viewnior your_image.png
2. XViewer
Description: Part of the Xfce desktop environment, but can run standalone. It's lightweight and fast.
Installation:
bash
sudo pacman -S xfce4-panel xfce4-appfinder
Usage: Launch it via terminal:
bash
xviewer your_image.png
3. nomacs
Description: A free, open-source image viewer that supports a wide variety of image formats and has some editing capabilities.
Installation:
bash
sudo pacman -S nomacs
Usage: Run it with:
bash
nomacs your_image.png
4. GImageView
Description: A simple image viewer that allows for easy viewing and light editing of images.
Installation:
bash
sudo pacman -S gimageview
Usage: Start it with:
bash
gimageview your_image.png
5. gthumb
Description: A versatile image viewer with additional features for image management, such as organizing and basic editing.
Installation:
bash
sudo pacman -S gthumb
Usage: Open images with:
bash
gthumb your_image.png
6. eog (Eye of GNOME)
Description: The GNOME desktop environment's image viewer, which is simple to use and feature-rich.
Installation:
bash
sudo pacman -S eog
Usage: Open an image with:
bash
eog your_image.png
Notes on Using Wayland
Most of the image viewers mentioned above should work well under Sway, as they are either native Wayland applications or support running under XWayland. Here are a few tips:
Performance: Native Wayland applications typically perform better in Sway than those running in XWayland.
Keyboard Shortcuts: Familiarize yourself with the keyboard shortcuts of your chosen viewer to enhance navigation efficiency.
Integration: Some viewers may integrate more seamlessly with certain file managers or workflows, so choose one that best fits your typical use case.
Testing: If you're unsure, try installing a couple of them to see which one you find most comfortable for your workflow.
Feel free to explore each of these options to find the image viewer that best meets your needs on Arch Linux with the Sway compositor.