uosc icon indicating copy to clipboard operation
uosc copied to clipboard

Add DOpus support for `show-in-directory` command

Open Soromeister opened this issue 2 years ago • 6 comments

Current setup:

  • Directory Opus 13 installed and set as default explorer replacement;
  • MPV installed with uosc;

Current behavior:

  • When using script-binding uosc/show-in-directory, uosc opens Explorer.exe instead of the default DOpus;

Desired behavior:

  • uosc should use DOpus (Or any other replacement like TotalCommander) if it's set as default Explorer replacement.

Soromeister avatar Jan 03 '24 10:01 Soromeister

...if it's set as default Explorer replacement.

Set where? Is it possible to change default explorer app in window?

If there's a command on windows that would open what we need in any user preferred explorer app, than I have nothing against implementing it.

But if this requires a windows specific option, or doing stuff like detecting apps installed at specific locations, than I'm against this.

tomasklaen avatar Jan 04 '24 10:01 tomasklaen

Well, yeah, it is possible to change a lot of stuff in Windows.

But this wouldn't apply to uosc anyway.

Code search turned up this:

https://github.com/tomasklaen/uosc/blob/0d7825a4ad8ffb317ec901aafff53f8e65c12aa4/src/uosc/main.lua#L926-L931

I assume utils.subprocess_detached works similar to the run / subprocess input commands from mpv. So, mpv is starting these processes, by directly calling the relevant WinAPI function, as far as I recall.

Solution for making this work with DOpus, for example: Make the args here configurable. So that a path (read from uosc.conf, for example) can be specified here to the DOpus exefile, and an additional arg to change /select, accordingly..

Hrxn avatar Jan 04 '24 11:01 Hrxn

Make the args here configurable.

I don't want to add any platform specific options, let alone ones that will only be used by 0.01% of users.

If I wanted to use an alternative explorer, I'd try to figure out how to redirect explorer.exe calls to it, rather than ask every single app I'm using to implement options to work with my unconventional setup.

So again, if there is a more appropriate command we could be using that will launch a preferred explorer on windows, or maybe some windows environment value convention to retrieve and use preferred explorer, then I have no issue switching to it. Otherwise this will be a wontfix.

tomasklaen avatar Jan 04 '24 11:01 tomasklaen

Code search turned up this:

Since you have known its commands. It could be done in input conf independently. You do not need uosc in this case.

hooke007 avatar Jan 08 '24 03:01 hooke007

launch a preferred explorer on windows

a preferred explorer would not be called explorer.exe, not sure how you expect launching a specific executable to launch something else entirely. For Mac you use a more generic open command, not Finder, and for Linux you have platform-specific code that starts with Nautilus (so similar to that Explorer call), though it has a fallback.

(but otherwise I also don't know whether there is some more complicated way to override a direct call to explorer vs. tweaking a path in a config. For notepad I had to do some tweaking of files within system folders which I would never do for something so core as explorer.exe

DOpus is one of the more advanced apps, and still it warns

A program that specifically invokes Explorer may not be able to be intercepted by Opus (although many times it will).

)

eugenesvk avatar Jan 10 '24 13:01 eugenesvk

Yeah, but as @hooke007 has already pointed out, the smart™ and simple solution is to simply start any external application with a simple command bind from input.conf - OP already mentions script-binding uosc/show-in-directory, so this would work in exactly the same vein.

https://mpv.io/manual/master/#command-interface-[-]]]

https://mpv.io/manual/master/#command-interface-subprocess

Hrxn avatar Jan 10 '24 16:01 Hrxn