Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make target for contrib/autorandr_nitrogen_wallpaper #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gmdfalk
Copy link

@gmdfalk gmdfalk commented Jan 7, 2016

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

@phillipberndt
Copy link
Owner

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 #42 (comment), 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.

@gmdfalk
Copy link
Author

gmdfalk commented Jan 7, 2016

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

@phillipberndt
Copy link
Owner

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?

@gmdfalk
Copy link
Author

gmdfalk commented Jan 7, 2016

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.

@phillipberndt
Copy link
Owner

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 #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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants