I toggle my resolution with:
sudo xrandr --output eDP-1-1 --mode "3840x2400"
How do I make xrandr not require sudo? So e.g. I can do:
xrandr --output eDP-1-1 --mode "3840x2400"
I am in the video
group. I would not like to expose my password in a regular file, but am willing to make some kind of system script which automatically becomes root temporarily just for xrandr
purposes.
(The script will be called when I click a toggle button in a menubar, so in fact it will be a python script which detects the resolution and toggles between 3840x2400 and 1920x1200.)
EDIT: I believe some strange circumstance caused xrandr to require being run as root. This may have been nvidia-drm.modeset kernal parameter, or something like having to manually re-add modelines despite them existing. If you find yourself in this situation, I really don't know what to suggest. Please feel free to comment. Somehow the requirement to use sudo went away with a reboot. I am accepting the top answer.
xrandr
as root? It should only need a valid X authentication. – Toby Speight Aug 17 '23 at 16:08