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 support for rate #30

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

Add support for rate #30

wants to merge 2 commits into from

Conversation

jonaz
Copy link

@jonaz jonaz commented Dec 3, 2020

Also fixed a few other things:

  • bugs in active mode detection with displays with multiple rates (144hz and 60hz in my case). Updated test cases.
  • Turn off changed displays in a smarter way. Im using usb-c daisychain
    and had trouble with the current approach. it disabled my screen as soon
    as the screen went into hibernate because xrandr stopped detecting the
    display.
  • some autoformatting of comments and code according to efficient go
    guidelines
  • if xrand (ApplyRule) fails, try 3 times with a little more sleep each
    time. This also solved issues with my daisychained displays.
  • dont execute_after if xrandr fails 3 times.

Fixes #29

@jonaz
Copy link
Author

jonaz commented Dec 4, 2020

Retry does not work. A Cmd cannot be reused after calling its Run, Output or CombinedOutput methods.
Will have to refactor that.

@jonaz
Copy link
Author

jonaz commented Dec 4, 2020

Can confirm the retry stuff works now like a charm.

Dec 04 21:42:44 work sh[1979081]: grobi: 21:42:44.049230 new rule found: Dockhome
Dec 04 21:42:44 work sh[1979081]: grobi: 21:42:44.049239 enable outputs: [eDP-1 DP-2-1@2560x1440@60 DP-2-8]
Dec 04 21:42:44 work sh[1979081]: grobi: 21:42:44.049247 using one atomic call to xrandr
Dec 04 21:42:44 work sh[1979081]: grobi: 21:42:44.049297 running command /usr/bin/xrandr xrandr --output eDP-1 --auto --output DP-2-1 --mode 2560x1440 --rate 60 --right-of eDP-1 --output DP-2-8 --auto --right-of DP-2-1
Dec 04 21:42:44 work sh[2146601]: xrandr: cannot find mode 2560x1440
Dec 04 21:42:44 work sh[1979081]: executing command for rule Dockhome failed: exit status 1
Dec 04 21:42:44 work sh[1979081]: trying again in 0sgrobi: 21:42:44.052792 running command /usr/bin/xrandr xrandr --output eDP-1 --auto --output DP-2-1 --mode 2560x1440 --rate 60 --right-of eDP-1 --output DP-2-8 --auto --right-of DP-2-1
Dec 04 21:42:44 work sh[2146602]: xrandr: cannot find mode 2560x1440
Dec 04 21:42:44 work sh[1979081]: executing command for rule Dockhome failed: exit status 1
Dec 04 21:42:44 work sh[1979081]: trying again in 500msgrobi: 21:42:44.556665 running command /usr/bin/xrandr xrandr --output eDP-1 --auto --output DP-2-1 --mode 2560x1440 --rate 60 --right-of eDP-1 --output DP-2-8 --auto --right-of DP-2-1
Dec 04 21:42:48 work sh[1979081]: grobi: 21:42:48.230698 running command /usr/bin/sh sh -c /home/jonaz/jonaz-vim-rc/workScreenLayout.sh DP-2-1 DP-2-8

Copy link
Owner

@fd0 fd0 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fd0
Copy link
Owner

fd0 commented Feb 27, 2021

Would you mind rebasing on the master branch? There's a merge conflict

Jonas Falck added 2 commits March 9, 2021 11:37
Also fixed a few other things:
- bugs in active mode detection with my display (144hz and 60hz)
- Turn off changed displays in a smarter way. Im using usb-c daisychain
and had trouble with the current approach. it disabled my screen as soon
as the screen went into hibernate because xrandr stopped detecting the
display.
- some autoformatting of comments and code according to efficient go
guidelines
- if xrand (ApplyRule) fails, try 3 times with a little more sleep each
time. This also solved issues with my daisychained displays.

Fixes fd0#29
@jonaz
Copy link
Author

jonaz commented Mar 9, 2021

@fd0 rebased on master!

@jonaz
Copy link
Author

jonaz commented Mar 9, 2021

Hmm Error: exported func BuildCommandOutputRow returns unexported type github.com/fd0/grobi.commands, which can be annoying to use (golint)

I personally dont think thats a problem. But to satisfy the linter i could make it public? Commands
What do you think?

ping @fd0

@jonaz
Copy link
Author

jonaz commented Nov 22, 2022

Ping @fd0 ?

@jonaz
Copy link
Author

jonaz commented Mar 8, 2024

ping @fd0

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.

Set refresh rate?
2 participants