autorandr icon indicating copy to clipboard operation
autorandr copied to clipboard

Add make target for contrib/autorandr_nitrogen_wallpaper

Open gmdfalk opened this issue 9 years ago • 5 comments

Add make target and detection for autorandr_nitrogen_wallpaper and install it next to the autorandr binary.

gmdfalk avatar Jan 07 '16 12:01 gmdfalk

How about making the following additional changes:

  • Run non-profile-specific preswitch/postswitch scripts from system-wide configuration directories as well, i.e. let exec_scripts search each $XDG_CONFIG_DIRS/autorandr as well
  • In addition to path/script_name, also run each executable from path/script_name.d/
  • Symlink autorandr_nitrogen_wallpaper to /etc/xdg/autorandr/postswitch.d/autorandr_nitrogen_wallpaper in the Makefile
  • While we're at it: Introduce a new script hook, postsave, that is called for new autorandr configurations, and use it for autorandr_nitrogen_wallpaper save

Also, in https://github.com/phillipberndt/autorandr/issues/42#issuecomment-168490169, I've recently added a variable $AUTORANDR_CURRENT_PROFILE to block scripts. We could add the same for postswitch scripts to avoid the second call to autorandr in autorandr_nitrogen_wallpaper.

phillipberndt avatar Jan 07 '16 13:01 phillipberndt

Thanks, for the reply.

It might just be me but I've always preferred the simple approach of acpid or bsd style initalization. Keep configuration in as few files as possible and have ideally one script to handle all execution paths conditionally. I don't quite see how autorandr warrants the complexity of /etc style configuration and modularization.

But maybe that is because my use case is very simple. I dock my laptop, the event is recognized, a handler script is automatically executed which calls, among others, autorandr. Same for undocking.

Then again, I've just started using autorandr today (thanks, btw!) and i will keep an eye on this issue and certainly contribute back any changes i make.

Oh, and $AUTORANDR_CURRENT_PROFILE is great. It should definitely be documented in README.md, imo.

Regards

gmdfalk avatar Jan 07 '16 13:01 gmdfalk

My point is that IMHO it doesn't make much sense to install the script to /usr/bin by default, but then leave it unused/unconfigured. That'd just add cruft to the system, wouldn't it?

phillipberndt avatar Jan 07 '16 13:01 phillipberndt

In my eyes it's not much different to autorandr. It's a binary that can be used. What happens after installation is up to the user. You can symlink it directly to postswitch or call it automatically/manually on demand. For now, i just wanted it in $PATH (because it wasn't being installed at all). But i think you're right, what you're proposing does make sense in the long run. Can i ask why /etc/xdg? I would have expected it under /usr/lib/autorandr/scripts or similar.

gmdfalk avatar Jan 07 '16 13:01 gmdfalk

Can i ask why /etc/xdg? I would have expected it under /usr/lib/autorandr/scripts or similar.

Because the basedir spec says so 😃 Autorandr used to store configurations in ~/.autorandr, the idea to comply with xdg came up in https://github.com/phillipberndt/autorandr/pull/18. That the global postswitch/preswitch scripts are stored inside the configuration directory rather than a separate one is a remnant of the legacy autorandr script, I try to maintain compatibility as much as possible in case wertarbyte decides to revive his original version.

(By the way, autorandr already loaded profiles from /etc/xdg/autorandr, only script support was missing. I've just added that some minutes ago.)

phillipberndt avatar Jan 07 '16 14:01 phillipberndt