sxmo: reduce the screenoff LED frequency 2s -> 5s

this should hopefully allow entering sleep more reliably
This commit is contained in:
Colin 2023-10-11 02:05:55 +00:00
parent c3d0b6b486
commit 5a753583bf
2 changed files with 32 additions and 4 deletions

View File

@ -70,8 +70,8 @@ let
hookPkgs = {
inputhandler = pkgs.static-nix-shell.mkBash {
pname = "sxmo_hook_inputhandler.sh";
src = ./hooks;
pkgs = [ "coreutils" ];
src = ./hooks;
};
postwake = pkgs.static-nix-shell.mkBash {
pname = "sxmo_hook_postwake.sh";
@ -80,18 +80,23 @@ let
};
rotate = pkgs.static-nix-shell.mkBash {
pname = "sxmo_hook_rotate.sh";
src = ./hooks;
pkgs = [ "sway" ];
src = ./hooks;
};
screenoff = pkgs.static-nix-shell.mkBash {
pname = "sxmo_hook_screenoff.sh";
pkgs = [ "sway" ];
src = ./hooks;
};
start = pkgs.static-nix-shell.mkBash {
pname = "sxmo_hook_start.sh";
src = ./hooks;
pkgs = [ "systemd" "xdg-user-dirs" ];
src = ./hooks;
};
suspend = pkgs.static-nix-shell.mkBash {
pname = "sxmo_suspend.sh";
src = ./hooks;
pkgs = [ "coreutils" "rtl8723cs-wowlan" "time" "util-linux" ];
src = ./hooks;
};
};
in
@ -183,6 +188,7 @@ in
"sxmo_hook_inputhandler.sh" = "${hookPkgs.inputhandler}/bin/sxmo_hook_inputhandler.sh";
"sxmo_hook_postwake.sh" = "${hookPkgs.postwake}/bin/sxmo_hook_postwake.sh";
"sxmo_hook_rotate.sh" = "${hookPkgs.rotate}/bin/sxmo_hook_rotate.sh";
"sxmo_hook_screenoff.sh" = "${hookPkgs.screenoff}/bin/sxmo_hook_screenoff.sh";
"sxmo_hook_start.sh" = "${hookPkgs.start}/bin/sxmo_hook_start.sh";
"sxmo_suspend.sh" = "${hookPkgs.suspend}/bin/sxmo_suspend.sh";
};

View File

@ -0,0 +1,22 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p sway
# this hook is mostly identical to default sxmo_hook_screenoff.sh except:
# - the LED frequency is adjusted from its default of "blink every 2s"
# - dwm-specific bits are removed
BLINK_FREQ=5
swaymsg mode default
sxmo_wm.sh dpms on
sxmo_wm.sh inputevent touchscreen off
sxmo_daemons.sh start periodic_blink sxmo_run_periodically.sh "$BLINK_FREQ" sxmo_led.sh blink red blue
wait
# avoid immediate suspension. particularly, ensure that we get at least one blink in
sxmo_wakelock.sh lock sxmo_hold_a_bit "$BLINK_FREQ"s
sxmo_wakelock.sh unlock sxmo_not_screenoff