-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathremote.lua
107 lines (86 loc) · 1.79 KB
/
remote.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
local kb = libs.keyboard;
local fs = libs.fs;
events.detect = function ()
return
fs.exists("/usr/bin/mpv") or
fs.exists("/bin/mpv");
end
--@help Lower volume
actions.volume_down = function()
kb.stroke("9");
end
--@help Mute volume
actions.volume_mute = function()
kb.stroke("m");
end
--@help Raise volume
actions.volume_up = function()
kb.stroke("0");
end
--@help Previous track
actions.previous = function()
kb.stroke("<");
end
--@help Next track
actions.next = function()
kb.stroke(">");
end
--@help Skip forward 10 secs
actions.forward = function()
kb.stroke("right");
end
--@help Skip backward 10 secs
actions.backward = function()
kb.stroke("left");
end
--@help Toggle play/pause state
actions.play_pause = function()
kb.stroke("p");
end
--@help Stop playback
actions.stop = function()
kb.stroke("q");
end
--@help Cycle through subtitles
actions.switch_subs = function()
kb.stroke("j");
end
--@help Toggle subtitle visibility
actions.toggle_subs = function()
kb.stroke("v");
end
--@help Toggle fullscreen
actions.fullscreen = function()
kb.stroke("f");
end
actions.osd = function()
kb.stroke("O");
end
--@help Increase subtitle delay
actions.subtitle_delay_down = function()
kb.stroke("z");
end
--@help Decrease subtitle delay
actions.subtitle_delay_up = function()
kb.stroke("x");
end
--@help Increase audio delay
actions.audio_delay_down = function()
kb.stroke("ctrl", "minus");
end
--@help Decrease audio delay
actions.audio_delay_up = function()
kb.stroke("ctrl", "plus");
end
--@help Decrease playback speed
actions.playback_speed_down = function()
kb.text("[");
end
--@help Increase playback speed
actions.playback_speed_up = function()
kb.text("]");
end
--@help Reset playback speed
actions.playback_speed_reset = function()
kb.stroke("backspace");
end