Skip to content

Commit

Permalink
Replace Shell "Command" to File.Load (Faster method) And Add If Exist…
Browse files Browse the repository at this point in the history
…("sys/classdrm")
  • Loading branch information
eloaders committed Nov 19, 2013
1 parent 9f99248 commit baf082f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/i-nex/.src/FGraphic.module
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@ End

Public Sub _check()
Dim status, enabled, dpms, monitor_name, manufacturer, serial_number As String
Shell "cat /sys/class/drm/" & Finfosys.ComboBox8.Text & "/status" Wait To status
Shell "cat /sys/class/drm/" & Finfosys.ComboBox8.Text & "/enabled" Wait To enabled
Shell "cat /sys/class/drm/" & Finfosys.ComboBox8.Text & "/dpms" Wait To dpms

If Exist("/sys/class/drm/") Then

status = File.Load("/sys/class/drm/" & Finfosys.ComboBox8.Text & "/status")
enabled = File.Load("/sys/class/drm/" & Finfosys.ComboBox8.Text & "/enabled")
dpms = File.Load("/sys/class/drm/" & Finfosys.ComboBox8.Text & "/dpms")

Shell "/usr/bin/inex-edid /sys/class/drm/" & Finfosys.ComboBox8.Text & "/edid | grep 'Monitor name' | cut -d ':' -f 2" Wait To monitor_name
Shell "/usr/bin/inex-edid /sys/class/drm/" & Finfosys.ComboBox8.Text & "/edid | grep 'Manufacturer' | cut -d ':' -f 2" Wait To manufacturer
Shell "/usr/bin/inex-edid /sys/class/drm/" & Finfosys.ComboBox8.Text & "/edid | grep 'Serial number' | cut -d ':' -f 2" Wait To serial_number
Finfosys.Label100.Text = "Monitor name: " & Replace(monitor_name, "\n", "")
Shell "/usr/bin/inex-edid /sys/class/drm/" & Finfosys.ComboBox8.Text & "/edid | grep 'Monitor name' | cut -d ':' -f 2" Wait To monitor_name
Shell "/usr/bin/inex-edid /sys/class/drm/" & Finfosys.ComboBox8.Text & "/edid | grep 'Manufacturer' | cut -d ':' -f 2" Wait To manufacturer
Shell "/usr/bin/inex-edid /sys/class/drm/" & Finfosys.ComboBox8.Text & "/edid | grep 'Serial number' | cut -d ':' -f 2" Wait To serial_number

Endif

'/sys/class/drm/card0-VGA-1/dpms
Finfosys.Label100.Text = "Monitor name: " & Replace(monitor_name, "\n", "")
Finfosys.Label65.Text = "Status: " & Replace(status, "\n", "")
Finfosys.Label66.Text = "Enabled: " & Replace(enabled, "\n", "")
Finfosys.Label67.Text = "DPMS: " & Replace(dpms, "\n", "")
Finfosys.Label101.Text = "Manufacturer: " & Replace(manufacturer, "\n", "")
Finfosys.Label102.Text = "Serial number: " & Replace(serial_number, "\n", "")

End

0 comments on commit baf082f

Please sign in to comment.