shell/sk: fix skgl, bm & hist aliases (firefox bookmark/history search)
This commit is contained in:
parent
1589fd9df3
commit
62240ec4b5
|
@ -1,5 +1,5 @@
|
|||
alias skgcf='noglob git commit -S --fixup `skim-git-sha`'
|
||||
alias skgl=skim-git-log
|
||||
alias skgcf='noglob git commit -S --fixup `sk-git-sha`'
|
||||
alias skgl=sk-git-log
|
||||
|
||||
alias bm=skim-browser-bookmarks
|
||||
alias hist=skim-browser-history
|
||||
alias bm=sk-browser-bookmarks
|
||||
alias hist=sk-browser-history
|
||||
|
|
|
@ -8,14 +8,17 @@
|
|||
[[ $OSTYPE == linux* ]] && open='xdg-open' || open='open'
|
||||
|
||||
_do_sk() {
|
||||
for url in $(awk -F "$1" '{printf "%s, %s\n", $1, $2}' | skim --prompt='bookmarks > ' --multi | sed 's#.*\(https*://\)#\1#'); do
|
||||
for url in $(awk -F "$1" '{printf "%s, %s\n", $1, $2}' | sk --prompt='bookmarks > ' --multi | sed 's#.*\(https*://\)#\1#'); do
|
||||
$open "$url" &
|
||||
done
|
||||
}
|
||||
|
||||
case ${BROWSER:-firefox} in
|
||||
firefox)
|
||||
for dir in ~/.mozilla/firefox/*.default ~/.config/firefox/.mozilla/firefox/*.default ~/Library/Application\ Support/Firefox/Profiles/*.default; do
|
||||
for dir in ~/.mozilla/firefox/*.default \
|
||||
$XDG_CONFIG_HOME/firefox/.mozilla/firefox/*.default \
|
||||
$XDG_DATA_HOME/mozilla/firefox/*.default \
|
||||
~/Library/Application\ Support/Firefox/Profiles/*.default; do
|
||||
if [[ -d "$dir" ]]; then
|
||||
sep='{{::}}'
|
||||
sqlite3 -separator $sep "$dir/places.sqlite" \
|
||||
|
|
|
@ -9,14 +9,17 @@ sep='{{::}}'
|
|||
[[ $OSTYPE == linux* ]] && open='xdg-open' || open='open'
|
||||
|
||||
_do_skim() {
|
||||
for url in $(awk -F "$sep" '{printf "%s, %s\n", $1, $2}' | skim --prompt='history > ' --multi | sed 's#.*\(https*://\)#\1#'); do
|
||||
for url in $(awk -F "$sep" '{printf "%s, %s\n", $1, $2}' | sk --prompt='history > ' --multi | sed 's#.*\(https*://\)#\1#'); do
|
||||
$open "$url" &
|
||||
done
|
||||
}
|
||||
|
||||
case ${BROWSER:-firefox} in
|
||||
firefox)
|
||||
for dir in ~/.mozilla/firefox/*.default ~/.config/firefox/.mozilla/firefox/*.default ~/Library/Application\ Support/Firefox/Profiles/*.default; do
|
||||
for dir in ~/.mozilla/firefox/*.default \
|
||||
$XDG_CONFIG_HOME/firefox/.mozilla/firefox/*.default \
|
||||
$XDG_DATA_HOME/mozilla/firefox/*.default \
|
||||
~/Library/Application\ Support/Firefox/Profiles/*.default; do
|
||||
if [[ -d "$dir" ]]; then
|
||||
sqlite3 -separator $sep "$dir/places.sqlite" \
|
||||
"SELECT DISTINCT title, url FROM moz_places \
|
||||
|
|
Loading…
Reference in a new issue