Giter VIP home page Giter VIP logo

Comments (22)

leo-arch avatar leo-arch commented on June 11, 2024 1

Tried with both sakura (3.8.7, AUR) and st (0.8.2) and they both work fine. Have you tried with another terminal, say xterm?

opens some random file from another folder completely with and without wrapping the %f in quotes

This is pretty weird, specially if it works fine when using st (which means that the file to be opened is properly passed to the opening application). Maybe some issue with your sakura version?

What would be perfect would be a variable that could set to detach apps without the need to launch another terminal if possible either globally or on a per app basis.

I'll bear this in mind.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

Hi @ErinVoid. Edit Lira's config file (via mm edit) and add this line under the Video and audio section (delete/comment out the old line or place the new one on top of it):

X:^video/.*=xterm -e mpv %f &

This instructs clifm to open video files in the background using mpv on a separate instance of xterm (The focus will be on the newly created window, but clifm will immediately generate a new prompt).

As to the docs, thanks for the observation; I will take a look at it. Please feel free to edit it as you see it fits.

getting into Clifm with previews for images so thank you.

You're welcome!

from clifm.

ErinVoid avatar ErinVoid commented on June 11, 2024

Thank for the feedback. The above doesn't work with Sakura which does spawn a new term but opens some random file from another folder completely with and without wrapping the %f in quotes. Trying st works correctly but complains "couldn't read from shell: I/O error" when exiting.

What would be perfect would be a variable that could set to detach apps without the need to launch another terminal if possible either globally or on a per app basis.

from clifm.

ErinVoid avatar ErinVoid commented on June 11, 2024

Thank you

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

But the thing is still not working, isn't it? Could you provide more context info (OS, DE/WM, term, shell, clifm version)? I need to reproduce the issue.

from clifm.

ErinVoid avatar ErinVoid commented on June 11, 2024

Alpine Linux 3.18 up to date (musl libc)
Sakura 3.8.7-r0
st 0.9-r1
CliFM 1.11-r0
bash 5.2.15-r5

In a folder; type "2" at the prompt, it recognises it being "Show S13E01.mp4", st opens correctly "/my/file/path/show name/Show S13E01" [st -e %f &] whereas Sakura immediately opens "/my/file/path/show/Show S00E01.mp4". It also occurs whatever file is chosen in the selected folder.

Bit of debugging; the requested URI is ""/my/file/path/show name/Show" so the whole folder is enqueued.

There are other posts about Sakura and it not coping with spaces. Wrapping the %f in "" makes no difference. st is fine!

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

Hey @ErinVoid! I'll try to reproduce the issue, but it is good to know that it seems to be a Sakura bug. However, maybe we can think of some workaround. For the time being, I guess it's better not to rely on Sakura, at least for this specific use case.

Btw, clifm current version is 1.15 (available in Alpine's Edge branch).

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

Issue reproduced, and yes, the -e option seems to be broken in Sakura since a long time (see this post).

So, if there's nothing else to add regarding our original issue, I guess we can close it.

from clifm.

ErinVoid avatar ErinVoid commented on June 11, 2024

If possible, change to a feature request for spawning apps and focus returning to Clifm?

Happy the -e bug is Sakura's.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

What do you mean exactly? Isn't this request already fulfilled by my first comment? True, once an app is spawned in a different window (detached), the focus will change to it, but this is not controlled by clifm, but by the window manager, in which case there's nothing we can do as far as I know.

from clifm.

ErinVoid avatar ErinVoid commented on June 11, 2024

The request was for Clifm to open GUI applications as a separate process to allow Clifm to continue to be used without opening additional terminal windows.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

When it comes to GUI apps, all you need to do is to specify the desired application. For example, if you want to open video files with vlc:

X:^video/.*=vlc

This will open vlc on a separate window without requiring a new terminal window (because GUI apps have their own window). Furthermore, the process is independent/detached: close clifm, and even the terminal it is running on, and vlc will continue running. You can also run it in the background (though it doesn't make much difference):

X:^video/.*=vlc %f &

In the case of terminal apps, like mpv, which do not create a new window by themselves, we need to run them on a new terminal window in order to detach it (otherwise, it will be executed on the current terminal window):

X:^video/.*=xterm -e mpv %f &

If this is not what you want, please provide a more concrete example.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

@ErinVoid, is it ok to close this issue then?

from clifm.

ErinVoid avatar ErinVoid commented on June 11, 2024

Other CLI FMs manage to open mpv without a terminal. Going to close anyway.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

You can try silencing both STDERR and STDOUT, as follows:

X:^video/.*=mpv %f !EO &

As an alternative, mpv provides a --no-terminal command line switch which can be useful in this case. Try this:

X:^video/.*=mpv --no-terminal %f &

Please give it a shot and tell me if it's ok now.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

@ErinVoid, have you tried this? Does it work for you?

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

@ErinVoid, does the above solution work as expected?

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

Happy the -e bug is Sakura's

Bug fixed upstream.

from clifm.

LinArcX avatar LinArcX commented on June 11, 2024

I have this issue. I tried: X:^video/.*=mpv --no-terminal %f &. mpv is running, yes. but the terminal is freezing. even Ctrl+C doesn't work. I need to press Ctrl+z to get out of it. I have this impression that & doesn't work properly in clifm.

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

@LinArcX , I cannot reproduce this issue (tried this rule with Openbox/i3 and alacritty/xterm/lxterminal, no issue). Could you provide more context information (clifm version, terminal, desktop environment/window manager)?

from clifm.

LinArcX avatar LinArcX commented on June 11, 2024

OS: VoidLinux
Clifm: v1.18(https://github.com/search?q=repo%3Avoid-linux%2Fvoid-packages%20clifm&type=code)
Terminal Emulator: wezterm
Windows Manager: dwm

from clifm.

leo-arch avatar leo-arch commented on June 11, 2024

Tried with wezterm. Still nothing.

The only way I've found to reproduce this issue (or at least something similar) is having the current terminal window maximized, in which case the video is certainly reproduced, but in a window hidden by the currently used one.

Please try with a different terminal (to discard a terminal-specific issue) and with a different video application (to discard an mpv-specific issue).

from clifm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.