Created
September 1, 2025 10:50
-
-
Save akssri/92a3b240c89212815a66e86c60eabde8 to your computer and use it in GitHub Desktop.
totp.el
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun call-function-on-region (cmd args &optional b e) | |
| (let ((buf (buffer-substring b e))) | |
| (with-temp-buffer | |
| (apply #'call-process cmd nil t nil (append args (list buf))) ;;(split-string buf))) | |
| (let ((bufstr (buffer-string))) | |
| (x-select-text bufstr) | |
| (kill-new bufstr) | |
| (princ bufstr))) | |
| (deactivate-mark))) | |
| (defun totp (&optional b e) | |
| (interactive "r") | |
| (call-function-on-region "oathtool" '("--totp" "-b" "-d 6") b e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment