stop waydroid session before sleep

This commit is contained in:
Adithya 2024-01-04 21:51:26 +05:30
parent eb801c9096
commit 76e6e43300
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -1,7 +1,9 @@
{ config, ... }: { lib, pkgs, config, osConfig, ... }:
let let
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
waydroid = "${pkgs.waydroid}/bin/waydroid";
waydroidEnabled = osConfig.virtualisation.waydroid.enable;
in in
{ {
services.swayidle = { services.swayidle = {
@ -10,7 +12,7 @@ in
events = [ events = [
{ {
event = "before-sleep"; event = "before-sleep";
command = "${swaylock} -f -i /tmp/wallpaper.jpg"; command = "${lib.optionalString waydroidEnabled "${waydroid} session stop; "}${swaylock} -f -i /tmp/wallpaper.jpg";
} }
]; ];
timeouts = [ timeouts = [