Code: Select all
#!/bin/sh
# Simple script (my first bashscript ever!) for grabbing info out of 'nvclock -i'
# - meant for torsmo/conky users with nvidia cards, by grimzy (grimzy@monet.no)
#
# Requires nvclock 0.8 and a nvidia-based card (only tested with gf 4400/gf6800 and nvclock 0.8).
# Note that only newer nvidia cards have temp-sensors.
# Also, make sure you have permission to run nvclock -i.
# Example for .torsmorc/.conkyrc:
# GPU: ${exec sh gpuinfo.sh boardname} (${exec sh gpuinfo.sh boardchip})
# Mhz ${execi 10 sh gpuinfo.sh gpuspeed} (Mem ${execi 10 sh gpuinfo.sh memspeed})
# Temp ${execi 10 sh gpuinfo.sh gputemp} (Board ${execi 10 sh gpuinfo.sh boardtemp})
#
if [ -z "$1" ]
then
echo "Usage: `basename $0` [boardname|boardchip|boardtemp|gputemp|gpuspeed|memspeed]"
exit $E_NOARGS
fi
if [ -e ~/.gpuinfo.tmp ]
then
file=~/.gpuinfo.tmp
{
read line1
} < $file
let "line1 += 10"
# Check if file has been updated less than 10secs ago (No reason to spam nvclock - uses less cpu (I think :P))
# Change 10 to a lower value if you want it to be updated more often.
if [ "$(date +%s)" -gt "$line1" ]
then
date +%s > ~/.gpuinfo.tmp
nvclock -i >> ~/.gpuinfo.tmp
fi
else
# Create file on first-time run
date +%s > ~/.gpuinfo.tmp
nvclock -i >> ~/.gpuinfo.tmp
fi
case $1 in
"boardname" ) out=$(cat ~/.gpuinfo.tmp | grep "Card" | sed -e 's/^.*Card: \(.*\)$/\1/' -e s/,//g -e 's/^[ \t]*//;s/[ \t]*$//');;
"boardchip" ) out=$(cat ~/.gpuinfo.tmp | grep "Architecture" | sed -e 's/^.*Architecture: \(.*\)$/\1/' -e s/,//g -e 's/^[ \t]*//;s/[ \t]*$//');;
"boardtemp" ) out=$(cat ~/.gpuinfo.tmp | grep "Board temp" | awk '{print $3}');;
"gputemp" ) out=$(cat ~/.gpuinfo.tmp | grep "GPU temp" | awk '{print $3}');;
"gpuspeed" ) out=$(cat ~/.gpuinfo.tmp | grep "GPU clock" | awk '{print $3}');;
"memspeed" ) out=$(cat ~/.gpuinfo.tmp | grep "Clock" | awk '{print $2}');;
* ) out="Usage: `basename $0` [boardname|boardchip|boardtemp|gputemp|gpuspeed|memspeed]";;
esac
echo "$out"
exit $?
Code: Select all
totalmessages=1
newmessages=0
status=Using () of


