Anybody thinking about an apt-notify plasmoid?

Forum for discussion and implementation of features relating directly to development of MEPIS releases.
Message
Author
User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 11142
Age: 57
Joined: Fri Dec 15, 2006 8:07 pm

Anybody thinking about an apt-notify plasmoid?

#1 Postby Stevo » Sun Apr 04, 2010 11:27 pm

What was the old KDE 3 app polling to find out if there were updates?

A python plasmoid is quite easy to build, either manually or with Kdevelop (install kdevelop and kdesdk) see this link: http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/?ca=drs-

but I really don't know the code to insert into the plasmoid. You can look at something like the simple CPU temperature plasmoid at kde-look.org to see how he greps the cpu temp (a .plasmoid file is just a renamed tar.gz, easy to extract), and one that displays the number of updates would show it on the desktop or on the taskbar.

Edit: Latest test versions of the applet:
You do not have the required permissions to view the files attached to this post.
The optimist proclaims that we live in the best of all possible worlds, and the pessimist fears this is true.

James Branch Cabell

User avatar
The Garage
Forum Regular
Forum Regular
Posts: 335
Joined: Tue Jan 15, 2008 7:32 am

#2 Postby The Garage » Sun Apr 04, 2010 11:47 pm

I once had trouble with mepis apt-notify & had to add this to my /etc/sudoers file to make it work again. Maybe this points you in the right direction?

Code: Select all

%users   ALL=NOPASSWD: /usr/bin/apt-get -s upgrade
Image

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 8989
Age: 58
Joined: Wed Jul 12, 2006 2:26 pm

#3 Postby kmathern » Sun Apr 04, 2010 11:56 pm

Could you do something with apt-show-versions -u, it can run as either user or root.

If you have upgrades available you get something like:

Code: Select all

[kent@mepis1 ~]$ apt-show-versions -u
adduser/squeeze upgradeable from 3.110 to 3.112
apt/squeeze upgradeable from 0.7.20.2+lenny1 to 0.7.25.3
apt-show-versions/squeeze upgradeable from 0.15 to 0.16
.
.
.
{I temporarily enabled squeeze so there would be upgrades available to show you}

You could grep on the word "upgradeable".

With some fancy scripting (beyond my ability) you might even be able to keep a count of how many occurances of "upgradeable" were grep'd.

How would the apt-get update as a regular user get performed? Could fakeroot do that?

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 11142
Age: 57
Joined: Fri Dec 15, 2006 8:07 pm

#4 Postby Stevo » Mon Apr 05, 2010 12:05 am

There's an apt updating script in /etc/cron.daily that already is doing that, and it could be moved into the cron.hourly folder. I think that was what the old notifier was using.
The optimist proclaims that we live in the best of all possible worlds, and the pessimist fears this is true.

James Branch Cabell

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 8989
Age: 58
Joined: Wed Jul 12, 2006 2:26 pm

#5 Postby kmathern » Mon Apr 05, 2010 12:11 am

The old mepis-aptnotify package installed a /etc/apt/apt.conf.d/15periodic-update file that contained:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";

User avatar
tzefanyah
Forum Novice
Forum  Novice
Posts: 73
Joined: Tue Dec 09, 2008 7:35 pm

Porting suggestion....

#6 Postby tzefanyah » Mon Apr 05, 2010 8:06 am

Hello,

What about porting what PCLinuxOS uses? Eventhough it is rpm based they use synaptic package manager like we do. I am going to check to see if I could download an rpm and covert to alien and see what I can do from there. I will keep everyone posted.

Update: Looked in the their repo and did not see any obvious file. I believe the have one though and I think any accompanying scripts could be modified from rpm to deb based. I think I will leave this to those who have more experience, but let us know if I could be on to something.

regards,
tzefanyah
Only Linux since 1997. Athlon XP3000 3gb RAM 256mb Nvidia FX6200 MAudio 1010LT snd card ;)

User avatar
Adrian
Forum Veteran
Forum Veteran
Posts: 6177
Age: 41
Joined: Wed Jul 12, 2006 1:42 am

#7 Postby Adrian » Mon Apr 05, 2010 10:17 am

The Garage wrote:I once had trouble with mepis apt-notify & had to add this to my /etc/sudoers file to make it work again. Maybe this points you in the right direction?

Code: Select all

%users   ALL=NOPASSWD: /usr/bin/apt-get -s upgrade


Yes, that's it, MEPIS 8 and some older version had that in sudoers. I can't try apt-get -s upgrade right now because I don't have anything to update on my system but I bet you could use some simple grep/cut commands to get how many upgrades are available.

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 11142
Age: 57
Joined: Fri Dec 15, 2006 8:07 pm

#8 Postby Stevo » Mon Apr 05, 2010 11:01 am

Yes, that's it. Pehaps we can add some of those older apt-notify files to a apt-notify python plasmoid to get it working like the old one: the sudoers modification, the /etc/apt/apt.conf.d/15periodic-update,and the plasmoid. It would require the plasma-python engine, but that's 180 K uncompressed.
The optimist proclaims that we live in the best of all possible worlds, and the pessimist fears this is true.

James Branch Cabell

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 8989
Age: 58
Joined: Wed Jul 12, 2006 2:26 pm

#9 Postby kmathern » Mon Apr 05, 2010 11:19 am

Do you need to do anything else after having used visudo to add

Code: Select all

%users    ALL=NOPASSWD: /usr/bin/apt-get -s upgrade
to /etc/sudoers?

Do you need to logout, restart X, run some other command, etc.

I still get the following error message:

Code: Select all

[kent@mepis1 ~]$ /usr/bin/apt-get -s upgrade
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

User avatar
richb
Administrator
Posts: 13018
Joined: Wed Jul 12, 2006 2:17 pm

#10 Postby richb » Mon Apr 05, 2010 11:23 am

You are more knowledgeable than me about this. But shouldn't you be

root@mepis1

[kent@mepis1 ~]$ /usr/bin/apt-get -s upgrade
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Forum Rules
Guide - How to Ask for Help

Rich

Laptop: Acer V5-572G: Intel i5, 12 GIG mem, Intel graphics, SanDisk SSD, 256GB
Virtualbox: Win 7
Desktop: MX-15- 64, AMD A8 7600 FM2+ CPU R7 Graphics, fglrx driver, 16 GIG Mem. Samsung EVO SSD 250 GB


Return to “Dev Team”

Who is online

Users browsing this forum: No registered users and 1 guest