File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,22 @@ Show current file in your operating systems' file explorer.
313
313
314
314
Switch audio output device.
315
315
316
+ #### `paste`, `paste-to-open`, `paste-to-playlist`
317
+
318
+ Commands to paste path or URL in clipboard to either open immediately, or append to playlist.
319
+
320
+ `paste` will add to playlist if there's any (`playlist-count > 1`), or open immediately otherwise.
321
+
322
+ Note: there are alternative ways to open stuff from clipboard without the need to bind these commands:
323
+
324
+ - When `open-file` menu is open → `ctrl+v` to open path/URL in clipboard.
325
+ - When `playlist` menu is open → `ctrl+v` to add path/URL in clipboard to playlist.
326
+ - When any track menu (`subtitles`, `audio`, `video`) is open → `ctrl+v` to add path/URL in clipboard as a new track.
327
+
328
+ #### `copy-to-clipboard`
329
+
330
+ Copy currently open path or URL to clipboard.
331
+
316
332
#### `open-config-directory`
317
333
318
334
Open directory with `mpv.conf` in file explorer.
Original file line number Diff line number Diff line change @@ -1074,6 +1074,22 @@ bind_command('audio-device', create_self_updating_menu_opener({
1074
1074
end ,
1075
1075
on_activate = function (event ) mp .commandv (' set' , ' audio-device' , event .value ) end ,
1076
1076
}))
1077
+ bind_command (' paste' , function ()
1078
+ local has_playlist = mp .get_property_native (' playlist-count' ) > 1
1079
+ mp .commandv (' script-binding' , ' uosc/paste-to-' .. (has_playlist and ' playlist' or ' open' ))
1080
+ end )
1081
+ bind_command (' paste-to-open' , function ()
1082
+ local payload = get_clipboard ()
1083
+ if payload then mp .commandv (' loadfile' , payload ) end
1084
+ end )
1085
+ bind_command (' paste-to-playlist' , function ()
1086
+ local payload = get_clipboard ()
1087
+ if payload then
1088
+ mp .commandv (' loadfile' , payload , ' append' )
1089
+ mp .commandv (' show-text' , t (' Added to playlist' ) .. ' : ' .. payload , 3000 )
1090
+ end
1091
+ end )
1092
+ bind_command (' copy-to-clipboard' , function () set_clipboard (state .path ) end )
1077
1093
bind_command (' open-config-directory' , function ()
1078
1094
local config_path = mp .command_native ({' expand-path' , ' ~~/mpv.conf' })
1079
1095
local config = serialize_path (normalize_path (config_path ))
You can’t perform that action at this time.
0 commit comments