summarylogtreecommitdiffstats
path: root/add-wmenu-run.patch
diff options
context:
space:
mode:
authorGabriel Felix2024-02-26 16:45:08 -0300
committerGabriel Felix2024-02-26 17:26:35 -0300
commit968d621711229cf01fe1a7787a738af04696a6d3 (patch)
treea0365263df3e591067b8ca03aed80f0f1a5818e9 /add-wmenu-run.patch
parentba778a011fce0bc4f8be2d7084a08664a150737a (diff)
downloadaur-968d621711229cf01fe1a7787a738af04696a6d3.tar.gz
Add wmenu_run script and patch
Adds a patch to bring dmenu_run functionality to wmenu. The code for the script is from https://lists.sr.ht/~adnano/wmenu-devel/patches/39820 and the meson.build modification comes from https://lists.sr.ht/~adnano/wmenu-devel/patches/49727
Diffstat (limited to 'add-wmenu-run.patch')
-rw-r--r--add-wmenu-run.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/add-wmenu-run.patch b/add-wmenu-run.patch
new file mode 100644
index 000000000000..6f91ec9ddaab
--- /dev/null
+++ b/add-wmenu-run.patch
@@ -0,0 +1,55 @@
+diff '--color=auto' --new-file --text --unified --recursive wmenu-0.1.6.orig/meson.build wmenu-0.1.6.new/meson.build
+--- wmenu-0.1.6.orig/meson.build 2024-02-26 16:10:40.116773860 -0300
++++ wmenu-0.1.6.new/meson.build 2024-02-26 16:11:38.250466476 -0300
+@@ -33,6 +33,8 @@
+ subdir('protocols')
+ subdir('docs')
+
++install_data('wmenu_run', install_dir: get_option('bindir'))
++
+ executable(
+ 'wmenu',
+ files(
+diff '--color=auto' --new-file --text --unified --recursive wmenu-0.1.6.orig/wmenu_run wmenu-0.1.6.new/wmenu_run
+--- wmenu-0.1.6.orig/wmenu_run 1969-12-31 21:00:00.000000000 -0300
++++ wmenu-0.1.6.new/wmenu_run 2024-02-26 16:12:29.227035337 -0300
+@@ -0,0 +1,39 @@
++#!/bin/sh
++
++cache_dir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
++cache="$cache_dir/wmenu_run"
++
++uptodate()
++{
++ IFS=:
++ for path in $PATH
++ do
++ test "$path" -nt "$cache" &&
++ return 1
++ done
++
++ return 0
++}
++
++get_bin()
++{
++ IFS=:
++ for path in $PATH
++ do
++ for bin in "$path"/*
++ do
++ [ -x "$bin" ] &&
++ echo "${bin##*/}"
++ done
++ done
++}
++
++[ -d "$cache_dir" ] ||
++ mkdir -p "$cache_dir"
++
++if [ -f "$cache" ] && uptodate
++then
++ wmenu "$@" < "$cache" | ${SHELL:-"/bin/sh"} &
++else
++ get_bin | sort -u | tee "$cache" | wmenu "$@" | ${SHELL:-"/bin/sh"} &
++fi