Skip to content

Instantly share code, notes, and snippets.

@tyjak
Created January 12, 2024 14:58
Show Gist options
  • Save tyjak/af05f7666aff2e20e35cbd9ff20e17ed to your computer and use it in GitHub Desktop.
Save tyjak/af05f7666aff2e20e35cbd9ff20e17ed to your computer and use it in GitHub Desktop.
#!/bin/sh
# dmenu scripts to search in history and bookmark or in default vimb search engine
# mark the window where searched was launch
i3-msg 'mark websearch'
# go to web marked if possible
i3-msg '[con_mark="web"] focus'
# don't display search engine history
searchengine='google\|startpage\|lilo\|duckduckgo\|search.tyjak'
url=$(cat ~/.local/share/vimb/history ~/.config/vimb/bookmark.d/* ~/.config/vimb/bookmark ~/.config/vimb/history | grep -e "^http" | grep -v -e "$searchengine" | uniq | tac | sed 's/\t/ | /' | dmenu -l 20 -b -i -nb '#002b36' -nf '#839496' -sb '#859900' -fn 'MesloLGSDZ Nerd Font-10' -h ${DMENUHEIGHT:-36})
if [ "$url" != "" ];then
# retrive url only
if [ "${url:0:4}" = "http" ];then
url=${url%% *}
fi
/usr/bin/vimb "$url"
fi
# on vimb quit come back where you were on you start the search
i3-msg [con_mark="websearch"] focus
# Gist: 6c931cb37ea608a053cbccb94a3d7bf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment