Skip to content

Commit

Permalink
Add report-ng code to screenfetch. Print all data to one file as JSON…
Browse files Browse the repository at this point in the history
… format
  • Loading branch information
eloaders committed Jun 23, 2014
1 parent c19e306 commit 9f3a1b9
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 69 deletions.
18 changes: 9 additions & 9 deletions src/i-nex/.src/Distribution_Detect.module
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
' along with this program. If not, see <http://www.gnu.org/licenses/>.

Public Sub _inits()
Dim DV As String = File.Load(User.Home & "/.i-nex/DistributionVendor.conf")
Dim DE As String = File.Load(User.Home & "/.i-nex/DE.conf")
Select Case DV
Dim SCREENFETCH As Collection
SCREENFETCH = JSON.Decode(File.Load(User.Home & "/.i-nex/screenfetch.json"))
Select Case SCREENFETCH["Distro"]
Case Like "*Mint*"
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/mint.png"]
Finfosys.PictureBox2.Name = "mint.png"
Expand Down Expand Up @@ -69,27 +69,27 @@ Public Sub _inits()
Finfosys.PictureBox2.Name = "netrunner.png"
End Select

If DV Like "*Ubuntu*" And DE Like "*KDE*" Then
If SCREENFETCH["Distro"] Like "*Ubuntu*" And SCREENFETCH["DE"] Like "*KDE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/kubuntu.png"]
Finfosys.PictureBox2.Name = "kubuntu.png"
Endif
If DV Like "*Ubuntu*" And DE Like "*XFCE*" Then
If SCREENFETCH["Distro"] Like "*Ubuntu*" And SCREENFETCH["DE"] Like "*XFCE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/xubuntu.png"]
Finfosys.PictureBox2.Name = "xubuntu.png"
Endif
If DV Like "*Mint*" And DE Like "*KDE*" Then
If SCREENFETCH["Distro"] Like "*Mint*" And SCREENFETCH["DE"] Like "*KDE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/Mint/linux_mint_KDE_BIG_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_KDE_BIG_sticker.png"
Endif
If DV Like "*Mint*" And DE Like "*LXDE*" Then
If SCREENFETCH["Distro"] Like "*Mint*" And SCREENFETCH["DE"] Like "*LXDE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/Mint/linux_mint_LXDE_BIG_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_KDE_BIG_sticker.png"
Endif
If DV Like "*Mint*" And DE Like "*Fluxbox*" Then
If SCREENFETCH["Distro"] Like "*Mint*" And SCREENFETCH["DE"] Like "*Fluxbox*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/Mint/linux_mint_Fluxbox_BIG_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_Fluxbox_BIG_sticker.png"
Endif
If DV Like "*Mint*" And DE Like "*XFCE*" Then
If SCREENFETCH["Distro"] Like "*Mint*" And SCREENFETCH["DE"] Like "*XFCE*" Then
Finfosys.PictureBox2.Picture = Picture["Database/Distlogos/Mint/linux_mint_XFCE_Big_sticker.png"]
Finfosys.PictureBox2.Name = "Mint/linux_mint_XFCE_Big_sticker.png"
Endif
Expand Down
43 changes: 19 additions & 24 deletions src/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ End

Public Sub System()
Dim hostname, arch, gcc, timezone, xorg_version, glx_version As String
Dim SCREENFETCH As Collection
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 Timezone: |awk '{print $2}'" Wait To timezone
Expand All @@ -357,30 +359,23 @@ Public Sub System()
Label141.Text = "X.Org Version: " & Replace(xorg_version, "\n", "")
Label142.Text = "GLX Version: " & Replace(glx_version, "\n", "")
Distribution_Detect._inits
Label4.Text = "Distro Vendor: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/DistributionVendor.conf"), "\n", ""), " ", ""), "\n", "")
Label135.Text = "Distro Release: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/DistributionRelease.conf"), "\n", ""), " ", ""), "\n", "")
Label144.Text = Replace(File.Load("" & User.Home & "/.i-nex/Binutils.conf"), "\n", "")
Label145.Text = "Linux C Library: " & Replace(File.Load("" & User.Home & "/.i-nex/Lnxclib.conf"), "\n", "")
Label37.Text = "Desktop environment: " & Replace(File.Load("" & User.Home & "/.i-nex/DE.conf"), "\n", "")
Label60.Text = "Window manager: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/WM.conf"), "\n", ""), " ", ""), "\n", "")
Label61.Text = "Window manager Theme: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/Win_theme.conf"), "\n", ""), " ", ""), "\n", "")
Label62.Text = "GTK+ 2 Theme: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/gtk2Theme.conf"), "\n", ""), " ", ""), "\n", "")
Label63.Text = "GTK+ 3 Theme: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/gtk3Theme.conf"), "\n", ""), " ", ""), "\n", "")
Label147.Text = "GTK Font: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/gtkFont.conf"), "\n", ""), " ", ""), "\n", "")
Label148.Text = "GTK Icons: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/gtkIcons.conf"), "\n", ""), " ", ""), "\n", "")
Label149.Text = "GNU Make Version: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/GNUMAKE.conf"), "\n", ""), " ", ""), "\n", "")
Label150.Text = "PPP: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/PPP.conf"), "\n", ""), " ", ""), "\n", "")
Label151.Text = "Dynamic linker (ldd): " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/DYNAMIC_LINKER.conf"), "\n", ""), " ", ""), "\n", "")
Label152.Text = "Net-tools: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/NETTOOLS.conf"), "\n", ""), " ", ""), "\n", "")
Label153.Text = "Wireless-tools: " & Replace(Replace(Replace(File.Load("" & User.Home & "/.i-nex/WIRELESS_TOOLS.conf"), "\n", ""), " ", ""), "\n", "")
' DE.conf
' WM.conf
' Win_theme.conf
' gtk2Theme.conf
' gtk3Theme.conf
' gtkFont.conf
' gtkIcons.conf


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"]

End

Expand Down
5 changes: 0 additions & 5 deletions src/i-nex/.src/MInit.module
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Public Sub _inits()
Logs("i-nex in home folder is exist", Logger.Info)
Logs("Try to remove files", Logger.Info)
Try Kill User.Home & "/.i-nex/screenfetch-dev"
Try Kill User.Home & "/.i-nex/report-ng.sh"

Else
Logs("i-nex in home folder not exist", Logger.Error)
Expand All @@ -37,14 +36,10 @@ Public Sub _inits()
Logs("Copy nedded files", Logger.Info)
Logs("Copy screenfetch-dev from Data/screenfetch-dev to " & User.Home &/ ".i-nex/screenfetch-dev", Logger.Info)
Copy "Data/screenfetch-dev" To User.Home &/ ".i-nex/screenfetch-dev"
Logs("Copy report-ng.sh from Data/report-ng.sh to " & User.Home &/ ".i-nex/report-ng.sh", Logger.Info)
Copy "Data/report-ng.sh" To User.Home &/ ".i-nex/report-ng.sh"
Logs("Execute copied files", Logger.Info)
Logs("Execute screenfetch-dev", Logger.Info)
Exec ["/bin/bash", "" & User.Home & "/.i-nex/screenfetch-dev"] Wait To Do_not_print
Do_not_print = Null
Logs("Execute report-ng.sh", Logger.Info)
Exec ["/bin/bash", "" & User.Home & "/.i-nex/report-ng.sh"] Wait

If Settings["FirstRun/Value"] = "True" Then
If Settings["FirstRun/AppVer"] < Application.Version Then
Expand Down
22 changes: 0 additions & 22 deletions src/i-nex/Data/report-ng.sh

This file was deleted.

38 changes: 29 additions & 9 deletions src/i-nex/Data/screenfetch-dev
Original file line number Diff line number Diff line change
Expand Up @@ -3365,13 +3365,33 @@ done
infoDisplay
[ "$screenshot" == "1" ] && takeShot
[ "$exportTheme" == "1" ] && themeExport
echo $DE > ~/.i-nex/DE.conf
echo $WM > ~/.i-nex/WM.conf
echo $distro > ~/.i-nex/DistributionVendor.conf
echo $distro_release > ~/.i-nex/DistributionRelease.conf
echo $Win_theme > ~/.i-nex/Win_theme.conf
echo $gtk2Theme > ~/.i-nex/gtk2Theme.conf
echo $gtk3Theme > ~/.i-nex/gtk3Theme.conf
echo $gtkIcons > ~/.i-nex/gtkIcons.conf
echo $gtkFont > ~/.i-nex/gtkFont.conf
BINUTILS=("Binutils $(ld -v | egrep -o '[0-9]+\.[0-9\.]+')")
LNXCLIB=$(sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps)
GNUMAKE=$(make --version 2>&1 | awk -F, '{print $1}' | awk '/GNU Make/{print $NF}')
PPP=$(pppd --version 2>&1| grep version | awk 'NR==1{print $3}')
#Dynamic linker (ldd)
DYNAMIC_LINKER=$(ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk 'NR==1{print $NF}')
NETTOOLS=$(ifconfig --version 2>&1 | grep tools | awk 'NR==1{print $NF}')
WIRELESS_TOOLS=$(iwconfig --version 2>&1 | awk '(NR==1 && ($3 == "version")) {print $4}')

cat > ~/.i-nex/screenfetch.json <<EOF
{
"DE": "$DE",
"WM": "$WM",
"Distro": "$distro",
"Distro_Release": "$distro_release",
"WinTheme": "$Win_theme",
"GTK2Theme": "$gtk2Theme",
"GTK3Theme": "$gtk3Theme",
"GTKIcons": "$gtkIcons",
"GTKFont": "$gtkFont",
"BINUTILS": "$BINUTILS",
"LNXCLIB": "$LNXCLIB",
"GNUMAKE": "$GNUMAKE",
"PPP": "$PPP",
"DYNAMIC_LINKER": "$DYNAMIC_LINKER",
"NETTOOLS": "$NETTOOLS",
"WIRELESS_TOOLS": "$WIRELESS_TOOLS",
}
EOF
exit 0

0 comments on commit 9f3a1b9

Please sign in to comment.