You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Betterlockscreen:4.2.0
- i3lock-color:2.13.c.5
- ImageMagick:7.1.1-25
- dunst (if used):Version in NixOS repo
- feh (if used):Version in NixOS repo
Bug description
Even after translating the systemctl service to a version that works with NixOS I cant get sleep/suspend to work and trigger the lock screen. It is complaining of not getting authorization. Below is my configuration.nix for the systemd service and for my installed apps:
# Set the X11 config.
services.xserver = {
enable = true;
windowManager.awesome.enable = true;
videoDrivers = ["nvidia"];
libinput.mouse.accelProfile = "flat";
displayManager.gdm.enable = true;
xautolock = {
enable = true;
time = 1; # You can adjust this value according to your needs
locker = "${pkgs.betterlockscreen}/bin/betterlockscreen --lock";
};
};
# Custom Systemd setup.
systemd.services = {
"betterlockscreen@" = {
description = "Lock screen when going to sleep/suspend";
wantedBy = [ "sleep.target" "suspend.target" ];
before = [ "sleep.target" "suspend.target" ];
serviceConfig = {
Type = "simple";
Environment = "DISPLAY=:0";
ExecStart = "${pkgs.betterlockscreen}/bin/betterlockscreen --lock --blur";
ExecStartPost = "${pkgs.coreutils}/bin/sleep 1";
TimeoutSec = "infinity";
};
};
xss-lock = {
description = "xss-lock integration";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.xss-lock}/bin/xss-lock -- ${pkgs.betterlockscreen}/bin/betterlockscreen --lock";
Restart = "always";
};
};
};
# Relevant installed apps
environment.systemPackages = with pkgs; [
dbus
i3lock-color
xss-lock
betterlockscreen
feh
dunst
];
This could be something about my config, but from everything I found on making custom systemd services in NixOS this should work.
Steps to reproduce
Use the relevant parts of my configuration.nix
Rebuild and reboot
Try to hibernate, sleep, or suspend
It wont work
If you try to start it manually it will start and work as expected, say for another bug where even with package.loaded["naughty.dbus"] = {} in AwesomeWM it will complain Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. and take a long time to run.
Relevant log output
systemctl status betterlockscreen@$USER
○ betterlockscreen@daniel.service - Lock screen when going to sleep/suspend
Loaded: loaded (/etc/systemd/system/betterlockscreen@.service; static)
Active: inactive (dead)
Jan 24 12:11:15 danielpc betterlockscreen[4316]: -h, --help display this help and exit
Jan 24 12:11:15 danielpc betterlockscreen[4316]: -V, --version output version information and exit
Jan 24 12:11:15 danielpc betterlockscreen[4316]: For more details see pgrep(1).
Jan 24 12:11:15 danielpc betterlockscreen[4299]: [*] Running prelock...
Jan 24 12:11:15 danielpc betterlockscreen[4299]: [*] Locking screen... (FAILSAFE MODE)
Jan 24 12:11:15 danielpc betterlockscreen[4317]: Authorization required, but no authorization protocol specified
Jan 24 12:11:15 danielpc betterlockscreen[4317]: i3lock-color: Could not connect to X11, maybe you need to set DISPLAY?
Jan 24 12:11:15 danielpc betterlockscreen[4299]: [*] Running postlock...
Jan 24 12:11:16 danielpc systemd[1]: betterlockscreen@daniel.service: Deactivated successfully.
Jan 24 12:11:16 danielpc systemd[1]: Started Lock screen when going to sleep/suspend.
The text was updated successfully, but these errors were encountered:
Update: I got it to half work with xss-lock, now it will lock on all the events as xss-lock is calling it. But this is still a half work as there is a massive delay in the time it takes to lock. I think it is related to part B of the NixOS bugs where even with package.loaded["naughty.dbus"] = {} in AwesomeWM rc.lua it will complain:
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. Failed to communicate with dunst, is it running? Or maybe the version is outdated. You can try 'dunstctl debug' as a next debugging step.
and take a long time to run. I know that dunst must be running as dunstify "test" makes a popup, so I dont know why betterlockscreen cant see it.
Is there an existing issue for this?
Operating system
NixOS Stable 23.11
Installation method
Package Manager (from OS)
Betterlockscreen & Dependency-Versions
Bug description
Even after translating the systemctl service to a version that works with NixOS I cant get sleep/suspend to work and trigger the lock screen. It is complaining of not getting authorization. Below is my configuration.nix for the systemd service and for my installed apps:
This could be something about my config, but from everything I found on making custom systemd services in NixOS this should work.
Steps to reproduce
package.loaded["naughty.dbus"] = {}
in AwesomeWM it will complainError org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
and take a long time to run.Relevant log output
The text was updated successfully, but these errors were encountered: