ayekat / localdir

Personal configuration files
65 stars 3 forks source link

Trigger automatic action when (un)plugging screens #34

Open ayekat opened 3 years ago

ayekat commented 3 years ago

I frequently attach and detach screens, and it would be nice if there was a way to automatically configure the external screen (at least in known cases/for known screens).

https://tyler.vc/auto-monitor-detection-on-linux describes how to tap into udev for detecting screen (un)plug events. Although I would certainly implement my handler differently (permission and environment handling), I think it's worth trying out something similar there (though potentially that will mostly happen in a dedicated tool, i.e. not in this dotfiles repo).

But the basics are there.

kriansa commented 1 year ago

You could use autorandr if you're on X11.

Shameless plug: you could also try wmcompanion