Coder Social home page Coder Social logo

megalock's Introduction

megalock: X11 xlock replacement

This currently is a substrate for a minimal xlock replacement in Rust. It is only functional with X11, but performs the following functions:

  • Blanks the entire screen regardless of monitor configuration
  • Grabs the keyboard and pointing devices
  • Buffers all input into a password
    • Backspace removes the previously entered characters, walking back to the beginning of the buffer
  • Upon pressing enter, verifies that password
    • On success, the program exits
    • On failure, the program clears the password field and continues
  • Performs all password checking through PAM
  • Additionally, the following environment variables are respected:
    • TRACE=1: Enable Trace (lowest) level debugging; includes passwords in plain text
    • DEBUG=1: Enable Debug level logging -- most status changes, but no raw data
    • EXIT_TRAP=n: Forcefully terminate the program after n seconds

It performs no indication of events while displaying the lock screen. This is being worked on now.

Events are all synthetic, which are then translated to X11 calls in a dedicated thread. This should allow for easy porting to wayland later without breaking the X11 contract, allowing megalock to work with both systems natively.

Optimized binary size is about 730k, which was a nice discovery. We'll see if that sticks.

Installation

cargo install megalock

Debian and RedHat packages will come soon!

PAM configuration

If you use megalock, be sure to put contrib/megalock in /etc/pam.d so that megalock can use the PAM subsystem effectively. megalock may not work on OpenBSD.

Thanks

Special thanks to Michael Stapelberg, who wrote i3lock, I spent a lot of time reading it while learning how to write this program.

Author

Erik Hollensbe [email protected]

License

MIT

megalock's People

Contributors

erikh avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.