Compare commits
No commits in common. "9b1ee15c30870f59af621187d550c7026b9c6521" and "cd921f6083fe76494328ea6985ff1ed3acae6689" have entirely different histories.
9b1ee15c30
...
cd921f6083
3 changed files with 2 additions and 38 deletions
|
|
@ -1,12 +1,9 @@
|
||||||
---
|
---
|
||||||
- name: Create configuration directories
|
- name: Create configuration directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ ansible_env.HOME }}/.config/mpv"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0700"
|
mode: "0700"
|
||||||
loop:
|
|
||||||
- "{{ ansible_env.HOME }}/.config/mpv"
|
|
||||||
- "{{ ansible_env.HOME }}/.config/mpv/scripts"
|
|
||||||
|
|
||||||
- name: Copy configuration files
|
- name: Copy configuration files
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
@ -18,5 +15,3 @@
|
||||||
dest: "{{ ansible_env.HOME }}/.config/mpv/input.conf"
|
dest: "{{ ansible_env.HOME }}/.config/mpv/input.conf"
|
||||||
- src: "templates/mpv/config.j2"
|
- src: "templates/mpv/config.j2"
|
||||||
dest: "{{ ansible_env.HOME }}/.config/mpv/mpv.conf"
|
dest: "{{ ansible_env.HOME }}/.config/mpv/mpv.conf"
|
||||||
- src: "templates/mpv/clipboard.lua.j2"
|
|
||||||
dest: "{{ ansible_env.HOME }}/.config/mpv/scripts/clipboard.lua"
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
-- {{ ansible_managed }}
|
|
||||||
-- Note that the mp global is injected by mpv when the script is ran.
|
|
||||||
|
|
||||||
local utils = require 'mp.utils'
|
|
||||||
|
|
||||||
local function paste_from_clipboard(command)
|
|
||||||
local res = utils.subprocess({ args = { 'wl-paste', '--no-newline' } })
|
|
||||||
if res.status == 0 and res.stdout then
|
|
||||||
local url = res.stdout:gsub("^%s*(.-)%s*$", "%1") -- trim whitespace
|
|
||||||
if url ~= "" then
|
|
||||||
mp.commandv("loadfile", url, command)
|
|
||||||
mp.osd_message("Processed: " .. url)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function append_from_clipboard()
|
|
||||||
paste_from_clipboard("append")
|
|
||||||
end
|
|
||||||
|
|
||||||
local function replace_from_clipboard()
|
|
||||||
paste_from_clipboard("replace")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- TODO: add keybinding that works with idle screen
|
|
||||||
mp.add_key_binding("Shift+MBTN_RIGHT", "append_clipboard", append_from_clipboard)
|
|
||||||
mp.add_key_binding("Shift+MBTN_LEFT", "replace_clipboard", replace_from_clipboard)
|
|
||||||
|
|
@ -8,6 +8,3 @@ keep-open=yes # do not close the window on exit
|
||||||
keepaspect-window=no # add black bars if window aspect and video aspect mismatch
|
keepaspect-window=no # add black bars if window aspect and video aspect mismatch
|
||||||
|
|
||||||
sub-auto=fuzzy # load all subs containing the media filename
|
sub-auto=fuzzy # load all subs containing the media filename
|
||||||
|
|
||||||
alang=en,nl
|
|
||||||
slang=en,nl
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue