From 17afdd47194da24b581075f01d678342c4b56f14 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 2 Jan 2025 13:13:11 -0800 Subject: a hello world --- README.md | 9 +++++++++ lua/sleep.lua | 12 +++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9d1fdf6..ff43750 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,12 @@ Key Codes (gestures): ``` $: adb push sleep.lua /storage/emulated/0/Android/media/is.xyz.mpv/scripts/ ``` + + +## ignore + diff --git a/lua/sleep.lua b/lua/sleep.lua index bba30f2..462e6e1 100644 --- a/lua/sleep.lua +++ b/lua/sleep.lua @@ -1,11 +1,13 @@ -local function set_brightness() - mp.set_property_number("brightness", -50) - mp.commandv("seek", "20", "relative") +-- this is executed when the user invokes it through gesturing +local function foo() + mp.osd_message("Hello World!", 2) end +-- this is called immediately upon opening a file local function init() - mp.set_property_bool("pause", true) + mp.msg.info("Sleep timer script initialized") + mp.osd_message("Sleep timer script initialized!", 3) end -mp.add_key_binding(nil, "test", set_brightness) +mp.add_key_binding(nil, "sleep", foo) init() -- cgit v1.2.3