grobi
grobi copied to clipboard
Add support for rate
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
Retry does not work. A Cmd cannot be reused after calling its Run, Output or CombinedOutput methods.
Will have to refactor that.
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
Would you mind rebasing on the master branch? There's a merge conflict
@fd0 rebased on master!
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
Ping @fd0 ?