Skip to content

Commit

Permalink
New uname JSON. MV files to JSON folder. Fixes in thermal.
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jan 28, 2014
1 parent 7d55397 commit a9d4d76
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 72 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions JSON/uname.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Copyright(C) 2014, Michał Głowienka aka eloaders <eloaders@linux.pl>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include <stdio.h>
#include <sys/utsname.h>

int main() {
struct utsname inex_uname;

if(uname(&inex_uname) == -1)
printf("{\n"
" \"Failed\": \"uname_call_failed\""
"}\n");
else
printf("{\n"
" \"System_name\": \"%s\",\n" /* Operating system name (e.g., "Linux") */
" \"Nodename\": \"%s\",\n" /* Name within "some implementation-defined network" */
" \"Release\": \"%s\",\n" /* OS release (e.g., "2.6.28") */
" \"Version\": \"%s\",\n" /* OS version */
" \"Machine\": \"%s\"\n" /* Hardware identifier */
"}\n",
inex_uname.sysname,
inex_uname.nodename,
inex_uname.release,
inex_uname.version,
inex_uname.machine);

return 0;
}
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ libgl = $(shell pkg-config gl --cflags --libs)
libx11 = $(shell pkg-config x11 --cflags --libs)
libxext = $(shell pkg-config xext --cflags --libs)
GBC = /usr/bin/gbc3
GBCOPTS = -eagtpmv
GBCOPTS = -eagtpm
GBA = gba3
CC = gcc
ARCH=$(shell uname -m)
Expand Down Expand Up @@ -65,11 +65,12 @@ dependency_build ?= git \

make:
@printf "\033[1;31mCompile edid-decode as inex-decode \033[0m$1\n"
$(CC) -o i-nex-edid edid-decode.c $(CFLAGS) $(additional_confflags)
$(CC) -o i-nex-cpuid cpu.c -static $(CC_OPTS_LIBCPUID) $(additional_confflags)
$(CC) -o i-nex-usage free.c -static $(CC_OPTS_LIBPROCPS) $(additional_confflags)
$(CC) -o i-nex-cpusage cpusage.c $(additional_confflags)
$(CC) -o i-nex-glinfo glinfo.c -O2 $(libx11) $(libgl) $(libxext) $(additional_confflags)
$(CC) -o i-nex-edid JSON/edid-decode.c $(CFLAGS) $(additional_confflags)
$(CC) -o i-nex-cpuid JSON/cpu.c -static $(CC_OPTS_LIBCPUID) $(additional_confflags)
$(CC) -o i-nex-usage JSON/free.c -static $(CC_OPTS_LIBPROCPS) $(additional_confflags)
$(CC) -o i-nex-cpusage JSON/cpusage.c $(additional_confflags)
$(CC) -o i-nex-glinfo JSON/glinfo.c $(libx11) $(libgl) $(libxext) $(additional_confflags)
$(CC) -o i-nex-uname JSON/uname.c $(additional_confflags)
@printf "\033[1;31mCompile src/i-nex stage 1 \033[0m$1\n"
$(GBC) $(GBCOPTS) src/i-nex
@printf "\033[1;31mCompile src/i-nex stage 2 \033[0m$1\n"
Expand Down Expand Up @@ -98,6 +99,7 @@ self:
chmod +x i-nex-usage
chmod +x i-nex-cpusage
chmod +x i-nex-glinfo
chmod +x i-nex-uname
chmod +x debian/check_kernel
chmod +x debian/i-nex-lspci
$(INSTALL) 0755 i-nex inex$(bindir)
Expand All @@ -106,6 +108,7 @@ self:
$(INSTALL) 0755 i-nex-usage inex$(bindir)
$(INSTALL) 0755 i-nex-cpusage inex$(bindir)
$(INSTALL) 0755 i-nex-glinfo inex$(bindir)
$(INSTALL) 0755 i-nex-uname inex$(bindir)
$(INSTALL) 0755 src/i-nex/i-nex.gambas inex$(bindir)
$(INSTALL) 0755 pixmaps/pixmaps/i-nex.xpm inex/usr/share/pixmaps/
$(INSTALL) 0755 debian/i-nex.desktop inex/usr/share/applications/
Expand Down Expand Up @@ -166,6 +169,7 @@ clean:
$(RM_COM) $(RMFILE_OPT) i-nex-usage
$(RM_COM) $(RMFILE_OPT) i-nex-cpusage
$(RM_COM) $(RMFILE_OPT) i-nex-glinfo
$(RM_COM) $(RMFILE_OPT) i-nex-uname
$(RM_COM) $(RMDIR_OPT) `find . -name ".gambas"`
$(RM_COM) $(RMDIR_OPT) `find . -name "*.gambas"`
$(RM_COM) $(RMDIR_OPT) `find . -name ".directory"`
Expand Down Expand Up @@ -200,6 +204,7 @@ install:
chmod +x i-nex-usage
chmod +x i-nex-cpusage
chmod +x i-nex-glinfo
chmod +x i-nex-uname
chmod +x debian/check_kernel
chmod +x debian/i-nex-lspci
$(INSTALL) 0755 i-nex $(DESTDIR)$(bindir)
Expand All @@ -208,6 +213,7 @@ install:
$(INSTALL) 0755 i-nex-usage $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-cpusage $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-glinfo $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-uname $(DESTDIR)$(bindir)
$(INSTALL) 0755 src/i-nex/i-nex.gambas $(DESTDIR)$(bindir)
$(INSTALL) 0755 debian/i-nex.desktop $(DESTDIR)/usr/share/applications/
$(INSTALL) 0755 debian/check_kernel $(DESTDIR)/usr/bin/
Expand All @@ -230,6 +236,7 @@ uninstall:
rm $(DESTDIR)$(bindir)/i-nex-usage
rm $(DESTDIR)$(bindir)/i-nex-cpusage
rm $(DESTDIR)$(bindir)/i-nex-glinfo
rm $(DESTDIR)$(bindir)/i-nex-uname
rm $(DESTDIR)$(bindir)/i-nex.gambas
rm $(DESTDIR)/usr/share/pixmaps/i-nex.xpm
rm $(DESTDIR)/usr/share/applications/i-nex.desktop
Expand Down
10 changes: 5 additions & 5 deletions src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SearchComment=False
SearchString=True

[OpenFile]
Active=1
File[1]=".src/Finfosys.form"
File[2]=".src/Global.class:15.70"
File[3]=".src/About.form"
Expand All @@ -40,16 +41,15 @@ File[13]=".src/FReport_Gen.class:15.70"
File[14]=".src/Start_App_Args.form"
File[15]=".src/Start_App_Args.class:15.70"
File[16]=".src/ChkPrm.module:15.70"
File[17]=".src/thermal_zone.module:15.70"
File[17]=".src/thermal_zone.module:27.20"
File[18]=".src/FModules.form"
File[19]=".src/FModules.class:15.70"
File[20]=".src/Input_Devices.module:15.70"
File[21]=".src/net.module:15.70"
File[22]="Data/report-ng.sh:5.3"
File[23]=".src/Distribution_Detect.module:15.70"
File[24]=".src/FFlags.module:15.70"
Active=25
File[25]=".src/Finfosys.class:1007.3"
File[25]=".src/Finfosys.class:303.19"
File[26]=".src/FDF.form"
File[27]=".src/FDF.class:15.70"
File[28]=".src/FNET_R_T.form"
Expand All @@ -60,7 +60,7 @@ File[32]=".src/FCPU.module:15.70"
File[33]=".src/FUdisks.form"
File[34]=".src/FUdisks.class:15.70"
File[35]=".src/FCpudb.module:15.70"
File[36]=".src/JSON.module:15.70"
File[36]=".src/JSON.module:109.7"
File[37]=".src/Settings.class:15.70"
File[38]=".src/Main.module:15.70"
File[39]=".src/_Settings_Keys.class:15.70"
Expand All @@ -70,7 +70,7 @@ File[42]=".src/Dialog.class:15.70"
File[43]=".src/Mdecode.module:15.70"
File[44]=".src/Reports/MCPU_REPORT.module:48.53"
File[45]=".src/Reports/MMOBO_REPORT.module:20.60"
File[46]=".src/Reports/MGPU_REPORT.module:47.77"
File[46]=".src/Reports/MGPU_REPORT.module:24.35"
File[47]=".src/Reports/MSOUND_REPORT.module:13.14"
File[48]=".src/Reports/MPastebinit.module:22.35"
File[49]=".src/Reports/MSYSTEM_REPORT.module:39.1"
Expand Down
74 changes: 36 additions & 38 deletions src/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -301,20 +301,30 @@ Public Sub ComboBox1_Click()
End

