From kde-devel Wed Apr 06 15:52:04 2005 From: Manuel Amador Date: Wed, 06 Apr 2005 15:52:04 +0000 To: kde-devel Subject: Re: Modifying the right-click Actions menu for files Message-Id: <1112802724.1087.9.camel () master ! amauta> X-MARC-Message: https://marc.info/?l=kde-devel&m=111280238500196 You might want to take a look at python-inotify. It comes with a cmdline app called, aptly, inotify, which will watch a folder for events. It's more than appropriate, and you can use the code and reuse the module to run PyKDE code against the changed files. El lun, 07-03-2005 a las 20:43 +0100, Kristian Sørensen escribió: > On Monday 07 March 2005 18:56, Aaron J. Seigo wrote: > > On Monday 07 March 2005 10:24, Kristian Sørensen wrote: > > > I am looking to implement the Apple-feature of having "active folders". > > > Active folders allows you to attach a script to a folder, such than when > > > you drop a file in it, the script is run on this file. > > > > cool > > > > > Thus I need to add an "Action" to enable the folder to be > > > "active" (monitored), > > > > how will you be monitoring these folders? via another process with > > KDirWatches? > I was thinking about taking a pragmatic approach, simply making a small daemon > doing simple monitoring (detecting new files) - But I'll certainly have a > look at KDirWatch one of these days. Thanks for the tip! :-) > > > > and then a menu item to customize which script to be > > > run on new files in the folder. > > > > we already support putting an action in the .directory file in a directory > > to create directory-specific features in the Action menu. perhaps you could > > use that? > Sounds like it! But how does it work? I've crated the dir $HOME/Desktop/Action > and made the directory $HOME/Desktop/Action/.directory - and in > the .directory I've placed the small script, Touch: > > #!/bin/bash > touch /tmp/TEST_FILE > > But nothing shows up in the Actions menu when right-clicking the directory... > Can I have done anything wrong? (The script IS executable ;) > > > as for a menu item to set which script... it would be very nice to have > > such a GUI for servicemenus in general. something i've wanted to get around > > to doing for some time now... =/ so that when you right click on > > file/folder you get an entry in the Actions menu (or section, if there is > > no menu) to "Define an action" which then pops up a little dialog which > > lets you set some basic things and creates the .desktop or .directory file > > for you. > What is the difference between .directory and .desktop? It could be cool to > implement - but I am not much of a GUI programmer - normally I do kernel > stuff, so this is just for fun. But it would be cool though :) > > KS. > > -- > Kristian Sørensen > E-mail: ipqw@users.sf.net, Phone: +45 29723816 > > -- Manuel Amador Amauta >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<