Skip to content

Instantly share code, notes, and snippets.

@sheepla
Last active July 16, 2023 23:49
Show Gist options
  • Save sheepla/ceef0a86a0b5f8d4bfd7f8e18d74df28 to your computer and use it in GitHub Desktop.
Save sheepla/ceef0a86a0b5f8d4bfd7f8e18d74df28 to your computer and use it in GitHub Desktop.
dmenu-websearch.sh - creating tiny web-search menu on Linux desktop
#!/bin/sh
_err() {
echo "[ \e[31;1mERROR\e[m ] ${1}" 2>&1
}
_has() {
command -v "${1}" &>/dev/null
}
_dmenu() {
dmenu -nb "#161821" -sb "#444b71" -fn "Terminus (TTF)" -l 5 "${@}"
}
_has s || _err "s command not found. please install s. see: https://github.com/zquestz/s"
_has dmenu || _err "dmenu command not found. please install dmenu. see: https://github.com/davatorium/rofi"
provider="$(s --list-providers | _dmenu -p "Search Provider")"
query="$(echo "" | _dmenu -p "Query")"
s -p "${provider}" "${query}"
@sheepla
Copy link
Author

sheepla commented Jul 16, 2023

Q: How to use dmenu-like less-bloated dinamic menu on Windows? 🪟🤔
A: Use LinArcX/wmenu !😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment