shell script for conky getting errors....


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script for conky getting errors....
# 8  
Old 01-07-2012
I am not very familiar with conky. I just installed and tried invoking with a normal user and it required root privileges.

My question is : If sudo is configured for you, why don't you want to use it?

If prefixing sudo is a problem for you, try creating an alias kind in your script and use that... Something like this...
Code:
CONKY="/usr/bin/sudo /usr/bin/conky"
...
...
$CONKY inputargs

--ahamed
# 9  
Old 01-07-2012
My main problem now is that I still cant get the wlanscript.sh to work with my conky. I feel like I have all the paths right, but I cannot get the picture for the signal to show up at all...Here is the code:

Code:
override_utf8_locale yes
use_xft yes
xftfont verdana:size=8
alignment top_left
xftalpha 0.8
own_window class Conky
own_window yes
#own_window_type override
own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1
default_shade_color grey
default_outline_color black
default_color BADCDD
use_spacer none
no_buffers yes
uppercase no
color1 4D6844
color0 E6E6E6
color1 A7CC5C
color2 E6E6E6

minimum_size 310 310
maximum_width 310
    
#alignment tl
gap_x -20
gap_y 40



TEXT
#######################################
###             Logo              #####
#######################################
#${color D3DADF}${font OpenLogos:size=40}   S 
#######################################
###         HTC Weather            ####
#######################################  
${voffset 30}${font Helvetica LT Std :style=Condensed:size=60}${color 434343}${goto 42}${time %H}${goto 142}${color 434343}${time %M}${font Helvetica LT Std :size=15:style=condensed}${color 808080}${goto 229}${time %S}
${voffset 55}${color whitesmoke}${font Helvetica LT Std :size=8}${alignr 105}${time %A},${time %e},${time %B},${time %G}
${voffset -45}${goto 22}${font Helvetica LT Std :size=8}${color 909090}${execi 600 conkyForecast -i --location=USOR0304 --datatype=CN --refetch}
#${voffset 8}${font Helvetica LT Std :size=10}${color 707070}${goto 24}Бургас
${font Helvetica LT Std :size=8}${color whitesmoke}${goto 24}${execi 1800 conkyForecast -i --location=USOR0304 --datatype=CT}${voffset -10}${goto 200}${font Helvetica LT Std :size=25}${color d4d4d4}${execi 1800 conkyForecast -i --location=USOR0304 -u
--datatype=HT}
${voffset 35}${font Helvetica LT Std :size=8}${color white}${goto 34}${execi 600 conkyForecast -i --location=USOR0304 --datatype=HT -u --startday=1}/${color 707070}${execi 600 conkyForecast -i --location=USOR0304 --datatype=LT -u --startday=1}${font Helvetica LT Std :size=8}${color white}${goto 79}${execi 600 conkyForecast -i --location=USOR0304 --datatype=HT -u --startday=2}/${color 707070}${execi 600 conkyForecast -i --location=USOR0304 --datatype=LT -u --startday=2}${font Helvetica LT Std :size=8}${color white}${goto 128}${execi 600 conkyForecast -i --location=USOR0304 --datatype=HT -u --startday=3}/${color 707070}${execi 600 conkyForecast -i --location=USOR0304 --datatype=LT -u --startday=3}${font Helvetica LT Std :size=8}${color white}${goto 169}${execi 600 conkyForecast -i --location=USOR0304 --datatype=HT -u --startday=4}/${color 707070}${execi 600 conkyForecast -i --location=USOR0304 --datatype=LT -u --startday=4}
${font Helvetica LT Std :size=8}${color 707070}${goto 34}${execi 600 conkyForecast -i --location=USOR0304 --datatype=DW --shortweekday --startday=1}${font Helvetica LT Std :size=8}${color 707070}${goto 79}${execi 600 conkyForecast -i --location=USOR0304 --datatype=DW --shortweekday --startday=2}${font Helvetica LT Std :size=8}${color 707070}${goto 120}${execi 600 conkyForecast -i --location=USOR0304 --datatype=DW --shortweekday --startday=3}${font Helvetica LT Std :size=8}${color 707070}${goto 169}${execi 600 conkyForecast -i --location=USOR0304 --datatype=DW --shortweekday --startday=4}
${voffset -10}${font Helvetica LT Std :size=8}${color 707070}${goto 216}${execi 600 conkyForecast -i --location=USOR0304 --datatype=DW --shortweekday --startday=5}
${voffset -23}${font Helvetica LT Std :size=8}${color white}${goto 216}${execi 600 conkyForecast -i --location=USOR0304 --datatype=HT -u --startday=5}/${color 707070}${execi 600 conkyForecast -i --location=USOR0304 --datatype=LT -u --startday=5}
${image /home/kris/.images/base.png -p 12,30 -s 238x140}
${image /home/kris/.images/base.png -p 12,190 -s 238x40}
${image /home/kris/.images/flip_bg.png -p 30,10 -s 100x110}
${image /home/kris/.images/flip_bg.png -p 130,10 -s 100x110}
${execpi 600 conkyForecast -i --location=USOR0304 --template=/home/kris/.vreme.template}
####################################
###          Email Setup        ####
####################################
${voffset -52}${font WW2 BlackltrAlt:size=25}${color 014A7F}Current Emails & PC Vitals${color black}${hr 2}
${image /home/kris/.images/wlanbg2.png  -s 362x325 -p -10,240}
${voffset -9}${font OpenLogos:size=38}J${font Radio Space:size=22}${color yellow}${execpi 300 python ~/scripts/gmail_parser.py hornerkris@gmail.com June10th 3}${font Radio Space:size=14}${color 014A7F} New Message(s)
####################################
###       Battery Bar           ####
####################################
${color black}${font OpenLogos:size=26}T${color 014A7F}${font}  Battery: ${battery_percent}% ${battery_bar}
${color ffffff}${color black}${font OpenLogos:size=26}K${color 014A7F}${font}  CPU0: ${cpu cpu0}% ${cpubar cpu0}
${color black}${font OpenLogos:size=26}K${color 014A7F}${font}  CPU1: ${cpu cpu1}% ${cpubar cpu1}
${color black}${font OpenLogos:size=30}t${color 014A7F}${font}  Work:  ${uptime_short}
####################################
###         Network Info        ####
####################################
${voffset 16}${font WW2 BlackltrAlt:size=25}Network Info${color black}${hr 2}
${image /home/kris/.images/wlanbg2.png  -s 362x140 -p -10,533}
${alignc -10}${execpi /home/kris/wlanscript.sh}
${voffset -100}${font WW2 BlackltrAlt:size=13}${alignc -80}SSID: ${wireless_essid eth1}
${alignc -60}${font WW2 BlackltrAlt:size=13}Bitrate: ${wireless_bitrate eth1}
${alignc -48}${font WW2 BlackltrAlt:size=13}Local: ${addr eth1}
${alignc -35}${font WW2 BlackltrAlt:size=13}Public: ${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}
${voffset -20}${offset 44}${wireless_link_qual_perc eth1}%
${image /home/kris/.images/wlan100.png -p 20,550 -s 94x94}
${alignc -10}${execpi /home/kris/wlanscript.sh}
${font LT Oksana Medium:size=12}${execpi 300 /home/kris/verse.sh}

