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 Fri 24 Oct 2014, 06:19
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Click/mount a partition without gui file manager? [Solved]
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Thu 24 Oct 2013, 14:24    Post subject:  Click/mount a partition without gui file manager? [Solved]
Subject description: I do that stuff with mc...
 

It's a lot easier to just click on one of the desktop device icons to mount it to an automatically created mountpoint, than to manualy create a mountpoint and then mount the device from command line.

But I have zero use for ANY gui window with a view of the partitions contents such as the one that automatically pops up when I click on one of those icons. I NEVER use any GUI file managers. I only ever do such things with mc or failing that, I'll stumble along with just the bare the bash command line first...

Is there a way to alter the automount logic so that clicking on one of those device icons mounts it, but stops short of starting that durned gui file manager? I'm tired of always having to close it...

Last edited by jtwdyp on Mon 28 Oct 2013, 23:33; edited 1 time in total
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8361

PostPosted: Thu 24 Oct 2013, 17:12    Post subject:  

Yes edit /usr/local/bin/drive_all

hang onto your stomach and look out for exec rox -x $MNTPT -d $MNTPT

near the bottom...it may vary ...might have to change to exit to keep the sludge happy.

You may have to delete the contents of /root/.pupevent to refresh the code you edit.

mike
Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Fri 25 Oct 2013, 14:42    Post subject:  

mikeb wrote:
Yes edit /usr/local/bin/drive_all

hang onto your stomach and look out for exec rox -x $MNTPT -d $MNTPT
near the bottom...it may vary ...might have to change to exit to keep the sludge happy.


Yeah, trying to figure out what any given line in that script is actually doing made me dizzy. But your right I did find that command near the bottom...

But Nothing I did to it stopped the rox filer window from opening when I clicked on the device icon... That is until:

Quote:
You may have to delete the contents of /root/.pupevent to refresh the code you edit.


When I zapped that stuff, clicking on any of the device icons got an error pop-up and the partition didn't mount. That is until:

next time I booted puppy the .pupevent content was regenerated. :big sigh:

Well thanks anyway, having to close them pesky rox windows is only a petty nuisance. I guess can live with it.

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8361

PostPosted: Fri 25 Oct 2013, 15:21    Post subject:  

After the reboot your edited code should have been used... you can right click on the /root/.pupevent/{drives} and see if your edit is actually getting there.

Its a horrible system that I managed to replace in the end so all this is from recent memory.

I suppose since normally internal drives do not get refreshed you could edit the code behind the icons.

mike
Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Mon 28 Oct 2013, 01:16    Post subject:  

mikeb wrote:
After the reboot your edited code should have been used...


Probably should have. Didn't seem to work out that way.

Quote:
you can right click on the /root/.pupevent/{drives} and see if your edit is actually getting there.


Hunh? I'm not sure I get you... :



It doesn't look like you mean to right click on the desktop icons...

And if you mean to click on the file itself...



All that happens when I do that is to select the subdir for file operations...

Confused Confused Confused

Quote:
Its a horrible system that I managed to replace in the end so all this is from recent memory.


Oh I don't know as I'd go that far. Seem to me that nowadays most users prefer gui tools such as rox... The only thing horrible is that I'd like to take advantage of only part of the automagic called by clicking on the durned thing.

Quote:
I suppose since normally internal drives do not get refreshed you could edit the code behind the icons.


But at best that would only result in different behavior out of the automagic stuff on when I click on the non-removable device icons from what happens when I click on one representing a removable device such as a flash drive.

As much as I wish the rox filer window didn't jump into my way, it's not that hard to close, and I crave consistent results a lot more than I despise having to close the undesired application window.

So like I said, I can live with it.

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8361

PostPosted: Mon 28 Oct 2013, 04:39    Post subject:  

well i have nice drive icons that look pretty much the same from one 4k script rather than a tangled web of them that don't do what you want or even what they are supposed to at times. Someone also made a nice binary version too...they also don't spike yer cpu every 2 seconds. So its not a necessary evil in order to have a nice gui.
Many here hate the default system as much as I do and 'horrible' is an appropriate adjective in this case. Smile

Editing the apprun in pup_event would disable rox for your permanent drives but leave it for flash sticks as it happens.

mike
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Mon 28 Oct 2013, 08:07    Post subject:  

What mikeb said, except look for this line:
Code:
   exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME

or this line:
Code:
   rox -x /mnt/$xONEDRVNAME -d /mnt/$xONEDRVNAME &

You didn't mention which Puppy you have. A recent Puppy like Precise 5.7.1 will have the latter line; older Puppies like Racy 5.2.2 may have the former line.

So backup your /usr/local/bin/drive_all file, then edit one line as follows:

In older versions, this:
Code:
  if [ $RETVAL1 -eq 0 ];then
   exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
  else

should be changed to this:
Code:
  if [ $RETVAL1 -eq 0 ];then
   exit
  else

or, in newer versions, this:
Code:
  if [ $RETVAL1 -eq 0 ];then
   rox -x /mnt/$xONEDRVNAME -d /mnt/$xONEDRVNAME &
   EXITFLAG=yes
  else

should be changed to this:
Code:
  if [ $RETVAL1 -eq 0 ];then
   EXITFLAG=yes
  else

(If your version looks different from these two, please tell us which Puppy you have, so we can find the correct modification.)

Then delete the contents of /root/.pup_event and reboot, as you did before.
Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Mon 28 Oct 2013, 23:29    Post subject:  

