Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 13:14
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Suggestions
[Request]Automagically mount USB drives + add rox bookmarks
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Mon 17 Aug 2009, 01:50    Post_subject:  [Request]Automagically mount USB drives + add rox bookmarks
Sub_title: Workflow/usability issue
 

I run a netbooted puppy linux cybercafe based on puppy 4.2.1. Its clientel are non-linux initiates (seafarers and sailors to be precise), who use the cybercafe to keep in contact with their families back home. Mostly they use digital cameras/pendrives to store pictures, which they upload and download to/from social networks, and send around as email attachments.

Under linux, they find it very difficult to find their files, and it requires a trained member of staff to supervise them when they are doing this. This is not only time consuming for the staff there, but raises privacy concerns.

What I would work to allay these issues is this...

1. Pendrives, when inserted, should preferably automount (or at least show a dialogue saying "USB storage has been inserted, do you wish to mount and view its contents?).

2. When mounted, I wish to set firefox's default upload, and download, location to the pendrive (mostly /mnt/sda1). This way, clicking on the browse button, or "right-click/save as" will by default download to/upload from the pendrive.

3. Its common policy to "unmount" or "eject" the pendrive before removing it physically. However, with the level of technical knowledge of the clientel, I cannot assume they will always do this. Will I need to automatically "sync" any unperformed writes to the pendrive, so as if this does occur there will be less chance of data corruption.

4. It would be nice, when uploading pictures, for a preview thumbnail of the pictures to appear in the file selection windows when "browse..." is clicked on the webpage. Currently puppies gtk/rox dialogues do not have this feature.

Thanks in advance for any pointers/advice on how this may be achieved.

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send_private_message Visit_website MSNM 
4-stroke

Joined: 07 Aug 2009
Posts: 114
Location: Sweden

PostPosted: Mon 17 Aug 2009, 04:02    Post_subject:  

1. This works on Puppy 4.3 beta 1. Menu -> System -> Puppy event manager -> icon handler, tick box for auto-launch 'handler' when plugged in.

restart x.

When i insert my usb-stick p-mount opens and if i click mount, rox opens with the contents of the usb-stick.

The rest is beyond my knowledge...
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8367

PostPosted: Mon 17 Aug 2009, 07:47    Post_subject:  

1.Try what the man said first...I made an auto detecting pmount that refreshed when drives are plugged in and out...would not be a major trauma to have it mount as well.
2..my experience is that firefox remembers where the file browser last was so after once downloaded to sda1 it will go there again...If you are dealing with only one stick at a time then should work ok for you.
3. Trick and no real solution that comes to mind for any OS. I also noticede that when a transfer is finished the drive is still not unmountable for a while....someone mention cache size and kernels somewhere ...perhaps this could be changed so that once a transfer is done it is really done so unlugging mounted is relatively harmless. Otherwise some obvious warning message before disaster rather than after as windows does...a blinking message whilst mounted...something subtle but eye catching. I think manually mounting does give a better awareness that unmounting is required. Definately some human psychology needed.
4.Thumbnails...ummm..yes long standing limitation.Since firefox uses the native browser I'm trying to remember if kde gave this(oh for a memory). Gtk2 can have thumbnails in its file chooser.(xfce4 does it and the gimp as 2 examples)..this would mean altering the firefox sources to call this option up..perhaps ttuuxxx could shed some light on this as it would be very useful.

mike

edit..for file sharing I have it unmount the share when the rox window is closed as it is spawned as a separate instance....only thing is it isn't 100% reliable..not sure why.
Back to top
View user's profile Send_private_message 
MagicZaurus

Joined: 05 Jan 2009
Posts: 88

PostPosted: Mon 17 Aug 2009, 08:16    Post_subject:  

In Firefox you can set the location to which to download. Go to 'Tools' > 'Options' > 'Main' > 'Downloads'. Here you could for example specify /mnt/pendrive. Then when a pendrive is automounted it should link to /mnt/pendrive. As soon as you have a SATA drive in your box, then the pendrive will be sda2 or sda3. So directly to set it to /mnt/sda1 might be not so good.

I'm still using Firefox 3.0, but 3.5 should be same.
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8367

PostPosted: Mon 17 Aug 2009, 09:47    Post_subject:  

Actually on further thought perhaps if pendrives are the only items that need to be handled a custom flash stick only daemon would make more sense. (or do you need cd as well?) For a cybercafe hard drive access is not perticularily desirable.
Or perhaps admin custom choice of what is accessible.
I recently dumped puppy_frontend_d as it's slow and not reliable. A simple script with mut as a backend is much more efficient.

So plug in...automount and rox launched with message of 'close this window before unplugging' sort of idea

mike
Back to top
View user's profile Send_private_message 
Ray MK


Joined: 05 Feb 2008
Posts: 765
Location: UK

PostPosted: Mon 17 Aug 2009, 15:58    Post_subject:  

Hi Rob

Have a really good look at John's TeenPup 2008.

It does most if not all of the things that you often ask for in a Puppy.

Very n00bie friendly and runs very well as a frugal install on an old 6/7 year old acer laptop (233mb ram. 2.5Ghz celeron proc. 512ish swap partition. ext2/ext3)

I've also run it frugal on my othr laptop (96mb ram. 1Ghz celeron proc. 250ish swap partition. ext2)
However it is slow and would obviously run better as a full HD install (with a swap partition) on that type of machine.

On startup it recognises my touchpad automagically - it also does the same with the wired ethernet internet connection.

Click on internet - and it runs - online straight away.
(No save file - running live in ram)

The built-in help and tips are second to none - just try.

Plug in a USB - up pops Pdrive and a folder opens showing your files.

Ok - it is a big download - similar size to Ecopup but when you look at what it comes with you will be astounded.

Well worth a look.

Hope that helps - Very best regards - Ray.
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Tue 18 Aug 2009, 00:41    Post_subject:  

I wrote a script years ago that did exactly this.
Mounted an inserted USB and unmounted it when it`s removed.
It popped up ROX file window for the USB. and ROX auto closes itself.

The app. is called: "usbauto" or maybe "usb-auto" ( I can`t remember ).
Do a search here for it and with luck you may find it, it may still be here.

It`s been years, I thought Dougal had fixed Puppy to do this sort of thing.
But it seems that stuff goes in and out of Puppy and does not stay ( sad ).
Back to top
View user's profile Send_private_message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Fri 21 Aug 2009, 21:06    Post_subject:  

@ MZ

If a pendrive is not plugged in (i.e. they dont have one) then I would really like the files to download to a location for which there is a comprehensible location (currently all downloads automatically go to "/root/Downloads", and there is a shortcut off the desktop for this. I really need to change the default download location automatically (or at least make it very easy to pick it using a ROX shortcut). There is a string for this in firefox's setting file ~/.mozilla/firefox/<profile folder>/???? (I cant remember the exact filename). I must test to see if changing this text file will alter it while it is running (hopefiully a firefox restart will not be required).

@ MikeB, this is very useful information, I now at least know the names of the scripts I would need to hack to achieve this. Youve given me a start for my research thank you.

@ Sunburnt

Quote:
But it seems that stuff goes in and out of Puppy and does not stay


I know I have seen the same thing! Its Barry that has the say of what goes in or stays out, I believe he is simply not aware of all of the new innovations and improvements that take place or the same issues would not keep coming up. I suppose its up to us to keep him informed.

Unfortunately, I cant find your script with either of the two forms you suggest. Crying or Very sad It certainly would be very useful to have something already developed and tested. Would you suggest some other places where I might find it?

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send_private_message Visit_website MSNM 
mikeb


Joined: 23 Nov 2006
Posts: 8367

PostPosted: Fri 21 Aug 2009, 21:31    Post_subject:  

Quote:
@ MikeB, this is very useful information, I now at least know the names of the scripts I would need to hack to achieve this. Youve given me a start for my research thank you.

I was going to do this but on balance it was simpler to extend pmount...hope you get to know bash as this will enable you to get what you need ...you are more than capable and no one knows your aims better than you Smile

mike

ps were's my skegness postcard??
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Fri 21 Aug 2009, 23:46    Post_subject:  

ecomoney; Amazingly I just fired up my old development computer with all that stuff on it.
I found my work directory for auto-usb and I`ll try to find the last working copy for you.
I`ll let you know how I`m doing... Terry
Back to top
View user's profile Send_private_message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Sat 22 Aug 2009, 06:48    Post_subject:  

@ Sunburnt

Many thanks for taking the time to seek it out. If you would like me to host this, or any of your other work I would be happy to provide you with an ftp account on my server. Its important that valuable code from seasoned puppy developers such as yourself does not get lost.

@ MikeB, Im learning bash and trying to put it together with all my old programming expertise (mostly software archetecture). Changing over from M$ Visual Basic (the last language I programmed in) to Bash is quite a leap of syntax however Rolling Eyes Im going to hold off while Sunburnt finds the code, its always better not to re-invent the wheel....(especially when it comes to BASH by gum its hard work!).

I only managed a couple of days away camping in the Peak District and had to come home early through lack of funds, so no one got a postcard!

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send_private_message Visit_website MSNM 
mikeb


Joined: 23 Nov 2006
Posts: 8367

PostPosted: Sat 22 Aug 2009, 07:14    Post_subject:  

Quote:
.(especially when it comes to BASH by gum its hard work!).

don't know what you mean Very Happy . Quite unique is the polite term. I find every other language I've learnt similar in structure but bash is the beastie..I started by modifying scripts and grabbing bits from other scripts....usually driving the various gui widgets.I'm still learning stuff with the help of online man pages (wikipedia are often very clear and easy to learn from) but each hurdle brings a whole pile of new possibilities.

Sorry yer holiday was cut short but hope you got a good blast of fresh air and sunshine to clear the mind

mike
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Sat 22 Aug 2009, 20:57    Post_subject:  

ecomoney; Looked on usb-auto, BIG surprise, it didn`t work...
It seems that the utility that it depended on "dmesg" is no longer used in Puppy.
Were we just talking about this sort of thing or what ???
Rather than try to figure out how to fix that, I rewrote it to work different.

It "seems" to work well. YOU are the final tester ecomoney...
As to #2 through #4 of your wish list, I don`t know how to do them.

I`m posting it in the forum: Cutting Edge / usb-auto
Direct any development talk and bug reports to there.
Back to top
View user's profile Send_private_message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Sun 23 Aug 2009, 06:52    Post_subject:  

Very Happy Thank you Sunburnt! I asked for it, I will test it (very thoroughly!). I appreciate you going to the time and trouble to re-work the script.

Ive spend the last three hours doing some research, this is what Ive found.

Part 4 - Auto-Bookmarking

Regarding point 2 (Adding Bookmarks automatically), Ive dont a few hours research and found that puppy stores its file location bookmarks in two places

/root/.gtkbookmarks - this is where bookmarks for the file-open dialogs are kept. Its read by the gtk-dialog routings...I believe this to be a set of standard libraries for dialog boxes that applications call to re-use the same code and provide a standard look and feel.

Heres a sample...
Code:
file:///root/spot
file:///root/Startup


Seems fairly explanatory. Smile

These correspond to the locations in the left hand pane of the save/open dialogs of most puppy Apps.

/root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml

This is the location for the bookmarks in ROX (the ones in the drop down bookmarks on the Rox filer window. Its in "XML" format like this

Code:
<?xml version="1.0"?>
<bookmarks>
  <bookmark title="/root">/root</bookmark>
<bookmark title="/root/boot">/root/boot</bookmark>
<bookmark title="/usr">/usr</bookmark></bookmarks>


If the automount script added the location lines to these files (and removed them when unplugged) then this would fix point 2 (I will make a request on your new thread in "Cutting Edge". (I think this would require a "grep"? maybe Im getting ahead of myself Wink )

Part 2 & 4 - Set Default Download Locations & Filemanager Preview

Apparently this is a gtk function. This thread lead me to this page of gtk documentation. It seems to cover the functions of setting the default download locations and the preview.

I have no idea how these would be used however...as part of the your script Sunburnt?

Part 3 - Coping with unannounced pendrive removal

I havnt found out any info on this, MikeB you say that changing the usb pendrive cache size to zero would mean that all files are written immedietely to the pendrive?

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send_private_message Visit_website MSNM 
mikeb


Joined: 23 Nov 2006
Posts: 8367

PostPosted: Sun 23 Aug 2009, 08:04    Post_subject:  

http://www.linux-consulting.com/Amd_AutoFS/autofs.html
any use ?..or is it more for lan booting?

this looks promising for file browsing from the browser
https://addons.mozilla.org/en-US/firefox/addon/3076

ui.allow_platform_file_picke false
in firefox and mozilla and thunderbird switches to its built in file picker...I think this remembers locations.

au'revoir

mike
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Taking the Puppy out for a walk » Suggestions
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1032s ][ Queries: 12 (0.0082s) ][ GZIP on ]