a7f0e08891c8
Merge
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Tue, 08 Sep 2020 11:31:09 -0400 |
parents | 1fa04416fcdb (diff) 8b5b2b90ac77 (current diff) |
children | 01b4fd763aab |
branches/tags | (none) |
files | stumpwmrc |
Changes
--- a/lisp/pick.lisp Mon Sep 07 20:57:39 2020 -0400 +++ b/lisp/pick.lisp Tue Sep 08 11:31:09 2020 -0400 @@ -1,5 +1,5 @@ (eval-when (:compile-toplevel :load-toplevel :execute) - (ql:quickload '(:adopt) :silent t)) + (ql:quickload '(:adopt :with-user-abort) :silent t)) (defpackage :pick (:use :cl) @@ -149,22 +149,28 @@ *option-many*))) +(defmacro exit-on-ctrl-c (&body body) + `(handler-case + (with-user-abort:with-user-abort (progn ,@body)) + (with-user-abort:user-abort () (adopt:exit 130)))) + (defun toplevel () - (handler-case - (multiple-value-bind (arguments options) (adopt:parse-options *ui*) - (cond ((gethash 'help options) (adopt:print-help-and-exit *ui* :option-width 24)) - ((gethash 'version options) (write-line *version*) (adopt:exit))) - (with-open-file (*interactive-input* "/dev/tty" :direction :input) - (let ((*separator* (gethash 'separator options)) - (*interactive-output* *error-output*) - (arguments (mapcan (lambda (arg) - (if (string= "-" arg) - (read-lines *standard-input*) - (list arg))) - arguments))) - (funcall (if (gethash 'one options) - #'run-one - #'run-many) - arguments)))) - (error (c) (adopt:print-error-and-exit c)))) + (exit-on-ctrl-c + (handler-case + (multiple-value-bind (arguments options) (adopt:parse-options *ui*) + (cond ((gethash 'help options) (adopt:print-help-and-exit *ui* :option-width 24)) + ((gethash 'version options) (write-line *version*) (adopt:exit))) + (with-open-file (*interactive-input* "/dev/tty" :direction :input) + (let ((*separator* (gethash 'separator options)) + (*interactive-output* *error-output*) + (arguments (mapcan (lambda (arg) + (if (string= "-" arg) + (read-lines *standard-input*) + (list arg))) + arguments))) + (funcall (if (gethash 'one options) + #'run-one + #'run-many) + arguments)))) + (error (c) (adopt:print-error-and-exit c)))))
--- a/stumpwm/zoom.lisp Mon Sep 07 20:57:39 2020 -0400 +++ b/stumpwm/zoom.lisp Tue Sep 08 11:31:09 2020 -0400 @@ -38,22 +38,22 @@ :X 1452 :Y 0 :WIDTH 2348 - :HEIGHT 120 + :HEIGHT 40 :WINDOWS NIL :CURRENT NIL) #S(FDUMP :NUMBER 6 :X 1452 - :Y 120 - :WIDTH 2348 - :HEIGHT 1320 - :WINDOWS (23068677) - :CURRENT 23068677))) + :Y 40 + :WIDTH 2300 + :HEIGHT 1400 + :WINDOWS NIL + :CURRENT NIL))) (#S(FDUMP :NUMBER 3 - :X 3800 + :X 3752 :Y 0 - :WIDTH 660 + :WIDTH 708 :HEIGHT 1440 :WINDOWS NIL :CURRENT NIL) @@ -73,4 +73,4 @@ :HEIGHT 495 :WINDOWS NIL :CURRENT NIL)))))) - :CURRENT 6) \ No newline at end of file + :CURRENT 6)
--- a/stumpwmrc Mon Sep 07 20:57:39 2020 -0400 +++ b/stumpwmrc Tue Sep 08 11:31:09 2020 -0400 @@ -1,6 +1,6 @@ (in-package :stumpwm-user) -(ql:quickload '(:losh :split-sequence :alexandria :parse-number :str :cl-ppcre) :silent t) +(ql:quickload '(:losh :split-sequence :alexandria :parse-number :str :cl-ppcre :bordeaux-threads) :silent t) (use-package :losh) @@ -386,10 +386,28 @@ (defcommand describe-window () () (show-window-properties)) +(defcommand unfuck-zoom-link () () + (let ((url (pbpaste))) + (ppcre:register-groups-bind + (meeting-id meeting-pass) + ("^https://[a-zA-Z0-9]+[.]zoom[.]us/j/(\\d+)[?]pwd=([A-Za-z0-9]+)$" url) + (pbcopy meeting-id) + (message "Zoom meeting ID copied.") + (bt:make-thread (lambda () + (sleep 3) + (pbcopy meeting-pass) + (message "Zoom meeting password copied.") + (sleep 5) + (pbcopy "")) + :name "Zoom Link Defuckulator") + (return-from unfuck-zoom-link)) + (message "Clipboard doesn't seem to be a Zoom link."))) + (defcommand rain () () (message (run-shell-command "weather -H 36" t))) + ;;;; Terminal Fonts ----------------------------------------------------------- (defcommand reload-terminal-font-size () () @@ -526,6 +544,7 @@ ("H-O" "spotify") ("H-o" "files") ("H-z" "zoom") + ("H-Z" "unfuck-zoom-link") ("H-q" "exec lock-screen") ("H-y" "screenshot") ("H-g" "gcontrol")