Jump to content

Idea: Magnetic (Files and) Folders


Darkelve
 Share

Recommended Posts

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

This is the reverse... it should copy from a ~/images directory to a mp3 player on sda1

 

adjust as necassary

[Desktop Action attract_to_mediadev]
Exec=krename  %F --copy "~/images/*" /mnt/sda1 --start --nopreview
Icon=kfilereplace
Name=Attract Images to Media Device

[Desktop Entry]
Actions=attract_to_mediadev
Dev=/dev/sda1
Encoding=UTF-8
Icon=hdd_mount
MountPoint=
Name=Example media device.desktop
Name[en_US]=Example media device.desktop
ReadOnly=false
ServiceTypes=image/*
Type=FSDevice
UnmountIcon=hdd_unmount

Link to comment
Share on other sites

Another way to implement would be for the special (filetype-specific) directory to appear under the "Move To" and "Copy To" context menu entries. That way you could choose whether to move or copy - it's not obvious which one "attract" is. One-click attract sounds cool, but the choice to move or copy would be cooler and the integration would make it more intuitive what is going on perhaps.

 

Also if you right-click on a directory it could have an item "Copy music files from..." or "Move images from..." and then you could navigate to where you wanted to attract from (ie not from the whole hard drive, just from /home/user/tunes" for example).

Link to comment
Share on other sites

Another way to implement would be for the special (filetype-specific) directory to appear under the "Move To" and "Copy To" context menu entries. That way you could choose whether to move or copy - it's not obvious which one "attract" is. One-click attract sounds cool, but the choice to move or copy would be cooler and the integration would make it more intuitive what is going on perhaps.

Did you try it?

You can have the submenu with move and copy (you just need it to be a part of the desktop entry using the X-KDE-Submenu=XXXXX ) ... I just showed a single menu entry with a crappy icon... doesn't make it easy to spot :D but I nice colorful magnet would be cool (anyone).

 

The problem with move/copy menu's is I think they are KDE specific .... what I hacked together so far is using the common desktop formats shared between Gnome and KDE. Obviously krename is KDE specific but that is just changing helper app :D and I gues the best would be to just write a small C program to do the moving/copying or even bash... I actually used some of the documentation from Gnome ..... on the desktop entries since google found it 1st.

 

Also if you right-click on a directory it could have an item "Copy music files from..." or "Move images from..." and then you could navigate to where you wanted to attract from (ie not from the whole hard drive, just from /home/user/tunes" for example).

This is effectively what I did in the second example.... but both of them fire up directory browsing in kreplace it just sets the default from to but the user can override it at this point. A device .desktop file isn't much different to a directory one btw.

 

You can also make a event on attachment of a device which automatically moves the contents of say ~/music to a device when its plugged in.

 

 

Have a go

This is just about 30 mins reading and then 5 mins actual programming....

I copied all the ideas from http://developer.kde.org/documentation/tut...rvicemenus.html

Its not hard and literally anyone could do it :D

Link to comment
Share on other sites

Nice idea... most of what you are trying is already possible in OS X though.

 

I do it on my Powerbook all the time with Smart Folders.

 

It's not exactly like what you're suggesting, because it doesn't actually place a physical copy of the files in the folder, a smart-folder just basically herds them all up. You can get a folder to show all of one filetype automatically, by date range, by size, etc. etc.

Link to comment
Share on other sites

SoulSe,

 

I checked out the MacOSX Panther preview and explanation pages... and WOW is MacOSX looking good... it's like they're one step ahead of the competition...

 

What I was referring to, was not that it would be like 'service menus', or even 'Smart Folders' like in OSX. What I meant was something more in the lines on "Smart Folders + Automator"...

 

Let me explain a bit further.

 

The main problem I was considering when thinking about this, was how people sort (or don't sort, or mis-sort) files and information. My 'magnetic' folder concept, generically, would be something like

 

1. Check filesystem for changes (creation, editing, deletion, ... of files)

2. Check to see if a certain rule applies to this

3. If there is a match, execute a certain action

 

Indeed you could do a thousand and one things with this, like you could in OSX with Spotlight+Automator... but there are a couple of things nearly anyone would benefit from, with IMhO the biggest one being the classifying of files.

 

For example my collegues are quite orderly people who classify everything. But often, you see that they mis-placed something, accidentally moved a folder to somewhere they don't remember, they use multiple versions of the same document stored in different folders... why not let a background process do that for them?

 

(heck, a company might even set their own rules for collecting such information company-wide. Just as an example, a central location of templates and powerpoint files...)

 

So In Linux this could translate to:

 

1. Beagle (or something else) indexes the filesystem;

2. As soon as there's a change to the filesystem (total FS or somewhere in it): check to see if a certain rule applies.

 

For example:

- File is of type: Video/Movie

- File name contains: Bleach

 

3. If there is a match, for example if I just downloaded Bleach episode 93, which Firefox automatically downloads to my desktop (changing the default download location isn't much use because I download other stuff with it too) then execute the action "Move file to folder":

 

"mv bleach93.avi ~/Multimedia/Movies/Bleach/"

( if keeping a copy to the location on the desktop is desired: "ln bleach93.avi ~/Multimedia/Movies/Bleach/bleach93.avi" )

 

The next time I download an episode of Bleach, when Beagle notices file system activity, it sees that the file matches one of the rules and automatically moves the file to the proper location.

 

Service menus might still be useful here, for example, have an option in the context menu for each file (in the home directory) that says "Classify this file". Have an option in each folder that says "Smart Collect Files". Both will take you to a dialog screen where you can enter the necessary information.

 

But what this is supposed to do, is easen information overload by helping you automatically classify files following pre-defined rules.

 

Another example: suppose I regularly receive e-mail from Gowator who sends me presentations often. I could add a rule saying:

 

		
(pseudo-code)

	- IF <sender name> contains "Gowator"
	- AND e-mail has attachment
	- AND attachment is of type "Presentation" (.odt, .ppt, ...)

	THEN cp 'attachment' (filename) ~/Documents/Presentations/Gowator/

 

After I set up this rule, every time Gowator sends me an e-mail with a presentation, it gets auto-classified in the correct folder. Cross-pollination with an address book is possible too (for example, if sender address matches people in my address book, copy/move to location 'X')

 

Things to consider are: conflicting rules. If they conflict, give the user a dialog box allowing him to fine-tune the rule(s).

 

Another possible problem is, suppose someone is working on a company presentation, and he wants it to be copied to a shared network drive ASAP, then Beagle should index it ASAP too in order to update it after each save option. I don't know if the service gets immediately notified, but if not a file should have a way to shout "hey! I'm important! Index me! ..." well, you get the idea :unsure:

 

And yes, very powerful things can be done with technologies like this... perhaps this isn't totally obvious, but if you're using OSX as a server, with Smart Folders and Automator, I think you may be able to apply certain conditions to a file and you have a mini-content management system!

 

For example:

- you uploaded a file called "products.php" (standard product page)

- you apply a rule "on date x/yy/zzzz, h:xx s:yy" replace "/var/www/html/products.php" with "~/christmas/products.php" (product page with special christmas conditions)

 

 

 

The power (maybe also weakness?) in doing this with something like Beagle, is that it's indexed and rules are applied to it after the fact, so you don't need specific settings for, let's say, Firefox, or a full-blown metadata FileSystem.

Edited by Darkelve
Link to comment
Share on other sites

Oh, another example...

 

For my job I manage our corporate website, and I get a lot of word and PDF-files e-mailed to me daily... what I do each month is create a folder structure something like "/current/month/province/sender/" and dump the attachments in there. For example:

 

/current/august/california/tom/pdf/ (if PDF file)

/current/august/california/tom/word/ (if word document)

 

If I could create a rule using the information present in the e-mail (or Lotus Notes database), then I could get this done for me automatically! I would never have to mess with these folder things again; as soon as the filesystem is updated (e.g. I opened the e-mail), it gets copied to the proper location. It might even be possible to create 'dynamic favorites/bookmarks' this way. For example, this month '/current/august/' is in my Favorites in Windoze Explorer. Next month it'll be /current/september ... indeed.

Edited by Darkelve
Link to comment
Share on other sites

First off.. did you try it and is it working?

 

SoulSe,

 

I checked out the MacOSX Panther preview and explanation pages... and WOW is MacOSX looking good... it's like they're one step ahead of the competition...

 

What I was referring to, was not that it would be like 'service menus', or even 'Smart Folders' like in OSX. What I meant was something more in the lines on "Smart Folders + Automator"...

 

Let me explain a bit further.

 

The main problem I was considering when thinking about this, was how people sort (or don't sort, or mis-sort) files and information. My 'magnetic' folder concept, generically, would be something like

 

1. Check filesystem for changes (creation, editing, deletion, ... of files)

2. Check to see if a certain rule applies to this

3. If there is a match, execute a certain action

 

Indeed you could do a thousand and one things with this, like you could in OSX with Spotlight+Automator... but there are a couple of things nearly anyone would benefit from, with IMhO the biggest one being the classifying of files.

 

For example my collegues are quite orderly people who classify everything. But often, you see that they mis-placed something, accidentally moved a folder to somewhere they don't remember, they use multiple versions of the same document stored in different folders... why not let a background process do that for them?

 

(heck, a company might even set their own rules for collecting such information company-wide. Just as an example, a central location of templates and powerpoint files...)

 

So In Linux this could translate to:

 

1. Beagle (or something else) indexes the filesystem;

2. As soon as there's a change to the filesystem (total FS or somewhere in it): check to see if a certain rule applies.

 

For example:

- File is of type: Video/Movie

- File name contains: Bleach

 

3. If there is a match, for example if I just downloaded Bleach episode 93, which Firefox automatically downloads to my desktop (changing the default download location isn't much use because I download other stuff with it too) then execute the action "Move file to folder":

 

"mv bleach93.avi ~/Multimedia/Movies/Bleach/"

( if keeping a copy to the location on the desktop is desired: "ln bleach93.avi ~/Multimedia/Movies/Bleach/bleach93.avi" )

 

The next time I download an episode of Bleach, when Beagle notices file system activity, it sees that the file matches one of the rules and automatically moves the file to the proper location.

 

Service menus might still be useful here, for example, have an option in the context menu for each file (in the home directory) that says "Classify this file". Have an option in each folder that says "Smart Collect Files". Both will take you to a dialog screen where you can enter the necessary information.

 

But what this is supposed to do, is easen information overload by helping you automatically classify files following pre-defined rules.

 

Another example: suppose I regularly receive e-mail from Gowator who sends me presentations often. I could add a rule saying:

 

		
(pseudo-code)

	- IF <sender name> contains "Gowator"
	- AND e-mail has attachment
	- AND attachment is of type "Presentation" (.odt, .ppt, ...)

	THEN cp 'attachment' (filename) ~/Documents/Presentations/Gowator/

 

After I set up this rule, every time Gowator sends me an e-mail with a presentation, it gets auto-classified in the correct folder. Cross-pollination with an address book is possible too (for example, if sender address matches people in my address book, copy/move to location 'X')

 

Things to consider are: conflicting rules. If they conflict, give the user a dialog box allowing him to fine-tune the rule(s).

 

Another possible problem is, suppose someone is working on a company presentation, and he wants it to be copied to a shared network drive ASAP, then Beagle should index it ASAP too in order to update it after each save option. I don't know if the service gets immediately notified, but if not a file should have a way to shout "hey! I'm important! Index me! ..." well, you get the idea :unsure:

 

And yes, very powerful things can be done with technologies like this... perhaps this isn't totally obvious, but if you're using OSX as a server, with Smart Folders and Automator, I think you may be able to apply certain conditions to a file and you have a mini-content management system!

 

For example:

- you uploaded a file called "products.php" (standard product page)

- you apply a rule "on date x/yy/zzzz, h:xx s:yy" replace "/var/www/html/products.php" with "~/christmas/products.php" (product page with special christmas conditions)

 

 

 

The power (maybe also weakness?) in doing this with something like Beagle, is that it's indexed and rules are applied to it after the fact, so you don't need specific settings for, let's say, Firefox, or a full-blown metadata FileSystem.

 

I think the weakness is that for instance you have a load of text files.

I have a couple like useful.txt which basically is my own collection of little hints and tips.... another called install.log which is just what I do after a kanotix install (I can copy paste the apt-get stuff and all)

 

But i also have hundreds (perhaps thousands) of .txt in README files in specific directories in say /usr/share or /usr/local etc. and these are referred to by dpkg ... i can always check em and find an installed .deb and then see the documentation in terms of the README .... sometimes its html etc. etc.

 

A lot of these are easily excluded by say ownership...

 

We have system sounds and icons, backgrounds etc. etc. etc. these can be part of a theme so they are not only a subdir of your user directory but also owned by you or system icons etc... imagine the mess all the system icons suddenly being moved!

 

To this end I see you have types (docs, audio, pictures etc.) and you have directories for them....

 

One way to do this is actually using the find function on konqueror and then move_to ... but it takes ages and it includes the themes and stuff etc. etc. but I actually do this and have for ages.

 

So i see a system where you would have to define a set of where each doc type should go if it is in an area NOT part of the exclusion.

 

Your idea is really cool....

It takes this quite a bit further.

I worry about the automatic stuff ... kat is pretty much a pain in the butt .... however you can do loads with simple desktop entries....

For instance a single directory or set of directories can have properties and these properties can include this.

 

example:

 

[Desktop Entry]
Encoding=UTF-8
Icon=unknown
Type=Link
URL=/mnt/backups/
[Desktop Entry]
ServiceTypes=image/*
Actions=attract_to_images_silent
[Desktop Action attract_to_images_silent]
Name=Attract to Image folder silent
Icon=kfilereplace
Exec=krename  %F --move "~/images" --start --nopreview

 

in this case I created a link in ~/Desktop and just edited it using vi....

 

you can do it yourself ...

 

I could write a small app that does this for you .... this app would be added to the context menu and another small app or config utility that lets you define a directory to put them in and exclusion or inclusion directories for that type..

 

Further to this you could also make a meta event from the entry so you could prompt it to do the search but respect the exclusion folders.

 

 

Any comments? anyone else tried this yet?

Link to comment
Share on other sites

1. What is "kat" ?

2. I haven't tried the others yet, still have to install Kreplace. But I'm going to try the simpler ones first before I try the last. Some practice certainly can't hurt, I think.

 

3.

We have system sounds and icons, backgrounds etc. etc. etc. these can be part of a theme so they are not only a subdir of your user directory but also owned by you or system icons etc... imagine the mess all the system icons suddenly being moved!

 

To this end I see you have types (docs, audio, pictures etc.) and you have directories for them....

 

No, I'm still assuming everything outside of /home/user/ should be excluded... unless you specifically *enable* inclusion of certain directories outside of this like, say, /var/www/html

Edited by Darkelve
Link to comment
Share on other sites

you would still need to have restrictions. the ability to exclude a directory. as gowator points out, themes, etc. use many common file types (xml, png, jpg, etc.) so if you were to apply a magnet to everything in your home you would end up breaking user-installed themes, for example.

 

you would want some default excludes, and the ability to add exclusions.

 

kat is like...beagle for KDE. it used to be here but seems to have disappeared.

Link to comment
Share on other sites

Hi sorry I still haven't gotten to try it... installing software on SuSe is pure hell at the moment... ZMD goes berserk on me and SMART is useful but I still need to learn my way around... I WILL try it, I took some to try it, but not today anymore... I'm sick of all the problems with updates & installations... enough for today.

Link to comment
Share on other sites

I'm currently at my job, and in the evening there's supper with my grandparents, but I just wanted to say that I *do* appreciate you taking the time and effort to write out these scripts, Gowator.

Not a prob....

I just wanted to check you are still interested and that it is providing the functionality before I do any UI programming.

 

They are really just more proof of concept than a real solution right now but they could be stuck on workbench of people are interested.

They are also real easy to make.... once you work oput the syntax then I can make an editor that makes the actual file and stick that editor into a context menu.

 

Like instead of make shortcut it could be "Create Attract folder"

Link to comment
Share on other sites

Not a prob....

I just wanted to check you are still interested and that it is providing the functionality before I do any UI programming.

 

I'm still interested. It just doesn't ever seem to work out! (getting to try it out, no the script itself). I'm starting to feel guilty about it.

Edited by Darkelve
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...