plasma-emergelog plasmoid
Usually I use yakuake whenever I need to do terminal job. But having to press the shortcut key again and again in order to hide and unhide yakuake is not that handy , especially when somebody wants to monitor the emerge progress :). So , two days ago, I decided to write a simple kde4 plasmoid to monitor emerge progress for me :) . The plasmoid monitors /var/log/emerge.log file, so make sure that you have at least ‘read’ access before you use it.
There is no tarball for this yet, but you can install it using two different ways
1) Cloning git repo
git clone git://github.com/hwoarang/plasma-emergelog.git
cd plasma-emergelog
cmake -DCMAKE_INSTALL_PREFIX=/usr
make
make install ( as root )
2) Using the ebuild from kde-testing overlay
I did push an ebuild for this plasmoid on kde-testing overlay. Feel free to try it :)
Credits: Filewatcher plasmoid helped me a lot to create this plasmoid :)
You can browse the git repository here
Update 02-05-2009
Version 0.0.1 released on kde-look.org

Comments
36 Responses to “plasma-emergelog plasmoid”
Leave a Reply











Great, this is gonna come in handy, gonna try it out right now :)
How exactly does this differ from standard file watcher set to /var/log/emerge.log ?
Filewatcher wont work ( well ) with emerge.log file cause this file is so HUGE . Mine is 30000 lines. So filewatcher will consume huge amounts of memory to read it and monitor it. Furthermore , a normal ‘cat /var/log/emerge.log’ produces something like this:
1237573366: ::: completed emerge (1 of 1) dev-util/qt-creator-1.0.0 to /
1237573366: *** Finished. Cleaning up…
1237573367: *** exiting successfully.
1237573368: *** terminating.
1237579454: Started emerge on: Mar 20, 2009 22:04:14
I am applying several regexps in order to clear all the dirty data and keep only the valid information :)
But as I said , most of its code is based on filewatcher ,so I guess that filewatcher will work too but it will consume much more memory :).
And another thing. Filewatcher will read emerge.log from the beginning. This means it will display the very old emerges :). I am reading that file backwards :P
But again, use whatever works for you :)
Ouch. How come you call tail? Isn’t it faster to seek to the bottom of the text file yourself and not spawn a new process?
Mmmm, well , to read the most recent emerges you need to read that file from the very end. I couldnt find (yet) a way to do that. So I prefer ( for now ) to have a small I/O for updating the tmp file rather than loading the whole emerge.log on memory. If you have another way to deal with this, I am ready to hear it ( and apply it if possible ) :)
why you don’t use “tail -F /var log/emerge.log”?
btw: if i chmod 666 my log, it returns 660 after some time… how can i do?
thanks
tail -F wont work afaik. The Qt classes I am using, need to read the file and not monitoring the tailing output :)
About the permissions, portage adjusting permissions afaik. I would suggest to add your user in ‘portage’ group :)
Thanks to Espen Hustad, this plasmoid now provides support for paludis and pkgcore package managers :)
I also applied some more regexps in order to display a more discent output :)
Great one,
unluckly my plasma crashes over and over after the installation of this plugin :\
DOH (kde4.2 – platform x86)
Of course it does :)
As I said , you need to have “at least read access” on /var/log/emerge.log file in order to be able to use the plasmoid
If you run
plasmoidviewer plasma_applet_emergelog , you will see that it crashes due to permissions failures on that file :)
Adding your user on portage group would be the best solution
I ll try to write a workaround to prevent it from crashing when the permissions are wrong :)
[quote] QString cmd = “tail -250 “+logFile+” > “+log;
int i=system(cmd.toAscii().constData());
if(i){
perror(“Error:”);
KMessageBox::error(pmConfig,i18n(“Permission denied: Cannot open %1. Did you add your self to portage group?”).arg(logFile));
exit(1);
}[/quote]
exit(1); lol
why not something less destructive for plasma?
> Of course it does :)
all plasmoids shows “configure me”, “nothing to show” or just empty container. only clever emergelog plasmoid silently (well, now with msg) crashes whole plasma and makes user anger everytime…is you mozilla developer?
What?
I never claimed it is a stable version. I havent released anything stable yet. I am gathering feedback in order to make it more stable. Latest development code doesnt crash plasma or plasmoid ( at least I cant make plasma crash at all ).
The code you have quoted doesnt crash plasma. It pops up a messagebox and warns you that you need to be in portage group to use it. After that, the plasmoid kills it self but without killing the plasma
It doesnt work for ya? Providing feedback would be more appreciated that accusing me for being a Mozilla developer :D
And yes, you were right that plasma still crashes :)
I fixed it, so you should receive and empty widget now if you dont have permissions to open that file ( and yes , plasma wont crash, maybe :) )
probed, approved. I see an empty widget (maybe showing a message on this empty area will be more user-friendly?).
but emergelog still crashes plasma on accepting settings dialog (I keep my active user out of `portage’ group for testing emergelog from time to time)
Your feedback is much appreciated :). plasmoid now displays a message when you have permissions issue instead of being empty. Finaly, it should not crash anymore on accepting settings dialog
Thank you so much for your feedback :)
Думаю многие будут солидарны с вашим мнением, это очень важно сейчас учитывая непростое влияния мирового кризиса на нашу страну
Более грамотного изложения давно не видел но вы не везде полностью правы, за 10 минут такие темы полностью не почухать
I had a hard time finding out why plasma-workspace would crash on startup, leaving me with a black screen until i deleted the .kde4.2 folder :P
anyway, did that 3 times until i found out i could simply reproduce it by putting the plasmoid on the desktop and relog (it works perfectly until the next time i log in, then i can’t get past the kde splashscreen). Im on gentoo ~amd64(multilib) with kde4.2.3 and the plasma-emergelog from kde-testing overlay).
I haven’t found anyone else with this bug, am i the only one experiencing this odd behavior? (or have i simply done/not done something i should/shouldn’t do?)
Thats really weird. Since it works fine at first, there is no sane reason to fail while you login again :/
I ll try to reproduce it somehow …
well, i haven’t dared testing anymore, don’t wanna have to setup my desktop again, i’ll do without it for now (even though i’d love to have it)
Anyway, it’s a rly nice and useful plasmoid, keep up the good work ^^
You can run it from a terminal using
plasmoidviewer plasma_applet_emergelog
This will popup some debuggin messages and help me understand why it fails just for you :/
I dont get the “don’t wanna have to setup my desktop again”. If for any reason you lose your settings after a plasma crash, it is not related to any plasmoid weird behavior. We used to have some weird behavior like this in the past ( transition from -kdeprefix -> + kdeprefix and vise versa )
I don’t loose my settings when it crashes, but i was unable to find out just what settings/files in the .kde4 folder to remove to be able to log in again, so simply reseting kde (removing the .kde4 folder) was the temporary solution to that problem, since i have just started using kde 4 recently as of the 4.2 version (and don’t know exactly wich config files handling what).
bluex@station ~ $ plasmoidviewer plasma_applet_emergelog
plasmoidviewer(9989) KServiceFactory::findServiceByDesktopPath: “findServiceByDesktopPath: not found”
/var/log/paludis.org doesnt exist. Falling back to emerge.log
The plasmoid works fine as long as i don’t relog (or simply use it with plasmoidviewer).
Ok, first of all make sure that you use the -9999 ebuild :)
If you need to delete the settings from a specific applet all you need to to do is to open ~/.kde4/share/config/plasma-appletrc file
For plasma-emergelog you need to delete the following lines
[AppletGlobals][plasma_applet_emergelog]
logfile=/var/log/emerge.log
That will delete your plasma-emergelog settings :)
Noticed i had the 0.0.1 ebuild, so i uninstalled and installed the 9999 instead. However, i still get the same crash when i try to log in again. I still have no idea what’s causing it, but i might try to look into it later when i have the time.
Hey, atleast now i know wich file that sets up the plasmoid(s) on startup, thanks :)
hello,
emergelog also crashes my desktop here.
After 2 days i found out that emergelog was the culprit, so i deleted the lines from plasma-desktop-appletrc.
This seems to happen only when i am creating a huge emergelog(my screen is 1440×900, so maybe the height from the emergelog plasmoid is like 800).
sorry, i forgott to mention.
That the plasma-desktop crashes upon relogin, so during the current session, the plasmoid seems to work fine.
so i subscribed on this post to receive crap like this last comment? ;)
The Plasma crash is fixed on git repository. Use -9999 ebuild . I will try to release a new version asap :)
i am not that experienced yet with gentoo. So I don’t know what -9999 means, but i am looking forward to your fix ;) thank you for fixing it.
you can just use this ebuild http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=blob_plain;f=kde-misc/plasma-emergelog/plasma-emergelog-9999.ebuild;hb=HEAD
:)
hehe unfortunately i don’t know how to “use” this ebuild :(
there is a -9999 version in portage but i don’t know how to unmask it.
echo “kde-misc/plasma-emergelog **” >> /etc/portage/package.keywords
echo “kde-misc/plasma-emergelog” >> /etc/portage/package.unmask
emerge plasma-emergelog
More info: http://linuxreviews.org/gentoo/masked_packages/
thank you.
Unfortunately after using the -9999 version for about one day and rebooting my pc plasma-desktop still keeps on crashing.
Percocet….
Percocet online. No precription percocet. Percocet. Percocet addiction….