Commit Graph

1348 Commits

Author SHA1 Message Date
Guido Cella
0b3cc3a167 commands.lua: split this script out of console.lua
It was suggested by CogentRedTester in
https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858727729 and
https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858809580 and
by avih that making running commands an mp.input client is a better
architecture.

A practical advantage is that completions are calculated in a different
thread, which prevents hanging when completing slow/network filesystems.

script-binding console/enable becomes script-binding commands/open,
though the console one is kept as an alias. I took the opportunity to
rename this because open makes more sense for a graphical modal, and it
is the word used in mp.input and user-data.

script-message-to console type becomes script-message-to commands type,
though the console one is kept as an alias. It is also changed to
automatically close on submit without having to append '; keypress ESC'
as you don't need to keep the console open after running prefilled
commands.

Also convert to double quotes like other scripts and rename some
inconsistent functions.
2025-03-08 19:09:23 +00:00
Jaime Marquínez Ferrándiz
561156217e fish-completion: create the fish completion script
It is an adaptation of the bash completion.
2025-03-08 00:25:45 +01:00
Kacper Michajłow
93ea3df0a9 player: add mpv:// protocol
This is useful to run mpv from URL handler. Can be used to start mpv
from you web browser or anything that would trigger url handler for
given protocol. Only safe protocols are allowed.

Current solutions to run mpv in such context are to spawn IPC proxy and
run mpv when requested, but this is in most cases not necessary.

Currently the protocol is added in mpv.desktop. Windows related
registration will follow in future changes.
2025-03-07 00:15:23 +01:00
Kacper Michajłow
27f39811fa etc/mpv.desktop: update safe protocol list 2025-03-07 00:15:23 +01:00
Guido Cella
e98d3b62ec input.conf: bind MBTN_MID to align-to-cursor 2025-02-24 15:53:34 +01:00
Guido Cella
f1f6184025 input.conf: bind Ctrl+left click to drag-to-pan
An alternative is to bind to right click only for images, but since we
will likely bind right click to the context menu once it works on
platforms other than Windows, bind to ctrl+left click to not have to
change it later.
2025-02-24 15:53:34 +01:00
Guido Cella
8da6e8ad55 input.conf: bind Ctrl+wheel to cursor-centric-zoom
Probably not worth adding to etc/restore-old-bindings.conf since it's an
extension of add video-zoom.
2025-02-24 15:53:34 +01:00
Guido Cella
9422a85638 input.conf: make Alt+BS reset --video-align-{x,y}
This is useful because positioning.lua uses video-align.
2025-02-24 15:53:34 +01:00
Guido Cella
f0b4f3340f input.conf: make Alt+BS print "video-zoom: 0"
Alt+BS prints "video-pan-y: 0" which seems arbitrary. Make it print
video-zoom: 0 which is the most important property that gets reset.
2025-02-24 15:53:34 +01:00
Guido Cella
e32beaa0db input.conf: bind Shift+{HOME,END} to go to the first and last file 2025-02-20 15:54:11 +00:00
Guido Cella
036528d44d input.conf: bind HOME to seek to the beginning 2025-02-20 15:54:11 +00:00
nanahi
02199aeb3f input.conf: use no instead of -1 for video-aspect-override 2025-02-18 23:05:02 +00:00
Kacper Michajłow
5e3f8d336d input.conf: add ctrl+p and g-m keybind for menu
Many keyboards doesn't even have MENU key and ctrl+p is common keybind
for command style menus like this one.
2025-02-17 22:54:04 +01:00
Kacper Michajłow
3baa255d47 builtin.conf: set menu corner_radius to 0 in box profile
OSD mesages are floating in exactly the same way as menu, they should be
consistent.
2025-02-17 22:54:04 +01:00
Dudemanguy
d7159e4662 vd_lavc: make auto the same as auto-safe and introduce auto-unsafe
Users basically never need --hwdec=auto in reality and sometimes it
bites them unexpectedly (e.g. #15814). Unfortunately the name is kind of
nice sounding and if you don't read the manual closely, you might
inadvertently end up using it. So just make auto the same as auto-safe.
auto-unsafe is introduced to have the old behavior of auto instead. A
similar thing is done with the -copy variants. Try to update the
documentation of this section a little bit and discourage people from
using auto-unsafe because it's kind of dumb.
2025-02-17 16:32:37 +00:00
nanahi
5809d4d1bc etc/restore-osc-bindings.conf: add previously unbound actions
This makes sure that newly added actions do nothing, like before.
2025-02-16 01:01:49 +00:00
Guido Cella
3e0b3373df select.lua: add a miscellaneous menu 2025-01-27 21:06:50 +01:00
Guido Cella
e2090533cf select.lua: select from the watch history with g-h
Implement selection of the entries in the watch history.

The last entry in the selector deletes the history file.
2025-01-27 18:53:28 +01:00
Guido Cella
7a59a12b76 select.lua: select files with watch later files with g-w
Implement selection of files to resume playing from watch later config
files. Requires --write-filename-in-watch-later-config.
2025-01-05 23:21:50 +01:00
Guido Cella
d84e1b3582 stats.lua: inherit --osd-shadow-offset
Unlike font and border sizes, the default stats shadow offset is 0 like
--osd-shadow-offset, so it can be inherited from it by default to not
make users configure it in 2 places.

Since 0 and negative numbers are valid offsets, use infinity as the
placeholder for unconfigured values.
2025-01-04 20:07:49 +01:00
Kacper Michajłow
96da0cbcbd options: remove the player argument from --media-controls
It is now handled internally by the libmpv profile.

Since `player` was the default option, the impact should be minimal, as it
is uncommon to override the default option with the same value.
yes/no args will function the same way as before this commit.
2025-01-04 15:16:40 +01:00
Guido Cella
fab8848d7d sub/osd: default to a semitransparent black back color
By default OSD and subs have no shadow, but if you do set a
--osd/sub-shadow-offset, the current default white shadow color looks
bad around white text with black border. Default to semitransparent
black instead. Use the same color box profiles were using to allow
removing it from there.
2025-01-03 12:18:03 +01:00
Guido Cella
753e206d5c zsh-completion: complete av://lavfi:testsrc and av://lavfi:sine
It is annoying to type these over and over.
2024-12-28 16:48:48 +00:00
Guido Cella
a0f8d27aba input.conf: bind Ctrl+v to play the path in the clipboard 2024-12-28 14:08:32 +01:00
nanahi
298c178f1e input.conf: use capital letters instead of shift modifiers
Follow the suggestion of keyname documentation.

Fixes: b4d9980870
2024-12-20 14:54:35 +00:00
Guido Cella
365a33badd osc.lua: open the playlist selector when right clicking playlist arrows
- It makes more sense to select a playlist entry from the buttons that
  navigate the playlist than from the title
- Provides different bindings for right and middle click
- Mirrors chapter button bindings
2024-12-12 21:54:44 +01:00
Guido Cella
43f4568816 select.lua: select editions 2024-12-02 21:44:18 +01:00
nanahi
8c6ad1dc81 etc/input.conf: add KP_PLUS/KP_SUBTRACT key bindings
Same as d06f3d39cb.
2024-12-01 18:55:50 +01:00
Kacper Michajłow
92a98f1ce2 osc.lua: cycle sub/audio down on shift+L-click / middle-click 2024-11-27 20:26:06 +01:00
Kacper Michajłow
62db90634e osc.lua: cycle sub/audio on left-click, select on right-click 2024-11-27 20:26:06 +01:00
Kacper Michajłow
638ada18f8 etc/builtin.conf: add osd-box/sub-box/box profiles 2024-11-20 20:39:26 +01:00
nanahi
1b2aed0b5a etc/restore-old-bindings.conf: fix comment description
The file also provides changed key bindings.
2024-10-29 20:36:38 +01:00
nanahi
e21e1c3180 etc/restore-osc-bindings.conf: add file to restore old osc bindings
The OSC changed to use select.lua for various tasks, resulting in a
significant change in user interaction. This adds a config file
which records OSC behavior changes so that the old behavior can be
restored.
2024-10-29 20:36:38 +01:00
Guido Cella
1b53793a4c various: convert tabs to spaces 2024-10-18 18:32:26 +02:00
Guido Cella
23e774d514 input.conf: bind ? to show key bindings
This should help new users to view mpv's key bindings as it's easier to
discover than shift+i and 4, because many other websites and terminal
applications show key bindings upon pressing ?.
2024-10-14 20:33:27 +02:00
Guido Cella
ce0452fa0d zsh-completion: fix completing --screenshot-avif-opts-*
The list options --screenshot-avif-opts and --vo-image-opts are
completed with an extra 8), e.g. --screenshot-avif-opts-add=8), because
*= in
screenshot-avif-opts=-:Key/value list (default\: usage=allintra,crf=0,cpu-used=8):
matches up to cpu-used= instead of instead of up to
screenshot-avif-opts=.

Fix this by enabling non-greedy matching.
2024-09-30 11:26:00 +02:00
Kacper Michajłow
71f2220991 meson: use relative file paths for file2string
This fixes "Generated from" comments to not include local source path in
generated files.
2024-09-21 23:39:10 +02:00
Oneric
207b1a2c91 sub: merge vsfilter-aspect and vsfilter-blur-compat options
The naming for "blur-compat" was misleading since the setting
actually affects more than just blur affects. Additionally
forwarding storage resolution but forcing an aspect ratio
of 1.0 for the video is likely to result in odd rendering
and there’s no known usecase for it.

Both options control which video properties are exposed to libass
so to fix the aforementioned issues merge these settings into one
tri-state sub-ass-use-video-data.

The default V keybind now cycles through all states of
use-video-data instead of toggling vsfilter-aspect-compat.

Resolves: https://github.com/mpv-player/mpv/issues/10680
2024-09-13 23:24:08 +02:00
llyyr
fe4ba71962 etc/mpv.conf: update stale comment about mpv config location
We don't support reading mpv.conf without a mpv parent directory anymore
(did we ever?).
2024-09-02 13:51:00 -04:00
norinoriko
afdbbac81d input.conf: swap the positions of values for ctrl+h binding
Allows users to toggle software decoding with a single action if they
are using a value for `hwdec` that is different from `auto-safe`.
2024-09-01 19:42:15 +02:00
nanahi
d06f3d39cb input.conf: add KP_DIVIDE/KP_MULTIPLY key bindings
Map them to volume up/down, which is arguably the original intent
of these key bindings, as the non-numpad positions of them make
little sense.
2024-08-11 15:08:42 +02:00
Kacper Michajłow
f470b63a04 input.conf: add zoom, pan, scale and rotate keybinds for numpad 2024-07-11 21:57:11 +02:00
Diederik de Haas
1acb49f9c6 bash-completion: remove hashbang
Hashbangs are meant for scripts that are executed, but a bash completion
script is meant to be sourced and therefor shouldn't have a hashbang.

Remarked by Debian's ``lintian`` tool with the
``bash-completion-with-hashbang`` tag.
2024-06-18 16:06:02 +00:00
Guido Cella
80de88361b input.conf: make Alt+BS reset panscan
It makes sense to reset panscan along with the zoom because it is a kind
of zoom.
2024-06-13 12:57:48 +00:00
Dudemanguy
df166c1333 mpv.desktop: fix capitalization error
Missed in 481e498427
2024-06-01 15:08:59 -05:00
x9a
481e498427 mpv.desktop: add Arabic translation
Added Arabic translation for "Name", "GenericName", "Comment", and
"Keywords" entries in the .desktop file.
2024-05-30 12:54:44 +00:00
llyyr
7aaa7b221f input.conf: change 'u' binding to cycle between 'force' and default 2024-05-29 17:48:50 +00:00
Guido Cella
61f72bd512 select.lua: add this script
This adds script messages to select playlist entries, tracks, chapters,
subtitle lines, bindings and properties using the newly introduced
mp.input.select().

This fully closes #13964.
2024-05-12 23:13:48 +02:00
stax76
01d815d95d powershell-completion: add PowerShell command line completion 2024-05-05 15:38:46 +02:00
Guido Cella
2f4c550b4b zsh-completion: complete --gpu-context
This is made by possible by 96e1f1dfa5 standardizing --gpu-context's
help output. This changes the check to complete any Object settings list
so it will automatically work with future options of this kind.
2024-04-27 03:01:06 +02:00