18 lines
412 B
Tcl
Executable File
18 lines
412 B
Tcl
Executable File
#!/usr/bin/tclsh
|
|
|
|
set out [exec xwininfo -root -display :0]
|
|
regexp {geometry (\d+x\d+)} $out m res
|
|
if { $argc == 1 } {
|
|
set str "$argv0\($argv\): $res"
|
|
} else {
|
|
set str "$argv0: $res"
|
|
}
|
|
puts $res
|
|
# if file can be opened for writing then add debug data to it
|
|
set fn "/tmp/resolution_results.txt"
|
|
if { ! [catch {open $fn a} f] } {
|
|
puts -nonewline $f "[clock format [clock seconds]]: "
|
|
puts $f $str
|
|
close $f
|
|
}
|