From dc75076a582d3f4f3d33af82e0c2df7ba3ea7d1e Mon Sep 17 00:00:00 2001 From: kencx Date: Fri, 23 Feb 2024 09:46:48 +0800 Subject: [PATCH] Minor edits --- README.md | 2 +- content/posts/sxhkd-watcher/index.md | 14 ++++++++------ content/projects.md | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a23be599..99c0d3e2 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/content/posts/sxhkd-watcher/index.md b/content/posts/sxhkd-watcher/index.md index 03fd6557..d5a4affa 100644 --- a/content/posts/sxhkd-watcher/index.md +++ b/content/posts/sxhkd-watcher/index.md @@ -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 @@ -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 diff --git a/content/projects.md b/content/projects.md index 981fdd92..1ae1d4ca 100644 --- a/content/projects.md +++ b/content/projects.md @@ -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