GithubHelp home page GithubHelp logo

lhkd's Introduction

LockscreenHotKeyDaemon

This software is a (very rudimentary) hotkey daemon for X11, i.e. a tool to execute a command whenever a certain key combination is pressed. The difference to various other hotkey daemons (and probably your window manager) is that it is designed to work even when your screen is locked.

Warnings

Having active hotkeys when your screen is locked has obvious security implications. Some of them are:

  • If the command executing at a keypress allows an attacker to do bad things, he can do bad things. D'Uh. Things to specifically keep in mind:
    • If a command starts a program that opens a window, that window might open in front of your screen locker. This is highly dependent on the way your screen locker locks the screen and might be non-deterministic.
  • This is alpha software. I have only tested it with i3lock. It might behave badly with other screen lockers (tested it with another screen locker? Let me know!)
  • The way lhkd grabs keys may conflict with the way your screen locker grabs the keys. Especially if both try to listen for the same key combination, race conditions will occur, and bad things could happen.

The takeaway: Please don't use this software on security-sensitive workstations. You have been warned.

Features

LockscreenHotKeyDaemon …

  • runs commands at the press of a hotkey (combination) even while your screen locker is active
  • is able to distinguish between different keyboards. Personally, I have a second numblock keyboard next to my main keyboard, which I use solely for hotkeys.

Building

You will need the headers for libX11, libXi and libxkb as well as a compiler supporting C++11 and cmake. Having this, building should be as easy as:

mkdir build
cd build
cmake ..
make

Usage

You need to start lhkd with a JSON config file. Currently, the only required configuration is a mapping of key combinations to commands. Look at example.json for an example. The key modifiers currently available are:

  • meta
  • alt
  • ctrl
  • shift
  • super (The "windows" key on non-Mac systems)

Optionally, you can assign keyboard numbers to your keyboards, and have certain hotkeys only listen to certain keyboards. Again, see example.json for an example.

License

lhkd is released under MIT license. See License.txt for details. The JSON parser is taken from https://github.com/nlohmann/json and also available under MIT license.

lhkd's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

lhkd's Issues

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.