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

autorandr: 855c18b -> 1.1 #26296

Merged
merged 2 commits into from Jun 10, 2017
Merged

autorandr: 855c18b -> 1.1 #26296

merged 2 commits into from Jun 10, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jun 1, 2017

Motivation for this change

Update package and also fix predetect script usage

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@gnidorah, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kampka, @coroa and @edolstra to be potential reviewers.

wantedBy = [ "sleep.target" ];
};

services.udev.extraRules = ''
ACTION=="change", SUBSYSTEM=="drm", RUN+="${pkgs.bash}/bin/sh -c '${pkgs.systemd}/bin/systemctl is-active -q graphical.target && ${pkgs.systemd}/bin/systemctl start autorandr.service'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACTION=="change", SUBSYSTEM=="drm", TAG+="systemd", ENV{SYSTEMD_WANTS}="autorandr.service"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 Great, thank you! Will ask this to go in upstream.

Copy link
Author

@ghost ghost Jun 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 After a better testing it seems that the rule you suggested doesn't execute at every monitor replug (which is desired behaviour). Insisting on my rule line then and reopening PR... phillipberndt/autorandr#61 (comment)

Copy link
Member

@Mic92 Mic92 Jun 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I would rename the upstream unit to autorandr@.service and set BindsTo to the device node to systemd to make the service restart, whenever the device appears/disappears:

ACTION=="change", SUBSYSTEM=="drm", TAG+="systemd", ENV{SYSTEMD_WANTS}="autorandr@%E{DEVNAME}.service"

If this does also not work. I would at least remove the raise condition (systemctl is-active check) and make systemctl non-blocking:

${pkgs.systemd}/bin/systemctl start --no-block autorandr.service

@ghost ghost closed this Jun 3, 2017
@ghost ghost reopened this Jun 3, 2017
@ghost ghost closed this Jun 6, 2017
@ghost ghost reopened this Jun 7, 2017
@ghost ghost changed the title autorandr: 855c18b -> ee77c35 autorandr: 855c18b -> 1.1 Jun 7, 2017
@ghost
Copy link
Author

ghost commented Jun 7, 2017

@Mic92 Fixed in upstream. Thank you much for the help!

@@ -22,19 +22,9 @@ in {

environment.systemPackages = [ pkgs.autorandr ];

# systemd.unitPackages = [ pkgs.autorandr ];
systemd.packages = [ pkgs.autorandr ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have enabled the service and it also seems to be trigger:

services.autorandr.enable = true;
Jun 08 12:08:56 turingmachine autorandr[12586]: Failed to load profile 'default': Profile not found (line 1035)
Jun 08 12:08:56 turingmachine autorandr[12586]: Running autorandr as joerg for display :0
Jun 08 12:08:56 turingmachine systemd[1]: Started autorandr execution hook.

So the idea would be to make a default profile in my user account for autorandr?

Copy link
Author

@ghost ghost Jun 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 You will need to manually configure autorandr to make use of it. Default is often created as a symlink to desired be-default profile https://github.com/phillipberndt/autorandr#how-to-use

@Mic92 Mic92 merged commit fbe658e into NixOS:master Jun 10, 2017
@ghost ghost deleted the master3 branch June 12, 2017 13:49
@ghost
Copy link
Author

ghost commented Jun 12, 2017

@Mic92 Thank you!

@grahamc
Copy link
Member

grahamc commented Feb 21, 2018

@gnidorah when trying to use this service I get:

Feb 21 10:27:16 Morbo systemd[1]: Starting autorandr execution hook...
Feb 21 10:27:16 Morbo autorandr[26523]: /bin/sh: xrandr: command not found
Feb 21 10:27:16 Morbo autorandr[26523]: Failed to run xrandr (line 439)
Feb 21 10:27:16 Morbo autorandr[26523]: Running autorandr as grahamc for display :0

any ideas on what is up?

@Mic92
Copy link
Member

Mic92 commented Feb 21, 2018

impurity ...

@Mic92
Copy link
Member

Mic92 commented Feb 21, 2018

There should be a makeWrapper in autorandr that adds xrandr to $PATH of autorandr.

@ghost
Copy link
Author

ghost commented Feb 22, 2018

@grahamc @Mic92 #35314

BTW autorandr is X11 only thing, no Wayland support. What is the best way to indicate that?
And that means you need services.xserver.enable = true; which adds xorg.xrandr to environment.systemPackages. So the only real use of above PR is autorandr package under non-NixOS distro with missing xrandr in path.

@ghost ghost mentioned this pull request Feb 22, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants