-
-
Save leoossa/fba1cd637377c68153adcbed65edd12b to your computer and use it in GitHub Desktop.
A script to copy Chrome's search engine settings into Vimium's settings format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script lists user defined search engines in Brave Nightly. | |
# It replaces {inputEncoding}, which appears in some search engine definitions, with | |
# UTF-8, {google:baseURL} with the Google URL, and omits other such tokens. | |
# Location of Brave's 'Web Data' SQLite3 file | |
BRAVE_NIGHTLY_WEB_DATA="$HOME/.config/BraveSoftware/Brave-Browser-Nightly/Default/Web Data" | |
# Location to create temporary copy of 'Web Data', since the database is locked while | |
# Brave is running | |
COPY=$(mktemp) | |
cp "$BRAVE_NIGHTLY_WEB_DATA" "$COPY" | |
sqlite3 <<COMMANDS "$COPY" | | |
.echo off | |
.separator ': ' | |
select keyword, url from keywords; | |
.quit | |
COMMANDS | |
sed -e \ ' | |
s#{searchTerms}#%s#g | |
s#{google:baseURL}#https://google.com/#g | |
s#{inputEncoding}#UTF-8#g | |
s#&?[^{}?&]\+={[^}]\+}##g | |
s#{[^}]\+}##g | |
' | tee engines-exported | |
rm "$COPY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment