Commit Briefs

aedcc73698 Brett Fisher

Makefile: Start preparing for compiling bxhkd with cproc. (main)

- Add -std=c11 and -pedantic to CFLAGS


7d97a97917 Brett Fisher

Makefile: Add man page install and uninstall.


d3cbf80c83 Brett Fisher

bxhkd.c: Reorder functions and add comments

- Edit existing comments for brevity and readability - Organize forward function declarations based on function purpose - Reorder functions to match order in forward declarations


e79c0991d9 Brett Fisher

bxhkd.1: Initial commit.


44dbec001e Brett Fisher

README.md: Initial commit.


9354c05637 Brett Fisher

LICENSE.md: Add license.


de45136001 Brett Fisher

config.def.h: Reorder hotkeys.


f27627444f Brett Fisher

config.def.h: Add local flag to Hotkey struct for command dispatch.

- Add `local` field to Hotkey to distinguish between commands executed locally by bxhkd (spawn) and commands sent to bxwm over the socket (send_cmd). - Replace abstract labels like "spawn_terminal" with actual program names ("st", "st -e launchprogram") so the command string is always the real thing to execute. - Route "quit" to bxwm via socket (local=0) rather than attempting local exec.


6a492bc4c5 Brett Fisher

bxhkd.c: Implement command dispatch and harden socket logic.

- Add dispatch logic in keypress() to route local commands to spawn() and socket commands to send_cmd(), using the local flag from theHotkey struct. - Fix -Wsign-compare warning by changing loop variable to size_t. - Add NULL check on getenv("HOME") in send_cmd(). - Mark send_cmd parameter as const. - Replace hardcoded socket path with SOCKET_SUFFIX macro.


9b45b37e89 Brett Fisher

bxhkd.c:

- Add comments - Add missing semi-colon in send_cmd() forward declaration - Add functions to forward declarations - Move main() from last position in functions to first position - Consistent with main() first in other basix X programs


Branches

Tags

This repository contains no tags

Tree

.gitignorecommits | blame
LICENSE.mdcommits | blame
Makefilecommits | blame
README.mdcommits | blame
bxhkd.1commits | blame
bxhkd.ccommits | blame
config.def.hcommits | blame

README.md

# bxhkd

A very basix X hotkey daemon, a.k.a Brett's X hotkey daemon.

## Doing One Thing and Doing It Well

Modern window managers, even popular _minimalist_ ones, have bloat in  
in their codebases from bundling extraneous features into a single  
binary. Just my opinion.

I chose a different path. __bxhkd__ is an independent, modular  
companion to my primary window manager, __bxwm__. By offloading key  
handling management, I ensure that both the window manager and the  
hotkey daemon remain focused, llightweight, and easily maintainable.

__bxhkd__ isn't just about managing keys. This hotkey daemon  
is another project I am using for transitioning from writing shell  
scripts for automating workflow to writing robust C that prioritizes  
minimal runtime overhead, adherence to the Unix philosophy, and clean, 
 readable API design.

## Build

Compile __bxhkd__ from source.

```
make
```

## Install

Install the binary and man page. Note that root privileges are not  
required as the default desination is `~/.local/`.

```
make install
```

## Uninstall

Remove the binary and man page.

```
make uninstall
```

## Configuration

__bxhkd__ is configured at compile-time by editing config.def.h. After  
making changes, the program must be recompiled and reinstalled. See  
bxhkd(1) for details.

## Design & Functionality

__bxhkd__ operates as a background daemon that interfaces directly with  
the X11 window system.

  - Input Processing
    - Maps X11 key-events to command strings defined in config.def.h
  - Open a New Window
    - Open a window running st, simple terminal
    - Open a window running the author's launcher script
    - Users should change these per their own preferences
  - Focus, Move, and Resize A Window
    - Centered horizontally, full height
    - Left half
    - Right half
    - Maximized
    - Small, centered horizontally and vertically
  - Workspaces
    - Move windows to a specific workspace
    - Navigate to a specific workspace
  - Close Focused Window

Add the following lines to `~/.xinitrc` to start __bxhkd__.

```
exec bxhkd 2> ~/.local/var/log/bxhkd.log &
```