Skip to content

Commit

Permalink
fix syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
fishman committed Nov 21, 2023
1 parent fce055c commit 6c5a760
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Important distinction between `Helpers:run` and `Helpers:run_once`. `run_once` w

Originally I wanted to reload the config whenever the AC adaptor is plugged in and out, but due to the timeout issue described below, you can check for the `on_battery` state in functions.

`````` lua
``` lua
Helpers:log("Loading idle_config.lua")

function LockScreen()
Expand All @@ -52,8 +52,8 @@ DbusHandler:PrepareSleep("LockScreen")
DbusHandler:LockHandler("LockHandler")
DbusHandler:UnlockHandler("UnlockHandler")
IdleNotifier:get_notification(300, "ScreenLockBattery")
```

``````
`get_notification` creates a Wayland idle timeout handler. It uses the `ext-idle-notify-v1` protocol. It is not (yet) possible to create callback functions, so the function calls are made by specifying the name of the function.

`PrepareSleep`, `LockScreen`, `UnlockScreen`, are dbus signals from the `org.freedesktop.logind.manager` and `org.freedesktop.logind.session`.
Expand Down
2 changes: 1 addition & 1 deletion lua_configs/idle_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ScreenDpmsBattery(event)
end

function ScreenLockAC(event)
if event == "idled" && not Helpers:on_battery() then
if event == "idled" and not Helpers:on_battery() then
LockScreen()
end
end
Expand Down

0 comments on commit 6c5a760

Please sign in to comment.