diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 37 | ||||
-rw-r--r-- | lua/sleep.lua | 11 |
3 files changed, 48 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..02e8202 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +push.sh @@ -1 +1,36 @@ -init +# MPV-Android Sleep # Requirements + + +# Setup For the Dummies +In mpv-android + +1. Set the gesture in `Settings > Touch gestures > Double tap (right)` (or other of your choice). + + +2. In `Settings > Advanced > Edit input.conf` + add: `0x1000* script-binding sleep` where `*` should be set as 1, 2, or 3, based on your choice in #2. See key codes below. + +Key Codes (gestures): +- `0x10001` ---> left +- `0x10002` ---> center +- `0x10003` ---> right<br><br> + +<!-- +| Gesture | Key Code | +|---------|-----------| +| Left | 0x10001 | +| Center | 0x10002 | +| Right | 0x10003 | +--> + + + +3. edit `mpv.conf` In `Settings > Advanced > Edit mpv.conf` and add: `script=/storage/emulated/0/Android/media/is.xyz.mpv/scripts/sleep.lua` + +4. Either download [sleep.lua](https://urlcom) on **mobile** to `Android/media/is.xyz.mpv/scripts/` + + or on **PC ---> Android**, use [adb](https://url.com). + + ``` + $: adb push sleep.lua /storage/emulated/0/Android/media/is.xyz.mpv/scripts/ + ``` diff --git a/lua/sleep.lua b/lua/sleep.lua new file mode 100644 index 0000000..bba30f2 --- /dev/null +++ b/lua/sleep.lua @@ -0,0 +1,11 @@ +local function set_brightness() + mp.set_property_number("brightness", -50) + mp.commandv("seek", "20", "relative") +end + +local function init() + mp.set_property_bool("pause", true) +end + +mp.add_key_binding(nil, "test", set_brightness) +init() |