grobi icon indicating copy to clipboard operation
grobi copied to clipboard

Add support for rate

Open jonaz opened this issue 4 years ago • 10 comments
trafficstars

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 avatar Dec 03 '20 16:12 jonaz

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

jonaz avatar Dec 04 '20 08:12 jonaz

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

jonaz avatar Dec 04 '20 21:12 jonaz

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

fd0 avatar Feb 27 '21 10:02 fd0

@fd0 rebased on master!

jonaz avatar Mar 09 '21 10:03 jonaz

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 avatar Mar 09 '21 11:03 jonaz

Ping @fd0 ?

jonaz avatar Nov 22 '22 18:11 jonaz