From 16fb12c35ea3a89d3f35c7725e04994e93a407a3 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 1 Jan 2025 17:41:01 -0800 Subject: added gitignore --- .gitignore | 1 + README.md | 37 ++++++++++++++++++++++++++++++++++++- lua/sleep.lua | 11 +++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 lua/sleep.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..02e8202 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +push.sh diff --git a/README.md b/README.md index b1b7161..9d1fdf6 100644 --- a/README.md +++ b/README.md @@ -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

+ + + + + +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() -- cgit v1.2.3