Skip to content

Instantly share code, notes, and snippets.

@fooqri fooqri/ql-thoughts.sh
Last active Dec 10, 2016

Embed
What would you like to do?
A few alias functions for using qlmanage to create png files. Used for creatingpng previews of iThoughtsX files that can be embedded in org-mode notes.
# qlmanager is used to open quicklook view of a file from command line.
# see http://www.quicklookplugins.com/ for more plugins
# an alias to create a simple command to olen a quicklook view in background, showing no terminal messages
alias ql='function _qlfunc(){ qlmanage -p $@ >/dev/null 2>&1 &};_qlfunc'
# I use this to save png files using qlmanager into an images directory inside my org-mode notes dir.
# I use a lisp function that calles this comand when org-links are added to notes so I get a nice embedded png view
# of the file being linked to. Requires plugin for file type that creates png's
# I use for mindmaps, stl files, etc so canshow quicklook inside emacs org-mode for linked files
alias qlo='function _qlofunc(){ qlmanage -p $1 -o . >/dev/null; cp $1.qlpreview/[pP]review.png ./images/$1.png; rm -rf $1.qlpreview &};_qlofunc'
# qloo below outputs png as text, meant to pipe to a function or app that can use it (like Preview app).
# to view output of gloo use:
# qloo {filename.itmz} | open -f -a Preview
alias qloo='function _qloofunc(){ qlmanage -p $1 -o . >/dev/null; pattern="${1}.qlpreview/[Pp]review.*"; files=( $pattern ); cat ${files[0]}; rm -rf $1.qlpreview &};_qloofunc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.