Skip to content

jasoc/xorg-resolution-fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xorg resolution fixer

Linux Python


What is Xorg resolution fixer?

It is a python module that uses xrandr and cvt to force a specific resolution whenever a supported resolution doesn't appear in your monitor settings. For instance, it determines the VESA CVT modelines with the command cvt {width} {height} {refresh_rate} and passes it to xrandr by calling xrandr --newmode {modeline_str} and xrandr --addmode {display} {name}


What is the advantage?

It automates the above procedure simply by calling

xrf --set --height 1080 --width 1920 --refresh-rate 120

plus, with the --install parameter it can configure a systemd service that call the command at every boot.


How to use it

To install xrf in your system, issue the following commands:

git clone https://github.com/jasoc/xorg-resolution-fixer.git

cd xorg-resolution-fixer

sudo python setup.py install

Then you will have the xrf command globally available in your system. To fix a resolution, this is the magic line:

xrf --set --height 1080 --width 1920 --refresh-rate 120 --display HDMI-1

Be aware that the --display parameter requires any available display that you can list with

xrf --list-displays

To install it as a systemd service, use

xrf --install --height 1080 --width 1920 --refresh-rate 120 --user boblazar
systemctl --user enable --now xorg-resolution-fixer

The --user parameter should be the user that runs the X server at the boot. Most of the time is your standard user, so if you don't specify, that will be used. Just be aware of that if you have any kind of special configuration of Xorg.

Anyway, a detailed list of command is available with

xrf --help

Why

Well, for some misterious reasons, with some monitor (expecially TVs) some resolutions doesn't appear under Xorg, even if supported. But, for the same misterious reasons, you can force it! What a deal! This module helps you doing so. If you wonder, it all began when I decided to switch from Gnome under Wayland to Gnome under Xorg, since Wayland isn't supported pretty much by anything, and seeing my old-fashion TV I am using as a monitor in a totally broken resolution made me nuts.


License


Contributing

You are free to reuse and contribute to the project, I'll eventually accept the pull requests if the proposed features fits the initial aim of the project.

About

A python cli tool that forces a resolution in a specific display using xrandr.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages