Commit Graph

64 Commits

Author SHA1 Message Date
8e66dc234e Set minimum screen brightness level to 1, not 0 2024-10-06 22:23:56 -07:00
2239788f86 Update all dependencies 2024-10-06 22:23:56 -07:00
d0df73a9c7 Make sure build is re-run if HELPER_DIR changes 2024-08-02 10:46:29 -07:00
ae2f100b38 Ensure gtk apps only run on X11 2023-09-25 12:00:42 -07:00
3c48ab1c7f Update dependencies 2023-09-25 12:00:42 -07:00
9bbf6db11c Add backlight udev rules file 2023-01-24 14:19:06 -08:00
742ff7b92c Add sysfs fallback for screen brightness
Some drivers/displays don't support the xbacklight stuff, so fall back
to sysfs if needed.  This usually will require some extra permissions
setup on the user's part.
2022-09-06 18:13:04 -07:00
1ace254163 Use 'cargo deb' to build Debian package 2022-08-16 00:09:40 -07:00
4c8ffbab6a Disable/reenable DPMS when inhibiting 2022-08-15 22:54:54 -07:00
0ef979549a Update deps 2022-08-15 22:53:45 -07:00
d7a7d57ccd Hackily retry keyboard/pointer grabs if they fail
When using a global key combo to lock the screen, often the WM (or
whatever) will still have an active grab on the keyboard by the time we
try to get our own grab.
2022-08-14 22:54:24 -07:00
ab543afcbc Remove some Debian deps
We don't actually depend on libxcb-randr or libxcb-xfixes, because the
Rust xcb crate implements extensions by autogenerating XCB message
structs, and then using the main libxcb message sending functions (not
the C functions in each extension library) to send the requests.
2022-08-14 22:31:38 -07:00
49394b3e53 Use PAM properly, which allows us to handle other auth types
Previously I was just presenting a static username/password box, and
then running PAM with pre-set credentials.  This works just fine when
PAM is expecting a username and password, but if it's expecting
something like a fingerprint scan or a hardware security token, this
wouldn't entirely work right.  Well, it would "work", but the
username/password dialog would be displayed, and then hitting "Unlock"
would start a different auth process with no visible feedback as to
what's supposed to happen.

This also means I need to switch PAM wrapper crates; the one I was using
before did not allow passing a fixed username to the underlying
pam_start() call, which meant that PAM would try to prompt the user for
it, which is not what we want.
2022-08-14 22:31:38 -07:00
7d05bcb0d5 Don't recreate monitors when we get a spurious randr notify
Sometimes we get notifications from randr of changes where the new setup
is exactly like the old.  The main annoying time this happens is when
the system resumes from suspend.  This is probably why there's often a
flash of the desktop right after resuming: we're destroying the old
blanker windows and creating new ones, even though the setup is exactly
the same.
2022-06-14 19:37:32 -07:00
d3de9f7fad Be more aggressive about handling user activity
Previously we only trigger unblanking or showing the unlock dialog if
core key or motion events come through.  Now we also do this when xinput
events come in.  We also now reset the last-user-activity time for core
events.

This also changes xcb-xembed to explicitly only handle core events.
2022-06-08 15:22:09 -07:00
b0c2ffc74a Drop unneeded dependency on 'x11' from locker 2022-05-30 18:57:28 -07:00
28bcbd2ab0 Don't consider dialog as still running if wait() fails
I'm not sure if we can trust the state of things if the wait() call
actually fails (as in, the call itself returns an error), so let's just
let the dialog die and hope that if there's more user activity it'll
start up again properly.
2022-05-30 18:44:49 -07:00
5405d3081e Increase dialog exit status parsing safety in the locker
This also stops using -1 as auth failed, and moves all failure statuses
to positive numbers.  It looks like Exiting with -1 ends up setting the
status to 255 on exit, but then in the locker, it sees this as 255 and
not -1, since things get coerced into 32-bit integers.
2022-05-30 18:43:29 -07:00
057eaf7c85 Ensure we don't exit successfully if the main loop exits
We never quit the main loop, but if something odd happens that causes it
to quit outside our control, ensure that we don't return the "auth
success" status code.
2022-05-30 17:48:49 -07:00
32cb674e7a Codify dialog exit statuses and make them less error-prone 2022-05-30 17:47:56 -07:00
762fdc3912 Use clone!() macro instead of Rc 2022-05-30 17:30:29 -07:00
f0bbc9d982 Show auth is happening after clicking Unlock
Changes the auth failed label into an auth status label, and prints a
dot once every half second while authenticating.

Also reduces the post-auth-failed pause to 1 second; 2 seconds is longer
than it seems.
2022-05-30 17:27:43 -07:00
50a5e94307 Some low-effort visibility hygiene 2022-05-27 18:38:30 -07:00
8657bc249c Stop threading the xcb connection everywhere
Easier to just store a reference to it in the structs.
2022-05-27 18:35:38 -07:00
761b906fb7 Split Monitor detection/creation 2022-05-27 18:16:02 -07:00
e89b6cb604 Make monitor resource freeing better 2022-05-27 18:11:20 -07:00
a516a25a9f Use regular X11 rather than XFIXES to hide cursor
The semantics of the XFIXES cursor hide deal are annoying and make
things harder.
2022-05-27 18:05:55 -07:00
344907f55a Avoid unmatched ShowCursor/HideCursor requests 2022-05-24 20:32:15 -07:00
63a176c26e Major refactor of locker
Moves the meat of the screensaver into its own file, and separates out
the subservice stuff.
2022-05-24 19:52:21 -07:00
611e3b8dd0 Use constants in settings rather than hard-coded strings 2022-05-23 20:33:14 -07:00
45b5b7fc96 Fix inconsistency in the example config 2022-05-23 20:32:12 -07:00
8eb8dfac2e Refactor a bit and add backlight brightness keys handling
This will only work if the video driver supports the xrandr backlight
property.  It's possible only Intel does this...
2022-05-23 20:27:59 -07:00
6e5dfabcfd Add TODO file 2022-05-23 15:24:14 -07:00
16f88fca5a Add readme 2022-05-22 13:04:13 -07:00
c3166f0b9c Don't forward enter or escape to unlock window on first event
If the user presses enter or escape in order to get the unlock dialog to
show in the first place, forwarding that event to the dialog will only
cause it to close immediately.

Also took the opportunity to clean up the dependencies where I have my
own patches.  I'm now using the cargo 'patch' section so that the
dependencies specified in the individual Cargo.toml files are clean.
2022-05-17 19:56:34 -07:00
9e266894df Fix restart and exit commands not returning replies 2022-05-15 22:04:13 -07:00
dda1a53856 Make the new login button stuff more automatic
By default it'll look at your environment to try to figure out which
display manager is used in order to start a new session.  We first try
the org.freedesktop.DisplayManager dbus interface, and if that fails,
inspect XDG_SESSION_DESKTOP to try to figure out which display manager
is running.

The user can also still specify the correct display manager, or a custom
command.
2022-05-15 20:50:45 -07:00
99ffa88657 Add "auth failed" message to unlock dialog 2022-05-14 18:19:11 -07:00
8394d45d1a Have remote commands return a success/failure message 2022-05-14 17:48:34 -07:00
aafe026092 Make debian package building work
I gave up on getting it to build on bullseye, as its cargo/rustc is too
old for the 2021 edition.  Building newer deb packages of rust is
apparently a difficult, manual process.  I tried installing rustup and
pulling the latest compiler, but that failed with strange errors that I
am tired of debugging.
2022-05-14 00:17:50 -07:00
b63de1d416 Fix another typo in makefile 2022-05-14 00:17:50 -07:00
f6c1020535 Remove the need for rust nightly
My pidfd implmentation is simple enough, and Option.contains() is not
worth requiring nightly.
2022-05-14 00:17:50 -07:00
7e18b87707 Fix typo in DESTDIR in makefile 2022-05-14 00:17:50 -07:00
992f32330c Hide mouse pointer when blanked 2022-05-14 00:17:50 -07:00
cab7d4bfe5 Do xrandr version check on init 2022-05-14 00:17:50 -07:00
64dc809295 Properly init xfixes extension 2022-05-14 00:17:50 -07:00
e588988254 Fix pointer-to-monitor location code 2022-05-14 00:17:50 -07:00
df81c14871 Add debian packaging files
This doesn't quite work, since the debuild stuff refuses to see the
rustup-installed cargo/rustc, which is required for our build.
2022-05-14 00:17:50 -07:00
712467f433 Improve makefile, add autogenerated manpages 2022-05-14 00:17:50 -07:00
050bf5cbac Support more versions of glib and gtk 2022-05-14 00:17:50 -07:00