Public Sub kernel()
Dim found_kernels, cur_used, All_Kernels, for_add, Kernel_command_line As String
Dim found_kernels, All_Kernels, for_add, Kernel_command_line As String
Dim kernels, i As Integer
Dim UNAME_DATA As String
Dim UNAME As Collection
Try Exec ["/usr/bin/i-nex-uname"] Wait To UNAME_DATA
Try UNAME = JSON.Decode(UNAME_DATA)
Shell "ls /boot | grep 'vmlinuz*' | wc -l" Wait To All_Kernels
kernels = Replace(Replace(All_Kernels, " ", ""), "\n", "")

For i = 1 To kernels
Shell "ls /boot | grep 'vmlinuz*' | cut -d '/' -f 3 | sed -n '" & i & "p'" Wait To for_add
for_add = Replace(Replace(for_add, " ", ""), "\n", "")
ListBox1.Add(for_add, i)
Next

Shell "ls /boot/vmlinuz* | cut -d '/' -f 3 | wc -l" Wait To found_kernels
Shell "uname -r" Wait To cur_used
Shell "cat /proc/cmdline" Wait To Kernel_command_line
TextLabel25.Text = "Found " & found_kernels & " kernels:"
TextLabel26.Text = "Currently used: " & cur_used & ""

Frame22.Text = "Installed Kernels: " & found_kernels
Try TextLabel7.Text = "System name: " & UNAME["System_name"]
Try TextLabel16.Text = "Nodename: " & UNAME["Nodename"]
Try TextLabel17.Text = "Release: " & UNAME["Release"]
Try TextLabel18.Text = "Version: " & UNAME["Version"]
Try TextLabel26.Text = "Machine: " & UNAME["Machine"]
TextArea3.Text = Kernel_command_line
End

Expand Down Expand Up @@ -423,37 +433,20 @@ End
Public Sub grafika()
Dim available_resolutions, Kernel_driver_in_use As String
Dim rozdzielczosc, gpu, memory_prefetchable, memory_non_prefetchable As String
Dim opengl_vendor_string, opengl_renderer_string, opengl_version_string As String
Dim GL As String
Dim GLX_GFX As Collection

If ChkPrm.chkExec("glxinfo") = True Then
'lspci -v -s `lspci | awk '/VGA/{print $1}'` | grep 'Kernel driver in use:' | cut -d ':' -f 2
Shell "glxinfo | grep 'OpenGL vendor string:' | sed -n '1p' | cut -d ':' -f 2" Wait To opengl_vendor_string
Shell "glxinfo | grep 'OpenGL renderer string:' | sed -n '1p' | cut -d ':' -f 2" Wait To opengl_renderer_string
Shell "glxinfo | grep 'OpenGL version string:' | sed -n '1p' | cut -d ':' -f 2" Wait To opengl_version_string

Label105.Text = "OpenGL Vendor: " & Replace(opengl_vendor_string, "\n", "")
Label106.Text = "OpenGL Renderer: " & Replace(opengl_renderer_string, "\n", "")
Label107.Text = "OpenGL Version: " & Replace(opengl_version_string, "\n", "")
Try Label220.Text = "Server glx vendor: "
Try Label221.Text = "Server glx version: "
Try Label222.Text = "Client glx vendor: "
Try Label224.Text = "Client glx version: "
Try Label225.Text = "GLX version: "

Else
Try Exec ["/usr/bin/i-nex-glinfo"] Wait To opengl_vendor_string
Try GLX_GFX = JSON.Decode(opengl_vendor_string)
Try Label105.Text = "OpenGL Vendor: " & GLX_GFX["GL_VENDOR"]
Try Label106.Text = "OpenGL Renderer: " & GLX_GFX["GL_RENDERER"]
Try Label107.Text = "OpenGL Version: " & GLX_GFX["GL_VERSION"]
Try Label220.Text = "Server glx vendor: " & GLX_GFX["SERVER_GLX_VENDOR"]
Try Label221.Text = "Server glx version: " & GLX_GFX["SERVER_GLX_VERSION"]
Try Label222.Text = "Client glx vendor: " & GLX_GFX["CLIENT_GLX_VENDOR"]
Try Label224.Text = "Client glx version: " & GLX_GFX["CLIENT_GLX_VERSION"]
Try Label225.Text = "GLX version: " & GLX_GFX["GLX_VERSION"]
Endif

Try Exec ["/usr/bin/i-nex-glinfo"] Wait To GL
Try GLX_GFX = JSON.Decode(GL)
Try Label105.Text = "OpenGL Vendor: " & GLX_GFX["GL_VENDOR"]
Try Label106.Text = "OpenGL Renderer: " & GLX_GFX["GL_RENDERER"]
Try Label107.Text = "OpenGL Version: " & GLX_GFX["GL_VERSION"]
Try Label220.Text = "Server glx vendor: " & GLX_GFX["SERVER_GLX_VENDOR"]
Try Label221.Text = "Server glx version: " & GLX_GFX["SERVER_GLX_VERSION"]
Try Label222.Text = "Client glx vendor: " & GLX_GFX["CLIENT_GLX_VENDOR"]
Try Label224.Text = "Client glx version: " & GLX_GFX["CLIENT_GLX_VERSION"]
Try Label225.Text = "GLX version: " & GLX_GFX["GLX_VERSION"]

Shell "" & ChkPrm.ChkExecDir("lspci") & " -v -s `lspci | awk '/VGA/{print $1}'` | grep 'Kernel driver in use:' | cut -d ':' -f 2" Wait To Kernel_driver_in_use
Shell "" & ChkPrm.ChkExecDir("lspci") & " | grep 'VGA' | cut -d ':' -f3 | cut -d '(' -f 1" Wait To gpu
Shell "xdpyinfo | grep 'dimensions:' | cut -d ':' -f 2" Wait To rozdzielczosc
Expand Down Expand Up @@ -565,6 +558,7 @@ Public Sub Wykrywanie_procesorow()
Shell "grep 'physical id' /proc/cpuinfo | sed -n '" & eloaders & "' | cut -d ':' -f 2" Wait To physical_id
Shell "grep 'power management' /proc/cpuinfo | sed -n '" & eloaders & "' | cut -d ':' -f 2" Wait To power_management
Label14.Text = Replace(cpu, "\n", "")
Label14.Tooltip = Replace(cpu, "\n", "")
flags = Replace(flags, "\n", "")
'FFlags._init
Label71.Text = "Flags: " & FFlags.instructions
Expand Down Expand Up @@ -924,19 +918,20 @@ Public Sub Reportthisw_Click()
End

Public Sub TabStrip1_Click()
If TabStrip1.Current.Text = "CPU" Then
TabPanel1_Click()
If TabStrip1.Current.Text Like "*CPU*" Then
ComboBox1.Visible = True
Else
ComboBox1.Visible = False
Endif
If TabStrip1.Current.Text = "GPU" Then
If TabStrip1.Current.Text Like "*GPU*" Then
ComboBox8.Visible = True
Button11.Visible = True
Else
ComboBox8.Visible = False
Button11.Visible = False
Endif
If TabStrip1.Current.Text = "Drives" Then
If TabStrip1.Current.Text Like "*Drives*" Then
HBox19.Visible = True
Button8.Visible = True
Button14.Visible = True
Expand All @@ -953,9 +948,12 @@ Public Sub TabStrip1_Click()
Else
Button4.Visible = False
Endif

If TabStrip1.Current.Text Like "*Kernel*" Then
Button6.Visible = True
Else
Button6.Visible = False
Endif
Me.Text = "I-Nex / " & TabStrip1.Current.Text
TabPanel1_Click()
End

Public Sub Form_Move()
Expand Down

0 comments on commit a9d4d76

Please sign in to comment.