Introduction
When using a 5120x1440 screen resolution with i3 window manager and feh image viewer on Ubuntu, you might encounter a strange issue where the background image appears to be stretched to a 3840x1080 resolution. This article discusses the causes and solutions for this resolution mismatch issue.
Understanding the Issue
The issue occurs because, by default, i3 sets the wallpaper using the xwallpaper command, which doesn't support high resolutions like 5120x1440.
Feh is then used to tile the image, leading to the stretching effect.
feh Configuration
Feh has its limitations when used with high DPI screens. By default, feh scales the image to the closest resolution it supports, resulting in a distorted appearance.
Solutions
Method 1: Using a Script to Set the Wallpaper
One solution is to create a custom script that sets the wallpaper using feh with the correct dimensions.
#!/bin/bash
feh --bg-scale /path/to/your/image.jpg
Make the script executable and add it to your i3 configuration file (~/.config/i3/config):
exec --no-startup-id /path/to/your/script.shMethod 2: Using a Different Wallpaper Manager
Consider using a different wallpaper manager that supports high DPI screens, such as nitrogen, fehbg, or variety.
- By default, i3 uses
xwallpaperto set the wallpaper, which may not support high-resolution screens like 5120x1440. - Feh, the default image viewer, might not display high-resolution images correctly due to its limitations in handling high DPI screens.
- You can create a custom script using the
fehcommand with the correct dimensions or use a different wallpaper manager to address the issue.