Skip to content

Commit

Permalink
Minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
kencx committed Feb 23, 2024
1 parent d503b55 commit dc75076
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Source
Source for [blog](https://ken.cheo.dev). Hosted on Hetzner behind Nginx.
Source for [blog](https://ken.cheo.dev). Hosted on Hetzner behind Caddy.

## New Content
To quickly create new content, use the following `hugo new` commands.
Expand Down
14 changes: 8 additions & 6 deletions content/posts/sxhkd-watcher/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ super + p : super + {h,j,k,l}

One issue with this workflow is that there is no visual indicator for the
current activated "mode"; Vim has its status line to tell the user whether they
are in `NORMAL`, `INSERT` or `VISUAL` mode.
are in `NORMAL`, `INSERT` or `VISUAL` mode, but sxhkd has nothing since this is
a custom solution.

I often forget to leave the mode I had temporarily enabled, leading to
accidental executions of random commands, which can be extremely frustrating.

Thankfully, I discovered that `sxhkd` can output status information via a named
pipe with the `-s` flag. We can poll this output with a watcher script and pair
it with our bar of choice (`eww` for me) to show a visual indicator of the
current sxhkd mode.
After some research, I discovered that `sxhkd` can output status information via
a named pipe with the `-s` flag. We can poll this output with a watcher script
and pair it with our bar of choice (`eww` for me) to show a visual indicator of
the current sxhkd mode.

## Implementation

Expand Down Expand Up @@ -92,7 +93,8 @@ information, we can create a watcher script that reads from the named pipe and
runs a custom command based on the output.

For example, I would like to show that "node mode" is activated when `Hsuper +
n` is pressed and deactivated when `EEnd chain` is outputted.
n` is outputted and deactivated when `EEnd chain` is outputted. This can be done
with a switch-case statement in Bash:

```bash
#!/bin/bash
Expand Down
2 changes: 2 additions & 0 deletions content/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Nomad, Consul and Vault cluster hosted on Proxmox
Lightweight, fully customizable hotkey cheatsheet in the terminal
- [sxkcd](https://github.com/kencx/sxkcd) -
Full-text search engine for xkcd built with Go and Redis
- [vps](https://github.com/kencx/vps) - The infrastructure as code that hosts
this blog and other stuff

## Proof of Work

Expand Down

0 comments on commit dc75076

Please sign in to comment.