mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-22 19:10:24 +10:00
Restructuring the Emacs config so its not such a massive beast.
This commit is contained in:
55
.config/emacs/scripts/app-launchers.el
Normal file
55
.config/emacs/scripts/app-launchers.el
Normal file
@@ -0,0 +1,55 @@
|
||||
;;; app-launchers.el --- Possible alternatives to dmenu/rofi
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Counsel-Linux-App
|
||||
;; Since we have counsel installed, we can use 'counsel-linux-app' to launch our Linux apps. It list the apps by their executable command, so it's kind of tricky to use.
|
||||
|
||||
(defun emacs-counsel-launcher ()
|
||||
"Create and select a frame called emacs-counsel-launcher which consists only of a minibuffer and has specific dimensions. Runs counsel-linux-app on that frame, which is an emacs command that prompts you to select an app and open it in a dmenu like behaviour. Delete the frame after that command has exited"
|
||||
(interactive)
|
||||
(with-selected-frame
|
||||
(make-frame '((name . "emacs-run-launcher")
|
||||
(minibuffer . only)
|
||||
(fullscreen . 0) ; no fullscreen
|
||||
(undecorated . t) ; remove title bar
|
||||
;;(auto-raise . t) ; focus on this frame
|
||||
;;(tool-bar-lines . 0)
|
||||
;;(menu-bar-lines . 0)
|
||||
(internal-border-width . 10)
|
||||
(width . 80)
|
||||
(height . 11)))
|
||||
(unwind-protect
|
||||
(counsel-linux-app)
|
||||
(delete-frame))))
|
||||
|
||||
|
||||
;; App-Launcher
|
||||
;; The 'app-launcher' is a better run launcher since it reads the desktop applications on your system and you can search them by their names as defined in their desktop file. This means that sometimes you have to search for a generic term rather than the actual binary command of the program.
|
||||
|
||||
(use-package app-launcher
|
||||
:elpaca '(app-launcher :host github :repo "SebastienWae/app-launcher"))
|
||||
;; create a global keyboard shortcut with the following code
|
||||
;; emacsclient -cF "((visibility . nil))" -e "(emacs-run-launcher)"
|
||||
|
||||
(defun emacs-run-launcher ()
|
||||
"Create and select a frame called emacs-run-launcher which consists only of a minibuffer and has specific dimensions. Runs app-launcher-run-app on that frame, which is an emacs command that prompts you to select an app and open it in a dmenu like behaviour. Delete the frame after that command has exited"
|
||||
(interactive)
|
||||
(with-selected-frame
|
||||
(make-frame '((name . "emacs-run-launcher")
|
||||
(minibuffer . only)
|
||||
(fullscreen . 0) ; no fullscreen
|
||||
(undecorated . t) ; remove title bar
|
||||
;;(auto-raise . t) ; focus on this frame
|
||||
;;(tool-bar-lines . 0)
|
||||
;;(menu-bar-lines . 0)
|
||||
(internal-border-width . 10)
|
||||
(width . 80)
|
||||
(height . 11)))
|
||||
(unwind-protect
|
||||
(app-launcher-run-app)
|
||||
(delete-frame))))
|
||||
|
||||
|
||||
(provide 'app-launchers)
|
||||
;;; app-launchers.el ends here
|
||||
Reference in New Issue
Block a user