From 76e6e43300ec3f3a9261268e1a720e9b7333d0d0 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 4 Jan 2024 21:51:26 +0530 Subject: [PATCH] stop waydroid session before sleep --- home/wm/addon/swayidle.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 = [