#! /bin/bash

#############################################################
# Simple Current Systeminfo									#
#															#
# A simple way to get some info about your system!			#
#															#
# Created by D.M-Wilhelm (Leiche).							#
# Thanks goes to Neal Brooks.								#
# License: GPLv2											#
#															#
# First build Sun Mar 27 2011								#
# Builds since 2022 can edit some config files,				#
# and had added some tweaks.								#
# Created for PCLinuxOS 									#					
#############################################################
Encoding=UTF-8
#
export TEXTDOMAIN=sicusys
export TEXTDOMAINDIR="/usr/share/locale"
#
# check of running SiCuSys
RUN=`ps -e | grep -c sicusys`
#echo sicusys: $XDG_CURRENT_DESKTOP
if [ $RUN -gt 2 ];then
	exit 0
fi
if [ ! -d $HOME/.cache/SiCuSys ]; then
	mkdir $HOME/.cache/SiCuSys 
fi 
# variables
TMP=$HOME/.cache/SiCuSys
VERSION=" 25.12.18"
TITLE=$"Simple Current Systeminfo" 
GSU='xterm -geometry 60x3 -title "Enter_root_password" -e su -c'
GSU1='xterm -geometry 100x30 -title "Enter_root_password" -e su -c'
XTRM='xterm -geometry 100x30 -title "Read_files_from_xorg.conf.d" -hold -e'
dirname="$(dirname "$(readlink -e "$0")")"
ICON="$dirname"/icon
KLL="$dirname"/killPWsynaptic
RPM="$dirname"/rpmApp
ABOUT="$dirname"/sicusys-about
HINTS="$dirname"/hints.txt
SCREEN=`xrandr | grep '*' | sed -e 's/*+//'`
lspci | grep "Audio device" | cut -d ":" -f3 > $TMP/audio_name
echo -e " 
> Output of  /proc/asound/cards <
" >> $TMP/audio_name
cat /proc/asound/cards >> $TMP/audio_name
find  /dev -name sd* -o -name mmc* -o -name nvme* > $TMP/hdparm_diag
find /etc/X11/xorg.conf.d -type f  | \
sort -f | while read programm; do echo "$programm" >> $TMP/xrgfl ; done
hdparm -V > $TMP/hdparm_test
echo $"Hardware Diagnostic" > $TMP/hardware
if [ `ps -e | grep -c greetd` -gt "0" ]; then
	echo Greet  > $TMP/loginmanager
	else
	ps -ef | grep nodaemon  | cut -d "-" -f 1 | grep -m1 root | cut -d "/" -f4 > $TMP/loginmanager
fi

WHAT=`echo $DESKTOP_SESSION`
if [ "$WHAT" == "LXDE" ]; then 
	ERROR=$HOME/.cache/lxsession/LXDE/run.log
	else
	ERROR=$HOME/.xsession-errors
fi	
	
if [ `cat $ERROR | grep -c "\"xscreensaver-auth\" must be setuid root"` == 1 ]; then 
XSCRNSVR=true
else
XSCRNSVR=false
fi

if [ -f /usr/share/polkit-1/actions/org.pclinuxos.myrlyn.policy ];then 
	if [ `cat /usr/share/polkit-1/actions/org.pclinuxos.myrlyn.policy | grep -c "<allow_active>yes</allow_active>"` == 1 ]; then 
	MYRLYN=false
	else
	MYRLYN=true
	fi
	MYRLYN1='<vbox>
				<button tooltip-text="'$"It will change the /usr/share/polkit-1/actions/org.pclinuxos.myrlyn.policy to:

     <allow_any>yes</allow_any>
     <allow_inactive>yes</allow_inactive>
     <allow_active>yes</allow_active>

No reboot needed."'">
					<label>"'$"Myrlyn will no longer ask you for root password"'"</label>
						<action>'$KLL' myrlyn</action>
						<action>echo "Done..." >'$TMP'/info</action>
						<action type="launch">INFO</action>
					</button>
					<visible>'$MYRLYN'</visible>
				</vbox>'
fi	
if [ -f /usr/share/polkit-1/actions/org.pclinuxos.dnf5_launcher.policy ];then 
	if [ `cat /usr/share/polkit-1/actions/org.pclinuxos.dnf5_launcher.policy | grep -c "<allow_active>yes</allow_active>"` == 1 ]; then 
	DNF5L=false
	else
	DNF5L=true
	fi
	DNF5L1='<vbox>
				<button tooltip-text="'$"It will change the /usr/share/polkit-1/actions/org.pclinuxos.dnf5_launcher.policy to:

     <allow_any>yes</allow_any>
     <allow_inactive>yes</allow_inactive>
     <allow_active>yes</allow_active>

No reboot needed."'">
					<label>"'$"DNF5 Package Manager will no longer ask you for root password"'"</label>
						<action>'$KLL' dnf5_launcher</action>
						<action>echo "Done..." >'$TMP'/info</action>
						<action type="launch">INFO</action>
					</button>
					<visible>'$DNF5L'</visible>
				</vbox>'
fi
if [ -f /usr/share/polkit-1/actions/org.pclinuxos.synaptic.policy ];then
	if [ `cat /usr/share/polkit-1/actions/org.pclinuxos.synaptic.policy | grep -c "<allow_active>yes</allow_active>"` == 1 ]; then 
	SYNPTC=false
	else
	SYNPTC=true
	fi	
	SYNAP1='<vbox>
							<button tooltip-text="'$"It will change the /usr/share/polkit-1/actions/org.pclinuxos.synaptic.policy to:

     <allow_any>yes</allow_any>
     <allow_inactive>yes</allow_inactive>
     <allow_active>yes</allow_active>

No reboot needed."'">
					<label>"'$"synaptic will no longer ask you for root password"'"</label>
					<action>'$KLL' synaptic</action>
					<action>echo "Done..." >'$TMP'/info</action>
					<action type="launch">INFO</action>
					</button>
					<visible>'$SYNPTC'</visible>
				</vbox>	'
fi				
#  use editor
if [ -f /usr/bin/kwrite ];then
EDITOR=kwrite
elif [ -f /usr/bin/gedit ];then
EDITOR=gedit
elif [ -f /usr/bin/medit ];then
EDITOR=medit
elif [ -f /usr/bin/mousepad ];then
EDITOR=mousepad
elif [ -f /usr/bin/featherpad ];then
EDITOR=featherpad
else
EDITOR=leafpad
fi
{
if [ -f /usr/bin/vmstat ];then
	VMSTAT='<vbox tooltip-text="'$"Report virtual memory statistics: processes, memory, paging, block IO, traps, and cpu activity"'">	
				<button>
        			<label>VMSTAT</label>
        			<input file>'$ICON'/kcmmemory.png</input>
        			<action>xterm -geometry 80x20 -title "vmstat"  -hold -e vmstat 5 &</action>
				</button> 
			</vbox>'
fi	
if [ -f/usr/bin/acpi ];then
	ACPI='<vbox tooltip-text="'$"Shows information from the /proc filesystem, such as battery status or thermal information."'">	
			<button>
        		<label>ACPI -V</label>
        		<input file>'$ICON'/laptop_battery.png</input>
        		<action>xterm -geometry 80x20 -title "acpi"  -hold -e acpi -V &</action>
			</button> 
		</vbox>'
fi		
if [ ! -f /usr/bin/inxi ]; then
	export INFO_DIALOG='
<window window_position="1" title="'$TITLE'" icon-name="info">
	<vbox>
		<hbox border-width="30">
			<text use-markup="True">
				<label>"'$"<b>No inxi found!</b> 
Install inxi from your package manager.

$TITLE will now started without DE information! "'"</label>
			</text>
		</hbox>
		<hseparator></hseparator>
		<vbox homogeneous="true">
			<button ok></button>
		</vbox>
	</vbox>
</window>
'
gtkdialog --program=INFO_DIALOG 
# Ausgabe für das Terminal
	echo sicusys: $"inxi not found!"
fi
if [ ! -f /usr/bin/xterm ]; then
	export INFO_DIALOG='
<window window_position="1" title="'$TITLE'" icon-name="info">
	<vbox>
		<hbox border-width="30">
			<text use-markup="True">
				<label>"'$"<b>No xterm found!</b> 
Install xterm from your package manager."'"</label>
			</text>
		</hbox>
		<hseparator></hseparator>
		<vbox homogeneous="true">
			<button ok></button>
		</vbox>
	</vbox>
</window>
'
gtkdialog --program=INFO_DIALOG 
# Ausgabe für das Terminal
	echo sicusys: $"xterm not found!"
fi
if [ ! -f /usr/bin/nano ]; then
	export INFO_DIALOG='
<window window_position="1" title="'$TITLE'" icon-name="info">
	<vbox>
		<hbox border-width="30">
			<text use-markup="True">
				<label>"'$"<b>No nano found!</b> 
Install nano from your package manager."'"</label>
			</text>
		</hbox>
		<hseparator></hseparator>
		<vbox homogeneous="true">
			<button ok></button>
		</vbox>	
	</vbox>
</window>
'
gtkdialog --program=INFO_DIALOG 
# Ausgabe für das Terminal
	echo sicusys: $"nano not found!"
fi
KERN=`uname -r | cut -d "-" -f1`
MAJOR=`echo $KERN | cut -d "." -f1`
KERNEL='<vbox tooltip-text="'$"Changelog of current Kernel"'">	
				<button>
        			<label>ChangeLog</label>
        			<action>xdg-open https://cdn.kernel.org/pub/linux/kernel/v'$MAJOR'.x/ChangeLog-'$KERN' &</action>
				</button> 
			</vbox>'
}
{
export ENTRY='
<window window_position="1" icon-name="sicusys" width-request="600" title="'$TITLE$VERSION'">
	<vbox wrap-mode="1">
		<vbox scrollable="true">
			<text xalign="0" selectable="false" use-markup="True">
				<label>"<b>'$"Enter a time span in minutes"'</b>"</label>
			</text>
			<entry>
				<default>720</default>
				<variable>ENTRYI</variable>
			</entry>
			<hbox>
				<button ok>
					<action>find . -type f -cmin -$ENTRYI -ls -o -path "./.cache/SiCuSys" -prune >'$TMP'/info</action>
					<action type="launch">INFO</action>
				</button>
				<button cancel>
					<variable>END</variable>
					<action type="closewindow">END</action>
				</button>
			</hbox>
		</vbox>	
	</vbox>			
</window>	
'	
}	 
{
export INFO='
<window window_position="1" icon-name="sicusys" width-request="800" height-request="600" title="'$TITLE$VERSION'">
	<vbox wrap-mode="1">
		<frame>
			<vbox scrollable="true">
				<text selectable="true">
					<input file>'$TMP'/info</input>
				</text>
			</vbox>
		</frame>	
		<vbox><hbox>  
			<button>
				<label>OK</label>
				<variable>INFO</variable>
				<action type="closewindow">INFO</action>
			</button>
		</hbox></vbox>
	</vbox>		
</window>
'
}
{
#
Simple_Current_Systeminfo='
<window  window_position="1" maximize_initially="true" icon-name="sicusys" title="'$TITLE$VERSION'">
	<vbox> 
		<notebook labels="STANDARD|AUDIO/VIDEO|DRIVE|HARDWARE|ERROR|TWEAKS|XORG|TIPS" space-expand="true" space-fill="true" scrollable="true" show-tabs="true" tab-pos="2" >
##---------------------------------------------------------------------------------------------------			
## ----------------------------------------- STANDARD -----------------------------------------------
##---------------------------------------------------------------------------------------------------		
			<vbox space-expand="true" space-fill="true">
## -------------------------------- cpuinfo - zeigt Informationen zu den CPU an ---------------------
				<frame '$"Display CPU"'> 
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/kcmprocessor.png</input>
						</pixmap>
						<vbox>
						<text wrap="true" xalign="0" selectable="true">
							<input>cat /proc/cpuinfo | grep ^"model name" -m1 | cut -d ":" -f2</input>
						</text>
						<text wrap="true" xalign="0" selectable="true">
							<input>echo CPU setting: `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`</input>
						</text>
						</vbox>
						<vbox>
							<hbox tooltip-text="'$"See more from /proc/cpuinfo and cpufreq-info"'">
								<button>
									<label>'$"CPUINFO"'</label>
									<input file>'$ICON'/kcmprocessor.png</input>
									<action>cat /proc/cpuinfo >'$TMP'/info</action>
									<action type="launch">INFO</action>
								</button>
								<button>
									<label>'$"CPUFREQ"'</label>
									<input file>'$ICON'/kcmprocessor.png</input>
									<action>cpufreq-info >'$TMP'/info</action>
									<action type="launch">INFO</action>
								</button>									
							</hbox>	
							<hbox>
							<vbox tooltip-text="'$"Free up memory"'">
								<button>
									<label>'$"Free RAM"'</label>
									<input file>'$ICON'/kcmprocessor.png</input>
									<action>xterm -hold -title "'$"Enter root password to free up memory"'" -e su -c "free && sync && echo 3 > /proc/sys/vm/drop_caches && free"</action>
								</button>
							</vbox>
							'$VMSTAT'
							</hbox>
						</vbox>
					</hbox> 
				</frame>
				
## --------------------------- ACPI - zeigt Informationen ausgegeben von ACPI -------------------------------------------------
				<frame '$"Get information from ACPI"'>  
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/laptop_battery.png</input>
						</pixmap>
						<text wrap="true" xalign="0" selectable="true">
							<input>acpi -aib</input>
						</text>
						'$ACPI'				
					</hbox> 
				</frame> 
				
## -------------------------------------- Laufende Kernelversion --------------------------------------------------------------
				<frame '$"Running Kernel"'>  
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/kernel-icon.png</input>
						</pixmap>
						<text wrap="false" xalign="0" selectable="true"> 
							<input>uname -rp</input>
						</text>
						'$KERNEL'
					</hbox>	
				</frame>
				
## -------------------------------------- aktuelle Bildschirmgröße -------------------------------------------------------------
				<frame '$"Screen Resolution"'>
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/randr.png</input>
						</pixmap>
						<text wrap="false" xalign="0" selectable="true">
							<input>echo '"$SCREEN"'</input>
						</text>
						<text wrap="false" xalign="0" selectable="true">
							<input>xset -q | grep "DPMS is"</input>
						</text>
						<text wrap="false" xalign="0" selectable="true">
							<input>xrandr --current --verbose | grep Brightness:</input>
						</text>
						<text wrap="false" xalign="0" selectable="true">
							<input>xrandr --current --verbose | grep Gamma:</input>
						</text>
					</hbox>	
				</frame> 
				
## ------------------------------ Anzeigen der Arbeitsoberflächen Umgebung -----------------------------------------------------
				<hbox>
				<frame '$"Desktop Environment"'> 
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/desktop.png</input>
						</pixmap>
						<text wrap="false" xalign="0" selectable="true">
							<input>echo $XDG_CURRENT_DESKTOP</input>
						</text>
					</hbox>
				</frame> 
				
## -------------------------------------- Login Manager ------------------------------------------------------------------------
				<frame '$"Login Manager"'>  
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/kernel-icon.png</input>
						</pixmap>
						<text wrap="false" xalign="0" selectable="true"> 
							<input file>'$TMP'/loginmanager</input>
					</text>
					</hbox>	
				</frame>				
				
## ----------------------------------------- Anzeigen der Version --------------------------------------------------------------
				<frame '$"Version"'> 
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/cdrom_unmount.png</input>
						</pixmap>
						<text wrap="false" xalign="0" selectable="true">
							<input file>/etc/version</input>
						</text>
						<vbox>
							<text use-markup="true" xalign="0">
								<label>"<b>'$"Date of the original installation"'</b>"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>stat -c %w / | cut -d . -f1</input>
							</text>
						</vbox>	
					</hbox>	
				</frame> 
				</hbox>
				
## ----------------------------------------- Anzeigen des Benutzer -------------------------------------------------------------
				<hbox>
				<frame '$"User"'>  
					<hbox scrollable="false" space-expand="true" space-fill="true" tooltip-text="'$"Display real and effective user and group IDs of current user"'">
						<pixmap xalign="0">
							<input file>'$ICON'/personal.png</input>
						</pixmap>
							<button>
								<label>'`whoami`'</label>
								<action>id > '$TMP'/info</action>
								<action type="launch">INFO</action>
							</button>	
					</hbox>	
				</frame> 
				
## ---------------------------------------- Anzeigen des Betriebszeit ------------------------------------------------------------
				<frame '$"Uptime"'>  
					<hbox scrollable="false" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/xclock.png</input>
						</pixmap>
						<text wrap="false" xalign="0" selectable="true">
							<input>uptime</input>
						</text>
					</hbox>	
				</frame> 
				</hbox>
			</vbox>
##---------------------------------------------------------------------------------------------------			
## ---------------------------------------------- AUDIO/VIDEO	-------------------------------------
##---------------------------------------------------------------------------------------------------			
			<vbox space-expand="true" space-fill="true"> 
				<frame '$"Audio Card"'>
					<hbox scrollable="true" space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/artscontrol.png</input>
						</pixmap>
						<text wrap="true" xalign="0" selectable="true">
							<input file>'$TMP'/audio_name</input>
						</text>
					</hbox> 
				</frame> 
				
				<frame '$"Video Card"'>
					<hbox scrollable="true" space-expand="true" space-fill="true">
						<pixmap xalign="0">						
							<input file>'$ICON'/demo.png</input>
						</pixmap>
						<vbox>
							<text wrap="false" xalign="0" selectable="true">
								<input>lspci | grep "VGA compatible controller" | cut -d ":" -f3</input>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>xrandr --prop</input>
							</text> 
						</vbox>
					</hbox> 
				</frame> 
			</vbox>
##---------------------------------------------------------------------------------------------------			
## ----------------------------------------- DRIVE	-------------------------------------------------
##---------------------------------------------------------------------------------------------------		
			<vbox space-expand="true" space-fill="true">
## ---------------- df - zeigt den freien Festplattenplatz-------------------------------------------			
				<frame '$"Display free disk space, and mount points, and speedtest"'> 
					<hbox space-expand="true" space-fill="true">
						<pixmap xalign="0">
							<input file>'$ICON'/kcmpartitions.png</input>
						</pixmap>
						<vbox width="680" scrollable="true">
							<text use-markup="True" width-chars="50">
								<label>"'$"<b>Free Disc Space</b>"'"</label>
							</text> 
							<text wrap="false" xalign="0" selectable="true">
								<input>df -h</input>
							</text>
							<hseparator></hseparator>
							<text use-markup="True" width-chars="30">
								<label>"'$"<b>Mount Points</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>mount</input>
							</text>
						<hseparator></hseparator>
							<text use-markup="True" width-chars="30">
								<label>"'$"<b>Select a hard or usb drive.</b>"'"</label>
							</text> 						
							<text use-markup="True" width-chars="50" --space-expand="true" xalign="0" --space-fill="true">
								<label>"'$"<b>Note:</b> Hard drive will display as <b>sda</b>, and usb drive can display as <b>sdb</b>!"'"</label>
							</text>
							<tree rules_hint="true" exported_column="0" space-fill="true">
								<height>200</height><width>200</width>	
								<variable>SELECT</variable>
								<label>'$"SD*"'</label>
								<input file>'$TMP'/hdparm_diag</input> 
							</tree> 
							<text use-markup="True" width-chars="30">
								<label>"'$"<b>Result of hdparm</b>"'"</label>
							</text> 		
							<hseparator></hseparator>				
							<text use-markup="True" width-chars="60" --space-expand="true" --space-fill="true">
								<variable>HDPARM_SHOW</variable>
								<input file>'$TMP'/hdparm_test</input>
							</text>
						</vbox>	
						<vbox>
							<vbox tooltip-text="'$"View hard drive partitions"'">
								<button>
									<label>FDISK</label>
									<input file>'$ICON'/hdd_mount.png</input>
									<action>fdisk -l >'$TMP'/info</action>
									<action type="launch">INFO</action>
								</button>
							</vbox>		
							<vbox tooltip-text="'$"Reboot, for partition file system check. Did you save your current session?"'">	
								<button>
									<label>FSCK</label>
									<input file>'$ICON'/harddrive.png</input>
									<action>'$GSU' "touch /forcefsck -a | reboot || exit 1"</action>
								</button>
							</vbox>
							<vbox>
								<button tooltip-text="'$"hdparm - get hard disk parameters. Perform device read timings."'">
									<label>HDPARM</label>
									<input file>'$ICON'/hdd_mount.png</input>
									<action>'$GSU' "hdparm -t $SELECT > '$TMP'hdparm_test"</action>
									<action type="refresh">HDPARM_SHOW</action>
								</button>
							</vbox>	
							<vbox tooltip-text="'$"View information about the NVME drive"'">
								<button>
									<label>NVME Info</label>
									<input file>'$ICON'/hdd_mount.png</input>
									<action>'$GSU' "xterm -geometry 120x20 -title "nvme-cli" -hold -e nvme smart-log /dev/nvme0n1"</action>
								</button>
							</vbox>	
							<vbox tooltip-text="'$"Read Error Log from NVME drive, and show it"'">
								<button>
									<label>NVME Error</label>
									<input file>'$ICON'/hdd_mount.png</input>
									<action>'$GSU' "xterm -geometry 120x20 -title "nvme-cli" -hold -e nvme error-log /dev/nvme0n1"</action>
								</button>
							</vbox>	
						</vbox>
					</hbox>    
				</frame>    
			</vbox>
##---------------------------------------------------------------------------------------------------			
## ----------------------------------------- HARDWARE -----------------------------------------------
##---------------------------------------------------------------------------------------------------
			<vbox space-expand="true" space-fill="true"> 
				<frame '$"Output"'>
					<hbox space-expand="true" space-fill="true">
						<pixmap xalign="0" width="600" height="200">
							<input file>'$ICON'/hwinfo.png</input>
						</pixmap>
						<vbox scrollable="true" width="600" height="200">
						<text wrap-mode="0" xalign="0" selectable="true" justify="0">
							<variable>DISPLAY_OUT</variable>
							<input file>'$TMP'/hardware</input>
						</text>
						</vbox>
					<vbox scrollable="true">
						<vbox tooltip-text="'$"Read BIOS information."'">	
							<button>
								<label>BIOS</label>
								<input file>'$ICON'/blockdevice.png</input>
								<action>'$GSU' "dmidecode > '$TMP'/hardware"</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>
						<vbox tooltip-text="'$"Display Xorg.conf"'">
							<button>
								<label>Xorg</label>
								<input file>'$ICON'/xorg.png</input>
								<action>cat /etc/X11/xorg.conf > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>
						<vbox tooltip-text="'$"lsusb is a utility for displaying information about USB buses in the system and the devices connected to them."'">
							<button>
								<label>LSUSB</label>
								<input file>'$ICON'/usb.png</input>
								<action>lsusb > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>	
						<hseparator></hseparator>	
						<vbox tooltip-text="'$"lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded."'">	
							<button>
								<label>LSMOD</label>
								<input file>'$ICON'/kernel-icon.png</input>
								<action>lsmod >'$TMP'/info</action>
								<action type="launch">INFO</action>
							</button>
						</vbox>	
						<vbox tooltip-text="'$"Program to show information about a Linux Kernel module. To determine, or find a module use lsmod."'">	
							<text use-markup="True"><label>"<b>'$"Module:"'</b>"</label></text>
								<entry>
									<variable>FOUND</variable>
								</entry>
								<button>
									<label>MODINFO</label>
									<input file>'$ICON'/kernel-icon.png</input>
									<action>modinfo "$FOUND" >  '$TMP'/hardware</action>
									<action type="refresh">DISPLAY_OUT</action>
								</button>	
						</vbox>	
						<hseparator></hseparator>
						<vbox tooltip-text="'$"lspci is a utility for displaying information about PCI buses in the system and devices connected to them."'">	
							<button>
								<label>LSPCI</label>
								<input file>'$ICON'/hwinfo.png</input>
								<action>lspci > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>	
						<vbox tooltip-text="'$"lscpu - display information about the CPU architecture"'">	
							<button>
								<label>LSCPU</label>
								<input file>'$ICON'/kcmprocessor.png</input>
								<action>lscpu > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>	
						<vbox tooltip-text="'$"Current wireless network interface."'">	
							<button>
								<label>IWCONFIG</label>
								<input file>'$ICON'/network.png</input>
								<action>iwconfig > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>	
						<vbox tooltip-text="'$"View an ethernet network interface."'">	
							<button>
								<label>IFCONFIG</label>
								<input file>'$ICON'/Networksettings.png</input>
								<action>ifconfig > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>	
						<vbox tooltip-text="'$"Netstat is a network monitoring. Run \`netstat -peanut\` as root to see more details."'">	
							<button>
								<label>NETSTAT</label>
								<input file>'$ICON'/Networksettings.png</input>
								<action>xterm -hold -e su -c "netstat -peanut" &</action>
							</button>
						</vbox>	
						<vbox tooltip-text="'$"Information about the X-server."'">	
							<button>
								<label>XDPYINFO</label>
								<input file>'$ICON'/linuxconf.png</input>
								<action>xdpyinfo > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>
						<vbox tooltip-text="'$"Information about the X-server."'">	
							<button>
								<label>GLXINFO</label>
								<input file>'$ICON'/no3D.png</input>
								<action>glxinfo >'$TMP'/info</action>
								<action type="launch">INFO</action>
							</button>
						</vbox>
						<vbox tooltip-text="'$"The chkconfig list all available services along with their current setting."'">	
							<button>
								<label>CHKCONFIG</label>
								<input file>'$ICON'/info.png</input>
								<action>chkconfig > '$TMP'/hardware</action>
								<action type="refresh">DISPLAY_OUT</action>
							</button>
						</vbox>
					</vbox>
					</hbox> 
				</frame> 
			</vbox>		
##---------------------------------------------------------------------------------------------------			
## ----------------------------------------- ERROR	-------------------------------------------------
##---------------------------------------------------------------------------------------------------			
			<vbox>	
				<frame '$"DMESG Output"'>  ## Fehler anzeigen
					<hbox scrollable="true"  space-expand="true" space-fill="true">
						<pixmap xalign="0" tooltip-text="'$"Check on errors by loading of your current kernel!"'">
							<input file>'$ICON'/hwinfo.png</input>
						</pixmap>
						<vbox>
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Error</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>dmesg | grep -i error</input>
							</text> 
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Failed</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>dmesg | grep -i fail</input>
							</text> 
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Warning</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>dmesg | grep -i warn</input>
							</text> 
						</vbox>
					</hbox>
				</frame>
				
## -------------------------------- Fehler anzeigen -------------------------------------------------				
				<frame '$"XORG Output"'>  
					<hbox scrollable="true"  space-expand="true" space-fill="true">
						<pixmap xalign="0" tooltip-text="'$"Display errors located by Xorg!"'">
							<input file>'$ICON'/linuxconf.png</input>
						</pixmap>
						<vbox>
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Error</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>grep 'EE' /var/log/Xorg.0.log | sed s/"(WW) warning.*//"</input>
							</text> 
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Warning</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>grep 'WW' /var/log/Xorg.0.log | sed s/"(WW) warning.*//"</input>
							</text>
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Not Implemented</b>"'"</label>
							</text> 
							<text wrap="false" xalign="0" selectable="true">
								<input>grep 'NI' /var/log/Xorg.0.log | sed s/"(WW) warning.*//"</input>
							</text> 
							<text use-markup="True" width-chars="30" xalign="0">
								<label>"'$"<b>Unknown</b>"'"</label>
							</text>
							<text wrap="false" xalign="0" selectable="true">
								<input>grep '??' /var/log/Xorg.0.log | sed s/"(WW) warning.*//"</input>
							</text> 
						</vbox>
					</hbox>
					<vbox tooltip-text="'$"Open the xsession-errors file, to check for errors."'">
					<button>
						<label>'$"Xsession-errors"'</label>
						<input file>'$ICON'/x.png</input>
						<action>'$EDITOR' '$ERROR' &</action>
					</button>
				</vbox>
				</frame>
			</vbox>	
##---------------------------------------------------------------------------------------------------
##---------------------------------- Tweaks ---------------------------------------------------------
##---------------------------------------------------------------------------------------------------
			<vbox scrollable="true"  space-expand="true" space-fill="true">
				<frame '$"Tweaks"'>
					<vbox  homogeneous="true">
						<vbox>
							<button tooltip-text="'$"chmod u+s /usr/libexec/xscreensaver/xscreensaver-auth
Fixed most of the error message.
	OOM: /proc/xxxx/oom_score_adj: Permission denied
	To prevent the kernel from randomly unlocking
	your screen via the out-of-memory killer,
	'xscreensaver-auth' must be setuid root.
To get invisible the button, you have too reboot."'">
								<label>'xscreensaver-auth' must be setuid root</label>
								<action>'$GSU' "chmod u+s /usr/libexec/xscreensaver/xscreensaver-auth"</action>
								<action>echo "Please restart now" >'$TMP'/info</action>
								<action type="launch">INFO</action>
							</button>
							<visible>'$XSCRNSVR'</visible>
						</vbox>	
##---------------------------------------------------------------------------------------------------	
'"$SYNAP1"'					
'"$MYRLYN1"'
'"$DNF5L1"'						
##---------------------------------------------------------------------------------------------------
						<vbox>
							<button tooltip-text="'$"Synaptic looks different to the other gtk GUI, you can copy your GTK config file to root account!"'">
								<label>"'$"Copy gtkrc-2.0 to the root account"'"</label>
								<action>'$GSU' "cp $HOME/.gtkrc-2.0 /root/.gtkrc-2.0"</action>
							</button>
						</vbox>
					</vbox>
				</frame>
			</vbox>
##---------------------------------------------------------------------------------------------------
##--------------------------- XORG ------------------------------------------------------------------
##---------------------------------------------------------------------------------------------------
			<vbox>
				<frame Xorg>
					<hbox scrollable="true"  space-expand="true" space-fill="true">
						<tree rules_hint="true" exported_column="0" selection-mode="3" space-fill="true">
							<width>500</width><height>220</height>
								<variable>SLCT</variable>
								<label>"'$"Files in /etc/X11/xorg.conf.d"'"</label>
								<input file>'$TMP'/xrgfl</input> 
						</tree>
					</hbox>
					<hbox>
						<vbox tooltip-text="'$"Read files from /etc/X11/xorg.conf.d"'">
							<button>
								<label>'$"READ"'</label>
								<input file>'$ICON'/info.png</input>
								<action>'$XTRM' " cat $SLCT" &</action>
							</button>
						</vbox>
						<vbox tooltip-text="'$"Edit files in /etc/X11/xorg.conf.d 
Make a backup before you edit something!"'">
							<button>
								<label>'$"EDIT"'</label>
								<input file>'$ICON'/configure.png</input>
								<action>'$GSU1' " nano $SLCT" &</action>
							</button>
						</vbox>
					</hbox>
				</frame>
			</vbox>	
##---------------------------------------------------------------------------------------------------
##------------------------------ Tips ---------------------------------------------------------------
##---------------------------------------------------------------------------------------------------
			<vbox tooltip-text="'$"Copy is enabled."'">
				<frame Tips>
					<hbox scrollable="true"  space-expand="true" space-fill="true">
						<text use-markup="true" xalign="0" wrap-mode="0" selectable="true">
							<input file>'$HINTS'</input>
						</text>
					</hbox>	
				</frame>
			</vbox>					
		</notebook>

##---------------------------------------------------------------------------------------------------			
## ----------------------------------------- Untere Schaltflächen -----------------------------------
##---------------------------------------------------------------------------------------------------
			<vseparator></vseparator>		
			<hbox space-expand="true" space-fill="true" homogeneous="true">  
				'$SYSTEMINFO'
				<vbox tooltip-text="'$"Configure your computer"'">
					<button>
						<label>'$"PCC"'</label>
						<input file>'$ICON'/configure.png</input>
						<action>pcc &</action>
					</button>
				</vbox>
			
				<vbox tooltip-text="'$"What it is..."'">
					<button>
						<label>'$"About"'</label>
						<input file>'$ICON'/info.png</input>
						<action>'$ABOUT' &</action>
					</button>
				</vbox>
				<vbox tooltip-text="'$"Open a rpm application"'">
					<button>
						<label>RPM</label>
						<input file>'$ICON'/package.png</input>
						<action>'$RPM' &</action>
					</button>
				</vbox>	
				<vbox tooltip-text="'$"Which files are modificated at the last 12 hours ..."'">	
					<button>
						<label>'$"Changed"'</label>
						<input file>'$ICON'/find.png</input>
						<action type="launch">ENTRY</action>
					</button>
				</vbox>	
						
				<vbox tooltip-text="'$"Inxi -Fxxzr"'">
					<button>
						<label>'$"INXI"'</label>
						<input file>'$ICON'/x.png</input>
						<action>xterm  -geometry 100x40 -e "inxi -Fxxzr >'$TMP'/info"</action>
						<action type="launch">INFO</action>
					</button>
				</vbox>
				
				<vbox tooltip-text="'$"To exit click on close button!"'">
					<button>
						<label>'$"Close"'</label>
						<input file>'$ICON'/button_cancel.png</input>
						<action type="exit">Simple_Current_Systeminfo</action>
					</button>
				</vbox>
			</hbox>
	</vbox>
</window> 
'

export GUI="`echo "$Simple_Current_Systeminfo" | sed -e 's/##.*//'`" 
gtkdialog -p GUI #> /dev/null 2>&1
}
# isn't closed correctly, we must need to clean tmp directory
rm -r $TMP/*
echo $"SICUSYS: all files are removed"
exit 0
