Making a better freememapplet_tray

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Making a better freememapplet_tray

#1 Post by MochiMoppel »

I see that gyro is currently digging into the sourcecode of freememapplet_tray, the little tray icon showing the total/remaining size of personal storage when the user places the mouse cursor over it.

This reminds me that I changed the behaviour of this little thing some time ago because it drove me nuts. The 2 main problems:
1) When leftclicking the icon it pops up "partview", a tiny application that has little if any relation to free personal storage. Basically it shows only free hard disk space. Some may find this useful, I don't.

One of the most frequent questions in the forum is "What is eating my pupsave space?". The icon alerts to low personal storage, but a leftclick gives no answer.

2) What really annoyed me was that "partview" scans even unmounted partitions. I run Puppy from a USB stick. My harddisk is old, noisy and contains 2 Windows partitions. I don't need it and spin it down when I start Puppy. But when I accidentally clicked the freemem icon, my HD would slowly come back to life with a rattling noise. Then partview pops up and happily tells me that I have 84GB left on my Windows partition...grhhh...I know that! And I don't care!

Fortunately this is easy to fix:
1) Go to /usr/sbin/partview and rename partview to something else - or delete it (it remains part of the main sfs and can still be run from /initrd/pup_ro2/usr/sbin/partview)

2) Create a new script /usr/sbin/partview. Leftclicking the freemem icon will call this script. What's in the script depends on the user's needs. One of the most simple, but still useful scripts I can think of:

Code: Select all

#!/bin/sh
gdmap -f  /initrd/pup_rw
This will call gdmap (see screenshot) with a graphical representation of /initrd/pup_rw.
My own creation "Disk & RAM usage" is an old fashioned console window and less colorful, but that's the way I like it and I'm happy with it.
Gdmap is not my favorite, but it's included in many Puppies. TreeSize is too terse for me. As a good compromise between these 2 extremes I still like and use xdiskusage, but this thing seems to be abandonware. Better ideas always welcome!
Attachments
partview_replacement.png
Top: Partview - the original
Middle: Gdmap
Bottom: Mochimoppel's partview
(79.31 KiB) Downloaded 463 times
Last edited by MochiMoppel on Fri 18 Sep 2015, 05:43, edited 1 time in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#2 Post by rcrsn51 »

Check out Partview v2015.

Jasper

#3 Post by Jasper »

Hi MochiMoppel, rcrsn51 et al

Graphical Disk Map is, to me, an unfathomed maze and I'm a fan of LargeFilesFinder from SFR:
http://murga-linux.com/puppy/viewtopic. ... 73&t=77779

As I don't need the freemem tray icon I run:

Code: Select all

kill `pidof freememapplet_tray`
from a file in /root/Startup
I could run Partview from Menu > Filesystem > Partview in Precise 5.6

My regards

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#4 Post by rcrsn51 »

Better ideas always welcome!
@MochiMoppel: No reply? This variant of Partview has been around since 2012 and should do exactly what you want.

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#5 Post by gyro »

Hi,

In freememapplet_tray.c, "partview" is run by the following line of code:

Code: Select all

system("partview &");
So it would be very easy to change it to run something else, and recompile.

But I think that rcrsn51's improved "partview" could be the way to go.

gyro
Last edited by gyro on Thu 17 Sep 2015, 12:14, edited 1 time in total.

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#6 Post by gyro »

Jasper wrote:As I don't need the freemem tray icon I run:

Code: Select all

kill `pidof freememapplet_tray`
from a file in /root/Startup
Or you could stop freememapplet_tray from starting by deleting it (or any reference to it) from /root/Startup.
Or use System->Boot Manager->Startup Apps->Manage startup apps, if it exists on your puppy.

Edit: Sorry just noticed "Precise 5.6", I don't think it has "Startup Apps" gui.

gyro

Post Reply