Bem-vindo: Sáb, 23 de Novembro 2024, 15:30 Pesquisa avançada
Logistic (09-04-2013, 11:08) escreveu:Olá,
Alguém me pode dar um link para algum tutorial de como instalar o conky e configurar, é que já vi aqui coisas bastantes interessantes e gostava de experimentar.
cumps,
Logistic
Logistic (09-04-2013, 14:37) escreveu:Eu já instalei segui o tutorial do link e já fui meter uma configuração aqui deste post para ficar mais bonito o conky, mas dps a iniciar pelo terminal o conky dá este erro:
"Conky: invalid configuration file '/home/davide/.conkyrc'
Conky: missing text block in configuration; exiting
***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:
imlib_context_free();
With the parameter:
context
being NULL. Please fix your program."
Luis Cardoso (09-04-2013, 14:56) escreveu:Qual é que foi? Ah e devo avisá-lo que há um pequeno bug (conhecido mas não resolvido) no fórum, que quando se coloca o texto na code e em spoiler, ao clicar no botão para copiar o texto, acrescenta tabulações em todas as linhas Como o conky requer uma certa formatação no texto, esse acrescento de tabulações deixam o mesmo doido Por isso mesmo, recomendo que seleccione o texto manualmente, copiando-o e colando num ficheiro. Veja se isto resolve!
Logistic (09-04-2013, 15:09) escreveu:Luis Cardoso (09-04-2013, 14:56) escreveu:Qual é que foi? Ah e devo avisá-lo que há um pequeno bug (conhecido mas não resolvido) no fórum, que quando se coloca o texto na code e em spoiler, ao clicar no botão para copiar o texto, acrescenta tabulações em todas as linhas Como o conky requer uma certa formatação no texto, esse acrescento de tabulações deixam o mesmo doido Por isso mesmo, recomendo que seleccione o texto manualmente, copiando-o e colando num ficheiro. Veja se isto resolve!Spoiler:
Foi este que está dentro do spoiler. Eu seleccionei o texto que está dentro do spoiler e copiei.
Luis Cardoso (09-04-2013, 15:41) escreveu:Estive a testar e tenho de lhe dizer que teve cá uma pontaria... é que desde essa altura muita coisa mudou, nomeadamente o site que fornecia a indicação do estado do tempo, mudou a API, tornando essa funcionalidade obsoleta... E depois faltam ali os ficheiros para interagir com o Gmail... Logo, dá erro atrás de erro
Posso tentar restituir o que está em falta, mas irei demorar algum tempo, se tiver outro em mira, veja se funciona!
~/.1b1_accuweather_images
# Use Xft?
use_xft yes
xftfont AvantGarde LT ExtraLight:bold:pixelsize=9
xftalpha 0.8
text_buffer_size 1024
# Update interval in seconds
update_interval 30
# 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_class Conky
own_window yes
own_window_type normal
own_window_transparent yes
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
minimum_size 360 500
maximum_width 362
#minimum_size 600 0
#maximum_width 1000
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
draw_graph_borders no
# border width
border_width 10
# 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 10
gap_y 8
# Distric-Thin fonts
# Blue Highway
# Raleway
# Zekton
# Calibri
# Engebrechtre
# Opeln2001
# AvantGarde LT ExtraLight:bold
# AvantGarde LT ExtraLight:bold
default_color DDD #4D4D4D
color0 888 #cor discreta
color1 DB7F5A #titulos
color2 3E3E3E #linhas
color4 333
# -- Lua Load -- #
#lua_load ~/.conky/ConkyAnalytics/.draw_bg.lua
# lua_draw_hook_pre draw_bg
imlib_cache_size 0
TEXT
$color${texeci 500 bash $HOME/.1b1_accuweather_images/1b1}${image $HOME/.1b1_accuweather_images/background.png -p 0,0 -s 360x482}${image $HOME/.1b1_accuweather_images/cc.png -p 0,20 -s 167x114}
${font}${goto 180}${color1}TEMPERATURA: $color${alignr}${execpi 600 sed -n '29p' $HOME/.1b1_accuweather_images/curr_cond}°C (${execpi 600 sed -n '30p' $HOME/.1b1_accuweather_images/curr_cond}°C)
${goto 180}${color1}VENTO: $color${alignr}${execpi 600 sed -n '31p' $HOME/.1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}HUMIDADE: $color${alignr}${execpi 600 sed -n '33p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}PONTO DE ORVALHO: $color${alignr}${execpi 600 sed -n '37p' $HOME/.1b1_accuweather_images/curr_cond}°C
${goto 180}${color1}PRESSÃO: $color${alignr}${execpi 600 sed -n '34p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}VISIBILIDADE: $color${alignr}${execpi 600 sed -n '38p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}NUVENS: $color${alignr}${execpi 600 sed -n '35p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}ÍNDICE UV: $color${alignr}${execpi 600 sed -n '36p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}SOL: $color${alignr}${execpi 600 sed -n '39p' $HOME/.1b1_accuweather_images/curr_cond}/${execpi 600 sed -n '41p' $HOME/.1b1_accuweather_images/curr_cond}
${goto 180}${color1}LUA: $color${alignr}${execpi 600 sed -n '40p' $HOME/.1b1_accuweather_images/curr_cond}/${execpi 600 sed -n '42p' $HOME/.1b1_accuweather_images/curr_cond}
${color2}${hr 1}$color
${goto 50}${font Arial:size=10}${color1}Hoje$color$font${goto 230}${font Arial:size=10}${color1}Hoje à Noite$color$font${image $HOME/.1b1_accuweather_images/tod.png -p 10,160 -s 120x83}${image $HOME/.1b1_accuweather_images/ton.png -p 200,160 -s 120x83}
${goto 145}${execpi 600 sed -n '26p' $HOME/.1b1_accuweather_images/first_days}°C${goto 340}${execpi 600 sed -n '31p' $HOME/.1b1_accuweather_images/first_days}°C
${goto 140}(${execpi 600 sed -n '27p' $HOME/.1b1_accuweather_images/first_days}°C)${goto 335}(${execpi 600 sed -n '32p' $HOME/.1b1_accuweather_images/first_days}°C)
${goto 20}Probabilidade de chuva: ${execpi 600 sed -n '28p' $HOME/.1b1_accuweather_images/first_days}${goto 195}Probabilidade de chuva: $color${execpi 600 sed -n '33p' $HOME/.1b1_accuweather_images/first_days}
${color2}${hr 1}$color
${font Arial:size=9}${goto 40}${color1}${execpi 600 sed -n '5p' $HOME/.1b1_accuweather_images/first_days}${goto 145}${execpi 600 sed -n '10p' $HOME/.1b1_accuweather_images/first_days}${goto 270}${execpi 600 sed -n '15p' $HOME/.1b1_accuweather_images/first_days}$color${font}${image $HOME/.1b1_accuweather_images/6.png -p 5,260 -s 90x62}
${font Arial:size=8}${goto 100}${execpi 600 sed -n '8p' $HOME/.1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '13p' $HOME/.1b1_accuweather_images/first_days}°C${goto 330}${execpi 600 sed -n '18p' $HOME/.1b1_accuweather_images/first_days}°C
${goto 100}${execpi 600 sed -n '9p' $HOME/.1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '14p' $HOME/.1b1_accuweather_images/first_days}°C${goto 330}${execpi 600 sed -n '19p' $HOME/.1b1_accuweather_images/first_days}°C${image $HOME/.1b1_accuweather_images/11.png -p 115,260 -s 90x62}${image $HOME/.1b1_accuweather_images/16.png -p 235,260 -s 90x62}
${font Arial:size=9}${goto 40}${color1}${execpi 600 sed -n '20p' $HOME/.1b1_accuweather_images/first_days}${goto 145}${execpi 600 sed -n '1p' $HOME/.1b1_accuweather_images/last_days}${goto 270}${execpi 600 sed -n '6p' $HOME/.1b1_accuweather_images/last_days}$color${font}${image $HOME/.1b1_accuweather_images/21.png -p 5,340 -s 90x62}
${font Arial:size=8}${goto 100}${execpi 600 sed -n '23p' $HOME/.1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '4p' $HOME/.1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '9p' $HOME/.1b1_accuweather_images/last_days}°C
${font Arial:size=8}${goto 100}${execpi 600 sed -n '24p' $HOME/.1b1_accuweather_images/first_days}°C${goto 210}${execpi 600 sed -n '5p' $HOME/.1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '10p' $HOME/.1b1_accuweather_images/last_days}°C${image $HOME/.1b1_accuweather_images/last_2.png -p 115,340 -s 90x62}${image $HOME/.1b1_accuweather_images/last_7.png -p 235,340 -s 90x62}
${font Arial:size=9}${goto 40}${color1}${execpi 600 sed -n '11p' $HOME/.1b1_accuweather_images/last_days}${goto 145}${execpi 600 sed -n '16p' $HOME/.1b1_accuweather_images/last_days}${goto 270}${execpi 600 sed -n '21p' $HOME/.1b1_accuweather_images/last_days}$color${font}${image $HOME/.1b1_accuweather_images/last_12.png -p 5,420 -s 90x62}
${font Arial:size=8}${goto 100}${execpi 600 sed -n '14p' $HOME/.1b1_accuweather_images/last_days}°C${goto 210}${execpi 600 sed -n '19p' $HOME/.1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '24p' $HOME/.1b1_accuweather_images/last_days}°C
${font Arial:size=8}${goto 100}${execpi 600 sed -n '15p' $HOME/.1b1_accuweather_images/last_days}°C${goto 210}${execpi 600 sed -n '20p' $HOME/.1b1_accuweather_images/last_days}°C${goto 330}${execpi 600 sed -n '25p' $HOME/.1b1_accuweather_images/last_days}°C${image $HOME/.1b1_accuweather_images/last_17.png -p 115,420 -s 90x62}${image $HOME/.1b1_accuweather_images/last_22.png -p 235,420 -s 90x62}
#!/bin/bash
#put your Accuweather address here
#address="http://www.accuweather.com/en/us/new-york-ny/10007/weather-forecast/349727"
address="http://www.accuweather.com/en/pt/braga/272363/weather-forecast/272363"
#address="http://www.accuweather.com/en/ca/scarborough/m1h/weather-forecast/55049"
loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6
#files
curr_cond_var="$HOME/.1b1_accuweather_images/curr_cond"
first_days_var="$HOME/.1b1_accuweather_images/first_days"
last_days="$HOME/.1b1_accuweather_images/last_days"
curr_cond_var_raw="$HOME/.1b1_accuweather_images/curr_cond_raw"
first_days_var_raw="$HOME/.1b1_accuweather_images/first_days_raw"
last_days_raw="$HOME/.1b1_accuweather_images/last_days_raw"
messages_var="$HOME/.1b1_accuweather_images/messages"
kill -STOP $(pidof conky)
killall wget
wget --save-cookies $HOME/.1b1_accuweather_images/cookie -O "$curr_cond_var_raw" $curr_addr
wget --load-cookies $HOME/.1b1_accuweather_images/cookie -O "$first_days_var_raw" $addr1
wget --load-cookies $HOME/.1b1_accuweather_images/cookie -O "$last_days_raw" $addr2
#Current Conditions - curr_cond file
if [[ -s "$curr_cond_var_raw" ]]; then
egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|var d = '\''|var s = '\''|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |"start">|"finish">' "$curr_cond_var_raw" > "$curr_cond_var"
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' -e 's/RealFeel/\n/g' "$curr_cond_var"
sed -i -e 's/^.*"#">//g' -e 's/^.*<strong class="temp"//g' -e 's/^>//g' -e 's/<span>°.*$//g' "$curr_cond_var"
sed -i -e 's/<\/a>.*$//g' -e 's/\/span> //g' -e 's/var d = //g' -e 's/var s = //g' -e 's/"temp">/\n/g' "$curr_cond_var"
sed -i -e 's/^.*"start">//g' -e 's/^.*"finish">//g' -e 's/<li>//g' -e 's/<strong>//g' -e 's/<<span.*$//g' "$curr_cond_var"
sed -i -e 's/<\/span>//g' -e 's/<\/strong><\/li>//g' -e 's/ "><\/div>//g' -e 's/'\''//g' "$curr_cond_var"
sed -i -e 's/"><\/div>//g' -e 's/^.*; //g' -e 's/&#.*$//g' -e 's/ i-alarm.*$//g' -e 's/;//g' "$curr_cond_var"
sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e 's/Dew Point: //g' -e 's/Visibility: //g' "$curr_cond_var"
sed -i -e 's/^.*detail-tab-panel //g' -e 's/">//g' -e 's/\r//g' -e 's/ *$//g' -e 's/mb.*$/mb/g' "$curr_cond_var"
sed -i 's/-s\|-xl.*$//g' "$curr_cond_var"
time=$(sed -n 1p "$curr_cond_var")
if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
sed -i 3a- "$curr_cond_var"
fi
line35=$(sed -n 35p "$curr_cond_var")
sed -i '35d' "$curr_cond_var"
sed -i 35a$line35 "$curr_cond_var"
cp $HOME/.1b1_accuweather_images/Forecast_Images/$(sed -n 27p "$curr_cond_var").png $HOME/.1b1_accuweather_images/cc.png
fi
#First 5days - first_days file
if [[ -s "$first_days_var_raw" ]]; then
sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' "$first_days_var_raw"
egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' "$first_days_var_raw" > "$first_days_var"
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' "$first_days_var"
sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>°.*$//g' "$first_days_var"
sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' "$first_days_var"
sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' "$first_days_var"
sed -i -e 's/Today/TODAY/' -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' "$first_days_var"
sed -i 's/-s\|-l.*$//g' "$first_days_var"
time=$(sed -n 1p "$curr_cond_var")
if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
sed -i 2a- "$first_days_var"
fi
L1=$(sed -n 1p "$first_days_var")
if [[ $L1 == TODAY ]]; then
sed -i 1d "$first_days_var"
fi
for (( i=6; i<=21; i+=5 ))
do
cp $HOME/.1b1_accuweather_images/Forecast_Images/$(sed -n ${i}p "$first_days_var").png $HOME/.1b1_accuweather_images/$i.png
done
cp $HOME/.1b1_accuweather_images/Forecast_Images/$(sed -n 25p "$first_days_var").png $HOME/.1b1_accuweather_images/tod.png
cp $HOME/.1b1_accuweather_images/Forecast_Images/$(sed -n 30p "$first_days_var").png $HOME/.1b1_accuweather_images/ton.png
fi
#Last 5days - last_days file
if [[ -s "$last_days_raw" ]]; then
sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' "$last_days_raw"
egrep -i '>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' "$last_days_raw" > "$last_days"
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' "$last_days"
sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>°.*$//g' "$last_days"
sed -i -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' "$last_days"
sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' "$last_days"
sed -i -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' "$last_days"
sed -i 's/-s\|-l.*$//g' "$last_days"
for (( i=2; i<=22; i+=5 ))
do
cp $HOME/.1b1_accuweather_images/Forecast_Images/$(sed -n ${i}p "$last_days").png $HOME/.1b1_accuweather_images/last_$i.png
done
fi
#messages file
sed -n 28p "$curr_cond_var" | cut -c -20 > $messages_var
sed -n 29p "$first_days_var" | cut -c -20 >> $messages_var
sed -n 34p "$first_days_var" | cut -c -20 >> $messages_var
for (( i=7; i<=22; i+=5 ))
do
sed -n ${i}p "$first_days_var" | cut -c -20 >> $messages_var
done
for (( i=3; i<=23; i+=5 ))
do
sed -n ${i}p "$last_days" | cut -c -20 >> $messages_var
done
#Substituir nomes para portuguÊs
sed -i 's/monday/Segunda/gI;s/tuesday/Terça/gI;s/wednesday/Quarta/gI;s/thursday/Quinta/gI;s/friday/Sexta/gI;s/saturday/Sábado/gI;s/sunday/Domingo/gI;s/today/Hoje/gI;s/tonight/Hoje à Noite/gI' "$curr_cond_var"
sed -i 's/monday/Segunda/gI;s/tuesday/Terça/gI;s/wednesday/Quarta/gI;s/thursday/Quinta/gI;s/friday/Sexta/gI;s/saturday/Sábado/gI;s/sunday/Domingo/gI;s/today/Hoje/gI;s/tonight/Hoje à Noite/gI' "$first_days_var"
sed -i 's/monday/Segunda/gI;s/tuesday/Terça/gI;s/wednesday/Quarta/gI;s/thursday/Quinta/gI;s/friday/Sexta/gI;s/saturday/Sábado/gI;s/sunday/Domingo/gI;s/today/Hoje/gI;s/tonight/Hoje à Noite/gI' "$last_days"
kill -CONT $(pidof conky)
address="http://www.accuweather.com/en/pt/braga/272363/weather-forecast/272363"
Ainda não tem o Ubuntu instalado? Veja:
|
Dicas para melhorar o Ubuntu:
|
|
Usuários navegando neste fórum: Nenhum usuário registrado e 11 visitantes