Skip to content

Instantly share code, notes, and snippets.

@jabashque
Last active April 5, 2022 23:54
Show Gist options
  • Save jabashque/32bd56b6e0b537e5afd5ae84d4931e1a to your computer and use it in GitHub Desktop.
Save jabashque/32bd56b6e0b537e5afd5ae84d4931e1a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# search through every arg and edit the params to
# make it compatible with bemenu where needed
declare -a bemenu_args=( "$@" )
for (( i=0; i<${#bemenu_args[@]}; i++)); do
bemenu_args[$i]="$(sed -E 's/^-([a-z]{2})$/--\1/' <<< "${bemenu_args[$i]}")"
done
# decide whether to run bemenu-run based on the
# name of the script
bemenu_bin="bemenu"
if [[ "${0##*/}" = "dmenu_run" ]]; then
bemenu_bin="bemenu-run"
fi
exec "$bemenu_bin" "${bemenu_args[@]}"
# Maintainer: Tim Kersten <tim io41 * com>
pkgname=bemenu-dmenu
pkgver=1
pkgrel=2
pkgdesc="Symlink for using bemenu (native wayland support) as a drop-in replacement to dmenu"
arch=('any')
url="https://github.com/Cloudef/bemenu"
license=('MIT')
depends=('bemenu' 'bash')
provides=('dmenu')
conflicts=('dmenu')
source=(
"dmenu"
)
sha256sums=(
'ccf4abd22e0d9a732b78f94b44e0ad30b74ce975bd97ca4bea5b751614dfeff7'
)
package() {
install -d "$pkgdir"/usr/bin
cp dmenu "$pkgdir"/usr/bin/dmenu
ln -s dmenu "$pkgdir"/usr/bin/dmenu_run
}
# vim:set ts=2 sw=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment