diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-06-10 09:58:25 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-06-10 09:58:25 +0900 |
| commit | 585126b6b8e32a2fd2597b5e9c4bcf62d72542c7 (patch) | |
| tree | 41faef9a57600d4813fa6bcfcf677bf564545789 /ar/.local/bin/dmenudisplay | |
| parent | fc5165c1be93c695023d79942d907c8227140a62 (diff) | |
Diffstat (limited to 'ar/.local/bin/dmenudisplay')
| -rwxr-xr-x | ar/.local/bin/dmenudisplay | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ar/.local/bin/dmenudisplay b/ar/.local/bin/dmenudisplay index 4673599..8c4e411 100755 --- a/ar/.local/bin/dmenudisplay +++ b/ar/.local/bin/dmenudisplay @@ -25,7 +25,12 @@ get_resolution() { chosen_res=$(echo "$resolutions" | dmenu -i -p "Resolution for $display:") [ -n "$chosen_res" ] && echo "--mode $chosen_res" || echo "--auto" else - echo "--auto" + # No EDID-preferred mode on some displays makes --auto fall back to a tiny + # mode (e.g. 640x480). Default to the highest available mode instead. + best=$(xrandr --query | sed -n "/^$display/,/^[^ ]/p" | + grep -v "^$display" | grep -E "^[[:space:]]+[0-9]+x[0-9]+" | + awk '{print $1}' | sort -t x -k1,1n -k2,2n | tail -n1) + [ -n "$best" ] && echo "--mode $best" || echo "--auto" fi } |
