Last active
May 29, 2020 09:25
-
-
Save joebushi/5e4b1a448d12fc482b43f90d315d0fd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # BenQ PD3220U working modes for Purism Librem 13 v4 | |
| # Add higher resolutions via xrandr | |
| # References on issue | |
| # https://forums.puri.sm/t/4k-output-from-librem13-hdmi-port/4441/2 | |
| # Create new modes | |
| # NOTE: use `cvt` not `gtf` to get mode settings | |
| xrandr --newmode $(cvt 3840 2160 26 | sed '1d' | cut -d" " -f 2- | sed 's/.00"/hz"/g') | |
| xrandr --newmode $(cvt 2560 1440 30 | sed '1d' | cut -d" " -f 2- | sed 's/.00"/hz"/g') | |
| # TODO: test this non-blanking mode | |
| # cvt -r 3840 2160 | |
| # 3840x2160 59.97 Hz (CVT 8.29M9-R) hsync: 133.25 kHz; pclk: 533.00 MHz | |
| # Modeline "3840x2160R" 533.00 3840 3888 3920 4000 2160 2163 2168 2222 +hsync -vsync | |
| # Add modes to outputs | |
| xrandr --addmode HDMI1 3840x2160_26hz | |
| xrandr --addmode HDMI2 3840x2160_26hz | |
| xrandr --addmode DP1 3840x2160_26hz | |
| xrandr --addmode HDMI1 2560x1440_30hz | |
| xrandr --addmode HDMI2 2560x1440_30hz | |
| xrandr --addmode DP1 2560x1440_30hz | |
| # Set monitors | |
| xrandr --output eDP1 --auto --output HDMI1 --mode 3840x2160_26hz --above eDP1 | |
| # xrandr --output eDP1 --auto --output HDMI1 --mode 2560x1440_30hz --above eDP1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment