
------------------------------------------------------------------------
--# OS Info
------------------------------------------------------------------------

include GtkEngine.e
include std/os.e

enum KERNEL,HOSTNAME,RELEASE,VERSION,MACHINE

constant os = uname()
constant fmt = `
  <b>OS</b> = []
  <b>Kernel</b> = []
  <b>Version</b> = []
  <b>Process id</b> = []
  <small><i>using inline css for text styling</i></small>`

constant win = create(GtkWindow,
    "title=`OS Info`,border=15,background=blue,position=1,icon=emblem-system,$destroy=Quit")

constant panel = create(GtkBox,"orientation=HORIZONTAL")
    add(win,panel)

ifdef WINDOWS then 
constant img = create(GtkImage,"thumbnails/bug-buddy.png")
elsedef
constant img = create(GtkImage,"emblem-system",128)
end ifdef
    
    add(panel,img)
	
constant lbl = create(GtkLabel,{
    {"markup",text:format(fmt,{os[KERNEL],os[MACHINE],os[VERSION],get_pid()})},
    {"color","white"}})
    add(panel,lbl)

constant css = create(GtkCssProvider,
	"GtkLabel {text-shadow: 3px 3px #101010;}") -- styling;

show_all(win)
main()
