/ Published in: Perl
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/perl # Script to extract Update information from # YUM output for conky # # Written by Keiran "Affix" Smith <[email protected]> # http://affix.me # # Instructions # 1. download the perl script and save it to /bin/updateconky # 2. chmod a+x /bin/updateconky # 3. Add ${execpi 3600 /bin/updateconky} to you're .conkyrc file # 4. Enjoy it :D # my $font_color = "white"; # Conky Font Color my $output = `yum list updates 2>&1`; # Get output of yum list updates if($output =~ /^(.*)(Updated Packages.*)$/s) # Regex to parse out Updates from junk { $data = $2; # Store the data in a variable foreach $update(@updates) # For Each @updates make a variable $update { } } { }