Path Monitor 0.9

UUID: path-monitor@kamikaze
Score: 4

Download



Path-Monitor

Current version: 0.9
 
About this applet:
I developed this applet initially because I wanted a quick and easy replacement to the old GNOME2 'Sticky Notes' applet. The design decisions changed a little while implementing and I ended up with this applet. 
 
This applet monitors a user entered directory for any changes and displays that directory's contents. The contents are then selectable, and it will open whatever you click with the default launcher associated with Cinnamon.
 
Icon used is from a standard theme: folder-saved-search-symbolic.svg
 
Note that in later releases of Cinnamon, the icon has changed to a magnifying glass (no longer within a folder).
 
Thanks to these applet authors:
The following applets served as an example for me to learn from - I may have used some code from them aswell.
* weather@mockturtl
* bluetooth@cinnamon.org
* trash@cinnamon.org
* xrandr@cinnamon.org
 
Tested with Cinnamon 1.6 and 1.7 on ArchLinux, and with Mint-Cinnamon 14.1 LiveDVD (64 bit).
 
Note: This package now exists in the Arch User Repository. If you run ArchLinux it's recommended you get the applet from there instead.
 
How to install:
  1. Download the applet zip file.
  2. Move or copy the applet zip to the following directory: $HOME/.local/share/cinnamon/applets/
  3. Unzip into that directory.
  4. Go to 'Preferences' -> 'Cinnamon Settings' -> 'Applets'
  5. Scroll down to find 'Path Monitor' and select it.
  6. Left click the new applet icon and type in a path to monitor
New Features:
 
Path Monitor now has a right click context menu. From here you can configure settings and spawn extra instances of the applet. Path Monitor also supports filtering of file types. It will let you filter out the following types of files:
* Hidden files
* Directories
* Symlinks
* Temporary document files (files ending with "~")
* Your own custom exclusion pattern
 
About basic path/file filtering:
 
The file/path filtering will match any part of any entry in your file list with whatever text you enter. For example, if I have an entry named "atextfile.txt" and I enter in the exclusion pattern "ext", then it would match and exclude that entry from displaying. Using a single comma "," separates patterns so you can enter multiple pattern exclusions.
 
If you're familiar with regular expressions, then you should know that the pattern matching is basically done with the RegExp function in javascript.

About multiple instances of the applet:

Please note that support for multi-instances in path-monitor is experimental. It has the potential to break in a later release of cinnamon.
 
Cinnamon v1.7 and above have added the native ability to start multiple applets using the applet manager. Unfortunately I'm not yet sure how this works with storing settings for multiple instances. Due to this, I've let the applet itself handle multi-instances.
 
In one of the screenshots above you should see that you have the 'Monitor an extra path..." feature in the context menu. Clicking this will add an extra instance of 'path-monitor' and allow you to configure it's settings. It should also be able to save any settings you change and automatically start the extra instances next time you open Cinnamon. Note that you can only start extra instances from the "master" applet, that is, the very first one to appear in your cinnamon tray. Extra instances only allow you to 'Exit' instead of spawning additional copies, so you will notice that the context menu has that difference between your 'master' copy and any extra copies..
 
 
 
Changes in v0.9:
* Right click context menu for easy configuration.
* All applets can save their settings.
* Code clean-ups.
 
Changes in v0.5:
* Manual support for multiple instances of the applet.
* Manual support for changing file filtering settings.
* Hidden files are no longer displayed by default.
 
Changes in v0.4:
* Fix GSettingsSchema loading when outside of user's $HOME.
* Code clean-ups
 
Changes in v0.3:
* Now remembers the path you enter.
* Changed UUID to be consistent in applet.js and metadata.json.
* Hard coded to only show 25 entries, list shouldn't go past end of screen unless you have a small vertical resolution set on your display.

About The Author

Kamikaze


14 Comments

  1. ChrisOfBristol says:

    1 year ago

    Perfect!

  2. Kamikaze says:

    1 year ago

    I've updated the applet to a newer version (0.9). It now has a right click context menu to allow easy configuration. You should find it much easier to configure now.

  3. ChrisOfBristol says:

    1 year ago

    Correction - the multi-instance support works fine, filtering isn't finished yet.

  4. ChrisOfBristol says:

    1 year ago

    "I've also enabled multi-instance support and basic file filtering." Both things work perfectly. "Hopefully this makes the applet a bit more useful for you." I'm sure it's not just me it will be useful for - it's an excellent app!

  5. Kamikaze says:

    1 year ago

    I've just done a release. I tested it on a clean Mint-Cinnamon 14.1 LiveDVD and wasn't able to reproduce needing to hold down the mouse button when entering the directory the first time. I've also enabled multi-instance support and basic file filtering. Both of these options require manual configuration right now (displayed in the applet description), but I'll look at making them configurable settings at some stage. BTW I re-wrote the original multi-instance support that I did over the weekend that I described as "nasty" ! Hopefully this makes the applet a bit more useful for you.

  6. ChrisOfBristol says:

    1 year ago

    "my implementation was ... nasty" - well that's honest! I'll wait and see what you decide. "I'll sort out the file filtering" That would be useful.

  7. Kamikaze says:

    1 year ago

    So I started writing something which ended up as a bit of a mess to try and hack in multi-instance applets into Cinnamon. I've decided to hold off on releasing this as my implementation was ... nasty, and I then noticed this patch recently merged into Cinnamon to support multi-instances properly: https://github.com/linuxmint/Cinnamon/pull/1439 - Haven't decided what I'll do now as I'm not sure how long this will take to be released and if it will make it into the different cinnamon distros reasonably fast. In the meantime though I'll sort out the file filtering functionality and at least get that out there.

  8. Kamikaze says:

    1 year ago

    Didn't quite have time to finish my changes, I'll look at this again on the weekend.

  9. ChrisOfBristol says:

    1 year ago

    K said: "OK what I might do is look at modifying the code base to make it easier to support multiple instances, and for handling file filtering a bit easier." C says: That was what I was hoping for of course, but I thought it was too much to ask! K Said: "At this stage..." C says: That makes sense. K said: "...looking through the code..." C says: Well I can write programs in other languages so it was worth a quick look. I thought I'd worked out the difference between Java and Javascript but obviously not!...........The idea of being able to get at your commonly used files fast is great, as even "favourites" or "recently used files" take more clicks and selections and I am constantly adding very minor things to my most-used files. I have a couple of related ideas which I'll suggest if you are interested but they are possibly off-topic here so email chrisofbristol gmail com if you are interested.

  10. Kamikaze says:

    1 year ago

    OK what I might do is look at modifying the code base to make it easier to support multiple instances, and for handling file filtering a bit easier. At this stage I'll probably just put some basics into the code but not make a method for entering it easily for the user, and then expand on it later. Then I can do a release and give you simpler instructions to do what you want. I'm at work at the moment, but I'll see what I can do tonight. Cheers for your feedback Chris! BTW I think it's great that you're looking through the code. Good attitude to try and scratch your own itch :) Just a note though - the applet is written in javascript, not java. Ignore the similarities in the name - they're really quite different. I'd like it to be in java - I'm actually more proficient in that language :)

  11. ChrisOfBristol says:

    1 year ago

    I am using Linux Mint-14/Cinnamon. I only need to hold down the mouse button until I have entered one character. I'm not sure what sort of settings you mean...... You are right, the directory is lost - I hadn't got round to correcting my post. I wondered about a constant I saw called watchedpath but don't know what I'm doing so I left well alone! Multiple instances would be very useful, so please do post the instructions you mention......In an attempt to get rid of the hidden files I've been trying to see how the filelist is selected and found this fragment (child_info = files.next_file(null, null)) != null) and changed the last null to '*.~' but it didn't like it! I assume there is a simple way to do this. I hope you will excuse my reluctance to learn Java.

  12. Kamikaze says:

    1 year ago

    Chris - I'm surprised you mentioned that you needed to hold down your left mouse button to enter the directory. What distro and version are you running? Have you changed any particular settings that mean you need to hold the mouse button when looking at context menus etc? Making a copy of the applet should work fine until you restart cinnamon. On restart the second copy (path-monitor2) might not load the entered path. If this happens you probably need to modify the gschema to handle another "watchedpath" and recompile it, and then point the path-monitor2 at this other 'watchedpath' key. If you really want to get multiple instances to work I can post some more detailed instructions.

  13. ChrisOfBristol says:

    1 year ago

    So good I want two! One for each of the two directories I use most. I copied the applet's directory to another called "path-monitor2@kamikaze" and changed any occurrence of "path-monitor" in the names or contents of the files to "path-monitor2". Works fine, but I know nothing about Java - so it's at you own risk!

  14. ChrisOfBristol says:

    1 year ago

    I am going to try this as it could be useful. It's a bit difficult to enter the directory name as you have to hold down the left button at the same time. Once you've entered it, you can change it by editing the line at the top of the popup menu. It would be nice to be able to deselect hidden files.