diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-03-20 13:42:03 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-03-20 13:42:03 +1100 |
| commit | 51dfb5b3e30caf823c2355ff957c01864f35f9f6 (patch) | |
| tree | 1f0e41397259c6e206aba136ad5070b9de30e1b1 /lua/main.lua | |
| parent | 170c23b832eed6dad2b118e50164464cc93e5c4c (diff) | |
| parent | a05d93a1e26181237a76da5ce398c6b08497d591 (diff) | |
| download | tangara-fw-51dfb5b3e30caf823c2355ff957c01864f35f9f6.tar.gz | |
Merge branch 'main' into themes
Diffstat (limited to 'lua/main.lua')
| -rw-r--r-- | lua/main.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lua/main.lua b/lua/main.lua index 291f524e..d84e2417 100644 --- a/lua/main.lua +++ b/lua/main.lua @@ -33,6 +33,18 @@ GLOBAL_BINDINGS = { container:center() end) end), + -- When the device has been locked for a while, default to showing the now + -- playing screen after unlocking. + controls.lock_switch:bind(function(locked) + if locked then + lock_time = time.ticks() + elseif time.ticks() - lock_time > 8000 then + local queue = require("queue") + if queue.size:get() > 0 then + require("playing"):pushIfNotShown() + end + end + end), } local theme_dark = require("theme_dark") |
