tail

Plasma 4 Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

3
Score 82.4%
Description:

Simple plasmoid similar to command-line "tail -f" command - tracking changes in files and notifying about new lines.

Main goal was to track /var/log/emerge.log on Gentoo linux, but it functions just as well for any other file.

this version is almost complete: basic functionality is already there - it tracks the changes and displays notifications.

tracking several files means creating several instances of this plasmoid.

There are other plasmoids that would track the output of shell command - this one was build for sheer simlicity and convenience.
Last changelog:

8 years ago

1.0
- fixed some minor bugs
- tested on KDE-4.6.2 (Fedora-based)

1.0b4
- cleaned-up configuration screen
- added notification pooling to work around "KNotify spamming".

1.0b3
- added configuration option for KNotify message length

1.0b2
- forced data reload on startup. Now the state should be preserved fine between sessions.

1.0b1
- added configuration options and config preservation

1.0a3
- fixed spamming via KNotify. Now it tries to truly follow file and not dump contents of last 4K of file

1.0a2
- added exception handling for cases of missing /var/log/emerge.log (sorry to non-getnoo folks ;) )

rhsoftware

8 years ago

hi

really a nice tool but it needs some improvements

after "> file" to reset it will no longer refresh in the current session and should be cleared too

some years ago i solved this by using "tail -n 10" to get the latest 10 lines and call this in a fixed interval

if file does not exist at session start (remote mount points - would also be solved by using "tail -n lines" in a fixed interval with supressing errors

Report

unknownSpirit

8 years ago

"after "> file" to reset it will no longer refresh in the current session and should be cleared too"
Depends on what you write to the file.
On my system (ubuntu with old kde) it works.
If you remove the file the plasmoid will stop. However, it won't continue if your observed data is restored. That's a bit annoying.

Report

rhsoftware

8 years ago

"> file" writes nothing to it, it makes the file empty and the plasmaoid will show the old content forever

i think "tail -f" is not really relieable and should be replaced with "tail -n", this would not be a problem if the mount-point is even temorary not available

Report

xaccrocheur

8 years ago

I'm afraid your new version is no longer backwards-compatible with KDE 4.4.* the combo gadget for selecting the file is gone :(
That's too bad, because it's reaaly good.

Suggestions :

search for a word and color it
in config window :
string to search for <field> change color to <color menu> (simple, basic 8 colors)

Merge several logs together
in config window :

Log 1 <field + openfile button>
Log 2 <field + openfile button>
Log 3 <field + openfile button>
Separate : <radio button yes/no>
Separator character : <restricted text field>|<basic "-, _, # menu>

Thank you very much for your time/work

Report

C

dmakovey

8 years ago

I'll take a look, but I have no access to 4.4 anyplace (I do have older version kicking around so I can post it too if needed).

Report

Wonko

8 years ago

Nice, although similar to the filewatcher plasmoid. Two things I want to suggest:

1) Configurable font. I would like to make the font somewhat smaller.

2) An option to act like tail --follow=name. Tail -f normally follows the inode, so when the file is being renamed (e.g. by logrotate), the new file will not be monitored.

Report

C

dmakovey

8 years ago

I'll take a look - font is relatively easy, inode tracking may be a bit tricky as I'd have to change how I'm tracking things. But looks doable.

Report

nowhereman158

8 years ago

How do you use this thing? It's sitting on my desktop saying "No file specified" and there's nothing in the settings that allows to specify which file to watch.

Debian squeeze / KDE 4.4.5

Report

C

dmakovey

8 years ago

right-click and go to "Tail settings"

Report

Epimetheus11

8 years ago

Seems broken (with Kde 4.6.2), there is no field to enter a file name?

Anyway, from the source code it's clear that the applet requires a TailFileName field in ~/.kde/share/config/plasma-desktop-appletsrc

So if others run into this they only have to configure the number of entries they want, then search the config file for TailSize and add the TailFileName entry there.

Report

C

dmakovey

8 years ago

Just uploaded 1.0 that works on my KDE-4.6.2 setup (Fedora-14 with KDE-testing repo). Let me know if it helps.

Report

sblinux

9 years ago

Got the following error trying to run it on KDE 4.4 RC2

plasmoidviewer tail.plasmoid
plasmoidviewer(19838)/plasma main: setting FormFactor to "planar"
plasmoidviewer(19838)/plasma main: setting Location to "floating"
plasmoidviewer(19838)/plasma main: setting containment to "null"
plasmoidviewer(19838)/plasma main: setting auth policy
plasmoidviewer(19838)/plasma main: just load applet
plasmoidviewer(19838)/plasma FullView::addApplet: adding applet "tail.plasmoid" in "null"
plasmoidviewer(19838)/libplasma Plasma::CoronaPrivate::addContainment: loading of containment "null" failed.
plasmoidviewer(19838)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-sbrown/ksycoca4"
plasmoidviewer(19838)/libplasma Plasma::AppletPrivate::init: Check your constructor! You probably want to be passing in a Service::Ptr or a QVariantList with a valid storageid as arg[0].
plasmoidviewer(19838)/libplasma Plasma::Applet::load: offers is empty for "tail.plasmoid"
plasmoidviewer(19838)/libplasma Plasma::ContainmentPrivate::addApplet: Applet "tail.plasmoid" could not be loaded.
plasmoidviewer(19838)/libplasma Plasma::AppletPrivate::init: Check your constructor! You probably want to be passing in a Service::Ptr or a QVariantList with a valid storageid as arg[0].
plasmoidviewer(19838)/libplasma Plasma::FrameSvg::resizeFrame: Invalid size QSizeF(0, 0)

Report

C

dmakovey

9 years ago

Looks like RC2 is borked to begin with:

http://forum.kde.org/viewtopic.php?f=67&t=85368

Report

C

dmakovey

9 years ago

hmm. looks suspiciously like problem in KDE bindings for python. I've got no KDE 4.4 box yet to confirm. Once 4.4 goes live I'll upgrade and check it out. Thanks for early warning!

Report

mreloads

9 years ago

[first@MyComp ~]$ plasmoidviewer tail
Traceback (most recent call last):
File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 53, in init
self.pyapplet = self.module.main.CreateApplet(None)
File "/home/first/.kde/share/apps/plasma/plasmoids/tail/contents/code/main.py", line 171, in CreateApplet
return Tail(parent)
File "/home/first/.kde/share/apps/plasma/plasmoids/tail/contents/code/main.py", line 64, in __init__
self.follow=Follow('/var/log/emerge.log',size=10,lookback=14096)
File "/home/first/.kde/share/apps/plasma/plasmoids/tail/contents/code/main.py", line 16, in __init__
self.file=open(self.filename,'r')
IOError: [Errno 2] No such file or directory: '/var/log/emerge.log'
[first@MyComp ~]$ touch /var/log/emerge.log
touch: cannot touch `/var/log/emerge.log': Permission denied
[first@MyComp ~]$ su -c "touch /var/log/emerge.log"
[first@MyComp ~]$ su -c "chown -R first /var/log/emerge.log"
[first@MyComp ~]$ plasmoidviewer tail
[first@MyComp ~]$

In short, this plasmoid requires a file /var/log/emerge.log to be present in order to run at all. Creation of that file requires root privileges.

Also plasmoid name is a bit misleading because it can only display text files.

Report

C

dmakovey

9 years ago

re:misleading name

although you could use command line "tail" to trail binary files I haven't come across such usage. most tail uses are around text files - thus the name for the applet :)

Report

mreloads

9 years ago

Well, you're probably right about that, but it would be nice for plasmoid to display some command's output. Of course, that can be also achieved by defining cron job which then outputs command to text file, but such approach wouldn't be that convenient.

Report

C

dmakovey

9 years ago

what you may be looking for is:

http://kde-look.org/content/show.php/STDIN+Plasmoid?content=92309

but for my purposes I wanted just the "tail" part to keep it simle and tidy :)

Report

C

dmakovey

9 years ago

just realized it last night myself :) I'll upload a2 revision shortly.

Report

8 years ago

1.0
- fixed some minor bugs
- tested on KDE-4.6.2 (Fedora-based)

1.0b4
- cleaned-up configuration screen
- added notification pooling to work around "KNotify spamming".

1.0b3
- added configuration option for KNotify message length

1.0b2
- forced data reload on startup. Now the state should be preserved fine between sessions.

1.0b1
- added configuration options and config preservation

1.0a3
- fixed spamming via KNotify. Now it tries to truly follow file and not dump contents of last 4K of file

1.0a2
- added exception handling for cases of missing /var/log/emerge.log (sorry to non-getnoo folks ;) )

12345678910
17
product-maker tamra Aug 25 2011 9 excellent
product-maker unknownSpirit Jul 15 2011 9 excellent
product-maker dimitarpopov Jul 10 2011 9 excellent
product-maker Djellel Jul 06 2011 9 excellent
product-maker xaccrocheur Jun 28 2011 9 excellent
product-maker pavelgejdos Jun 26 2011 9 excellent
product-maker deep-z Jun 02 2011 9 excellent
product-maker watho May 31 2011 9 excellent
product-maker czarny777 May 19 2011 9 excellent
product-maker Gilde May 18 2011 9 excellent
product-maker Zorael May 08 2011 9 excellent
product-maker nicotine Apr 27 2011 9 excellent
product-maker H00K Apr 26 2011 9 excellent
product-maker vitoubien Apr 26 2011 9 excellent
product-maker Pyruzan Apr 26 2011 9 excellent
product-maker basaburu Apr 04 2011 9 excellent
product-maker LukSch Mar 01 2011 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
Details
license
version
1.0
updated Apr 28 2011
added Jan 05 2010
downloads 24h
0
page views 24h 3