diff --git a/home/wm/addon/swayidle.nix b/home/wm/addon/swayidle.nix index aac2a08..1ce7a15 100644 --- a/home/wm/addon/swayidle.nix +++ b/home/wm/addon/swayidle.nix @@ -1,7 +1,9 @@ -{ config, ... }: +{ lib, pkgs, config, osConfig, ... }: let - swaylock = "${config.programs.swaylock.package}/bin/swaylock"; 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 { services.swayidle = { @@ -10,7 +12,7 @@ in events = [ { event = "before-sleep"; - command = "${swaylock} -f -i /tmp/wallpaper.jpg"; + command = "${lib.optionalString waydroidEnabled "${waydroid} session stop; "}${swaylock} -f -i /tmp/wallpaper.jpg"; } ]; timeouts = [