summaryrefslogtreecommitdiff
path: root/lua/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/main.lua')
-rw-r--r--lua/main.lua12
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")