You are not logged in.

#1 2009-03-22 09:30:47

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Paconky: displays repo and AUR pkg info in conky

[2011-07-01] UPDATE The bash version of paconky is deprecated. Use the much more efficient paconky replacement script.

info page: http://xyne.archlinux.ca/old_projects/paconky/

screenshot
paconky_01.png

I was playing around with bash creating functions to get pkg info for other scripts and ended up making this in the process. This should hopefully be the pacman conky script for a while. Take a look at the info page to see the various configuration options. It's simple but versatile and plays well with "execp".


The above screenshot shows a single instance of conky with the following relevant lines in the configuration file:

color1 444444
color2 cccccc
color3 777777
# ...
# Notice that paconky is executed with "execpi" at an interval of 3600 seconds.
# There's no point in checking the AUR more than once an hour or your repo
# pkgs more often than you update your database.
# The voffset at the end seems to keep the list from getting cut off when it grows.
TEXT
${execpi 3600 paconky /path/to/repos.paconky}
${execpi 3600 paconky /path/to/aur.paconky}
${voffset 900}

DO NOT SET THIS LOWER THAN 3600 (ONE HOUR)!
The AUR doesn't move that quickly and if you have this script running more often than that, it will lead to the server getting hammered for nothing. Archlinux.org never did anything to you, so don't mistreat her (Arch, on the other hand, is my bitch and yours).

repos.paconky

#SET MSG_0 up to date
#SET MSG_1 1 new pkg
#SET MSG_N %N% new pkgs
#
${color1}repo status ${alignr}${color2}%MSG%${voffset 5}
${color3}%PKG_NAME% ${alignr}%PKG_VER%


aur.paconky

#SET AUR_MSG_0 up to date
#SET AUR_MSG_1 1 new pkg
#SET AUR_MSG_N %AUR_N% new pkgs
#
${voffset 10}${color1}AUR status ${alignr}${color2}%AUR_MSG%${voffset 5}
${color3}%AUR_PKG_NAME% ${alignr}%AUR_PKG_VER%

Last edited by Xyne (2012-02-26 04:46:44)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2009-03-22 10:06:04

cl10k
Member
From: Germany
Registered: 2008-12-24
Posts: 92

Re: Paconky: displays repo and AUR pkg info in conky

Nice, but with paconky my processorload (does this word exist in english?) goes up to 40%. Usually my load (without any extra programs started) is 4%... What could be the reason?

Offline

#3 2009-03-22 10:35:19

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

I don't know. I might be able to help if you post the paconky configuration file that you're using along with the output of the following commands:

pacman -Qu
pacman -Qm

Also tell me what update interval you're using in conky (both for the conky configuration file and for the exec command).

*EDIT*
I just found a bug in one of the functions. I'll post once I've fixed it.

*edit 2*
fixed... please download the latest version and let me know if you still have any issues (post the info above if you do)

Last edited by Xyne (2009-03-22 11:45:53)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2009-03-22 14:00:32

cl10k
Member
From: Germany
Registered: 2008-12-24
Posts: 92

Re: Paconky: displays repo and AUR pkg info in conky

Did you update the aur? I reinstalled the aur but still the same issue.
I'm using exactly the example files from your post above...

Load is still around 50% without any extra programs started, should be 4%


[christian@sonne ~]$ pacman -Qu
Suche nach aktualisierbaren Paketen...

Pakete (4): clisp-2.47-2 [7,07 MB]  dbus-glib-0.80-1 [0,12 MB]  
            fortune-mod-1.99.1-4 [1,79 MB]  openbox-3.4.7.2-2 [0,33 MB]
[christian@sonne ~]$ pacman -Qm
acroread 8.1.3-1
csup 20060318-5
dboxfe2 0.1.3-1
guipdftk 0.33-1
imaxima 1.0b2-1
linuxwacom 0.8.2-4
offsystem 0.19.34-1
paconky 1.4-1
pdftk 1.41-3
tkimg 1.3-2
ufoai-data 2.2-2
wmii-hg 2424-1
yaourt 0.9.2.4-1

Offline

#5 2009-03-22 14:53:24

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

I did, but I don't know when, so try again. There's a good chance that the issue was due to "ShowSize" in pacman.conf. I fixed that after someone brought it to my attention in the pbget thread (which uses the same bash function as paconky).

If you still have issues with the latest version (>=1.4-2), double-check conky update interval (update_interval). There's not much point in setting that lower than 15 minutes (I'm going to add that to my OP too).

*edit*
Nvm... I was assuming that you had multiple instances of conky and that "update_interval" would be set to something high. I've changed the first paconky execution to an execpi. Try adding that to your configuration with a long interval if you're still having issues.

Last edited by Xyne (2009-03-22 15:08:16)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#6 2009-03-22 15:40:23

cl10k
Member
From: Germany
Registered: 2008-12-24
Posts: 92

Re: Paconky: displays repo and AUR pkg info in conky

ah it works! cpu-load is down to 10% which is not perfect but ok! thank you for your work!

Offline

#7 2009-03-22 16:06:18

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

I still think that's strange. Just to be clear though, you do mean that it jumps up to 10% when it's run, right? It it's constantly at 10% then something is definitely wrong.

What CPU load do you get if you just run the commands on their own?

paconky /path/to/repos.paconky
paconky /path/to/aur.paconky

If you have a low update interval you may get better results if you remove the conky vars from the paconky configs and change "execpi" to "execi" to avoid the overhead of parsing the output.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#8 2009-03-22 17:26:54

cl10k
Member
From: Germany
Registered: 2008-12-24
Posts: 92

Re: Paconky: displays repo and AUR pkg info in conky

to make sure i didn't make any mistakes here is the whole thing:

.conkyrc

${execpi 7200 paconky /home/christian/repos.paconky}
${execpi 7200 paconky /home/christian/aur.paconky}
${voffset 900}

repos.paconky

#SET MSG_0 up to date
#SET MSG_1 1 new pkg
#SET MSG_N %N% new pkgs
#
${color1}repo status ${alignr}${color2}%MSG%${voffset 5}
${color3}%PKG_NAME% ${alignr}%PKG_VER%

aur.paconky

#SET AUR_MSG_0 up to date
#SET AUR_MSG_1 1 new pkg
#SET AUR_MSG_N %AUR_N% new pkgs
#
${voffset 10}${color1}AUR status ${alignr}${color2}%AUR_MSG%${voffset 5}
${color3}%AUR_PKG_NAME% ${alignr}%AUR_PKG_VER%

if i run the commands from the shell, cpu-load jumps to 20% and back to 4%

Offline

#9 2009-03-22 23:11:00

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

Try this:
.conkyrc

alignment top_left
gap_x 5
gap_y 5
maximum_width 150
minimum_size 150

own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes

update_interval 7200
total_run_times 0


default_color ff0000
color1 444444
color2 cccccc
color3 777777

text_buffer_size 1024

TEXT
${execp paconky /home/christian/repos.paconky}
${execp paconky /home/christian/aur.paconky}
${voffset 900}

Try plaing with "text_buffer_size" (e.g. set it to 512) if you still get bad performance.

-------------------------------------------------------------------

Otherwise try it without execp:
.conkyrc

alignment top_left
gap_x 5
gap_y 5
maximum_width 150
minimum_size 150

own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes

update_interval 7200
total_run_times 0


default_color ff0000
color1 444444
color2 cccccc
color3 777777

text_buffer_size 1024

TEXT
${exec paconky /home/christian/repos.paconky}
${execc paconky /home/christian/aur.paconky}
${voffset 900}

repos.paconky

#SET MSG_0 up to date
#SET MSG_1 1 new pkg
#SET MSG_N %N% new pkgs
#
repo status: %MSG%
%PKG%

aur.paconky

#SET AUR_MSG_0 up to date
#SET AUR_MSG_1 1 new pkg
#SET AUR_MSG_N %AUR_N% new pkgs
#
AUR status: %AUR_MSG%
%AUR_PKG%

-------------------------------------------------------------------

My way of thinking is this: if it jumps to 20% load from the command line then it can't be helped, but a few seconds once every two hours should be negligible and you should hardly notice conky running during the interval. It may be due to some bug in the script that I haven't noticed, but maybe bash scripting is just really inefficient, in which case maybe I could increase performance by rewriting it in something else... I'd like to get some feedback from others first though to get an idea of whether this is an isolated issue (it's not noticeable here).

Last edited by Xyne (2009-03-22 23:58:40)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#10 2009-03-27 00:13:12

cl10k
Member
From: Germany
Registered: 2008-12-24
Posts: 92

Re: Paconky: displays repo and AUR pkg info in conky

thank you very much for your afford so far. I'm very busy with university atm, therefore more testing has to wait. let's see what others have to say.

cl10k :-)

EDIT: I'm stupid, i think i found the error. I used your stuff inside my normal conky, which gets updated every second. with update_inval = 1, all others update_settings inside the conf files are ignored. i run a second instance of conky now, only with your scripts and it works great. cpu-load is back to 4%...

Thank you so much! Great little script!

Christian

Last edited by cl10k (2009-03-27 10:23:39)

Offline

#11 2009-05-03 00:11:22

smartboyathome
Member
From: $HOME
Registered: 2007-12-23
Posts: 334
Website

Re: Paconky: displays repo and AUR pkg info in conky

I have a feature request. Could you make it so that paconky shows the updates by repo? That way, I could know where the updates are coming from, which is handy for someone who runs testing. smile

Offline

#12 2009-05-03 04:49:57

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

I've added a "%PKG_REPO% tag to display the repo which contains the package (or more accurately the repo from which the package would be downloaded).
Example usage: "%PKG_REPO%/%PKG_NAME%".

I think the output is already ordered by repo as a consequence of how pacman checks for updates but I haven't really investigated it.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2009-05-03 17:11:15

smartboyathome
Member
From: $HOME
Registered: 2007-12-23
Posts: 334
Website

Re: Paconky: displays repo and AUR pkg info in conky

Thanks. smile

And as for the output, it isn't ordered by repo. There is testing mixed in with extra and core. I think they are ordered by which would be installed first.

Offline

#14 2009-06-16 10:26:30

kyotocafe
Member
From: Japan
Registered: 2009-01-28
Posts: 19

Re: Paconky: displays repo and AUR pkg info in conky

Great script. I am just having one issue when running it.
When I am running this script it displays the packages to be updated as it should, both in the repositories and in AUR, but the CPU goes to 100%, and I am getting the following message in the console:

Conky: can't select(): Invalid argument

Offline

#15 2009-06-16 17:31:04

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

@kyotocafe
Paconky is written in bash so it's not very cpu-efficient. I had hoped that it wouldn't matter too much though because it should only be run occasionally. There's an additional cpu hit when using execp in conky because it parses the output for formatting information.

I have no idea what's causing the "can't select()" error. Perhaps there's something wrong with your paconky output formatting. Post the config file that you're using and I'll test it and fix any mistakes that I find. You should also try to search for "conky: can't select()" to see if you can isolate the cause of the problem.

It may also be possible to optimize the configuration file that you're using to reduce the CPU load if you post it.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#16 2009-06-16 22:30:12

kyotocafe
Member
From: Japan
Registered: 2009-01-28
Posts: 19

Re: Paconky: displays repo and AUR pkg info in conky

Thanks a lot for the help.
I am posting my configuration files:

.conkyrc

alignment top_right
gap_x 5
use_xft yes
xftfont Terminus:size=10
xftalpha 0.8
out_to_console no
background no
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes

update_interval 7200
total_run_times 0

default_color White
color1 White
color2 White
color3 9f907d

text_buffer_size 1024

TEXT
${execpi 7200 paconky /home/bess/aur.paconky}
${execpi 7200 paconky /home/bess/repos.paconky}
${voffset 900}

aur.paconky

#SET AUR_MSG_0 up to date
#SET AUR_MSG_1 1 new pkg
#SET AUR_MSG_N %AUR_N% new pkgs
#
${voffset 10}${color1}AUR status ${alignr}${color2}%AUR_MSG%${voffset 5}
${color3}%AUR_PKG_NAME% ${alignr}%AUR_PKG_VER%

repos.paconky

#SET MSG_0 up to date
#SET MSG_1 1 new pkg
#SET MSG_N %N% new pkgs
#
${color1}repo status ${alignr}${color2}%MSG%${voffset 5}
${color3}%PKG_NAME% ${alignr}%PKG_VER%

Following your kind suggestion I tried searching on google, but I just found a couple of results with the same error message, and unfortunately they were not providing any solution just posting a bug with the same message.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474372

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473993

Offline

#17 2009-06-16 23:12:40

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

The only think that I would change is in your conkyrc file:

alignment top_right
gap_x 5
use_xft yes
xftfont Terminus:size=10
xftalpha 0.8
out_to_console no
background no
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes

update_interval 7200
total_run_times 0

default_color White
color1 White
color2 White
color3 9f907d

text_buffer_size 1024

TEXT
${execp paconky /home/bess/aur.paconky}
${execp paconky /home/bess/repos.paconky}
${voffset 900}

changes: "execpi 7200" -> "execp"
reason: the update interval is already set to 7200, so the scripts won't run more often than that anyway

I don't think that will have any noticeable effect on cpu usage though.

Can you post the output of the following commands and check the cpu usage as you run them?

paconky /home/bess/aur.paconky
paconky /home/bess/repos.paconky

Maybe there's a formatting error causing the problem. It might also be interesting to see if one of the commands is much more cpu-intensive than the other.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#18 2009-06-16 23:21:59

kyotocafe
Member
From: Japan
Registered: 2009-01-28
Posts: 19

Re: Paconky: displays repo and AUR pkg info in conky

I have made the change on the .conkyrc  file using execp instead:

${execp paconky /home/bess/aur.paconky}
${execp paconky /home/bess/repos.paconky}

These are the outputs I have for both fles:

aur.paconky

${voffset 10}${color1}AUR status ${alignr}${color2}up to date${voffset 5}

repos.paconky

${color1}repo status ${alignr}${color2}13 new pkgs${voffset 5}
${color3}xmms2 ${alignr}0.6DrMattDestruction-3
${color3}xulrunner ${alignr}1.9.0.11-1
${color3}mozilla-common ${alignr}1.4-1
${color3}nspr ${alignr}4.8-1
${color3}vte ${alignr}0.20.5-1
${color3}libv4l ${alignr}0.5.99-1
${color3}libwebkit ${alignr}1.1.9-1
${color3}lua ${alignr}5.1.4-3
${color3}firefox ${alignr}3.0.11-1
${color3}gconf ${alignr}2.26.2-2
${color3}libftdi ${alignr}0.15-3
${color3}ca-certificates-java ${alignr}20081028-2
${color3}e2fsprogs ${alignr}1.41.6-1

Offline

#19 2009-07-10 13:40:45

kyotocafe
Member
From: Japan
Registered: 2009-01-28
Posts: 19

Re: Paconky: displays repo and AUR pkg info in conky

It is quite weird actually. I found what is causing the error and the high CPU, it is the
update_interval 7200
line.
If I set a value up to 999, it is fine, it does not give any error, and the CPU goes back to normal after executing the script.
But if the update_interval value is 1000 or bigger, I get the error and the high CPU. Quite shocking *-*

Offline

#20 2009-08-08 11:47:15

Murphy10k
Member
Registered: 2009-08-08
Posts: 1

Re: Paconky: displays repo and AUR pkg info in conky

Does not work with the latest version of pacman.

Offline

#21 2009-11-08 17:29:13

Soupstuffs
Member
Registered: 2009-08-28
Posts: 42

Re: Paconky: displays repo and AUR pkg info in conky

Hey Xyne,

I love this script! It works perfectly... almost

I'm just having one problem with the aur notifier. For some reason, it always displays 1 new pkg, no matter what. The little indicator below it works perfectly, but the part that says 'up to date' or 'n new pkgs' always says '1 new pkg'.

I haven't changed anything, so I really don't know why it doesn't work.

Offline

#22 2009-11-08 17:57:44

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

Hi Soupstuffs,

So even if you have multiple upgradable AUR packages it will only display "1 new pkg"?
Does the AUR pkglist display correctly?

Do you have any AUR packages in pacman's ignore array? (That shouldn't matter but it might.)


Post your paconky and pacman configuration files too.

