You are not logged in.

#76 2010-09-18 11:30:09

cga
Member
Registered: 2010-08-11
Posts: 25

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

Hi Xyne,

thanks a lot, this is exactly what i wanted!


EDIT: almost there.... but i'll try myself before.

now i get the right behaviour but one thing: when everything is up-to-date i don't want to have only

local packages:   up-to-date

but

[core]: up-to-date
[extra]: up-to-date
[comm]:up-to-date

etcetera.

what i mean is: the repos adn aur should always been shown, what changes it's their status. between up-to-date and $n pkgs.

cheers


EDIT 2:

commenting  the if condition on no pkgs did it!!

thanks a lot Xyne

Last edited by cga (2010-09-18 12:19:31)

Offline

#77 2010-09-25 11:27:18

cga
Member
Registered: 2010-08-11
Posts: 25

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

Hi Xyne,

just a quick request fro help:

with this code:

#!/usr/bin/perl
use strict;
use warnings;

use Xyne::Arch::Bauerbill;

my $n_threads = 1;

my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});
$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;

my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
  else
  {
    &display($reponame);
  }
}

if (@aurpkgs)
{
  &display('AUR',@aurpkgs);
}
                                                                                                                                                                                   
                                                                                                                                                                                   
sub display                                                                                                                                                                        
{
  my ($name,@pkgs) = @_;
  my $msg;
  if (@pkgs)
  {
    my $n = scalar(@pkgs);
    $msg = ($n > 1) ? "$n new pkgs" : '1 new pkg';
  }
  else
  {
    $msg = "up-to-date";
  }
  print '${color1}[${color1}'.$name.'${color1}]${alignr}${color1}'.$msg.'${voffset 0}${color1}'."\n";
}

I get the wanted output result but it always show up-to-date even if there are packages to upgrade (ie: I issue pacman -Syu and upgrade them). Do miss anything?

thanks

Offline

#78 2010-09-25 16:58:09

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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


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

Offline

#79 2010-09-25 18:06:30

cga
Member
Registered: 2010-08-11
Posts: 25

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

Xyne wrote:

Oh... I tought that the script used Bauerbill to do that.

Thanks a bunch.

Offline

#80 2010-09-25 18:42:04

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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

cga wrote:

Oh... I tought that the script used Bauerbill to do that.

Thanks a bunch.

It could, but then it would need to be run as root. The cronjob is a much safer and simpler solution.


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

Offline

#81 2010-09-27 00:04:23

jalu
Member
Registered: 2009-04-05
Posts: 140

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

How do I tell paconky to use a newline for output? The manual says that "Blank lines [in the configuration file] are included to facilitate conky formatting", but that doesn't seem to be the case. Maybe I'm misunderstanding something.

Configuration file:

Main: %MSG%
%PKG_REPO%/%PKG_NAME% %PKG_VER%

AUR: %AUR_MSG%
aur/%AUR_PKG_NAME% %AUR_PKG_VER%

Example expected output:

Main: 3 packages
extra/allegro 4.4.1.1-1
extra/bluez 4.71-1
community/libtorrent-rasterbar 0.15.2-1

AUR: 3 packages
aur/flvtool2 1.0.6-3
aur/hwinfo 18.1-5
aur/libx86emu 1.1-27

Example actual output:

Main: 3 packages
extra/allegro 4.4.1.1-1
extra/bluez 4.71-1
community/libtorrent-rasterbar 0.15.2-1
AUR: 3 packages
aur/flvtool2 1.0.6-3
aur/hwinfo 18.1-5
aur/libx86emu 1.1-27

Offline

#82 2010-09-27 17:12:42

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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

jalu wrote:

How do I tell paconky to use a newline for output? The manual says that "Blank lines [in the configuration file] are included to facilitate conky formatting", but that doesn't seem to be the case. Maybe I'm misunderstanding something.


You understood... Bash didn't. tongue

For whatever reason, the command that I was using to append the parsed lines to a variable ignored newlines (cat + heredocs). It should work now.


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

Offline

#83 2010-09-27 18:13:04

jalu
Member
Registered: 2009-04-05
Posts: 140

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

Thanks for the update. The spacing now works properly here. Awesome.

One problem I noticed. paconky now prints the following error messages when running.

/usr/bin/paconky: line 80: get_upgradable_repo_pkgs: command not found
/usr/bin/paconky: line 88: get_upgradable_aur_pkgs: command not found

I'm running bash version 4.1.7(2)-release.

Offline

#84 2010-09-27 20:16:25

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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

Sorry, I forgot to undo one of my debugging changes. Try paconky>=2010.09.27.2-1.


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

Offline

#85 2010-10-01 00:19:39

jalu
Member
Registered: 2009-04-05
Posts: 140

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

Works well. Thanks, Xyne.

Offline

#86 2010-10-05 01:38:53

Beelzebud
Member
From: Illinois, U.S.
Registered: 2010-07-16
Posts: 154

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

I really like this script, but I'm having one issue with it.    When the system comes up, and conky is started for the first time, it will run the script, but then the script doesn't seem to be running every hour.   It will not display updated info until I manually kill and restart conky.   Here are my configs, please tell me if there is anything obviously wrong.

I'm calling the script from .conkyrc with this line:

${voffset -20}${execpi 3600 paconky /home/beelzebud/.paconky}

My .paconky file looks like this:

#SET AUR_MSG_0 up to date
#SET AUR_MSG_1 1 new AUR pkg
#SET AUR_MSG_N %AUR_N% new AUR pkgs
#SET MSG_0 up to date
#SET MSG_1 1 new Arch pkg
#SET MSG_N %N% new Arch pkgs
#
${if_match "%MSG%" != "up to date"}${GOTO 1200}${color0}%MSG%${endif}
${if_match "%AUR_MSG%" != "up to date"}${GOTO 1200}${color0}%AUR_MSG%${endif}

As I said, if i manually restart conky, it seems to be working, it just doesn't seem to be executing the script every hour with the execpi command.

Offline

#87 2010-10-05 01:58:12

jalu
Member
Registered: 2009-04-05
Posts: 140

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

You'll need to use Conky's execpi command for that. The Conky manual has a nice write up on the command, and Xyne provides an example in his first post.

HTH

Offline

#88 2010-10-05 02:13:15

Beelzebud
Member
From: Illinois, U.S.
Registered: 2010-07-16
Posts: 154

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

execpi is what I'm using.    What I'm thinking is that it might be my if_match commands interfering with it.   perhaps I should try a way to hide the 'up to date' status with that command from the conkyrc file.

Offline

#89 2010-10-05 04:10:04

jalu
Member
Registered: 2009-04-05
Posts: 140

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

Ah, sorry. I didn't see your use of execpi there.

It might have something to do with the if_match clauses, but that's just a guess. I've been running paconky for a while now without the issue you're describing, but I also don't use the if logic that you do.

If you'd like, I could post my configuration file for you to test.

Offline

#90 2010-10-06 18:59:09

Beelzebud
Member
From: Illinois, U.S.
Registered: 2010-07-16
Posts: 154

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

Posting a follow up.   My problem was more due to my ignorance than anything.   I missed the part about setting up a cron job.   big_smile   I also found a much more elegant solution than using if_match commands.   Just leave the 'up to date' line blank.    smile

Offline

#91 2010-10-09 15:07:55

cga
Member
Registered: 2010-08-11
Posts: 25

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

Hi all,

@Xyne:

conky got updated and now your script integration is upsetting the formatting. (now conky takes 80% of the screen, repos side of the shown seem to be the culprit)

i don't know what it could be but let us know if you fix it.

thanks

EDIT:

here they go two screenies: before (working) and after (broken)

Last edited by cga (2010-10-09 15:25:52)

Offline

#92 2010-10-09 20:03:26

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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

@cga
What do you mean by "script integration"?
Which script are you using?
What is the output of the script on a command line?

Very nice desktop btw. What icon set is that?


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

Offline

#93 2010-10-09 20:26:20

murr
Member
From: UK
Registered: 2008-04-01
Posts: 10

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

I think this may be the same issue as described here.

Offline

#94 2010-10-09 20:28:44

cga
Member
Registered: 2010-08-11
Posts: 25

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

Xyne wrote:

@cga
What do you mean by "script integration"?

i mean that i put execpi path to script in my conkyrc , it worked until yesterday, then conky got updated and that is the result.

${font :style=Bold}Packages${font} ${hr 2}
${execpi 3600 .conkyscripts/paconky.pl}
Xyne wrote:

@cga
Which script are you using?

this

cga@gwenllian:~$ cat .conkyscripts/paconky.pl 
#!/usr/bin/perl
use strict;
use warnings;

use Xyne::Arch::Bauerbill;

my $n_threads = 1;

my $bb = Xyne::Arch::Bauerbill->new({autoload=>1});
$bb->{AUR}->{CALLBACK}->{QUIET} = 1;
$bb->{PowerpillConf}->set_value('Threads', $n_threads);
$bb->{AUR}->{THREADS} = $n_threads;

my @repopkgs = sort $bb->get_upgradable_pkgnames();
my @aurpkgs = sort $bb->{AUR}->get_upgradable();

my %versions;
$versions{$_} = ($bb->{AUR}->get_versions($_))[0] foreach @aurpkgs;
$versions{$_} = $bb->get_sync_db_pkg_ver($_) foreach @repopkgs;

my $groups = $bb->group_pkgnames_by_repo(@repopkgs);

foreach my $reponame ($bb->get_repo_list)
{
  if (ref($groups->{$reponame}) eq 'ARRAY')
  {
    &display($reponame, @{$groups->{$reponame}});
  }
  else
  {
    &display($reponame);
  }
}

if (@aurpkgs)
{
  &display('AUR',@aurpkgs);
}

                                                                                                                                                                                   
sub display                                                                                                                                                                        
{                                                                                                                                                                                  
  my ($name,@pkgs) = @_;
  my $msg;
  if (@pkgs)
  {
    my $n = scalar(@pkgs);
    $msg = ($n > 1) ? "$n new pkgs" : '1 new pkg';
  }
  else
  {
    $msg = "up-to-date";
  }
  print '${color1}[${color1}'.$name.'${color1}]${alignr}${color1}'.$msg.'${voffset 0}${color1}'."\n";
}
Xyne wrote:

@cga
What is the output of the script on a command line?

you mean by launching it manually?

this is conky & output:

cga@gwenllian:~$ conky &
[1] 23914
cga@gwenllian:~$ Conky: desktop window (401d81) is subwindow of root window (15d)
Conky: window type - override
Conky: drawing to created window (0x6600001)
Conky: drawing to double buffer

there's no output for script invocation by hand.

again, untile yesterday it was wroking fine, now it's just bad formatted.

Xyne wrote:

@cga
Very nice desktop btw. What icon set is that?

I'm using Bespin black theme for all things graphic in KDE4, wallpaper is from deviantART.
If you want my colors' scheme and theme adjustments + wallpaper just tell me, I'll upload them on my ftp for you. wink

Thanks for support, as always.

Offline

#95 2010-10-09 23:45:31

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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

murr wrote:

I think this may be the same issue as described here.

Thanks, murr.

@cga
There's nothing that I can do about it. I recommend that you downgrade conky until a bugfix is released.



cga wrote:
Xyne wrote:

@cga
What is the output of the script on a command line?

you mean by launching it manually?

there's no output for script invocation by hand.

again, untile yesterday it was wroking fine, now it's just bad formatted.

The script has to output something, otherwise nothing would show up in conky.  hmm
It doesn't matter though as this seems to be a conky issue.


cga wrote:
Xyne wrote:

@cga
Very nice desktop btw. What icon set is that?

I'm using Bespin black theme for all things graphic in KDE4, wallpaper is from deviantART.
If you want my colors' scheme and theme adjustments + wallpaper just tell me, I'll upload them on my ftp for you. wink

Thanks for the offer but I just needed to know the name of the icon set. smile


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

Offline

#96 2010-10-10 10:39:29

cga
Member
Registered: 2010-08-11
Posts: 25

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

Xyne wrote:
murr wrote:

I think this may be the same issue as described here.

Thanks, murr.

@cga
There's nothing that I can do about it. I recommend that you downgrade conky until a bugfix is released.

I'm following that thread now, and the issue on conky bugtracker.

Sorry to have thought it was your script's fault but I noticed that taking the execpi script.pl line out wasn't causing the problem.
But now we know that is somehow related to execpi itself.

Thanks for support.

Offline

#97 2010-10-10 21:44:53

forkboy
Member
From: Blackpool, England
Registered: 2005-09-03
Posts: 74

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

cga wrote:

Hi all,

@Xyne:

conky got updated and now your script integration is upsetting the formatting. (now conky takes 80% of the screen, repos side of the shown seem to be the culprit)

i don't know what it could be but let us know if you fix it.

thanks

EDIT:

here they go two screenies: before (working) and after (broken)

Sorry for the OT, but could I get your .conkyrc please?

Offline

#98 2010-10-11 17:16:49

cga
Member
Registered: 2010-08-11
Posts: 25

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

forkboy wrote:

Sorry for the OT, but could I get your .conkyrc please?

No problem, but you need to install the fonts from Conky Colors too:

cga@gwenllian:~$ cat .conkyrc
# Use Xft?
use_xft yes
xftfont Sans Serif:size=9
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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_transparent yes
own_window_type override
own_window_class conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background no

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 180 0
#maximum_width 200

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?                                                                                                                                                                 
stippled_borders 0                                                                                                                                                                  

# border margins
border_inner_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color black
default_shade_color black
default_outline_color black
own_window_colour black
color1 black

# 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 35
gap_y 35

# 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 yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
${font :style=Bold}System${font} ${hr 2}
${font OpenLogos:size=18}t${font}   Kernel:  ${alignr}${kernel}
${font StyleBats:size=16}A${font}   CPU1: ${cpu cpu1}% ${alignr}${cpubar cpu1 8,60}
${font StyleBats:size=16}A${font}   CPU2: ${cpu cpu2}% ${alignr}${cpubar cpu2 8,60}
${font StyleBats:size=16}g${font}   RAM  : $memperc% ${alignr}${membar 8,60}
${font StyleBats:size=16}j${font}   SWAP: $swapperc% ${alignr}${swapbar 8,60}
${font Webdings:size=16}~${font}  Battery: ${battery_percent BAT0}% ${alignr}${battery_bar 8,60 BAT0}
${font StyleBats:size=16}q${font}   Uptime: ${alignr}${uptime}

${font :style=Bold}Temps${font} ${hr 2}
${offset 7}${font Weather:size=16}y${font}   CPU1: ${hwmon 1 temp 1}°C ${alignr}CPU2: ${hwmon 2 temp 1}°C
${offset 7}${font Weather:size=16}y${font}   GPU: ${execi 60 nvidia-settings -t -q GPUCoreTemp}°C ${alignr}HDD: ${execi 30 hddtemp -n /dev/sda}°C
#${offset 7}${font Weather:size=16}y${font}   MoBo: ${temp 1}°C ${alignr}Case: ${temp 3}°C

${font :style=Bold}Fan${font} ${hr 2}
${font ConkyWeather:size=14}2${font}   FAN : ${hwmon 0 fan 1}rpm

${font :style=Bold}Processes${font} ${hr 2}
NAME $alignr PID    CPU
${top name 1} $alignr ${top pid 1} ${top cpu 1}
${top name 2} $alignr ${top pid 2} ${top cpu 2}
${top name 3} $alignr ${top pid 3} ${top cpu 3}
${top name 4} $alignr ${top pid 4} ${top cpu 4}
${top name 5} $alignr ${top pid 5} ${top cpu 5}
${top name 6} $alignr ${top pid 6} ${top cpu 6}

#${font :style=Bold}Packages${font} ${hr 2}
#${execpi 3600 .conkyscripts/paconky.pl}

${font :style=Bold}Disk Space${font} ${hr 2}
${voffset 4}${font Pie charts for maps:size=14}7${font}   ${voffset -5}Root:
${voffset 4}${fs_used /}/${fs_size /} ${alignr}${fs_bar 8,60 /}
${font Pie charts for maps:size=14}7${font}   ${voffset -5}Home:
${voffset 4}${fs_used /home}/${fs_size /home} ${alignr}${fs_bar 8,60 /home}
${font Pie charts for maps:size=14}7${font}   ${voffset -5}OSX:
${voffset 4}${fs_used /oschiss}/${fs_size /oschiss} ${alignr}${fs_bar 8,60 /oschiss}

# we get the background trick
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}

Offline

#99 2010-10-31 21:55:58

forkboy
Member
From: Blackpool, England
Registered: 2005-09-03
Posts: 74

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

Xyne, thanks for the recent of the script so we can use it with the latest conky.  I still have alignment issues, it's probably something easy I can alter, although I can't see what it is.  Screenshot here

Offline

#100 2010-10-31 22:05:36

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,628
Website

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

@forkboy
You need to use a monospace font for the alignment to work properly, assuming that you're using the second script on the project page.


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

Offline

Board footer

Powered by FluxBB