summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs.org33
1 files changed, 31 insertions, 2 deletions
diff --git a/emacs.org b/emacs.org
index b79d407..3acdef4 100644
--- a/emacs.org
+++ b/emacs.org
@@ -312,15 +312,44 @@ Also, if you just stumbled accross this at random, there is an easy tangle butto
** Other, less useful stuff
*** Themes
I like to have a nice theme in my setup
- #+begin_src emacs-lisp :tangle misc.el
+ #+begin_src emacs-lisp :tangle emacsconfig/misc.el
(use-package flatland-theme
:config
(load-theme 'flatland))
#+end_src
*** Discord
My discord buddies /have/ to know I'm using emacs whenever I have my computer running
- #+begin_src emacs-lisp :tangle misc.el
+ #+begin_src emacs-lisp :tangle emacsconfig/misc.el
(use-package elcord
:config
(elcord-mode))
#+end_src
+*** Emenu
+ Since I'm using emacs as a daemon, it can also be benefical to make an application launcer
+ #+begin_src emacs-lisp :tangle emacsconfig/misc.el
+ (defun all-commands ()
+ "does a completing read of all the programs accessible to you in $PATH"
+ (let ((ls-output (mapcan (lambda (path)
+ (when (file-readable-p path)
+ (cl-remove-if (lambda (file)
+ (let ((fullpath (concat path "/" file)))
+ (or (file-directory-p fullpath)
+ (not (file-executable-p fullpath)))))
+ (directory-files path nil directory-files-no-dot-files-regexp nil))))
+ (split-string (getenv "PATH") ":" t)))
+ (alias-output (split-string (shell-command-to-string "alias -p | sed -E 's/^alias ([^=]*)=.*$/\1/'") "\n")))
+ (ido-completing-read "Command: " (append ls-output alias-output))))
+
+ (defun emenu ()
+ "A dmenu-inspired application launcher using a separate emacs frame"
+ (interactive)
+ (with-selected-frame (make-frame '((name . "emenu")
+ (minibuffer . only)
+ (width . 151)
+ (height . 1)))
+ (unwind-protect
+ (progn
+ (call-process (all-commands) nil 0)
+ (keyboard-quit))
+ (delete-frame))))
+ #+end_src