Skip to content

Instantly share code, notes, and snippets.

@Chimrod
Created February 19, 2017 09:09
Show Gist options
  • Save Chimrod/48d56dbe4ceb8b3247331d9e3b1c0880 to your computer and use it in GitHub Desktop.
Save Chimrod/48d56dbe4ceb8b3247331d9e3b1c0880 to your computer and use it in GitHub Desktop.
Rofi scripts
#!/bin/sh
if [ -z $1 ]; then
sqlite3 ~/.mozilla/firefox/${profile}/places.sqlite 'SELECT url from moz_places order by frecency desc' | grep -vE "google.com/search|google.com/url|duckduckgo"
else
i3-msg "exec firejail firefox --new-tab \"$*\"" > /dev/null
fi
Here are two scripts for rofi.
`rofi_locate.sh` use rofi for finding files in the home path with locate, and run `xdg-open`.
Usage : enter your patterns and validate the search. You can start a new search by selecting the first line (empty).
`firefoxhistory.sh` load all the visited pages in firefox, and open the selected in a new tab.
Configuration :
You have to define the path to the sqlite database by editing the value `${profile}`.
The script use `i3-msg` and `firejail`, but you can run firefox directly.
#!/bin/sh
if [ -z $1 ]; then
echo ""
else
if [ -e "$1" ]; then
xdg-open "$1"
else
echo ""
locate -A ~ $* | grep -v "/\."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment