Skip to content

Add support for rate - #30

Open
jonaz wants to merge 3 commits into
fd0:masterfrom
jonaz:master
Open

Add support for rate#30
jonaz wants to merge 3 commits into
fd0:masterfrom
jonaz:master

Conversation

@jonaz

@jonaz jonaz commented Dec 3, 2020

Copy link
Copy Markdown

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

jonaz commented Dec 4, 2020

Copy link
Copy Markdown
Author

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

@jonaz

jonaz commented Dec 4, 2020

Copy link
Copy Markdown
Author

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

@fd0 fd0 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM, thanks!

@fd0

fd0 commented Feb 27, 2021

Copy link
Copy Markdown
Owner

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

jonaz 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

jonaz commented Mar 9, 2021

Copy link
Copy Markdown
Author

@fd0 rebased on master!

@jonaz

jonaz commented Mar 9, 2021

Copy link
Copy Markdown
Author

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

jonaz commented Nov 22, 2022

Copy link
Copy Markdown
Author

Ping @fd0 ?

@jonaz

jonaz commented Mar 8, 2024

Copy link
Copy Markdown
Author

ping @fd0

displays

Happens for example in daisy chaining usb-c to DP it always changes the
number when reconnecting to the display
@xFA25E

xFA25E commented Apr 12, 2025

Copy link
Copy Markdown

Hi @jonaz , are you still using this patch? May I apply it locally since it's not merged?

@jonaz

jonaz commented Apr 12, 2025 via email

Copy link
Copy Markdown
Author

@weezel

weezel commented May 19, 2025

Copy link
Copy Markdown

Any change to get this merged?

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?

4 participants