Created
December 1, 2014 11:59
-
-
Save mickesv/f381e6e7dec365e70a85 to your computer and use it in GitHub Desktop.
Emacs Application Launcher
This file contains 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
;; -------------------- | |
;; Application Launcher | |
;; -------------------- | |
;; For OSX, where the "open" command knows most of what you would like to do. | |
(setq msv-launchers '(("conk" . (shell-command "open -a conkeror")) | |
("fox" . (shell-command "open -a firefox")) | |
("pfox" . (shell-command "open -a firefox --args -private")) | |
("finder" . (shell-command "open ~/Documents")) | |
("download" . (shell-command "open ~/Downloads")) | |
("cal" . (shell-command "open -a iCal")) | |
("skim" . (shell-command "open -a Skim")) | |
("mail" . (call-interactively 'msv-open-inbox)) | |
("term" . (shell-command "open -a Terminal")) | |
("its" . (shell-command "open https://www.itslearning.com/elogin/default.aspx?CustomerId=640")) | |
("google" . (call-interactively 'msv-lmgtfy)) | |
)) | |
(defun msv-launch (arg) | |
(interactive | |
(list | |
(completing-read "Launch: " (loop for (key value) on msv-launchers collect (car key))))) | |
(eval (cdr (assoc arg msv-launchers))) | |
nil) | |
(defun msv-lmgtfy (arg) | |
"Let me google that for you" | |
(interactive "MGoogle: ") | |
(shell-command (concat | |
"open " | |
"http://www.google.com/" | |
"search?q=" | |
(url-hexify-string arg)))) | |
(setq shell-file-name "bash") | |
(setq shell-command-switch "-ic") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment