mirror of
https://github.com/hykilpikonna/hyfetch.git
synced 2026-08-23 01:05:15 -05:00
[F] neofetch: skip inactive DRM connectors for resolution (Fix #319)
This commit is contained in:
14
neofetch
14
neofetch
@@ -4564,7 +4564,21 @@ get_resolution() {
|
||||
resolution="$(xdpyinfo | awk '/dimensions:/ {printf $2}')"
|
||||
|
||||
elif [[ -d /sys/class/drm ]]; then
|
||||
local connector status enabled single_resolution
|
||||
|
||||
for dev in /sys/class/drm/*/modes; do
|
||||
[[ -e $dev ]] || continue
|
||||
|
||||
connector=${dev%/modes}
|
||||
status=
|
||||
enabled=
|
||||
single_resolution=
|
||||
|
||||
[[ -r "$connector/status" ]] && read -r status _ < "$connector/status"
|
||||
[[ -r "$connector/enabled" ]] && read -r enabled _ < "$connector/enabled"
|
||||
|
||||
[[ $status == "disconnected" || $enabled == "disabled" ]] && continue
|
||||
|
||||
read -r single_resolution _ < "$dev"
|
||||
|
||||
[[ $single_resolution ]] && resolution="${single_resolution}, ${resolution}"
|
||||
|
||||
Reference in New Issue
Block a user