Explorer replacement and reset tab to home function after restart

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Mosed
Posts: 12
Joined: 13 Jan 2022 19:33

Explorer replacement and reset tab to home function after restart

Post by Mosed »

Hello,

I'm testing XYplorer right now and it looks quite good. But there are two topics I cannot manage at the moment.

1. It is possible to set xyplorer as default file manager. But I found directly two cases were still the explorer is used. Is this intentional or could this be something for the wish list?
- The windows standard shortcut "This computer" on the desktop
- pCloud icon in the system tray (so I guess in general system tray icons will still launch explorer instead of xyplorer)

With Opus Dir it is possible to launch Opus instead of explorer for this cases - so in general it should be possible.


2. It is possible to set a home zone for a tab and to lock the home zone. But there seems to be no option to reset the tab to home zone after restarting xyplorer. Is this right?
So the idea would be that I have several Tabs with specific home zone. When I navigate in this tabs I would like to start directly again in the home zone after restarting xyplorer. (At the moment I use the workaround to use the middle mouse button to switch back to home zone).
Perhaps a script could help here.


Especially the first topic could be a blocking point, but I would like to use xyplorer. :)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Explorer replacement and reset tab to home function after restart

Post by highend »

1. Only if a special handler would be written, that intercepts those locations...

2. Exactly, use a script as a command line parameter

Code: Select all

    while ($i++ < gettoken(<get Tabs |>, "count", "|")) {
        $home = tab("get", "home", $i);
        if ($home) { tab("relocate", $home, $i); }
    }
One of my scripts helped you out? Please donate via Paypal

Mosed
Posts: 12
Joined: 13 Jan 2022 19:33

Re: Explorer replacement and reset tab to home function after restart

Post by Mosed »

highend wrote: 13 Jan 2022 20:12 1. Only if a special handler would be written, that intercepts those locations...
ok, so the replacement is not as global as in Opus dir. Does it make sense to create a wish about that or is there a "hard" reason why xyplorer is not able to intercepts such locations?
2. Exactly, use a script as a command line parameter

Code: Select all

    while ($i++ < gettoken(<get Tabs |>, "count", "|")) {
        $home = tab("get", "home", $i);
        if ($home) { tab("relocate", $home, $i); }
    }
ok, I put this into Custom Event Actions for event "exit" and it works. Thank you. :tup:

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Explorer replacement and reset tab to home function after restart

Post by jupe »

Keep in mind that script will only apply to the active pane, so if you exit with the second pane active I doubt it will do what you expect without modifications.

Mosed
Posts: 12
Joined: 13 Jan 2022 19:33

Re: Explorer replacement and reset tab to home function after restart

Post by Mosed »

You are right. So the script must be adapted to take effect on both panes?

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Explorer replacement and reset tab to home function after restart

Post by jupe »

Yes correct, maybe something like this:

Code: Select all

  gohome();
  focus "PI";
  gohome();

function gohome() {
  while ($i++ < gettoken(<get Tabs |>, "count", "|")) {
      $home = tab("get", "home", $i);
      if ($home) { tab("relocate", $home, $i); }
  }
}
that is assuming you are going to have home tabs on pane 2 too, else you can modify to only run on pane 1 always.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Explorer replacement and reset tab to home function after restart

Post by highend »

This would leave him in the wrong pane (if in dual pane mode)

Switch focus, gohome(), switch focus again, gohome()...
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Explorer replacement and reset tab to home function after restart

Post by jupe »

Well "wrong pane" implies that everyone always wants to start on pane 1, to me I don't care, but everyone has their preference, its also why I wrote "something like this", besides that you are wrong, as it is it would only be on the "wrong pane" if exited with pane 1 active.

Mosed
Posts: 12
Joined: 13 Jan 2022 19:33

Re: Explorer replacement and reset tab to home function after restart

Post by Mosed »

Thank you. So I can also use this script to be always on a specific pane after restarting xyplorer.

Due to the fact that I know in general not which pane is in focus before running the script I guess I would have to use something like this (if I have on both panes home zones):

Code: Select all

 
 focus "P2";
 gohome();
  focus "PI";
  gohome();


function gohome() {
  while ($i++ < gettoken(<get Tabs |>, "count", "|")) {
      $home = tab("get", "home", $i);
      if ($home) { tab("relocate", $home, $i); }
  }
}
  
Then pane 1 is focused after restarting xyplorer. Correct?

EDIT: But in the settings is an option to define the starting pane. So I can choose there which pane should be in focus after restarting xyplorer.

Or if possible choose in the settings "last pane" as starting pane and in the script only a general double focus switch.

Post Reply