I have been playing with the idea of GUI'ing it as well as writing a plymouth selector. The plymouth selector I have all ready created in c, but is currently terminal based, I am not satisfied with. I do not expect my users to have to resort to a terminal. I will robust it, time permitting, will not make it in Ultimate Edition 2.8.
This will make it to 2.8:
I will not rob you of the source
- Code: Select all
#!/bin/bash
#written via TheeMahn
#set Base, hilight color & header please adjust colors in hex and font to your liking
BASE='${color #cccccc}'
HILIGHT='${color #ffff00}'
HEADER='${color #ffffff}${font Liberation:style=Bold:pixelsize=12}'
BAR='${color #0000d9}'
#Get CPU model
PROC=`cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //' | uniq`
echo $PROC
#check Architecture set 32 bit default
ARCHITECTURE='32 Bit'
#
# Check for x86_64 (Test 1) - some O/S's use the -i switch
#
if [ "`uname -i|grep x86_64`" == "x86_64" ]; then
ARCHITECTURE='64 Bit'
fi
#
# Check for x86_64 (Test 2) - some OSs (ie. Gentoo) return Processor manufacturer
# rather than architecture with "uname -i"
#
if [ "`uname -a|grep x86_64`" != "" ]; then
ARCHITECTURE='64 Bit'
fi
echo $ARCHITECTURE 'O/S detected.'
#Create conky skelaton
echo 'background yes
font Liberation:size=9
xftfont Sans Seriff:size=9
use_xft yes
xftalpha 0.1
update_interval 1.0
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
minimum_size 320 5
maximum_width 320
default_color ffff00
default_shade_color 000000
default_outline_color 000000
alignment top_right
gap_x 6
gap_y 22
no_buffers yes
cpu_avg_samples 2
override_utf8_locale no
uppercase no # set to yes if you want all text to be in uppercase
use_spacer no
' > ~/.conkyrc
#Count number of processor cores
CORES=1
CORES=`cat /proc/cpuinfo | grep "processor" | wc -l`
echo $CORES "Cpu core(s) Detected."
echo 'TEXT
'$HEADER'SYSTEM:${hr 1 }
'$BASE'O/S: '$HILIGHT'${alignr}Ultimate Edition 2.8
'$BASE'O/S architecture: '$HILIGHT'${alignr}'$ARCHITECTURE'
'$BASE'Hostname: '$HILIGHT'$alignr$nodename
'$BASE'Kernel: '$HILIGHT'$alignr$kernel
'$BASE'Uptime: '$HILIGHT'$alignr$uptime
'$BASE'Processes: '$HILIGHT'${alignr}$processes ($running_processes running)
'$BASE'Load: '$HILIGHT'${alignr}$loadavg
'$HEADER'CPU: ${hr 1 }
'$BASE$PROC'
'$BASE'CPU Usage: '$HILIGHT'${alignr} ${freq}MHz X '$CORES $BASE'
${cpu cpu0}% '$BAR' ${alignr}${cpubar cpu0 3,170}
'$HEADER'${hr 1}'$BASE'
'$BASE'Cores:' >> ~/.conkyrc
#Create a cpubar for each core
COUNTER=0
while [ $COUNTER != $CORES ]; do
let COUNTER=COUNTER+1
echo $BASE'${cpu cpu'$COUNTER'}% '$BAR'${alignr}${cpubar cpu'$COUNTER' 3,170}' >> ~/.conkyrc
done
#Output disk I/O bar top processes memory useage etc.
echo $HEADER'RAM:${hr 1 }'$HILIGHT'
${alignr}$mem / $memmax ($memperc%)'$HILIGHT'
'$BAR'${membar 3}
'$BASE'Swap: '$HILIGHT'${alignr}$swap/$swapmax
'$BAR'${swapbar 3}
'$HEADER'${font pixelsize=20}${alignc}Time: ${time %I:%M %P}
'$HEADER'HIGHEST CPU $alignr CPU% MEM%
${hr 1}
'$BASE'${top name 1}'$HILIGHT'$alignr${top cpu 1}${top mem 1}
'$BASE'${top name 2}'$HILIGHT'$alignr${top cpu 2}${top mem 2}
'$HEADER'${hr 1}
HIGHEST MEM $alignr CPU% MEM%
${hr 1}
'$BASE'${top_mem name 1}'$HILIGHT'$alignr${top_mem cpu 1}${top_mem mem 1}
'$BASE'${top_mem name 2}$alignr'$HILIGHT'${top_mem cpu 2}${top_mem mem 2}
'$HEADER'DISK I/O: ${diskio}
'$BAR'${diskiograph /dev/sda 3,170}
'$HEADER'FILESYSTEM ${hr 1}
'$BASE'Root: '$HILIGHT'${alignr}${fs_free /} / ${fs_size /}
'$BAR'${fs_bar 3 /}' >> ~/.conkyrc
#Detect hard disks & create a bar for each mount point
echo "Internal / External storage detected:"
echo "/ - Root"
ls /media/ > /tmp/tmp.txt
cat /tmp/tmp.txt | while read FILE
do
target=$(echo "$FILE" | sed -e "s/ /_/")
echo $BASE$FILE': '$HILIGHT'${alignr}${fs_free /media/'$FILE'} / ${fs_size /media/'$FILE'}
'$BAR'${fs_bar 3 /media/'$FILE'}' >> ~/.conkyrc
echo $FILE
done
rm /tmp/tmp.txt
echo $HEADER'NETWORK:${hr 1}' >> ~/.conkyrc
#Detect "Active" network and propigate Network Xfer bar
ACTIVE=`ifconfig | grep -B 1 inet | head -1 | awk '{print $1}'`
echo $BASE'IP: '$HILIGHT'${addr '$ACTIVE'} / ${execi 3600 wget -O - http://whatismyip.org/ | tail}
'$BASE'TCP Connections: '$HILIGHT'${tcp_portmon 1 65535 count}
'$BASE'Down: '$HILIGHT'${downspeed '$ACTIVE'} k/s ${alignr}Up ${upspeed '$ACTIVE'} k/s
'$BAR'${downspeedgraph '$ACTIVE' 25,107 '$BASE' '$HILIGHT'} ${alignr}${upspeedgraph '$ACTIVE' 25,107 '$BASE' '$HILIGHT'}
'$BASE'Total: '$HILIGHT'${totaldown '$ACTIVE'} ${alignr}'$BASE'Total: '$HILIGHT'${totalup '$ACTIVE'}' >> ~/.conkyrc
echo $HEADER'${hr 1}' >> ~/.conkyrc
Funny, I have began to think of other O/S's, what am I thinking there? My job should only be my O/S right? I am here to help, please learn. I have spent a lifetime educating ppl. I really wish I had the time to do so individually. I am one man. I enjoy the ability to educate many at a time.
If what I am looking at turns out we will be seeing tons of education coming from me in the area of programming. Not the kiddie script as seen above.
Not all users are keen to hex, I am going to try and help. #000000 = black, #FFFFFF = white, degrees of colors are done in the following fashion #RRGGBB. Red Green and blue well 2 slots for red 99 must be the highest number right? Not in hex 0a is your 100, 0b is your 101 feel me FF is your 255.
I would not have added that, but I educated the house on colors and hexidecimal. It should not be something I expect ppl to know. I hang out with smart ppl, they tell me when I should tell you things like that, perhaps too smart for my own good.
Einstein had ppl tell him when it was time to rest. Good night. I will build 2.8 tomorrow. Funny, once again it has been discussed. I can and have built an O/S in minutes, takes days before I am recognized.
Disrowatch does not accept me, until I drop final, it is coming. I am betting it is done locally tomorrow. A few days uploading followed through with a few days on the 64 and off the hook. If I had highspeed up Ubuntu would have a stroke.
I will not rob my admin they will have final say-so.
EDIT 01/09/11:
I thought I would come back and update the source with the "newest version" it has lua support, font size autoscaling, color selection & icons. The only part you should have to edit if at all is the top portion:
- Code: Select all
OS='Ultimate Edition 2.6.1'
#Please set parameters below based on you screensize / resolution
GRAPHWIDTH=320 #size of box in pixels
FONTSIZE=12
#set Base, hilight color & header please adjust colors in hex and font to your liking
BASE='${color #ffffff}${font Liberation Sans:style=normal:pixelsize='$FONTSIZE'}'
HILIGHT='${color #00ff00}${font Liberation Sans:style=normal:pixelsize='$FONTSIZE'}'
HEADER='${color #ffff00}${font Liberation:style=Bold:pixelsize='$FONTSIZE'}'
BAR='${color #ff0000}'
############### You Should not have to edit anything below #############
Conky builder 1.01 source:
- Code: Select all
#!/bin/bash
#written via TheeMahn
VERSION='1.01'
OS='Ultimate Edition 2.6.1'
#Please set parameters below based on you screensize / resolution
GRAPHWIDTH=320 #size of box in pixels
FONTSIZE=12
#set Base, hilight color & header please adjust colors in hex and font to your liking
BASE='${color #ffffff}${font Liberation Sans:style=normal:pixelsize='$FONTSIZE'}'
HILIGHT='${color #00ff00}${font Liberation Sans:style=normal:pixelsize='$FONTSIZE'}'
HEADER='${color #ffff00}${font Liberation:style=Bold:pixelsize='$FONTSIZE'}'
BAR='${color #ff0000}'
############### You Should not have to edit anything below #############
#Calculate v offset based on Fonts / pixelsize
VOFF=$((FONTSIZE+6))
ALEFT=$((FONTSIZE/4))
INDENT=$((FONTSIZE/3))
BARZ=$((GRAPHWIDTH/2))
BOFFSET=$((FONTSIZE/2))
TICON=$((FONTSIZE/5))
BPER=$((GRAPHWIDTH/100*75))
SBAR=$((GRAPHWIDTH/100*20))
LOGO=$((FONTSIZE*4))
#Get CPU model
PROC=`cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //' | uniq`
echo $PROC
#check Architecture set 32 bit default
ARCHITECTURE='32 Bit'
#
# Check for x86_64 (Test 1) - some O/S's use the -i switch
#
if [ "`uname -i|grep x86_64`" == "x86_64" ]; then
ARCHITECTURE='64 Bit'
fi
#
# Check for x86_64 (Test 2) - some OSs (ie. Gentoo) return Processor manufacturer
# rather than architecture with "uname -i"
#
if [ "`uname -a|grep x86_64`" != "" ]; then
ARCHITECTURE='64 Bit'
fi
echo $ARCHITECTURE 'O/S detected.'
#Create conky skelaton
echo '#Use XFT?
use_xft yes
xftfont Liberation Sans:size=10
xftalpha 0.8
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type override
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area -adjust if you would like to user smaller fonts etc.
minimum_size '$GRAPHWIDTH' 0
maximum_width '$GRAPHWIDTH'
# Draw shades?
draw_shades no
default_color 00ff00 #000000
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_margin 5
# border width
border_width 1
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 15
gap_y 45
# -- Lua Load -- #
lua_load ~/.draw_bg.lua
lua_draw_hook_pre draw_bg
' > ~/.conkyrc
#Count number of processor cores
CORES=1
CORES=`cat /proc/cpuinfo | grep "processor" | wc -l`
echo $CORES "Cpu core(s) Detected."
echo 'TEXT
${goto '$INDENT'}${image /usr/share/ultimate_edition/logo.png -p '$BARZ','$LOGO' -s 32x32}'$HEADER'SYSTEM ${hr 2 }
'$HILIGHT'${alignr}'$OS' - $alignr$kernel '$ARCHITECTURE'
'$HILIGHT'${alignr}'$USER'@$nodename
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}k${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Processes: ${alignr}'$HILIGHT'$processes ($running_processes running)
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}q${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Uptime: '$HILIGHT'${alignr}${uptime}
'$HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}CPU${hr 1 }
'$HILIGHT$PROC'
${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'CPU Usage: '$HILIGHT' ${freq}MHz X '$CORES'${alignr}${cpu cpu0}% '$BAR' ${cpubar cpu0 '$INDENT','$SBAR'}
'$BASE'Cores: ${hr 1 }' >> ~/.conkyrc
#Create a cpubar for each core
COUNTER=0
while [ $COUNTER != $CORES ]; do
let COUNTER=COUNTER+1
echo '${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Core '$COUNTER':' $HILIGHT'${cpu cpu'$COUNTER'}% '$BAR'${alignr}${cpubar cpu'$COUNTER' '$INDENT','$BPER'}'$BASE >> ~/.conkyrc
done
#Output disk I/O bar top processes memory useage etc.
echo $HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}g${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}RAM${hr 1 }'$BASE'
Useage: '$HILIGHT'$mem / $memmax ${alignr}'$HILIGHT'$memperc% '$BAR'${membar '$INDENT','$SBAR'}'$BASE'
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}j${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Swap: '$HILIGHT'$swap/$swapmax${alignr}$swapperc% '$BAR'${swapbar '$INDENT','$SBAR'}
'$HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}d${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}${alignc}${time %H:%M}, ${time %A %d %B}
'$HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}a${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}Highest: ${alignr}CPU RAM
${goto '$VOFF'}${voffset -5.5}${hr 1}
'$HILIGHT'${voffset -1}${goto '$VOFF'}${top name 1}${alignr}${top cpu 1} ${top mem 1}
${goto '$VOFF'}${top name 2}${alignr}${top cpu 2} ${top mem 2}
${goto '$VOFF'}${top name 3}${alignr}${top cpu 3} ${top mem 3}
${goto '$VOFF'}${top name 4}${alignr}${top cpu 4} ${top mem 4}
'$HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}FILESYSTEM${hr 1 }'$BASE'
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}Y${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Disk I/O: '$HILIGHT'${diskio}${alignr}'$BAR'${diskiograph 20,'$BARZ'}
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Root: '$HILIGHT'${fs_free /} / ${fs_size /}${alignr}${fs_used_perc /}% '$BAR'${fs_bar '$INDENT','$SBAR' /}'$BASE >> ~/.conkyrc
#Detect hard disks & create a bar for each mount point
echo "Internal / External storage detected:"
echo "/ - Root"
ls /media/ > /tmp/tmp.txt
cat /tmp/tmp.txt | while read FILE
do
target=$(echo "$FILE" | sed -e "s/ /_/")
echo ''$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$FILE': '$HILIGHT'${fs_free /media/'$FILE'} / ${fs_size /media/'$FILE'}${alignr}${fs_used_perc /media/'$FILE'}% '$BAR'${fs_bar '$INDENT','$SBAR' /media/'$FILE'}'$BASE >> ~/.conkyrc
echo $FILE
done
rm /tmp/tmp.txt
echo $HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}5${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}NETWORK${hr 1}' >> ~/.conkyrc
#Detect "Active" network and propigate Network Xfer bar
ACTIVE=`ifconfig | grep -B 1 inet | head -1 | awk '{print $1}'`
echo $BASE'${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}q${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Up: ${upspeed '$ACTIVE'} '$BAR'${alignr}${upspeedgraph '$ACTIVE' 20,'$BARZ' '$BASE' '$BAR' }
'$BASE'${voffset -24}${goto '$VOFF'}Total: ${totalup '$ACTIVE'}
${voffset -'$ALEFT'}${font VariShapes Solid:pixelsize='$FONTSIZE'}Q${font}${goto '$VOFF'}${voffset -'$ALEFT'}'$BASE'Down: ${downspeed '$ACTIVE'}${font} '$BAR'${alignr}${downspeedgraph '$ACTIVE' 20,'$BARZ' '$BASE' '$BAR'}
'$BASE'${voffset -24}${goto '$VOFF'}Total: ${totaldown '$ACTIVE'}
${voffset -'$ALEFT'}${font Poky:pixelsize='$FONTSIZE'}w${font}${goto '$VOFF'}${voffset -'$ALEFT'}'$BASE'Local IP: '$HILIGHT'${alignr}${addr '$ACTIVE'}
'$BASE'${goto '$VOFF'}Public IP: '$HILIGHT'${alignr}${execi 3600 wget -O - http://whatismyip.org/ | tail}
'$BASE'TCP Connections: '$HILIGHT'${tcp_portmon 1 65535 count}
' >> ~/.conkyrc
echo $HEADER'${voffset -'$ALEFT'}${hr 2}
' >> ~/.conkyrc
Lua (save to file in home folder called .draw_bg.lua):
- Code: Select all
--[[
Background by londonali1010 (2009)
This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish.
To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
lua_load ~/.scripts/draw_bg.lua
lua_draw_hook_pre draw_bg
Changelog:
+ v1.0 -- Original release (07.10.2009)
]]
-- Change these settings to affect your background.
-- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
corner_r=20
-- Set the colour and transparency (alpha) of your background.
bg_colour=0x4D4D4D
bg_alpha=0.40
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg()
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
cairo_fill(cr)
end