Code:
#! /bin/bash
function dload()
{   
    if [ $lq -le 100 ] && [ $lq -gt 65 ]; then
       echo '${image /home/kris/pix/wlan100.png -s 94x79 -p 10,520}'   
    fi   
    if [ $lq -le 66 ] && [ $lq -gt 55 ]; then   
       echo '${image /home/kris/pix/wlan50.png -s 94x79 -p 100,25}'   
    fi   
    if [ $lq -le 56 ] && [ $lq -gt 49 ]; then   
       echo '${image /home/kris/pix/wlan40.png -s 94x79 -p 100,25}'   
    fi   
    if [ $lq -le 50 ] && [ $lq -gt 5 ]; then   
       echo '${image /home/kris/pix/wlan5.png -s 94x79 -p 100,25}'   
    fi
}

function usage()
{
echo '${image /home/kris/pix/wlan0.png -s 94x79 -p 100,25}'
}


lq=$(sudo iwconfig eth1 | sed -n 's/.*Signal level[:=]-\([0-9]*\).*/\1/gp')

if [ $lq -le 5 ]
then
usage
else
dload
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Errors in if condition validations-Shell Script

Hello All, i am facing difficulty in validating the values, kindly help me in resolving the issue. Thanks a lot in advance. -Chandra Script:Test.sh #! /bin/sh # *************************************************************************** # Function to display help function usage()... (1 Reply)
Discussion started by: duddukuri
1 Replies

2. Shell Programming and Scripting

How to turn off ora errors in shell script?

I have a shell script which select total count from a table and use its value in a if condition like below connect_string="username/password@tnsname" tot=`sqlplus -s $connect_string << EOF set echo off set feedback off set head off select count(*) from test_table; EOF ` if then echo... (2 Replies)
Discussion started by: vel4ever
2 Replies

3. UNIX for Dummies Questions & Answers

Interpreting Shell Script errors when called from CRON

Hi All, I am calling a series of shell scripts via CRON so everything is running as root. However, in my error log file I am seeing the following errors. Please can anyone offer any advise as to the possible causes and solution to prevent the errors from appearing. The Error 1227 seems to... (2 Replies)
Discussion started by: daveu7
2 Replies

4. UNIX for Dummies Questions & Answers

Invalid option errors running shell script

The script below fails with the following error messages: gzip: invalid option -- 'w' Try `gzip --help' for more information. mysqldump: Got errno 32 on write cp: invalid option -- 'w' Try `cp --help' for more information. rm: invalid option -- 'w' Try `rm --help' for more information. ... (1 Reply)
Discussion started by: ANNACTION
1 Replies

5. Emergency UNIX and Linux Support

Seek help on shell script syntax errors

I want to delete archivelog files that has been archived and applied from primary database to standby database. This piece of script is working in Linux server. However, I copy it to Unix server with tiny modification. It won't work and generate the error message. I have checked code carefullt... (8 Replies)
Discussion started by: duke0001
8 Replies

6. Shell Programming and Scripting

Capture makefile errors in shell script

Hi, I have a bash script which calls a few "make". I would like to know whether the makefile failed with any errors. How do I do that in the script? Thanks, S (2 Replies)
Discussion started by: suryaemlinux
2 Replies

7. Shell Programming and Scripting

Bad substitution errors in shell script

Hello, I was hoping for a second pair of eyes or a little bit of help figuring out what my error is in a script. I did some searching in the forums and didn't find anything so please forgive me if it a similar problem has been discussed before. My script accepts normal user arguments; however,... (2 Replies)
Discussion started by: Jackinthemox
2 Replies

8. Shell Programming and Scripting

Help with shell script errors

hey watsup guys i am new in the shell script world. so i need help fom you guys, i have written these two codes and they both give the same errors( expr : syntax error). Code 1 : #! /bin/sh # count1 appends an increment to a file 200 times # note that a file called numbers must be... (5 Replies)
Discussion started by: surubi_abada
5 Replies

9. Shell Programming and Scripting

Parse for errors shell script

All, I have a shell script which parses the /var/adm/messages file for errors every 15 minutes as a cron job. The script runs at 01, 16, 31, and 46 minutes every hour. The problem is if the error is encountered any time during the beginning of hour I can get paged three times. I would like to... (2 Replies)
Discussion started by: bubba112557
2 Replies

10. Shell Programming and Scripting

Showing errors when connecting to sqlplus in shell script

hi, I am trying to automate the compilation of procedures stored in .sql files in Unix. Is there any way in which we can sho err if there errors are raised in the compilation? I am using the following code to connect to the sqlplus sqlplus ${SQL_USER}/${SQL_PASSWORD} (5 Replies)
Discussion started by: silas.john
5 Replies
Login or Register to Ask a Question