-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
print("Loading idle_config.lua") | ||
IdleNotifier:log("Loading idle_config.lua") | ||
|
||
function LockScreen() | ||
IdleNotifier:log("Locking Screen") | ||
IdleNotifier:run_once("swaylock -f") | ||
end | ||
|
||
function DpmsOn() | ||
IdleNotifier:log("Turning screen on") | ||
IdleNotifier:run_once("swaymsg output '*' dpms on") | ||
end | ||
|
||
function DpmsOff() | ||
IdleNotifier:log("Turning screen off") | ||
IdleNotifier:run_once("swaymsg output '*' dpms off") | ||
end | ||
|
||
function ScreenLockBattery(event) | ||
if event == "idled" then | ||
print("Locking Screen") | ||
IdleNotifier:run_once("swaylock -f") | ||
LockScreen() | ||
end | ||
end | ||
|
||
function ScreenDpmsBattery(event) | ||
if event == "idled" then | ||
print("Turning screen off") | ||
IdleNotifier:run_once("swaymsg output '*' dpms off") | ||
DpmsOff() | ||
elseif event == "resumed" then | ||
print("Turning screen on") | ||
IdleNotifier:run_once("swaymsg output '*' dpms on") | ||
DpmsOn() | ||
end | ||
end | ||
|
||
function ScreenLockAC(event) | ||
if event == "idled" then | ||
print("Locking Screen") | ||
IdleNotifier:run_once("swaylock -f") | ||
LockScreen() | ||
end | ||
end | ||
|
||
function ScreenDpmsAC(event) | ||
if event == "idled" then | ||
print("Turning screen off") | ||
IdleNotifier:run_once("swaymsg output '*' dpms off") | ||
DpmsOff() | ||
elseif event == "resumed" then | ||
print("Turning screen on") | ||
IdleNotifier:run_once("swaymsg output '*' dpms on") | ||
DpmsOn() | ||
end | ||
end | ||
|
||
|
||
IdleNotifier:get_notification(30, "ScreenLockBattery") | ||
IdleNotifier:get_notification(10, "ScreenDpmsAC") | ||
IdleNotifier:get_notification(10, "ScreenDpmsBattery") | ||
IdleNotifier:get_notification(600, "ScreenLockAC") | ||
IdleNotifier:get_notification(1200, "ScreenDpmsAC") | ||
|
||
print("Finished loading idle_config.lua") | ||
IdleNotifier:log("Finished loading idle_config.lua") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters