Click/mount a partition without gui file manager? [Solved]

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

Click/mount a partition without gui file manager? [Solved]

#1 Post by jtwdyp »

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 Tue 29 Oct 2013, 03:33, edited 1 time in total.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

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

User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#3 Post by jtwdyp »

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:
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.
[color=brown][size=67]
--
JtWdyP

[/size][/color]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#4 Post by mikeb »

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

User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#5 Post by jtwdyp »

mikeb wrote:After the reboot your edited code should have been used...
Probably should have. Didn't seem to work out that way.
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... :

Image Image

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

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

Image

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

:? :? :?
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.
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.
[color=brown][size=67]
--
JtWdyP

[/size][/color]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#6 Post by mikeb »

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. :)

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

mike

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#7 Post by npierce »

What mikeb said, except look for this line:

Code: Select all

   exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
or this line:

Code: Select all

   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: Select all

  if [ $RETVAL1 -eq 0 ];then
   exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
  else
should be changed to this:

Code: Select all

  if [ $RETVAL1 -eq 0 ];then
   exit
  else
or, in newer versions, this:

Code: Select all

  if [ $RETVAL1 -eq 0 ];then
   rox -x /mnt/$xONEDRVNAME -d /mnt/$xONEDRVNAME &
   EXITFLAG=yes
  else
should be changed to this:

Code: Select all

  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.

User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#8 Post by jtwdyp »

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. :)
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: Select all

   exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
or this line:

Code: Select all

   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! :oops: 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...
[color=brown][size=67]
--
JtWdyP

[/size][/color]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#9 Post by mikeb »

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 ;)

regards

Mike

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#10 Post by npierce »

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.)

User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#11 Post by jtwdyp »

mikeb wrote:
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 ;)
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.
:D :D :D
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. :D :D
[color=brown][size=67]
--
JtWdyP

[/size][/color]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#12 Post by mikeb »

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

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#13 Post by npierce »

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.

Post Reply