You are not logged in.
Hi all.
Here is my humble contribution.
I developed an utility which may be useful for those who tired of using bare xrandr and who ends up eventually in creating scripts home.sh office.sh default.sh to re-apply screen settings.
My utility solves this by storing screen settigns in json and providing simple interface to apply stored settings.
Here how it works:
Under /etc/randrctl/profiles you create profile that you use at home, say, /etc/randrctl/profiles/home
{
"outputs": {
"LVDS1": {
"width": 1366,
"height": 768,
"top": 0,
"left": 0
},
"DP1": {
"width": 1920,
"height": 1080,
"left": 1366
}
},
"primary": "DP1"
}
You can then activate this profile by simply running
$ randrctl switch-to home
Profiles can be generated automatically from your current screen setup (root is required as profiles are stored under /etc/randrctl/profiles/*)
# randrctl dump office
randrctl -h will give you basic usage information.
Utility is not nearly complete. The main idea (I already have prototype for this) is to associate EDIDs of connected displays with profiles and choose appropriate profiles automatically when new displays are connected/disconnected.
Code and all usage info is on github
https://github.com/edio/randrctl
I've created AUR package for archers
https://aur.archlinux.org/packages/randrctl-git/
Would be glad to get any feedback on idea and implementation.
Cheers!
Offline
Added simple code completions for zsh and bash (just edited those ones for netctl).
Offline
Are you familiar with autorandr? It seems to serve a similar purpose.
"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/
https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024
Offline
Thanks for pointing. Never heard of that project before.
I suspected there should be similar tools already...
Just checked the code: yes, it is exactly the tool I was looking for. Only after/before hooks are missing to workaround i3 crash when applying saved profile.
Offline
Oh, there is even a postswitch script. Nice. Perhaps I have to consider contributing support for "priorswitch"
Offline
Still, nice work!
Offline
Although there is this autorandr project, which is better in some ways (its simplicity is a huge Pro comparing to randrctl), I decided to keep up development.
Perhaps, I'll borrow some ideas from autorandr (I like that it works in without sudo and how its support for posthook is done).
Anyway, open source is about choice, and I have fun doing all this.
Regarding randrctl itself: I've just added support for rotation and panning. This, by the way, impacted profile format, which became simpler I believe.
Offline
One comment about the name: Everytime I read *ctl, I assume it is somehow related to systemd. That said, I salute your decision to continue development, maybe you can exchange ideas with autorandr at some point.
Do you plan to add support for user profiles not stored in /etc?
Offline
Awebb,
*ctl should suggest that experience is similar to Archlinux's netctl. This also led to a decision to store all configuration under /etc/randrctl to be consistent with netctl approach.
But, yes, I understand that this is not very convenient, so I'm going to implement support for profiles stored under user's home directory.
Offline
Yeah, that's exactly why I thought it's a systemd tool. It used to be netcfg but morphed into netctl to integrate and mimic systemd. No big deal, though.
Offline
Implemented per-user configuration.
Now application uses both ~/.config/randrctl/ and /etc/randrctl.
The first location is preferred. If no such folder exists, app will give a warning, saying, that it prefers to use ~/.config/randrctl.
If /etc/randrctl is also absent, app will create ~/.config/randrctl.
During conflicts resolution (conflicting options in config.ini, same profile names) data from ~/.config/randrctl prevails.
It is possible to force randrctl to use only /etc/randrct/ as before with --system key (may be needed to dump system-wide profile).
Known issues: shell completion functions are not fully updated, readme not updated.
Offline
Implemented support for automatic profiles switching.
Fully automatic switching is possible with udev (afaik, only opensource drivers allow this).
Also it is now possible to run
randrctl auto
to automatically activate the most matching profile.
What randrctl has now above autorandr is an ability to match profiles by supported modes. For example, you can create profile, that will be activated for any display on your HDMI port that supports 1920x1080 mode.
{
"primary": "DP1",
"outputs": {
"LVDS1": {
"pos": "0x312",
"mode": "1366x768"
},
"HDMI1": {
"pos": "1366x0",
"mode": "1920x1080"
}
},
"match": {
"LVDS1": {},
"DP1": {
"mode": "1920x1080"
}
}
}
Offline
Very nice tool - thanks for sharing it!
I have to try this out ASAP, as in the past my WM (bspwm) was sometimes crashing between xrandr-calls. Not sure if it's really bspwm's fault, but I've been looking for a tool to both provide pre-/post-switching hooks and the "auto-detect"-functionality at the same time.
thanks again,
CjK
Offline
Thanks for showing interest in this tool! I've been desperate already, that no one uses it (except for me of course ).
Let me know if you have any issues with it.
Offline
Noticed, I forgot to update aur package with new PKGBUILD. So package missed completions and udev rules. Fixed now.
Offline
Updated setup.py to include randrctl-auto. Before this autoswitching had been broken.
Offline