I recently intalled CVS on my machine and its searlly bloatedbrenden wrote:For those interested in the weather stuff, now would be a good time to check out conky. The next version of conky will have the weather stuff built in (it's in the dev snapshot currently), with temperatures in C and F. More on conky:
http://forums.gentoo.org/viewtopic-t-35 ... 9c0fa7a4a8

I've edited my post. You can see the scripts I write (being slowly updated) atHamstereyes wrote:Can someone repost the powerstatus script ??
The original link is broken =(.
I would love to get my hands on it.
Thanks guys


Code: Select all
${color}CPU %:${color } $cpu% ${color}CPU Temp:${color } $temp1 C

Code: Select all
leamonde linux # modprobe eeprom
leamonde linux # modprobe via686a
FATAL: Module via686a not found.
leamonde linux # modprobe i2c-viapro
leamonde linux # modprobe i2c-isa
FATAL: Module i2c_isa not found.
leamonde linux #

well i tried emerging that package and i get:nonas wrote:torsmo is deprecated, you should try Conky. (see this thread)
Code: Select all
leamonde ~ # emerge -Nva conky
These are the packages that I would merge, in order:
Calculating dependencies
!!! All ebuilds that could satisfy "conky" have been masked.
!!! One of the following masked packages is required to complete your request:
- app-admin/conky-1.3.3 (masked by: ~x86 keyword)
- app-admin/conky-1.3.1 (masked by: ~x86 keyword)
For more information, see MASKED PACKAGES section in the emerge man page or
section 2.2 "Software Availability" in the Gentoo Handbook.
leamonde ~ #

Code: Select all
background yes
#font 7x13
font 6x10
use_xft no
on_bottom yes
#mpd_host 192.168.150.2
#mpd_port 6600
update_interval 1.0
total_run_times 0
own_window no
own_window_transparent yes
double_buffer yes
minimum_size 250 5
draw_shades yes
draw_outline no
draw_borders no
stippled_borders 8
border_margin 4
border_width 1
default_color white
default_shade_color black
default_outline_color black
alignment top_right
maximum_width 265
gap_x 12
gap_y 12background yes
#font 7x13
font 6x10
use_xft no
on_bottom yes
#mpd_host 192.168.150.2
#mpd_port 6600
update_interval 1.0
total_run_times 0
own_window no
own_window_transparent yes
double_buffer yes
minimum_size 250 5
draw_shades yes
draw_outline no
draw_borders no
stippled_borders 8
border_margin 4
border_width 1
default_color white
default_shade_color black
default_outline_color black
alignment top_right
maximum_width 265
gap_x 12
gap_y 12
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale no
use_spacer no
# stuff after 'TEXT' will be formatted on screen
TEXT
${color grey}Gemini@${color #7f8ed3}$nodename ${color #5b6dad}Up:${color grey} ${uptime}
${color #5b6dad}$hr
${color #7f8ed3}$kernel on $machine ${alignr}${color #5b6dad}gcc-${color #5b6dad}${exec ~/scripts/conky/gccver}
${color #5b6dad}System:
${color #5b6dad} CPU Usage:${color #7f8ed3} $cpu% ${alignr}${color #5b6dad}Temp:${color #7f8ed3} ${execi 30 ~/scripts/conky/cpu_temp}
${color #000000}${cpugraph cpu0 32,265 CCCCCC 7f8ed3}
${color #5b6dad} RAM Usage:${color #7f8ed3} $memperc% - ${alignr}$mem/$memmax
${color #7f8ed3} ${membar}
${color #5b6dad} Swap Usage:${color #7f8ed3} $swapperc% - ${alignr}$swap/$swapmax
${color #7f8ed3} ${swapbar}
${color #5b6dad} Processes:${color #7f8ed3} $processes ${color #5b6dad}Running:${color #7f8ed3} $running_processes
${color #5b6dad} CPU PID CPU% Mem%
${color grey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #7f8ed3} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color #7f8ed3} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color #5b6dad} Memory
${color grey} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #7f8ed3} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color #7f8ed3} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color #5b6dad}Network:
${color #5b6dad} Up:${color #7f8ed3} ${upspeed wlan0} k/s ${color #5b6dad}${alignr}Down:${color #7f8ed3} ${downspeed wlan0} k/s
${color #000000}${upspeedgraph wlan0 32,130 CCCCCC 7f8ed3} ${color #000000}${alignr}${downspeedgraph wlan0 32,130 CCCCCC 7f8ed3}
${color #5b6dad}File Systems:
${color #5b6dad}root : ${color #7f8ed3}${fs_used /}${color #5b6dad}/${color #7f8ed3}${fs_size /} ${alignr}${color #5b6dad}(${color #7f8ed3}${fs_free /} ${fs_free_perc /}% ${color #5b6dad} free)
${fs_bar /}
${color #5b6dad}usr : ${color #7f8ed3}${fs_used /usr}${color #5b6dad}/${color #7f8ed3}${fs_size /usr} ${alignr}${color #5b6dad}(${color #7f8ed3}${fs_free /usr} ${fs_free_perc /usr}% ${color #5b6dad} free)
${fs_bar /usr}
${color #5b6dad}home : ${color #7f8ed3}${fs_used /home/gemini}${color #5b6dad}/${color #7f8ed3}${fs_size /home/gemini} ${alignr}${color #5b6dad}(${color #7f8ed3}${fs_free /home/gemini} ${fs_free_perc /home/gemini}% ${color #5b6dad} free)
${fs_bar /home/gemini}
${color #5b6dad}share: ${color #7f8ed3}${fs_used /mnt/downloads}${color #5b6dad}/${color #7f8ed3}${fs_size /mnt/downloads} ${alignr}${color #5b6dad}(${color #7f8ed3}${fs_free /mnt/downloads} ${fs_free_perc /mnt/downloads}% ${color #5b6dad} free)
${fs_bar /mnt/downloads}
${color #5b6dad}var: ${color #7f8ed3}${fs_used /var}${color #5b6dad}/${color #7f8ed3}${fs_size /var} ${alignr}${color #5b6dad}(${color #7f8ed3}${fs_free /var} ${fs_free_perc /var}% ${color #5b6dad} free)
${fs_bar /var}
${color #5b6dad}Portage:
${color #5b6dad}Current Progress ${color #7f8ed3}${execibar 30 ~/scripts/conky/emerge-progress.sh}
${color #5b6dad}Current Package ${color #7f8ed3}${execi 30 ~/scripts/conky/emerge-current.sh}
${color #5b6dad}Current Status ${color #7f8ed3}${execi 30 ~/scripts/conky/emerge-status.sh}
${color #5b6dad}Last Sync ${color #7f8ed3}${execi 300 ~/scripts/conky/lastsync.pl}
${color #5b6dad}Gentoo Linux Security Advisories:
${color #7f8ed3}${execi 300 ~/scripts/conky/conky-rdf.sh}
${color #5b6dad}Local Weather:
${color #7f8ed3}${execi 1800 ~/scripts/conky/weather/weather.sh}
${color #5b6dad}Fox News Latest Headlines:
${color #7f8ed3}${execi 300 ~/scripts/conky/conky-rss.sh}
${color #7f8ed3}${hr 2}
${color #5b6dad}Date: ${color #7f8ed3}${time %a %m/%d/%Y} ${alignr}${time %T}
Code: Select all
$ mkdir ~/scripts/conky
Code: Select all
#!/bin/sh
gcc --version | awk 'NR==1 { print $3 }'
Code: Select all
#!/bin/sh
cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2, $3}'
Code: Select all
alias reconky='killall -SIGUSR1 conky'
How can i change Farenheit to Celsius? I only know that C = (F - 32)/1.8 but dunno how stick this in code.Arainach wrote: #!/bin/bash
city="DeWitt"
link=USMI0231.html
file=/tmp/weather.txt
location=http://weather.yahoo.com/forecast/$link
lynx -accept_all_cookies -dump $location > $file
begin=`cat -n $file | grep "Currently" | cut -d ' ' -f5`
end=`expr $begin + 40`
head -n $end $file > tmp.t
tail -n 41 tmp.t > $file
case $1 in
Today) head -n 6 $file | sed '3d' ;;
Tomorrow)
begin=`cat -n $file | grep 'Today Tomorrow' | cut -d ' ' -f5`
end=`cat -n $file | grep 'Extended' | cut -d ' ' -f5`
num=`expr $end - $begin - 1`
end2=`expr $begin + 7`
head -n $end2 $file > tmp.t
tail -n 3 tmp.t | sed 's/sky/\n sky/' | sed '4d' ;;
*) exit ;;
esac
rm tmp.t
rm $file
franklun wrote:How can i change Farenheit to Celsius? I only know that C = (F - 32)/1.8 but dunno how stick this in code.Arainach wrote: #!/bin/bash
city="DeWitt"
link=USMI0231.html
file=/tmp/weather.txt
location=http://weather.yahoo.com/forecast/$link
lynx -accept_all_cookies -dump $location > $file
begin=`cat -n $file | grep "Currently" | cut -d ' ' -f5`
end=`expr $begin + 40`
head -n $end $file > tmp.t
tail -n 41 tmp.t > $file
case $1 in
Today) head -n 6 $file | sed '3d' ;;
Tomorrow)
begin=`cat -n $file | grep 'Today Tomorrow' | cut -d ' ' -f5`
end=`cat -n $file | grep 'Extended' | cut -d ' ' -f5`
num=`expr $end - $begin - 1`
end2=`expr $begin + 7`
head -n $end2 $file > tmp.t
tail -n 3 tmp.t | sed 's/sky/\n sky/' | sed '4d' ;;
*) exit ;;
esac
rm tmp.t
rm $file
thanks for anwsers... (plz help)
Code: Select all
background = yes