mirror of
				https://gitlab.sectorq.eu/jaydee/ansible.git
				synced 2025-10-30 18:01:11 +01:00 
			
		
		
		
	
		
			Some checks failed
		
		
	
	Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
				
			
		
			
				
	
	
		
			25 lines
		
	
	
		
			610 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			610 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/bash
 | |
| rm  /tmp/monitors.txt
 | |
| while read -r output hex conn; do
 | |
|     [[ -z "$conn" ]] && conn=${output%%-*}
 | |
|     echo "$output;$(xxd -r -p <<< "$hex")">>/tmp/monitors.txt
 | |
| 
 | |
| done < <(xrandr --prop | awk '
 | |
|     !/^[ \t]/ {
 | |
|         if (output && hex) print output, hex, conn
 | |
|         output=$1
 | |
|         hex=""
 | |
|     }
 | |
|     /ConnectorType:/ {conn=$2}
 | |
|     /[:.]/ && h {
 | |
|         sub(/.*000000fc00/, "", hex)
 | |
|         hex = substr(hex, 0, 26) "0a"
 | |
|         sub(/0a.*/, "", hex)
 | |
|         h=0
 | |
|     }
 | |
|     h {sub(/[ \t]+/, ""); hex = hex $0}
 | |
|     /EDID.*:/ {h=1}
 | |
|     END {if (output && hex) print output, hex, conn}
 | |
|     ' | sort
 | |
| )
 |