3 ms·
Sounds incredibly cool, to be honest I am a vim guy, but still is it your own script, is there any repo, can you share it? Also I was't aware that firefox store
by fikama 4y ago
Sounds incredibly cool, to be honest I am a vim guy, but still is it your own script, is there any repo, can you share it? Also I was't aware that firefox stores open tabs in SQLite, can you point me what to type in Google to read more about it?
- dotancohen 4y agoI can share it here: (defun ff-link-org () (interactive) (insert (shell-command-to-string "lz4jsoncat $FIREFOX_DIR/sessionstore-backups/recovery.jsonlz4 | jq -r '.windows[0].tabs | sort_by(.lastAccessed)[-1] | .entries[.index-1] | \"[[\" + (.url) + \"][\" + (.title) + \"]]\"' | tr -d '\n'")) ) (defun ff-link-org-xdotool () "Get Firefox link in Org mode format" (interactive) (shell-command "xdotool search 'Navigator' windowactivate --sync key --clearmodifiers Escape y o ; xdotool keydown alt key Tab ; xdotool keyup alt") ) (global-set-key (kbd "C-c f") 'ff-link-org) I misremembered, once the data was in an SQLite database but now it's easier to grab from the sessionstore backup file - it's compressed JSON. I then query it with jq and trim the newline - here's that part isolated with the format changed to provide a markdown-formated link: lz4jsoncat $FIREFOX_DIR/sessionstore-backups/recovery.jsonlz4 | jq -r '.windows[0].tabs | sort_by(.lastAccessed)[-1] | .entries[.index-1] | \"(\" + (.title) + \")[\" + (.url) + \"]\"' | tr -d '\n' By the way, I'm a longtime VIM user but have recently been converting all my notes to org-mode. Emacs with Evil is a good-enough VIM replacement for notes taking, and the org-mode format is absolutely terrific.