You are not logged in.
A rather gray Conky setup... It takes advantage of $voffset and $goto to put the current values inside the graphs (thus making the conkyrc look a little messy ).
that's really nice. what weather/amarok scripts are you using? also, can you give me a brief overview of what the goto do? goto x position 5, for example, or line 5 on conky?
thanks!
"I know what you're thinking, 'cause right now I'm thinking the same thing. Actually, I've been thinking it ever since I got here:
Why oh why didn't I take the BLUE pill?"
Offline
Heres mine... along with a pacman script I made for it.
background yes
use_xft yes
xftfont Sans:size=10
xftalpha 0.5
default_color CCC
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
own_window yes
own_window_transparent yes
own_window_type dock
own_window_hints undecorated, sticky, below, skip_pager, skip_taskbar
update_interval 1
double_buffer yes
alignment top_left
gap_x 12
gap_y 36
minimum_size 200
TEXT
${color Tan2}Time$color $hr
${font :size=25}$alignc${color FFF}${time %I:%M %p}$color$font
$alignc${time %A, %B %d, %Y}
${color Tan2}System$color $hr
Uptime:$alignr$uptime
Kernel:$alignr$kernel
${color Tan2}Processors$color $hr
CPU0:$alignr${color FFF}${cpubar 7, 100}$color
$alignr${freq_g cpu1} GHz
${color Tan2}Memory$color $hr
Used / Total$alignr${color FFF}${membar 7, 100}$color
${color Tan2}HDD$color $hr
Root:$alignr${color FFF}${fs_bar 7, 100}$color
${color Tan2}Network$color $hr
IP Address:$alignr${addr eth0}
Upload:$alignr${upspeed eth0}
Download:$alignr${downspeed eth0}
${color Tan2}Repository Status$color $hr
${texeci 20 ~/paclist}
TIP: Append a couple new lines for the pacman script so conky doesn't vertically cut off it's output.
The pacman script:
#!/usr/bin/env python
import commands
def echo_lst():
status, output = commands.getstatusoutput("pacman -Qu")
if not "no upgrades found." in output:
pkglst, sep, junk = output.partition("Total Download Size:")
pkglst = pkglst.split()
del pkglst[0:6]
del sep, junk
if len(pkglst) > 1:
print("{0} updated package(s) available:".format(len(pkglst)))
elif not len(pkglst) == 0:
print("The world is ending, please back up your data.")
for pkg in pkglst:
print(":: {0}".format(pkg))
else:
print("No updated packages available.")
echo_lst()
Last edited by knopper92 (2009-08-03 09:29:48)
Offline
jwcxz wrote:A rather gray Conky setup... It takes advantage of $voffset and $goto to put the current values inside the graphs (thus making the conkyrc look a little messy ).
that's really nice. what weather/amarok scripts are you using? also, can you give me a brief overview of what the goto do? goto x position 5, for example, or line 5 on conky?
thanks!
No problem. First of all, I completely forgot to add my temperature and voltage monitoring meters back in, so I updated my config above.
The weather portion consists of two scripts. The first (getweather.py) is a cronjob, run around every 15 minutes, that pulls weather data from weather.com's XML file (which I had to sign up for to get a publisher key or whatever). It stores it to a text file (~/.conky/wdata), which can be parsed by weather.sh (e.g. weather.sh 1 1 returns the first item in the first row of the weather data). This is nice because I can apply effects to all of the items individually without wasting bandwidth (i.e. I only have to pull the XML file once every 15 minutes).
The amarok portion is also two scripts (amarokstatus.py, amarokprogress.py) -- one for the "now playing" status and one for the progressbar. Neither is very complicated... I just used some DBUS calls.
Finally, I have nvtemp.sh for monitoring my GPU temperature settings.
Scripts are here:
http://jwcxz.com/pictures/desktop/09-08/conkyscripts/
$goto allows you to place text at any horizontal location on the line. E.g. if you want to put some text 20 pixels from the left, do ${goto 20}. $voffset allows you to offset your text vertically. In my configuration, I managed to save some space by scrunching up lines in each section with ${voffset -2}... It's a little messy, but the result is pretty nice.
HTH
-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers
Offline
Mostly posting this for the MPD info, here are the scripts (based on xd-0's work):
#!/bin/bash
# Script to use with conky to display cover art. You should modify
# the path to the directory containing the album art
# Array to extract the necessary data from MPD running on another
# system than localhost, in one call to save your CPU. Thanks to
# bruenig for pointing me to what bash - yet again - can do here
IFS=$'\t' mpd_array=( $(MPD_HOST=amalthea MPD_PORT=6666 mpc --format "\t%artist%\t%album%\t") )
# Link the cover into /tmp so the conky cover instance can pick it up
# Make sure we don't relink all the time, it's a waste of CPU cycles
# and SSD memory cells
if [[ ! -f /tmp/"${mpd_array[1]}".album ]] ; then
rm -f /tmp/*.album &>/dev/null
>/tmp/"${mpd_array[1]}".album
ln -sf ~/graphics/album\ art/*"${mpd_array[1]} 300.jpg" /tmp/cover.jpg || ln -sf ~/graphics/album\ art/"${mpd_array[0]} - ${mpd_array[1]} 300.jpg" /tmp/cover.jpg
fi
# ~/.conky-mpd - displays mpd info, to be used with ~/.conky-cover
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
alignment tl
draw_shades no
double_buffer yes
gap_x 155
gap_y 55
update_interval 1.0
minimum_size 275 5
use_xft yes
xftfont DejaVu Vera Sans:size=10
mpd_host amalthea
mpd_port 6666
TEXT
${if_running ncmpc}
${tab start}${color #888888}Title:${color} ${tab 35}${scroll 39 5 $mpd_title }
${tab start}${color #888888}Time:${color} ${tab 35}$mpd_elapsed/$mpd_length
${color #888888}$stippled_hr${color}
${tab start}${color #888888}Artist:${color} ${tab 35}$mpd_artist
${tab start}${color #888888}Album:${color} ${tab 35}$mpd_album
${endif}
# ~/.conky-cover - displays album-art, to be used with ~/.conky-mpd
imlib_cache_size 0 # so image is redrawn
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
minimum_size 130 130
alignment tl
double_buffer yes
gap_x 25
gap_y 55
update_interval 5
TEXT
${if_running ncmpc}
${execi 2 ~/scripts/cover.sh}
${image /tmp/cover.jpg -s 120x120}
${endif}
Advantages
* links to album image instead of copying it to /tmp
* only updates link to album image if album changes (other song, same album = same cover art, same file, no relink)
* song title will start scrolling if it doesn't fit within the conky window
* will ignore the artist name in the cover art file name so it will still work with cover art of multi-artist albums
* if multiple albums exist with the same album name but by different artists it will use both artist and album name to link to the correct image
* nothing will be displayed if ncmpc is not running (you can substitute this for whatever app you want conky to check for to start displaying info)
Disadvantages
* none to my knowledge, except for just being stupid and calling mpc every time for info instead of setting mpd_host and mpd_port in the conky settings...
The script (first code snippet) might need some adaptation depending on your situation (path, file names of the album art) but the skeleton is there.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
For those using mpd on localhost you can just replace all the mpc calls with the mpd_ functions conky already provides.
Is there a reason why you don't use mpd_host and mpd_port in your config? That should save you from all of those execi mpc stuff..
^as
edit.. uhh almost forgot.. Nice job
Last edited by sm4tik (2009-08-03 13:21:38)
Offline
Thanks .
The problem is the mpd_ functions don't take any arguments, hence you can only use MPD running on localhost and the default port.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Good work B, saved me some time with the script
And I realy like the scrolling you applied to the title etc. I will upload some of the changes to my page and add some credit.
Offline
methuselah wrote:I have a question for the conky weather experts. I was wondering if there was another weather font that can be used with the conkyForecast.py script?
you can try this one:
http://www.fontspace.com/gemfonts/whethers
Thank you, but that one doesn't really match the fonts that I use. I was hoping for something that looked more like the console font that I have in those conky screenshots.
Thanks again for trying.
Offline
Thanks .
The problem is the mpd_ functions don't take any arguments, hence you can only use MPD running on localhost and the default port.
Just to be clear, I meant the config settings of conky (stuff before TEXT), not the $mpd_* variables. I may be wrong though, no doubt
Offline
This is the one I use. Made for 1440x900 and higher.
With it, I almost don't need a panel anymore, except for the system tray which can't be placed into conky.
conkyrc:
# Adapted from:
# http://bbs.archlinux.org/viewtopic.php?pid=364143#p364143
# set to yes if you want Conky to be forked in the background
background no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
font -xos4-terminus-medium-r-normal--12-120-72-72-c-60-iso8859-1
# Use Xft?
#use_xft yes
use_xft no
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8
#xftfont Liberation Mono:size=8
# Text alpha when using Xft
xftalpha 0.8
# Print everything to stdout?
# out_to_console no
# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell
# Print everything to console?
# out_to_console no
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 1.0
# 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 no
# If own_window is yes, you may use type normal, desktop or override
own_window_type normal
# Use pseudo transparency with own_window?
own_window_transparent yes
# If own_window_transparent is set to no, you can set the background colour here
own_window_colour hotpink
# If own_window is yes, these window manager hints may be used
#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 280 5
# Draw shades?
draw_shades yes
# Draw outlines?
draw_outline no
#draw_outline yes
# Draw borders around text
#draw_borders yes
draw_borders no
# Draw borders around graphs
draw_graph_borders yes
# Stippled borders?
stippled_borders 8
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black
# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right
#alignment none
# Gap between borders of screen and text
# same thing as passing -x at command line
#gap_x 12
gap_x 0
gap_y 0
#gap_y 12
#gap_y 40
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
#override_utf8_locale no
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer no
# Change this to sane values for your resolution, I use 1440x900
maximum_width 1440
minimum_size 1280
# stuff after 'TEXT' will be formatted on screen
TEXT
${alignc}${color lightgrey}${freq_g 0}GHz @ ${platform coretemp.0 temp 1}C: ${color #cc4444}${cpu cpu0}% ${color}${freq_g 1}GHz @ ${platform coretemp.1 temp 1}C : ${color #cc4444}${cpu cpu1}% ${color lightgrey} | RAM: ${color}$mem ${color lightgrey}Swap: ${color}$swap | WLAN: ${wireless_essid wlan0} @ ${wireless_link_qual wlan0}%: ${addr wlan0} ${color lightgrey} DL: ${color #15F600}${downspeed wlan0} ${color lightgrey}UL: ${color #FF2CAE}${upspeed wlan0}${color lightgrey}| MPD: ${color #88aadd}$mpd_status ${color #88aadd}$mpd_smart ${color lightgrey} | $battery $battery_time ${color lightgrey} | ${time %X} ${execi 5 ~/bin/ks} KS up ${uptime} | ${loadavg 1}
the 'ks' utility is the standard kiloseconds C app, but modifiet to return just the value:
#include <stdio.h>
#include <time.h>
int main()
{
struct tm *t;
time_t now;
float ks;
time(&now);
t=localtime(&now);
ks=(t->tm_hour*3600 + t->tm_min*60 + t->tm_sec);
printf("%.2f\n",ks/1000);
return 0;
}
Offline
B wrote:Thanks .
The problem is the mpd_ functions don't take any arguments, hence you can only use MPD running on localhost and the default port.
Just to be clear, I meant the config settings of conky (stuff before TEXT), not the $mpd_* variables. I may be wrong though, no doubt
Crap... I so totally overlooked that . I'll adapt my stuff, thanks for pointing me to it! God I feel dumb...
Good work B, saved me some time with the script
And I realy like the scrolling you applied to the title etc. I will upload some of the changes to my page and add some credit.
Thank you . I will fix my errors though with calling mpc... Sm4tik gently pointed them out .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
sm4tik wrote:B wrote:Thanks .
The problem is the mpd_ functions don't take any arguments, hence you can only use MPD running on localhost and the default port.
Just to be clear, I meant the config settings of conky (stuff before TEXT), not the $mpd_* variables. I may be wrong though, no doubt
Crap... I so totally overlooked that . I'll adapt my stuff, thanks for pointing me to it! God I feel dumb...
No problemos! We don't want to waste those cpu cycles, do we?
Offline
Lol no we don't .
Edit: i just bumped into a problem I was thinking about yesterday while modifying the cover.sh script to only work with the album title - two MTV Unplugged albums .
I implemented a fallback function so if linking to the album cover fails based on the name of the album alone it will try to link to it using the name of the artist too. It doesn't look nice but it does the job.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Here's my one:
With the .conkyrc:
alignment tr
double_buffer yes
gap_x 20
gap_y 20
own_window yes
own_window_type desktop
own_window_transparent yes
use_xft yes
xftfont Sans:size=8
TEXT
Prozessor $hr
CPU1 ${alignr}${cpu cpu1}%
${cpugraph cpu1 16, 200}
CPU2 ${alignr}${cpu cpu2}%
${cpugraph cpu2 16, 200}
Temperatur${alignr}${hwmon temp 1}°C
Speicher $hr
RAM ${alignr}$mem/$memmax
${membar 6, 200}
Swap ${alignr}$swap/$swapmax
${swapbar 6, 200}
Dateisystem $hr
/ ${alignr}${fs_free /}
${fs_bar 6, 200 /}
/home ${alignr}${fs_free /home}
${fs_bar 6, 200 /home}
Prozessorleistung $hr
${top name 1}${alignr}${top cpu 1}%
${top name 2}${alignr}${top cpu 2}%
${top name 3}${alignr}${top cpu 3}%
${top name 4}${alignr}${top cpu 4}%
${top name 5}${alignr}${top cpu 5}%
Speichernutzung $hr
${top_mem name 1}${alignr}${top_mem mem 1}%
${top_mem name 2}${alignr}${top_mem mem 2}%
${top_mem name 3}${alignr}${top_mem mem 3}%
${top_mem name 4}${alignr}${top_mem mem 4}%
${top_mem name 5}${alignr}${top_mem mem 5}%
Akku $hr
${battery_time C1F3}${alignr}${battery_percent C1F3}%
${battery_bar 6,200 C1F3}
AC-Adapter${alignr}$acpiacadapter
Netzwerk $hr
ESSID${alignr}${wireless_essid wlan0}
Mode${alignr}${wireless_mode wlan0}
Qualität${alignr}${wireless_link_qual_perc wlan0}%
${wireless_link_bar 6,200 wlan0}
Last edited by Nagian (2009-08-06 19:35:39)
Offline
Here it comes.
-Conky (2x) One for the bar and another one to display the random xcd image wich uses this script
-Openbox
-Tint2
-Urxvt
The conky for the image would be : ( i am at work so i can't exactly check it)
X would be the random update interval of the image.
gap_x 20
gap_y 20
TEXT
${if_running ncmpcpp}
${execi X ~/bin/xkcd.pl}
${image /path/tp/xkcd.png -s 300x300}
${endif}
Last edited by jelly (2009-08-07 07:34:33)
Offline
Hi guys,
My conky is simple, but pretty eye-catchy - its iPod showing current music from mpd.
Idea taken from Ghost1227 genius openbox theme - all thanks go to him.
.conky/ipod_mpd
background no
use_xft yes
xftfont DejaVu Sans:Bold:size=10
xftalpha 0.9
update_interval 1.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 361 596
maximum_width 361
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 111111
color_1 a4a4a4
default_shade_color 101319
default_outline_color green
alignment top_right
gap_x 0
gap_y 100
no_buffers yes
uppercase no
override_utf8_locale yes
mpd_host localhost
mpd_port 6600
TEXT
${image .conky/iPod.png}
${font DejaVu Sans:Bold:size=8}
MPD: ${if_mpd_playing}${color 556B2F}Running${else}${color ff0000}Stopped${endif} ${color}${font}
${font DejaVu Sans:Bold:size=16} $mpd_artist${font}
$mpd_title ${color a4a4a4}[$mpd_length]${color}
${color a4a4a4}on ${color}${font DejaVu Sans:Bold:size=8}$mpd_album${font}
${color 556B2F}${mpd_bar 10, 100} ${color}$mpd_percent% ${color a4a4a4}$mpd_elapsed
${color}Volume:${color a4a4a4} $mpd_vol
${color}Bitrate:${color a4a4a4} $mpd_bitrate kbps
Source image - it is really lame, I'm not a big painter, it needs a lot of love.
Offline
in conky I was using this pl to see the number of packages to actualize:
#!/usr/bin/perl
use strict;
use warnings;
my $n = ((`pacman -Qu` =~ m/^[^\s]+\s\((\d+)\):/m) ? $1 : 0);
if ($n == 0)
{
print "nada para actualizar"
}
elsif($n == 1)
{
print "1 paquete para actualizar"
}
else
{
print "$n paquetes para actualizar"
and this in a hourly cron:
#!/bin/bash
pacman -Sy 1>/dev/null 2>&1
but... it is not working after the latest pacman update?
I arch, you arch, he arch, she arch, we arch, they arch...
Offline
in conky I was using this pl to see the number of packages to actualize:
#!/usr/bin/perl use strict; use warnings; my $n = ((`pacman -Qu` =~ m/^[^\s]+\s\((\d+)\):/m) ? $1 : 0); if ($n == 0) { print "nada para actualizar" } elsif($n == 1) { print "1 paquete para actualizar" } else { print "$n paquetes para actualizar"
and this in a hourly cron:
#!/bin/bash pacman -Sy 1>/dev/null 2>&1
but... it is not working after the latest pacman update?
pacman -Qu output has changed. it now lists the upgrades, and if there are none has no output. now you can get the number of packages available to upgrade with a simple
pacman -Qu | wc -l
Desktop/Laptop - DWM :: VM - screen
Registered Linux User Number 483137 :: Victory! :: GitHub
Offline
pacman -Qu output has changed. it now lists the upgrades, and if there are none has no output. now you can get the number of packages available to upgrade with a simple
pacman -Qu | wc -l
For those of us who are completely perplexed by all of this, is it a simple matter of changing the third line of this script?
#!/bin/sh
# save resources by querying the db once, reuse the output
output=`pacman -Qu`
numofup=`echo "$output" | grep Targets | sed 's/Targets (\([0-9]*\).*/\1/' `
if [ -n "$numofup" ]; then
sizeofup=`echo "$output" | grep "Total Installed Size" \
| cut -d ':' -f 2 \
| sed 's/^ *//'`
# pacman -Qu wont tell us how much to dl, skipping this one
#dlsize=`echo "$output" | grep "Total Download Size" \
# | cut -d ':' -f 2 \
# | sed 's/^ *//'`
echo "\${color}""$numofup New Packages Available"
#echo -e "\${alignr}\${color}($dlsize / $sizeofup)"
#echo -e "\t \${color0}" "dl/inst" "\${alignr}\${color}$dlsize / $sizeofup"
echo -e "\${color}Install Size:" "\${alignr}\${color}$sizeofup"
else
echo "\${color}""System up-to-date"
fi
Offline
pacman -Qu output has changed. it now lists the upgrades, and if there are none has no output. now you can get the number of packages available to upgrade with a simple
pacman -Qu | wc -l
thanks a lot mjheagle8!
I arch, you arch, he arch, she arch, we arch, they arch...
Offline
pacman -Qu output has changed. it now lists the upgrades, and if there are none has no output. now you can get the number of packages available to upgrade with a simple
pacman -Qu | wc -l
The only problem with this is when you have one or more packages in your IgnorePkg list (in pacman.conf) and you don't want those to be a part of the count. Because pacman -Qu lists them too, here's what I did..
pacman -Qu | grep -v "$(sed -n '/^Ign/!d; s/^IgnorePkg.*= //; s/ /\\|/gp' /etc/pacman.conf)" | wc -l
Not that pretty I guess, but does the job..
..edit..simplified just a bit
Last edited by sm4tik (2009-08-12 20:16:26)
Offline
Offline
http://www.f3ar007.com/images/conky-problem.png
#avoid flicker
double_buffer yes
#own window to run simultanious 2 or more conkys
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager
#borders
draw_borders no
border_margin 0
#shades
draw_shades yes
#position
gap_x 0
gap_y 6
alignment tm
#behaviour
update_interval 1
#colour
default_color 9f907d
#default_shade_color 000000
own_window_colour 3d352a
#font
use_xft yes
xftfont Sans:pixelsize=11
#to prevent window from moving
use_spacer none
minimum_size 1262 0
#mpd
mpd_host localhost
mpd_port 6600
TEXT
${alignc}Kernel: ${color D7D3C5}$kernel | ${time %d %B} ${color D7D3C5}${time %H:%M} | ${color} Up: ${color D7D3C5}${uptime_short} | ${color}Processes: ${color D7D3C5}$processes ${color}Running: ${color D7D3C5}$running_processes | ${color}Cpu: ${color D7D3C5}${cpu}%${color D7D3C5} | ${color }Mem: ${color D7D3C5}$mem/$memmax - $memperc% ${color D7D3C5} | ${color}Net: ${color D7D3C5}${font}${downspeed wlan0}${color} ${color D7D3C5} ${totaldown wlan0} | ${color D7D3C5}${upspeed wlan0}${totalup wlan0}
${alignc} ${color }Root: ${color D7D3C5}${font}${fs_free /} / ${fs_size /} - ${fs_free_perc /}% Free | ${color} Home: ${color D7D3C5}${fs_free /home} / ${fs_size /home} - ${fs_free_perc /home}% Free | ${color} Arch-pkg: ${color D7D3C5}${font}${execi 300 perl ~/.scripts/arch-updates/conky-updates.pl} | ${color}Email: ${color D7D3C5}${execi 300 python ~/.scripts/gmail.py} messages
Question:
A small box appears on the right side of the first line with my current config. Is there a way to remove it? Does anyone see the reason it appears?
Last edited by f3ar007 (2009-08-19 03:42:08)
Offline
use_xft yes
xftfont profont:pixelsize=11
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
alignment top_middle
gap_y 6
color0 ea6868
color1 88aa22
color2 6495ed
TEXT
${color0}${time %A %e %B %R} ${color1}${if_match ${execi 3 pacman -Qu | wc -l} == 0}Updated${else}Outdated${endif} ${color2}${if_gw}${if_up eth0}Wired$endif${if_up wlan0}Wireless${endif}${else}No Connection${endif}
Offline
mjheagle8 wrote:pacman -Qu output has changed. it now lists the upgrades, and if there are none has no output. now you can get the number of packages available to upgrade with a simple
pacman -Qu | wc -l
The only problem with this is when you have one or more packages in your IgnorePkg list (in pacman.conf) and you don't want those to be a part of the count. Because pacman -Qu lists them too, here's what I did..
pacman -Qu | grep -v "$(sed -n '/^Ign/!d; s/^IgnorePkg.*= //; s/ /\\|/gp' /etc/pacman.conf)" | wc -l
Not that pretty I guess, but does the job..
..edit..simplified just a bit
Here's what I have been using since the pacman 3.3 upgrade.
It ain't pretty because I only know a bit of sed and not much bash
#!/bin/bash
#A plugin script for conky to show any available arch linux sofware updates.
#Last modified on 10/AUGUST/2009
#version 0.8
#This version supports very basic display priority, and can be changed to suit the users needs.
NOP=6 #change this to display the maximum Number Of Packages in the display
NEED1=kernel #change this to whatever package is most important to you
NEED2=pacman #change this to your 2nd most important package
IGNORE=`cat /etc/pacman.conf | grep IgnorePkg | wc -l`
let IGNORE=IGNORE+1
NUM=`pacman -Qu | sed -n "$IGNORE"~1p | wc -l`
#start building the text to show on screen.
if [ $NUM -gt 0 ]; then
echo "There are $NUM new updates"
pacman -Qu | sed -n "$IGNORE"~1p | sed -e '/'$NEED1'/b' -e '/'$NEED2'/b' -e d
pacman -Qu | sed -n "$IGNORE"~1p | sed -n '/'$NEED1'/!p' | sed -n '/'$NEED2'/!p' | head -n $NOP
else
echo "There are no new updates"
echo "Arch is upto date :)"
Run it in a terminal to see if it works for you guys too, I only have one package on hold, and it works for me.
This Is My Truth, Tell Me Yours
Offline