mikeb wrote:
well i have nice drive icons that look pretty much the same from one 4k script rather than a tangled web of them that don't do what you want or even what they are supposed to at times. Someone also made a nice binary version too...they also don't spike yer cpu every 2 seconds. So its not a necessary evil in order to have a nice gui.


These icons "spike my cpu every 2 seconds"?? You mean I presume when they are just sitting there waiting for me to click on them"? I was unaware of that... Now I'm curious, Is that the whole group of device icons spike it once every 2 seconds? Or with 7 device icons showing at the moment, do you mean it's getting spiked 7 times every 2 seconds? (Worse, As I have the default 4 desktop areas, does that mean it's getting spiked 28 times??)

Perhaps I should ask for more info on your 4k script?

mikeb wrote:
Many here hate the default system as much as I do and 'horrible' is an appropriate adjective in this case. Smile


OK since the adjective "horrible" is often used to describe something "ugly", And since "ugly", like "beauty" is in the eye of the beholder, I'll agree that for anyone who strongly feels as you do, "horrible" would be an appropriate word.

For me though, Puppy is not my primary OS, Its a portable powertool for rescuing broke systems, and sometimes Just because I feel like a change of pace. I like the idea that it doesn't feel like my preferred E17 desktop, It helps remind me that I'm running as root.

npierce wrote:
What mikeb said, except look for this line:
Code:
   exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME

or this line:
Code:
   rox -x /mnt/$xONEDRVNAME -d /mnt/$xONEDRVNAME &


It was the latter, and your very explicit instructions worked like a charm.

npierce wrote:
You didn't mention which Puppy you have. A recent Puppy like Precise 5.7.1 will have the latter line; older Puppies like Racy 5.2.2 may have the former line.


What? Gosh your right! Embarassed Musta been sitting on my brains too long.

A bit belated, But for posterity and all that: I'm running Slacko 5.6 here.

I think I owe both you & mikeb a big:

Thank You!

For all the effort helping me figure this out, even after I was ready to pack it in and just live with the default behavior...

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8361

PostPosted: Tue 29 Oct 2013, 07:44    Post subject:  

Quote:
and just live with the default behavior...

never do that...it will bite you in the end.

The 2 seconds refers to polling the drives. Because its a pile of scripts a lot of code has to be run through with every 2 second poll plus there is a 4 second poll to check for free space (which never seems to save anyone..)

well now you have learned to find things in puppy scripts...that's a very useful skill Wink

regards

Mike
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Tue 29 Oct 2013, 12:21    Post subject:  

You're welcome, jtwdyp, and I'm glad to hear that it worked for you.

I am also among those folks who seldom use the ROX window that opens when clicking on the icon for a partition. Occasionally I use them to quickly mount an .iso or .sfs. file that lives in the partition, but mostly I just wait for the window to appear (which can take a few seconds if the partition's top-level directory is large) and then close it. So this change is useful to me as well. But I never took the time to go hunting for it. So thanks, mikeb, for pointing me to /usr/local/bin/drive_all and /root/.pup_event/.

(And when I do want a ROX window, I can just click on the icon for a previously mounted partition.)
Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Wed 30 Oct 2013, 19:56    Post subject:  

mikeb wrote:
Quote:
and just live with the default behavior...

never do that...it will bite you in the end.


I prefer not to...

mikeb wrote:
The 2 seconds refers to polling the drives. Because its a pile of scripts a lot of code has to be run through with every 2 second poll plus there is a 4 second poll to check for free space (which never seems to save anyone..)


And your script doesn't have to do that? Is there a tradeoff??

mikeb wrote:
well now you have learned to find things in puppy scripts...that's a very useful skill Wink


Trick is to know what to look for...


npierce wrote:
You're welcome, jtwdyp, and I'm glad to hear that it worked for you.


Very Happy Very Happy Very Happy

npierce wrote:
I am also among those folks who seldom use the ROX window that opens when clicking on the icon for a partition. Occasionally I use them to quickly mount an .iso or .sfs. file that lives in the partition, but mostly I just wait for the window to appear (which can take a few seconds if the partition's top-level directory is large) and then close it. So this change is useful to me as well. But I never took the time to go hunting for it. So thanks, mikeb, for pointing me to /usr/local/bin/drive_all and /root/.pup_event/.


That was quite nice of him.

npierce wrote:
(And when I do want a ROX window, I can just click on the icon for a previously mounted partition.)


Or, I've noticed, by double clicking on one that wasn't already mounted.

I'm guessing the rox call with the "$MNTPT" variable is the one that fires up rox on an already mounted partition?

But either way, I'm all happy now. Very Happy Very Happy

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8361

PostPosted: Wed 30 Oct 2013, 20:16    Post subject:  

Quote:

And your script doesn't have to do that? Is there a tradeoff??


since you ask...

the backend uses a binary to scan for drives and states.... the frontend is a small script that only gets triggered when there is a change in drive state or presence.... anything scripted has to be parsed through an interpreter every time it runs and in this case reruns every 2 seconds... binaries are already converted to a lower level of code so take much less cpu to run.... the resultant behaviour is the same but with several magnitudes less cpu cycles used.
I have an xfce applet monitoring free space...again a binary.

An even smarter approach would use udev so everything gets triggered from kernel events....someone else was/is playing with that approach.

Those icons I linked in another of your threads use a binary for front and backend... rather neat...and they produce drives in gtk file browser dialogs too..

mike
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 31 Oct 2013, 09:56    Post subject:  

jtwdyp wrote:
I'm guessing the rox call with the "$MNTPT" variable is the one that fires up rox on an already mounted partition?

Correct.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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