Last edited by Xyne (2009-11-09 20:34:25)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#23 2009-11-09 18:34:37

Soupstuffs
Member
Registered: 2009-08-28
Posts: 42

Re: Paconky: displays repo and AUR pkg info in conky

Hello Xyne,

Yes, it constantly says "1 new pkg".

The AUR pkglist does display correctly.

I do not have any AUR packages in Pacman's ignore array.

Here are my config files

#avoid flicker

double_buffer yes



#own window to run simultanious 2 or more conkys

own_window  yes

own_window_transparent yes

own_window_type desktop

own_window_hints undecorate,sticky,skip_taskbar,skip_pager 



#borders

draw_borders no

border_margin 1



#shades

draw_shades no



#position

gap_x 0

gap_y 0}

alignment top_right



#behaviour

update_interval 1



#colour

default_color  0968E6




#default_shade_color 000000

own_window_colour 000000



#font

use_xft yes

xftfont liberation sans:pixelsize=9



#to prevent window from moving

use_spacer yes

minimum_size 1280



TEXT

${font OpenLogos:size=12}A$color$font$color${voffset -4} $color$color1 SYSTEM $color$kernel ($machine) ${color slate grey}|$color1 UPTIME $color$uptime ${color slate grey}|$color1 TEMP $color${hwmon temp 1}C ${color slate grey}|$color1 CPU $color$cpu% ${color slate grey}|$color1 ${color1}HOG $color${top_mem name 1}${color slate grey}| ${color1}RAM $color${memperc}% | ${color1}HOG $color${top_mem name 1}$color1 | SWAP $color$swapperc% ${color slate grey}|$color1 ROOT $color${fs_used /}/$color${fs_size /} ${color slate grey}|$color1 HOME $color${fs_used /home}/$color${fs_size /home} ${color slate grey}|$color1 DOWN $color${downspeed eth0} ${color slate grey}|$color1 UP $color${upspeed eth0}${color slate grey}|$color1 GMAIL $color${execi 300 python ~/.config/conky/gmail.py} ${color slate grey}| ${execp paconky ~/.config/conky/repos.paconky} ${color slate grey}| ${execp paconky ~/.config/conky/aur.paconky}
#SET MSG_0 up to date
#SET MSG_1 1 new pkg
#SET MSG_N %N% new pkgs
#
${color1}PACMAN $color %MSG%
${color3}%PKG_NAME% ${alignr}%PKG_VER%
#SET AUR_MSG_0 up to date
#SET AUR_MSG_1 1 new pkg
#SET AUR_MSG_N %AUR_N% new pkgs
#
${color1}AUR $color %AUR_MSG%
${color3}%AUR_PKG_NAME% ${alignr}%AUR_PKG_VER%

It's only a single line, so I don't see the pkg list usually. I tested it out with the basic .conkyrc you provided, and found that the pkglist does work. The repos config works perfectly.

Thanks for the help!

-Soupstuffs

Offline

#24 2009-11-09 20:55:13

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Paconky: displays repo and AUR pkg info in conky

The only thing that I noticed is that your update interval is set to 1 second and you're using execp instead of execpi which means that your running both scripts every second. As mentioned several times above, you should not run the paconky AUR script more than once every 15 minutes and I would generally recommend that you use at least a 1 hour interval. The same is roughly true for the repos script as well. The output will only change after a database synchronization and you should generally not synchronize more than once per hour.

I'm also surprised that you didn't mention anything about cpu usage (paconky is written in bash and is quite inefficient... I'll rewrite it in perl or python eventually).

After removing the gmail line and adjusting the paths, paconky displayed the correct message here.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#25 2009-11-09 22:20:14

Soupstuffs
Member
Registered: 2009-08-28
Posts: 42

Re: Paconky: displays repo and AUR pkg info in conky

Ouch, I'm so sorry ArchLinux.org baby. I'll never mistreat you again!

I had a major brainfart and thought my update interval was set to 7200 because kyoto's was up there.

I really don't know what the problem is, then.

Oh well, I'll try writting a different script. I don't need the package list and I need to start practicing python anyway.

Thanks for trying to help,
Soupstuffs

Offline

Board footer

Powered by FluxBB