Plasma 5: Keeping an Eye on the Disk Quota

At this year’s KDE conference Akademy, I was working on a small plasmoid to continuously track the disk quota.

The disk quota is usually used in enterprise installations where network shares are mounted locally. Typically, sysadmins want to avoid that users copy lots of data into their folders, and therefor set quotas (the quota limit has nothing to do with the physical size of a partition). Typically, once a user gets over the hard limit of the quota, the account is blocked and the user cannot login anymore. This happens from time to time, since the users are not really aware of the current quota limit and the already used disk space.

Disk Quota as Plasmoid

Here is where the “Disk Quota” plasmoid helps: Once added to the panel, it shows all quota limits when clicking on the plasmoid:

Disk QuotaOn mouse over, a nice tool tip shows the used quota in percent (in case multiple quota limits exist, the highest quota is displayed):

Disk Quota ToolTipWhen a quota is > 50% but smaller than 75%, the quota icon gets orange:

Disk Quota > 50% And if the quota is between 75% and 90%, the quota icon gets red: diskquota-mediumFinally, a quota > 90% will urge the user to cleanup data by showing a exclamation mark as well:

High Disk QuotaClicking on a quota entry will launch Filelight in the correct folder, if it is installed.

Disk Quota in System Tray

If the quota plasmoid is shown in the system tray (configure the systray and add it there), then the quota information is shown inline in the system tray popup:

Disk Quota in System TrayAs soon as the quota is equal to or greater than 50%, the quota icon automatically gets visible in the system tray panel:

Disk Quota - AttentionFinally, if the quota is >= 98%, the quota icon pulses to get the user’s attention (a nice Plasma 5 feature!).

To decrease the quota again, simply click on the respective quota entry in the list view. This launches Filelight with the correct location.

Code Internals

As of now, the Disk Quota plasmoid internally calls the command line tool ‘quota‘ to retrieve the quota information. The output of this tool is parsed and then interpreted to show the quota information as can be seen in the screen shots. If the quota command line tool is not installed, then the Disk Quota plasmoid shows diagnostics like this:

Disk Quota missingInfos for Packagers

Since Disk Quota uses the command line tool ‘quota’ and launches ‘filelight’ when clicking on quota entries, you should ship ‘quota’ and ‘filelight’ when installing this applet. Most certainly, this plasmoid is only useful for networked systems (with remote mount points) and enterprise installations.

Release Info

Status: The plasmoid is Review Request: Disk Quota for inclusion in Plasma 5

Credit where Credit is Due

During implementation lots of questions popped up. Thankfully, we were all at the KDE conference Akademy, and Kai, Sebas, Marco, Martin and the Visual Design group (for design help and icons) were there for quick help – Thanks a lot! Hope you all like the result :-)

Akademy 2015 & Kate

Today, I will travel back home from Akademy 2015.

I must say, it was really a nice KDE meeting and I had a lot of fun ;=)
The first day the KDE e.V. general assembly did take place, then two days of actually interesting talks (including the great announcement of Plasma Mobile). After some more days with interesting BoFs and hacking, Akademy is now ending for me.

I didn’t do that much work on Kate, I mostly did small bugfixes for the applications bundled with the KDE Applications releases regarding their HiDPI support, finally no Konsole that can’t redraw correctly on scrolling on a HiDPI screen with scaling activated!

For Kate, the most stuff I did was porting one more plugin (the text filter plugin), fixing some small bugs and rearranging the search bars for in document and in files search. I hope it now is a bit nicer to use, still that is not the final state and I guess we will ask the VDG for more input later on. (btw., if you see any HiDPI glitches in Kate/KTextEditor master, please inform me, I really want to have non-pixelated output ;=)

A big thanks to all organizers & helpers of Akademy 2015! You did a great job, it was a lot of fun, the location was nice, the social event + day trip was good, all fine :) One of the nicer Akademy experiences! Lets hope that the flight home works out, as Dominik is taking the same plane, otherwise the Kate workforce will be seriously diminished.

Licensing of KDE Code

Akademy, the yearly KDE conference is alive and kicking. During the last days we were discussing again about potential KDE licensing issues (for instance code that is licensed under GPLv2, but not GPLv3). That’s why KDE is maintaining a relicense checker script, that every KDE contributor should enter herself/himself. I’ve blogged about it already in January 2015, but it cannot hurt to repeat it from time to time: From the KDE relicensing page:

A couple of KDE dependent projects or even libraries have moved or are going to move to GPLv3.

Unfortunately, GPL v3 is incompatible with GPL v2. This means that it is not possible to create a project linking GPL v2 and v3 code together. There is no problem for projects which are licensed GPLv2+ (version 2 or above).

A few parts of KDE are currently licensed as GPLv2 only. So far we have no reason to believe that this was something other than an oversight. However, we still need to validate with the individual copyright holders that a relicense to GPLv2+ or GPLv2+v3 is okay with them.

Therefore, in an effort we’re trying to identify the contributors that have contributed under the terms of GPLv2 and where the “+” part was not explicitly mentioned. If we know that all contributors agreed to a relicense, we can go ahead and flip the license of the individual source file.

Short story: If you have not done so yet, please add yourself to the kde relicensecheck.pl file!

If you cannot add yourself right now, please consider sending a mail to kde-devel@kde.org publically stating that you’re ok with relicensing all your contributions hosted on the KDE services under either  GPLv23, LGPLv23, GPLv2+, LGPLv2+. Additionally, you can give the membership of the KDE e.V. the credentials to relicense your contributions in future (this makes a lot of sense if you cannot contribute to KDE anymore and are no longer around). Many of the KDE contributors did this already. Thanks! :-)

PS: The official way to give KDE the rights to change licenses would be by signing the KDE e.V.’s FLA. Please note, that the KDE e.V. will not abuse this by immediately changing licenses you chose. Instead, this mostly about emergency cases (think of someone who suddenly passes away). But the script mentioned above is already a good start, since we can use it to quickly scan our code and identify problematic parts.

Update: With signing the FLA, you give the KDE e.V. several rights:

  • update KDE SC license
  • can protect KDE projects/code
  • can proect you (e.g. in copyright lawsuits)
  • make sure your code will live on even if you can’t contribute anymore

It is important to note, thought, that signing the FLA also includes that the KDE e.V. gives you back all your rights, so for you and your contributions, nothing changes. There is a BOF session about all this on Monday, so make sure you attend if you’re interested!

KDE Applications Versioning

A common problem for many applications contained in the KDE Applications releases are non-incremented version numbers. Often the maintainer forgets to update the version number of the application, like I did it for Kate since the first KF5 based release.

This means: On Bugzilla, I get bugreports that always tell me “Kate 5.0.0″, not very helpful.

KDE Frameworks solves this by automatic setting of the current framework release version in all framework CMakeLists.txt.

For KDE Applications, we have now optional the same concept. For details: visit https://community.kde.org/Applications/Versioning

In short: If you are to lazy to update your version number yourself or are just fine with using the same version number als the KDE Applications releases, you can add the following three lines to your toplevel CMakeLists.txt:

# KDE Application Version, managed by release script
set (KDE_APPLICATIONS_VERSION_MAJOR "15")
set (KDE_APPLICATIONS_VERSION_MINOR "04")
set (KDE_APPLICATIONS_VERSION_MICRO "0")

These variables will then be patched by the release scripts to the “right” version for the current release series.
You can than either just use the MICRO version to suffix your own applications version to differentiate the bugfix releases or like Kate construct your complete version number from the three vars and be done ;=)

I hope this helps to have more consistent and more important meaningful version numbers once again in the applications we bundle. Thanks to all people that made this “magic” happen ;=)