Commit Diff


commit - 9f92b7afb7dbc8b324aa74af17b9c7e8ad8691a2
commit + 1c3618fe07ac98ba9635c527f90e3201f0d39115
blob - 8ec447e23de20b27757f1cfa8dce375ea5927f65
blob + 01a31588ea161b35153145b7046ab22d78b522d9
--- resources/pages/projects.gmi
+++ resources/pages/projects.gmi
@@ -13,3 +13,6 @@ Interactive REPL for HTTP requests with a simple and i
 
 => sam-el.gmi           sam.el - An editor for the best OS
 sam.el is an implementation of the text editor sam from plan9 for emacs.  It's still far, far away from being usable.
+
+=> mymenu.gmi           mymenu – a menu of mine
+mymenu is a graphical menu for X11.  It reads items from standard input (one per line) and present a window where the user can choose one (or more) item.  It’s similar to dmenu, except it’s better (IMHO).
blob - /dev/null
blob + a93d6350d5adc097e2d3529c7108299e0d9fbc1a (mode 644)
--- /dev/null
+++ resources/pages/mymenu.gmi
@@ -0,0 +1,62 @@
+# mymenu
+> a menu of mine
+
+mymenu is a simple, dmenu-inspired, menu for X11.  It was written because of NIH, because I was bored, and because it was the perfect opportunity to learn more about X11 and xlib.  Jokes aside, is a fully functional and very customizable menu that I use every day.
+
+=> https://git.omarpolo.com/mymenud     Git repo
+=> https://github.com/omar-polo/mymenu  GitHub mirror
+
+It supports two layout: a vertical one (like rofi) and one horizontal (like dmenu).  Various aspects are customizables: color, transparency, borders and window placement.  It is very easily scriptable, and in the default repo you’ll find some example script (both in the manpage and in the scripts folder).  Of course, you can easily adapt your dmenu/rofi scripts to mymenu if you want.
+
+For instance, here’s what I’m currently using.  It has submenu and custom actions, so it could be a good example.
+
+```
+#!/bin/ksh
+
+a-menu() {
+	mymenu -f 'Go Mono-11' -l vertical -p '% ' \
+	       -W 50% -H 30% -P 10 -x center -y center \
+	       -C '#ffffea' -c '#000' -T '#ffffea' \
+	       -t '#000' -S '#000' -s '#fff' -b 3 \
+	       -a
+}
+
+# pass
+p() {
+	prefix=${PASSWORD_STORE_DIR:-~/.password-store}
+	set -A files -- "$prefix"/**/*.gpg "$prefix"/**/**/*.gpg
+	typeit=${1:-yes}
+
+	if p=$(printf '%s\n' ${files[@]} | sed -e 's/\.gpg$//' -e "s,^$prefix/,," | a-menu); then
+		if [ "$typeit" = yes ]; then
+			pass show "$p" | { IFS= read -r pass; printf %s "$pass"; } |
+				xdotool type --clearmodifiers --file -
+		else
+			pass show --clip "$password"
+		fi
+	fi
+}
+
+# exec
+e() {
+	if ! x=$(a-menu); then
+		return
+	elif [ "$x" = "pass" ]; then
+		p yes
+	elif [ "$x" = "pass copy" ]; then
+		p nope
+	elif [ "$x" = "keep" ]; then
+		exec keepassxc
+	else
+		exec $x
+	fi
+}
+
+(
+	echo keep
+	echo firefox
+	# ...
+	echo pass
+	echo pass copy # not "copy pass" so it's after pass
+) | e
+```
blob - d6a11ee4bca18a1cbb63b1306bcc638b1bee7d41
blob + 9e9c9e5b0149b98f5c8a30d39228f9cc52a41893
--- resources/pages.edn
+++ resources/pages.edn
@@ -7,4 +7,6 @@
  {:title "crest - see your rest endpoints"
   :slug  "crest"}
  {:title "sam.el - An editor for the best OS"
-  :slug  "sam-el"}]
+  :slug  "sam-el"}
+ {:title "mymenu - a menu of mine"
+  :slug  "mymenu"}]