Ekstatische Lyriken Pinnwand

My Own Version of Konqueror's "File Size View" Plugin

written by Pj on Thursday February 13th, 2014 -- 10:39 a.m.
in reply to Backup Software

edit this message - return to message index
(only moderators may edit messages)
I was thinking about the backup software I want (see parent post) yesterday, and again today.  Then it occurred to me that I hadn't tested a certain theory: Sugar gives people energy.

I kind of didn't want to test it either, having avoided sugar for more than two weeks and thus not craving it so much anymore, but of all the damn things I've tested multiple times, like water consumption, sodium/potassium consumption, and countless other shit, it seemed like the least-tested theory, even if it was a theory I'd just made up.

So I bought a two-liter of soda, some Twizzlers, some Reese's Cups, and some Andes mints, and proceeded to snack while watching a rerun of one of those awful Family Guy Star Wars episodes.

After a while, I did feel like I had more energy.  Not so much that I wanted to do anything, but my brain seemed to be burning more energy on shit like visual clarity.  Anyway, I then took a nap for an hour or two, and when I woke up, I decided to try some coding.

I first wrote a Perl script to scan my filesystem for files that may or may not need to be backed up.  Afterwards, I had it display the sum of all of the file sizes, which was about 80 GB.  Knowing I had no interest in backing up so much data, I figured I'd have to use Konqueror's "File Size View" plugin to find some shit to delete.  It's quite useful because it draws files and folders at a size that is in proportion to the disk space they consume.  In this way it's easy to see what's using up all your disk space, and the tiny things that consume almost nothing can't even be seen and so they're easily ignored.

However, there wasn't a whole lot I wanted to delete.  There was shit I could delete, like a huge "trash" folder full of what's basically garbage, but some of which I might decide to use in the near future.  It's shit that if it were deleted, I wouldn't care, but if it doesn't have to be deleted, I'd rather keep it.  The same is true for other folders, like collections of ISO files which could be easily downloaded from the internet again.  I'd like to keep the ISOs and just not back them up. 

So I decided I needed my own file size viewer.  One which would allow me to click on things and remove them from my view, and another way to click which would also add the files to a list which could either be my list of files to back up or a list of files to delete.  In this way, as I made decisions on things, they'd disappear and the smaller files would come into view, and I could continue until I didn't care anymore and just back up whatever's left over whether it's worth backing up or not.

Of course, this would be a large programming task, one for which on most days I'd say "fuck it" and go watch some television.  Not today, though!

Just in case anyone wants to try to run it:

Download: viewer.tar.bz2

Give it a directory on the command line and it'll index it, ignoring any other filesystems mounted within.  Be prepared for this to take a small eternity.  It'll also suck up lots of memory as it stores a full copy of the pathname of every file in memory.  When running it consumes 50% of my CPU constantly redrawing the screen 100 times a second even when it isn't doing anything, as I haven't yet made it smart enough to know when the screen doesn't need redrawn.


left-click - delete folder from view, and write pathname to stdout
right-click - delete folder from view
middle-click - maximize folder in view
scroll wheel - zoom in/out of folders

Note: It's a read-only tool.  It won't delete files.

If you have to recompile, you may need to uncomment the two commented lines in the 'compile' script in order to rebuild the two object files.  The included executable is compiled for whatever version of 64-bit Linux Mint I have.

I wonder if this means I should eat more sugar...


return to previous message - return to message index

Your Reply

Name: No registration necessary. Simply choose
a name and password and type them in.
You may want to read the rules before you spend a lot of time writing something.
Plain Text - What you type is what you will see.
Some HTML - Use this if you are including HTML tags.
Pure HTML - Copies your post directly into the web page.
first, then