https://github.com/pegvin/mhkd
mini hotkey daemon
https://github.com/pegvin/mhkd
Last synced: 11 months ago
JSON representation
mini hotkey daemon
- Host: GitHub
- URL: https://github.com/pegvin/mhkd
- Owner: pegvin
- License: mit
- Created: 2023-07-22T17:31:08.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-18T14:24:49.000Z (about 2 years ago)
- Last Synced: 2025-06-11T23:05:43.089Z (12 months ago)
- Language: C
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mhkd - mini hotkey daemon
originally written by [Peter Hofmann](https://www.uninformativ.de/contact.html), mhkd is a fork of [nhkd](https://www.uninformativ.de/git/nhkd/)
---
## Installation
nhkd depends on `libx11` and expects to be run on a POSIX-ish operating system.
You must customize the program by creating your own config.h based on
config.def.h. In any case, config.h must exist in order to build the
program.
To build the program and install it to /usr/local:
```
$ make
# make install
```
## Running
Run it from your ~/.xinitrc:
```bash
while sleep 0.25; do mhkd; done &
```
The loop ensures that you can easily restart the daemon by killing it.
---
## My Personal Config
```bash
# ~/.xinitrc
mhkd &
```
```c
// config.h
#include
#include
bool debug_print_spawned_command = false;
struct MouseEvent mouse_events[] = {
{ 0, 0, 0, 0, NULL }
};
struct KeyEvent key_events[] = {
{ KeyPress, 0, XF86XK_AudioLowerVolume, "sh -c \"bash ~/.local/bin/volume down; bash ~/.local/bin/dwmbar once;\"" },
{ KeyPress, 0, XF86XK_AudioMute, "sh -c \"bash ~/.local/bin/volume toggle; bash ~/.local/bin/dwmbar once;\"" },
{ KeyPress, 0, XF86XK_AudioRaiseVolume, "sh -c \"bash ~/.local/bin/volume up; bash ~/.local/bin/dwmbar once;\"" },
{ KeyPress, 0, XK_Print, "sh -c \"bash ~/.local/bin/aunty capture;\"" },
{ 0, 0, 0, NULL }
};
```
My config is simple, it runs a command on volume up, down & mute, and calls a custom screenshot script.
---
# Thanks