Skip to content

Commit

Permalink
Move Finfosys.System to MSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Oct 22, 2016
1 parent 10dfbcc commit 8b50424
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 68 deletions.
61 changes: 1 addition & 60 deletions I-Nex/i-nex/.src/MAIN/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Private Button[99] As Button
Private TextLabel[99] As TextLabel
Private YESNO As Picture
Public AllowLog As Boolean
Public sLine As String
Public aScan As String[]
Public cpu As String
Public CPU_FLAGS As New String[]
Public CPU_VENDOR_ID As New String[]
Expand All @@ -34,7 +32,6 @@ Public BUFFER As String
Public DATAT As Collection
Public UNAME As Collection
Public USAGE As Collection
Public SCREENFETCH As Collection
Public INDEX0 As String
Public INDEX1 As String
Public INDEX2 As String
Expand Down Expand Up @@ -269,7 +266,7 @@ Public Sub Form_Open()
Logs("Check Dospam uptime", Logger.Info)
dospam_uptime()
Logs("Check System", Logger.Info)
System()
Object.Call(MSystem, "System")
Logs("Call to Distribution_Detect", Logger.Info)
Object.Call(Distribution_Detect, "_inits")
Logs("Check Bios", Logger.Info)
Expand Down Expand Up @@ -320,62 +317,6 @@ Public Sub bios()
Try TextBox28.Text = "Product Version: " & Replace(File.Load("/sys/devices/virtual/dmi/id/product_version"), "\n", "")
End

Public Sub System()
Dim hostname, arch, gcc, timezone, xorg_version, glx_version As String
Dim SCREENFETCH_P As Process
SCREENFETCH_P = Exec ["" & ChkPrm.ChkExecDir("bash") & ""] For Write
Write #SCREENFETCH_P, File.Load("Data/screenfetch-dev")
SCREENFETCH_P.Wait
SCREENFETCH = JSON.Decode(File.Load(User.Home & "/.i-nex/screenfetch.json"))

Shell "cat /etc/timezone | grep ^TIMEZONE= /etc/sysconfig/clock | cut -d '=' -f 2" Wait To timezone
If timezone = Null Or "" Then
Shell "timedatectl status | grep \"Time zone:\" | cut -d \":\" -f 2 | cut -d \"(\" -f 1" Wait To timezone
Endif
'Detect heap size
For Each sLine In Split(File.Load("/proc/self/maps"), "\n")
If InStr(sLine, "[heap]") Then
aScan = Scan(sLine, "*-* *")
Label176.Text = "Heap size is " & Format(Val("&H" & aScan[1] & "&") - Val("&H" & aScan[0] & "&"), "#,##0") & " bytes."
Break
Endif
Next
'End od detect heap size
hostname = System.Host
arch = System.Architecture
Shell "gcc -dumpversion" Wait To gcc
Shell "cat /var/log/Xorg.0.log | grep \"X.Org X Server\" | awk {'print $4'}" Wait To xorg_version
Shell ChkPrm.ChkExecDir("glxinfo") & "| grep \"GLX version:\" | sed -n '1p' | cut -d ':' -f 2" Wait To glx_version
'Shell "echo $SHELL" Wait To TextBox67.Text
Label135.Text = "System SHELL: " & System.Shell
Label137.Text = "GCC Version: " & Replace(gcc, "\n", "")
Label138.Text = "Hostname: " & Replace(hostname, "\n", "")
Label139.Text = "Arch: " & Replace(arch, "\n", "")
Label140.Text = "Timezone: " & Replace(timezone, "\n", "")
Label141.Text = "X.Org Version: " & Replace(xorg_version, "\n", "")
Label142.Text = "GLX Version: " & Replace(glx_version, "\n", "")
Distribution_Detect._inits

Label4.Text = "Distro Vendor: " & SCREENFETCH["Distro"]
Label135.Text = "Distro Release: " & SCREENFETCH["Distro_Release"]
Label144.Text = SCREENFETCH["BINUTILS"]
Label145.Text = "Linux C Library: " & SCREENFETCH["LNXCLIB"]
Label37.Text = "Desktop environment: " & SCREENFETCH["DE"]
Label60.Text = "Window manager: " & SCREENFETCH["WM"]
Label61.Text = "Window manager Theme: " & SCREENFETCH["WinTheme"]
Label62.Text = "GTK+ 2 Theme: " & SCREENFETCH["GTK2Theme"]
Label63.Text = "GTK+ 3 Theme: " & SCREENFETCH["GTK3Theme"]
Label147.Text = "GTK Font: " & SCREENFETCH["GTKFont"]
Label148.Text = "GTK Icons: " & SCREENFETCH["GTKIcons"]
Label149.Text = "GNU Make Version: " & SCREENFETCH["GNUMAKE"]
Label150.Text = "PPP: " & SCREENFETCH["PPP"]
Label151.Text = "Dynamic linker (ldd): " & SCREENFETCH["DYNAMIC_LINKER"]
Label152.Text = "Net-tools: " & SCREENFETCH["NETTOOLS"]
Label153.Text = "Wireless-tools: " & SCREENFETCH["WIRELESS_TOOLS"]
SCREENFETCH_P.Kill
SCREENFETCH.Clear
End

Public Sub grafika()
Dim available_resolutions, Kernel_driver_in_use As String
Dim rozdzielczosc, gpu, memory_prefetchable, memory_non_prefetchable As String
Expand Down
16 changes: 8 additions & 8 deletions I-Nex/i-nex/.src/System/Distribution_Detect.module
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Public Sub _inits()
Select Case Finfosys.SCREENFETCH["Distro"]
Select Case MSystem.SCREENFETCH["Distro"]
Case Like "*Mint*"
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/mint.png"]
Finfosys.PictureBox2.Name = "mint.png"
Expand Down Expand Up @@ -74,31 +74,31 @@ Public Sub _inits()
Finfosys.PictureBox2.Name = "kde_neon.png"
End Select

If Finfosys.SCREENFETCH["Distro"] Like "*Ubuntu*" And Finfosys.SCREENFETCH["DE"] Like "*KDE*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Ubuntu*" And MSystem.SCREENFETCH["DE"] Like "*KDE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/kubuntu.png"]
Finfosys.PictureBox2.Name = "kubuntu.png"
Endif
If Finfosys.SCREENFETCH["Distro"] Like "*Ubuntu*" And Finfosys.SCREENFETCH["DE"] Like "*XFCE*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Ubuntu*" And MSystem.SCREENFETCH["DE"] Like "*XFCE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/xubuntu.png"]
Finfosys.PictureBox2.Name = "xubuntu.png"
Endif
If Finfosys.SCREENFETCH["Distro"] Like "*Mint*" And Finfosys.SCREENFETCH["DE"] Like "*KDE*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Mint*" And MSystem.SCREENFETCH["DE"] Like "*KDE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/linux_mint_KDE_BIG_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_KDE_BIG_sticker.png"
Endif
If Finfosys.SCREENFETCH["Distro"] Like "*Mint*" And Finfosys.SCREENFETCH["DE"] Like "*LXDE*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Mint*" And MSystem.SCREENFETCH["DE"] Like "*LXDE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/linux_mint_LXDE_BIG_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_KDE_BIG_sticker.png"
Endif
If Finfosys.SCREENFETCH["Distro"] Like "*Mint*" And Finfosys.SCREENFETCH["DE"] Like "*Fluxbox*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Mint*" And MSystem.SCREENFETCH["DE"] Like "*Fluxbox*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/linux_mint_Fluxbox_BIG_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_Fluxbox_BIG_sticker.png"
Endif
If Finfosys.SCREENFETCH["Distro"] Like "*Mint*" And Finfosys.SCREENFETCH["DE"] Like "*XFCE*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Mint*" And MSystem.SCREENFETCH["DE"] Like "*XFCE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/linux_mint_XFCE_Big_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_XFCE_Big_sticker.png"
Endif
If Finfosys.SCREENFETCH["Distro"] Like "*Mint*" And Finfosys.SCREENFETCH["DE"] Like "*MATE*" Then
If MSystem.SCREENFETCH["Distro"] Like "*Mint*" And MSystem.SCREENFETCH["DE"] Like "*MATE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/mint_mate.png"]
Finfosys.PictureBox2.Name = "Mint/mint_mate.png"
Endif
Expand Down
60 changes: 60 additions & 0 deletions I-Nex/i-nex/.src/System/MSystem.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
' Gambas module file

Public aScan As String[]
Public sLine As String
Public SCREENFETCH As Collection
Public Sub System()
Dim hostname, arch, gcc, timezone, xorg_version, glx_version As String
Dim SCREENFETCH_P As Process
SCREENFETCH_P = Exec ["" & ChkPrm.ChkExecDir("bash") & ""] For Write
Write #SCREENFETCH_P, File.Load("Data/screenfetch-dev")
SCREENFETCH_P.Wait
SCREENFETCH = JSON.Decode(File.Load(User.Home & "/.i-nex/screenfetch.json"))

Shell "cat /etc/timezone | grep ^TIMEZONE= /etc/sysconfig/clock | cut -d '=' -f 2" Wait To timezone
If timezone = Null Or "" Then
Shell "timedatectl status | grep \"Time zone:\" | cut -d \":\" -f 2 | cut -d \"(\" -f 1" Wait To timezone
Endif
'Detect heap size
For Each sLine In Split(File.Load("/proc/self/maps"), "\n")
If InStr(sLine, "[heap]") Then
aScan = Scan(sLine, "*-* *")
Finfosys.Label176.Text = "Heap size is " & Format(Val("&H" & aScan[1] & "&") - Val("&H" & aScan[0] & "&"), "#,##0") & " bytes."
Break
Endif
Next
'End od detect heap size
hostname = System.Host
arch = System.Architecture
Shell "gcc -dumpversion" Wait To gcc
Shell "cat /var/log/Xorg.0.log | grep \"X.Org X Server\" | awk {'print $4'}" Wait To xorg_version
Shell ChkPrm.ChkExecDir("glxinfo") & "| grep \"GLX version:\" | sed -n '1p' | cut -d ':' -f 2" Wait To glx_version
'Shell "echo $SHELL" Wait To TextBox67.Text
Finfosys.Label135.Text = "System SHELL: " & System.Shell
Finfosys.Label137.Text = "GCC Version: " & Replace(gcc, "\n", "")
Finfosys.Label138.Text = "Hostname: " & Replace(hostname, "\n", "")
Finfosys.Label139.Text = "Arch: " & Replace(arch, "\n", "")
Finfosys.Label140.Text = "Timezone: " & Replace(timezone, "\n", "")
Finfosys.Label141.Text = "X.Org Version: " & Replace(xorg_version, "\n", "")
Finfosys.Label142.Text = "GLX Version: " & Replace(glx_version, "\n", "")
Distribution_Detect._inits

Finfosys.Label4.Text = "Distro Vendor: " & SCREENFETCH["Distro"]
Finfosys.Label135.Text = "Distro Release: " & SCREENFETCH["Distro_Release"]
Finfosys.Label144.Text = SCREENFETCH["BINUTILS"]
Finfosys.Label145.Text = "Linux C Library: " & SCREENFETCH["LNXCLIB"]
Finfosys.Label37.Text = "Desktop environment: " & SCREENFETCH["DE"]
Finfosys.Label60.Text = "Window manager: " & SCREENFETCH["WM"]
Finfosys.Label61.Text = "Window manager Theme: " & SCREENFETCH["WinTheme"]
Finfosys.Label62.Text = "GTK+ 2 Theme: " & SCREENFETCH["GTK2Theme"]
Finfosys.Label63.Text = "GTK+ 3 Theme: " & SCREENFETCH["GTK3Theme"]
Finfosys.Label147.Text = "GTK Font: " & SCREENFETCH["GTKFont"]
Finfosys.Label148.Text = "GTK Icons: " & SCREENFETCH["GTKIcons"]
Finfosys.Label149.Text = "GNU Make Version: " & SCREENFETCH["GNUMAKE"]
Finfosys.Label150.Text = "PPP: " & SCREENFETCH["PPP"]
Finfosys.Label151.Text = "Dynamic linker (ldd): " & SCREENFETCH["DYNAMIC_LINKER"]
Finfosys.Label152.Text = "Net-tools: " & SCREENFETCH["NETTOOLS"]
Finfosys.Label153.Text = "Wireless-tools: " & SCREENFETCH["WIRELESS_TOOLS"]
SCREENFETCH_P.Kill
SCREENFETCH.Clear
End

0 comments on commit 8b50424

Please sign in to comment.