Closed mathstuf closed 6 years ago
Ah yes, that's true. I'm usually lazy enough to ignore the return code since I'd have to use either panic (which I want to avoid) or a wrapper function like do_main
. It'd be easier if std::env::set_exit_status
wasn't removed.
Ah. My thought was more along the lines of that if this is to replace xautolock
for me, it is run via systemd
and exit codes are important there :) .
I see. Mind sharing your systemd service file? I'm curious :)
xautolock.service
[Unit]
Description=Screen Auto-Locking Service
Requires=xorg.target
After=xorg.target
Requires=xrdb.service
After=xrdb.service
[Service]
ExecStart=/usr/bin/xautolock -detectsleep -noclose
ExecReload=/usr/bin/xautolock -restart
ExecStop=/usr/bin/xautolock -exit
Restart=on-failure
[Install]
WantedBy=x11-standard.target
xrdb block for xautolock
:
Xautolock.corners: 0-+0
Xautolock.cornerdelay: 5
Xautolock.cornerredelay: 15
Xautolock.time: 5
Xautolock.locker: systemctl --user start xlock@5.service
Xautolock.nowlocker: systemctl --user start xlock.service
Xautolock.killtime: 30
Xautolock.killer: /home/boeckb/.local/bin/wm-sleep-dbus
Xautolock.notify: 25
!Xautolock.notifier: /home/boeckb/.local/bin/wm-sleep-notify
Xautolock.resetsaver: on
xlock.service
:
[Unit]
Description=Screen Locking Service
Requires=xorg.target
After=xorg.target
After=xrdb.service
After=xautolock.service
Requires=xautolock.service
BindsTo=xlock.target
[Service]
Type=simple
ExecStart=/usr/bin/xlock
[Install]
WantedBy=x11-lock.target
xlock@.service
:
[Unit]
Description=Screen Locking Service with %i second delay
Requires=xorg.target
After=xorg.target
After=xrdb.service
After=xautolock.service
Requires=xautolock.service
BindsTo=xlock.target
[Service]
Type=simple
ExecStart=/usr/bin/xlock -lockdelay %i
[Install]
WantedBy=x11-lock.target
The return code should indicate that things went wrong.