emenu

Emacs version of dmenu
Log | Files | Refs | LICENSE

commit 802b49e3b4bf4f365ca18beff0842949b8e3ce11
parent a29cd37c1069cafaeb7ffd4dad98d13ff7d6603f
Author: Crazazy <crazazy@tilde.cafe>
Date:   Fri,  1 Dec 2023 18:11:38 +0100

formalized the repository a bit

Diffstat:
ALICENSE | 21+++++++++++++++++++++
Memenu.el | 28+++++++++++++++++++++++++---
2 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Erik Oosting + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/emenu.el b/emenu.el @@ -1,8 +1,30 @@ +;; emenu.el --- An emacs dmenu clone -*- lexical-binding t -*- + +;; Copyright © 2022 Erik Oosting + +;; Author: Erik Oosting <crazazy@tilde.cafe> +;; Keywords: application-launcher, misc +;; URL: https://crazazy.tilde.cafe/emenu.git/log.html + +;;; License: +;; This file comes with the MIT license, and without any warranty whatsoever +;; You can do with this stuff whatever you want to, but just remember +;; to put me in the footnote :D. Would be nice at least + +;;; Commentary: +;; This is basically what dmenu does, but then in emacs. There is a function 'all-commands' +;; that gets you all the commands that are on your system. If you instead want to use emenu +;; on a different list of strings, you can just pass that list to emenu itself and it will +;; let you select something yourself + (require 'cl-seq) (require 'ido) -(defun all-commands () - "does a completing read of all the programs accessible to you in $PATH" +(defun emenu--all-commands () + "returns a list of all the programs accessible to you in $PATH" + ;; This ls-output part was mostly created by phundrak because he found my shell-piping implementation + ;; inelegant. If something has to change about this chances are this is going to return to shell + ;; scripting again (let ((ls-output (mapcan (lambda (path) (when (file-readable-p path) (cl-remove-if (lambda (file) @@ -26,7 +48,7 @@ (call-process (ido-completing-read "Command: " (or command-list - (all-commands))) + (emenu--all-commands))) nil 0) (keyboard-quit))