jovanlanik / gtklock

GTK-based lockscreen for Wayland
GNU General Public License v3.0
318 stars 20 forks source link

--lock-command executes before the locker fully starts #99

Open Jozhin-s-Bazhin opened 2 months ago

Jozhin-s-Bazhin commented 2 months ago

I was using the -L flag in the context of a systemd service like this

  systemd.services.lockBeforeSleep = {
    enable = true;
    description = "Lock the screen before sleeping";
    before = [ "sleep.target" ];
    wantedBy = [ "sleep.target" ];
    serviceConfig = {
      Type = "notify";
      NotifyAccess = "all";
      User = username;
      ExecStart = "${pkgs.writeScriptBin "lockBeforeSleep" ''
#!/run/current-system/sw/bin/bash

# Environment variables for gtklock
export XDG_RUNTIME_DIR="/run/user/$(loginctl list-sessions | ${pkgs.gawk}/bin/awk 'NR==2 {print $2}')"
export WAYLAND_DISPLAY="wayland-$(loginctl list-sessions | ${pkgs.gawk}/bin/awk 'NR==2 {print $1}')"

${pkgs.gtklock}/bin/gtklock -L "systemd-notify --ready"
      ''}/bin/lockBeforeSleep";
    };
  };

and expected that the command would be run when the locker is ready to sleep but this doesn't seem to be the case. Is this intended behaviour?

jovanlanik commented 2 months ago

What version of gtklock are you on? On 2.x.x this is intended behaviour but 3.x.x should only execute the command after the windows are created and the screen is locked.

Jozhin-s-Bazhin commented 2 months ago

I am on v3.0.0

Jozhin-s-Bazhin commented 1 month ago

I think the issue has to do with something weird going on in my service, not the timing of the command. Do you by any chance know where this comes from? AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

Jozhin-s-Bazhin commented 1 month ago

I fixed that but the issue remains. I think it is gtklock after all