Commit a5421ee31f12

Vincent Demeester <vincent@sbr.pm>
2026-02-25 16:42:46
feat(raffi): add text snippets and uid/timestamp script filter
Text snippets (keyword -> copies value to clipboard): - em: email addresses (file-based, private) - addr: physical addresses (file-based, private) - rh: Red Hat internal links (file-based, private) - lnk: frequently used links (inline, committed) - sig: git/email signatures and sign-offs (inline, committed) Script filter: - uid: generates UUIDs, epoch, ISO 8601, date, datetime Private snippet files stored in ~/.config/raffi/snippets/ (not committed).
1 parent 4309f04
Changed files (2)
dots
config
pkgs
my
scripts
dots/config/raffi/raffi.yaml
@@ -171,6 +171,10 @@ addons:
       command: shpool-raffi
       icon: utilities-terminal
       action: "kitty --title shpool:{value} shpool attach {value}"
+    - name: IDs & Timestamps
+      keyword: uid
+      command: uid-raffi
+      icon: clock
     - name: GitHub Pull Requests
       keyword: pr
       command: ~/src/gitlab.com/chmouel/alfred-pr-workflow/pr.py
@@ -178,6 +182,61 @@ addons:
       icon: github
       action: "xdg-open {value}"
       secondary_action: "echo -n {value} | wl-copy"
+  text_snippets:
+    - name: Emails
+      keyword: em
+      icon: email
+      file: "~/sync/raffi-snippets/emails.yaml"
+    - name: Addresses
+      keyword: addr
+      icon: contact
+      file: "~/sync/raffi-snippets/addresses.yaml"
+    - name: Red Hat
+      keyword: rh
+      icon: key
+      file: "~/sync/raffi-snippets/redhat.yaml"
+    - name: Links
+      keyword: lnk
+      icon: insert-link
+      snippets:
+        - name: "GitHub (vdemeester)"
+          value: "https://github.com/vdemeester"
+        - name: "GitHub PRs (review requested)"
+          value: "https://github.com/pulls/review-requested"
+        - name: "NixOS Search"
+          value: "https://search.nixos.org"
+        - name: "Nix PR Tracker"
+          value: "https://nixpk.gs/pr-tracker.html"
+        - name: "Home Manager Options"
+          value: "https://nix-community.github.io/home-manager/options.xhtml"
+        - name: "Jira Board"
+          value: "https://issues.redhat.com/secure/RapidBoard.jspa"
+        - name: "Prow (OpenShift CI)"
+          value: "https://prow.ci.openshift.org"
+    - name: Email Signatures
+      keyword: sig
+      icon: mail
+      file: "~/sync/raffi-snippets/signatures.yaml"
+    - name: Git Trailers
+      keyword: git
+      icon: git
+      snippets:
+        - name: "Signed-off-by"
+          value: "Signed-off-by: Vincent Demeester <vincent@sbr.pm>"
+        - name: "Signed-off-by (Red Hat)"
+          value: "Signed-off-by: Vincent Demeester <vdemeest@redhat.com>"
+        - name: "Acked-by"
+          value: "Acked-by: Vincent Demeester <vincent@sbr.pm>"
+        - name: "Reviewed-by"
+          value: "Reviewed-by: Vincent Demeester <vincent@sbr.pm>"
+        - name: "Tested-by"
+          value: "Tested-by: Vincent Demeester <vincent@sbr.pm>"
+        - name: "Co-authored-by"
+          value: "Co-authored-by: Vincent Demeester <vincent@sbr.pm>"
+        - name: "LGTM"
+          value: "Thanks for the contribution! LGTM."
+        - name: "WIP"
+          value: "[WIP] This is a work in progress, please do not merge yet."
   web_searches:
     - name: Google
       keyword: g
pkgs/my/scripts/bin/uid-raffi
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Generate UUIDs, timestamps, and other IDs for raffi script filter.
+# Outputs Alfred Script Filter JSON format.
+set -euo pipefail
+
+uuid=$(cat /proc/sys/kernel/random/uuid)
+uuid_short=$(echo "$uuid" | tr -d '-')
+ts_epoch=$(date +%s)
+ts_iso=$(date -u +%Y-%m-%dT%H:%M:%SZ)
+ts_date=$(date +%Y-%m-%d)
+ts_datetime=$(date "+%Y-%m-%d %H:%M:%S")
+
+jq -n --arg uuid "$uuid" \
+      --arg uuid_short "$uuid_short" \
+      --arg ts_epoch "$ts_epoch" \
+      --arg ts_iso "$ts_iso" \
+      --arg ts_date "$ts_date" \
+      --arg ts_datetime "$ts_datetime" \
+'{
+  "items": [
+    {"title": "UUID", "subtitle": $uuid, "arg": $uuid},
+    {"title": "UUID (no dashes)", "subtitle": $uuid_short, "arg": $uuid_short},
+    {"title": "Epoch", "subtitle": $ts_epoch, "arg": $ts_epoch},
+    {"title": "ISO 8601", "subtitle": $ts_iso, "arg": $ts_iso},
+    {"title": "Date", "subtitle": $ts_date, "arg": $ts_date},
+    {"title": "Date Time", "subtitle": $ts_datetime, "arg": $ts_datetime}
+  ]
+}'