Files
command-list-el/command-list.el
2026-03-26 01:11:50 -07:00

67 lines
2.4 KiB
EmacsLisp

;; (defun command-list ()
;; "A `completing-read' based command list"
;; (interactive)
;; (let ((actions
;; '(("one" . 'one)) ))
;; (eval (cdr (assoc (completing-read "Prompt:" actions) actions)))))
;;; A list of commands related to reading novels in `eww' and with `nob'.
(defun nob-command-list ()
"A `completing-read' based command list"
(interactive)
(let ((actions
'(("Nob select" . (nob-select))
("Next chapter" . (next-chapter))
("Next url" . (eww-next-url))
("Go back" . (eww-back-url))
("List buffers" . (eww-list-buffers))
("History" . (eww-list-histories))
("Email page" . (eww-mail-page-url))) ))
(eval (cdr (assoc (completing-read "Root->Nob: " actions) actions)))))
(defun cb-category-list ()
(let ((categories
'(("Female" . "female-cams")
("Asian" . "tag/asian/f")
("Lesbian" . "tag/lesbian")
("Couples" . "couple-cams")
;; ("Other" . (read-string "Path: ")) ; ALMOST works. I don't think I full understand lisp behavior. :(
)))
(cb-stream-list (cdr (assoc (completing-read "Category: " categories) categories)))))
(defun cb-category-list-no-xwinwrap ()
(let ((cb-player-command "mpv --input-ipc-server=/tmp/mpv
--cache=yes --mute=yes"))
(cb-category-list)))
;;; I see a lot of potential in this `completing-read' driver menu system.
;;; Right now, there's a lot of hardcoded values, but with some functions
;;; and maybe a macro, I think I could create a flexible system for
;;; creating menus.
;;; A macro that's aware of sub menu levels would be cool.
(defun cb-command-list ()
"Choose a command in list to execute."
(interactive)
(let ((actions
'(("Take screenshot" . (cb-screenshot))
("Select Stream" . (cb-stream-list))
("Select Stream by Category" . (cb-category-list))
("Select Stream by Category no xwinwrap" . (cb-category-list-no-xwinwrap))
("Toggle Transparency" . (transparency-toggle))
("Toggle mute" . (cb-mute))
("Kill " . (cb-kill))) ))
(eval (cdr (assoc (completing-read "Root->Chaturbate: " actions) actions)))))
(defun root-command-list ()
"`completing-read based command menu.'"
(interactive)
(let ((actions
'(("Nob" . (nob-command-list))
("Chaturbate ;-)" . (cb-command-list))
("Switch Buffer" . (counsel-switch-buffer))
("Start firefox" . (start-process-shell-command "firefox" nil "firefox")))))
(eval (cdr (assoc (completing-read "Root: " actions) actions)))))
(provide 'command-list)