# HG changeset patch # User Steve Losh # Date 1599061544 14400 # Node ID 411d31e2360b79ec5de25655ce09db1757e55bdf # Parent 31e094924f7ef25e68813b606ad7c2f479eaa358 Make the computer do the busywork diff -r 31e094924f7e -r 411d31e2360b stumpwmrc --- a/stumpwmrc Mon Aug 31 11:53:56 2020 -0400 +++ b/stumpwmrc Wed Sep 02 11:45:44 2020 -0400 @@ -1,6 +1,6 @@ (in-package :stumpwm-user) -(ql:quickload '(:losh :split-sequence :alexandria :parse-number) :silent t) +(ql:quickload '(:losh :split-sequence :alexandria :parse-number :str :cl-ppcre) :silent t) (use-package :losh) @@ -18,8 +18,9 @@ *window-format* "(%n%m%20t)" *window-name-source* :title *maximum-completions* 20 - *shell-program* "/home/sjl/src/dotfiles/bin/bash-dammit") - + *shell-program* "/home/sjl/src/dotfiles/bin/bash-dammit" + losh:*pbcopy-command* "/home/sjl/src/dotfiles/bin/pbcopy" + losh:*pbpaste-command* "/home/sjl/src/dotfiles/bin/pbpaste") ;;;; Utils -------------------------------------------------------------------- @@ -422,6 +423,15 @@ (run-shell-command "pbeecopy") (message "Copied the entire Bee Movie script to clipboard.")) +(defcommand urlize-jira-issue () () + (let ((issue (str:trim (pbpaste)))) + (if (ppcre:scan "^[A-Z0-9]+-\\d+$" issue) + (let* ((endpoint (str:trim (run-shell-command "grep endpoint .jira.d/config.yml | sed -e 's/.*: //'" t))) + (url (format nil "~A/browse/~A" endpoint issue))) + (pbcopy url) + (message "Copied ~A to the clipboard." url)) + (message "Clipboard does not look like a JIRA issue.")))) + ;;;; Applications ------------------------------------------------------------- (defcommand spotify () () @@ -520,7 +530,7 @@ (define-top-keys ;; clipboard ("H-u" "generate-random-uuid") ("H-U" "bee-movie-script") - ) + ("M-H-u" "urlize-jira-issue")) (define-top-keys ;; movement ("H-h" "move-focus* left")