Linux
Welcome to c/linux!
Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!
Rules:
-
Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.
-
Be respectful: Treat fellow community members with respect and courtesy.
-
Quality over quantity: Share informative and thought-provoking content.
-
No spam or self-promotion: Avoid excessive self-promotion or spamming.
-
No NSFW adult content
-
Follow general lemmy guidelines.
view the rest of the comments
Depends what operating system you're using. I run Linux (Mint).
And I use mpv a lot... it’s probably the application I’m the most stupidly fond of, as a user I find it amazingly good.
I use it mostly through the Nemo file explorer (through its custom actions) as my video/music music player. But I also use it to listen to podcasts, using newsboat as my feed aggregator and yt-dlp to actually download/stream whatever multimedia content I want mpv to play. And, well, for everything else that contains video and/or audio.
You can launch mpv with
--no-videoand no window will be displayed, say if you want to play only the audio from a video file. You can also launch it using thesave-position-on-quit. I've mine set by default to yes (in mpv.conf), so it remembers position in whatever I play next time I play it, and on specific scripts/occasions it is set to ‘no’ (see example below).in my
~/.config.mpv/mpv.confI have setvolume=65which is the level I want it to start with, while defining custom keyboard shortcuts and mouse scrolling buttons to change volume in the~/.config.mpv/input.conf. I've never tried it but you might be able to add a volume parameter each time you launch mpv (maybe store the actual value in a hidden text file somewhere for it to load from, using a script?)Your 3, I'm not sure to understand what you want to do. But in order to keep mpv open after it’s done playing whatever, add this to your mpv.conf:
keep-open=yesAs an example, here is one of the 'Nemo Actions' I use to make mpv randomly play audio (even from video) from the folder I right-click on, without mpv opening any window. If you don’t know them already, custom Nemo Actions must be saved in
~/.local/share/nemo/some-file-name.nemo_action:The 'exec' part of that action uses standards mpv parameters next to Nemo's own stuff.
I also use the socat utility that lets me connect a series of tiny (they're one-liners) custom shell scripts directly to mpv, using system-wide keyboard shortcuts. I'm really not an expert about any of that, I just learned to use it to get what I wanted out of it which is a … universal mpv remote-control.
I don't mean just the Play/Pause buttons but almost any of the controls I need with mpv.
For example, I started using it to let me skip forward/backward a couple seconds and resume playback while I'm listening to audio notes, as I recently started using a pocket voice recorder. Which makes mpv great when I’m transcribing said notes. Not as good but quite close to one of those dedicated old-school foot pedal people into that kind of tech used to use in the 80s and 90s… Yep, don't tell anyone but I’m that old that I remember them ;)
Edit: I hope any of that can help you with your script.
I'm targeting a Linux release
I don't want the active MPV file info in the terminal as if I CTRL+C, CTRL+D, or close the terminal, MPV will close too. So I want it to run as a background process (like how you can minimize VLC to the tray)
I don't know if using something like
nohup mpv <some file> &would work. I guess I could usepkill mpvto close it then.I saw mpv has a
--quietoption. What does that do?