What are the scritps you referred to in your config?
zenny opened this issue ยท 3 comments
Hi @yantar92
Thanks for sharing your emacs-config.
While ripgrepping your config.org file, I found a few scripts and some local gitrepos (maybe customized) that went above my head were referred as follows:
$ rg yantar config.org
6:#+EMAIL: yantar92@gmail.com
39:(setq user-mail-address "yantar92@gmail.com")
234: :fork (:repo "/home/yantar92/Git/org-mode/")))
554: :fork (:host gitlab :repo "yantar92/gcmh"))
1576:;; Author: Ihor Radchenko <yantar92@gmail.com>
1877: :repo "yantar92/boon"))
2153: :repo "yantar92/helm"))
3114: (browse-url-generic-program "/home/yantar92/bin/qutebrowser-call.sh"))
3224: :fork (:host gitlab :repo "yantar92/emacs-windower")))
5041: :repo "yantar92/pdf-tools"))
5706: ((string-match "yantar92@gmail.com" from) "yantar92@gmail.com")
5715: ("yantar92@gmail.com" . "Gmail/Sent +sent -unread")))
5723:(defvar yant/mml-do-not-sign-accounts-list '("ihor_radchenko@alumni.sutd.edu.sg"
"yantar92@gmail.com")
5777: "/home/yantar92/bin/notmuch-new-messages-list-silent.sh"))
6254: (shell-command-to-string (s-concat "/home/yantar92/bin/detect-language \"" string "\"")))))
6323:Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg")
7043: ("\\.tiff?\\'" . "/home/yantar92/bin/feh-open %s")
7044: ("\\.png?\\'" . "/home/yantar92/bin/feh-open %s")
7756:;; Author: Ihor Radchenko <yantar92@gmail.com>
8111: :fork (:host github :repo "yantar92/org-web-tools"))
9336: :fork (:host github :repo "yantar92/org-quick-peek"))
9373:Bug report: [[id:75b22f226a98806ce13c1834e115450e0aa3c01a][yantar92 [Github] issue#9 The overlay is not always visible when org-agenda-filter is in place]]
9427: :fork (:host github :repo "yantar92/org-ql"))
9599: (setq org-contacts-files '("/home/yantar92/Org/contacts.org"))
9869: (async-start-process "Update balance widget" "/home/yantar92/bin/balance-monitor.sh" #'ignore))
11339: (let ((url-present-p (s-replace "\n" "" (shell-command-to-string (format "/home/yantar92/bin/org-check-bookmark.sh \"%s\"" url)))))
11670: ;; ("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "/home/yantar92/bin/pdf-compress.sh %b.pdf %b-compressed.pdf && mv -f %b-compressed.pdf %b.pdf")
11671: ("latexmk -xelatex -shell-escape -bibtex -f -output-directory=%o %f" "/home/yantar92/bin/pdf-compress.sh %b.pdf %b-compressed.pdf && mv -f %b-compressed.pdf %b.pdf")
Scripts
Would you mind sharing the following shell scripts among others that you used above:
/home/yantar92/bin/qutebrowser-call.sh
home/yantar92/bin/notmuch-new-messages-list-silent.sh
/home/yantar92/bin/detect-language
/home/yantar92/bin/balance-monitor.sh
/home/yantar92/bin/org-check-bookmark.sh
/home/yantar92/bin/pdf-compress.sh
/home/yantar92/bin/feh-open
Local repos
In addition, you have called many a emacs packages from the local git folder instead of upstream including org-mode
(/home/yantar92/Git/org-mode/ in line 234) Is there any specific reason to do so or your fork of org-mode
is highly customized? Just curious.
Thanks in advance. Cheers,
/z
Would you mind sharing the following shell scripts among others that you used above:
I am not sure if they are going to surve much purpose for you.
qutebrowser-call.sh
is just a wrapper around qutebrowser calling mpv (with youtube-dl) for youtube links.
notmuch-new-messages-list-silent.sh
is my custom tagging + spam detection script for notmuch. I wrote it long time ago and keep it mostly for historical reasons. A better choise for someone starting from scratch with notmuch would be afew doing pretty much the same job, but more customisable (https://afew.readthedocs.io/en/latest/).
detect-language
is just a wrapper around langdetect python library (https://pypi.org/project/langdetect/). I use it as a part of auto-translation extension for my Chinese rss feeds.
balance-monitor.sh
in the context of how it is called from my config.org is just a way to update org-time-balance widget in my WM (Awesome WM). It is specific to Awesome WM in that regard and require my custom rc.lua to work. I think I have discussed some details in https://orgmode.org/list/87h7rym9xi.fsf@localhost/. The script also displays my budget tracking from ledger, but that is not the part I would share in public as is.
org-check-bookmark.sh
is not used anymore. The relavant code, including the script was converted into org-capture-ref (which was initially just a part of my config.org).
pdf-compress.sh
is a script compressing large images inside pdf using ghostscript
INPUT="$1"
if [[ ! -f "$INPUT" ]]; then
echo "File not exist \"$INPUT\""
exit 1
fi
OUTPUT="$2"
if [[ -f "$2" ]]; then
echo "File exists \"$2\""
exit 1
fi
OUTPUT=${OUTPUT:-${INPUT%.*}.pdf}
[[ $# > 2 ]] && (echo "Extra arguments found: \"$*\""; exit 1)
#gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT"
# gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT"
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT"
feh-open
is a wrapper around image viewer (https://feh.finalrewind.org/).
#!/bin/bash
DIRNAME="`dirname "$1"`"
if [[ -z "$DIRNAME" ]]; then DIRNAME="$PWD"; fi
FILENAME="`dirname "$1"`/`basename "$1"`"
feh -d -B white --scale-down --auto-zoom --draw-exif --draw-tinted --edit --version-sort --start-at "$FILENAME" "$DIRNAME" 2>&1 > /dev/null
In addition, you have called many a emacs packages from the local git folder instead of upstream
Most of those are the packages I contributed to or submitted a merge request.
Is there any specific reason to do so or your fork of org-mode is highly customized?
I am an org-mode contributor. I need a fork to create bugfix branches and work on my own feature branches (like my WIP work on speeding up large org files: https://orgmode.org/list/87lfh5vvrp.fsf@localhost). So, my fork basically contains things that will hopefully land on master at some point. Everything else is in my config.org.
Would you mind sharing the following shell scripts among others that you used above:
I am not sure if they are going to surve much purpose for you.
Definitely so if you share those nifty scripts which appear to be functional utilities that serves the specific purpose which anyone may hack to fit their own purpose. Please share the scripts in your ~/.local/bin/
if nothing personal in a separate repo dotfiles
if convenient.
qutebrowser-call.sh
is just a wrapper around qutebrowser calling mpv (with youtube-dl) for youtube links.
Very useful call. Maybe this could be hacked to integrate qutebrowser with org-capture-ref
also as you stated in https://github.com/yantar92/org-capture-ref#integration-with-qutebrowser.
notmuch-new-messages-list-silent.sh
is my custom tagging + spam detection script for notmuch. I wrote it long time ago and keep it mostly for historical reasons. A better choise for someone starting from scratch with notmuch would be afew doing pretty much the same job, but more customisable (https://afew.readthedocs.io/en/latest/).
Thanks for useful pointer to afew
.
detect-language
is just a wrapper around langdetect python library (https://pypi.org/project/langdetect/). I use it as a part of auto-translation extension for my Chinese rss feeds.
Glad that you speak Chinese, a language. ๐
This script is very handy to any polyglot (including me) if made available public.
balance-monitor.sh
in the context of how it is called from my config.org is just a way to update org-time-balance widget in my WM (Awesome WM). It is specific to Awesome WM in that regard and require my custom rc.lua to work. I think I have discussed some details in https://orgmode.org/list/87h7rym9xi.fsf@localhost/.
๐ Shall have a check in the link you referred to. Fyi, I currently use DWM. Earlier I used i3.
The script also displays my budget tracking from ledger, but that is not the part I would share in public as is.
Interesting tweak to personal finance!
org-check-bookmark.sh
is not used anymore. The relavant code, including the script was converted into org-capture-ref (which was initially just a part of my config.org).
DRY ;-)
pdf-compress.sh
is a script compressing large images inside pdf using ghostscriptINPUT="$1" if [[ ! -f "$INPUT" ]]; then echo "File not exist \"$INPUT\"" exit 1 fi OUTPUT="$2" if [[ -f "$2" ]]; then echo "File exists \"$2\"" exit 1 fi OUTPUT=${OUTPUT:-${INPUT%.*}.pdf} [[ $# > 2 ]] && (echo "Extra arguments found: \"$*\""; exit 1) #gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT" # gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT" gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT"
Thanks for sharing.
feh-open
is a wrapper around image viewer (https://feh.finalrewind.org/).#!/bin/bash DIRNAME="`dirname "$1"`" if [[ -z "$DIRNAME" ]]; then DIRNAME="$PWD"; fi FILENAME="`dirname "$1"`/`basename "$1"`" feh -d -B white --scale-down --auto-zoom --draw-exif --draw-tinted --edit --version-sort --start-at "$FILENAME" "$DIRNAME" 2>&1 > /dev/null
Thanks again.
In addition, you have called many a emacs packages from the local git folder instead of upstream
Most of those are the packages I contributed to or submitted a merge request.
I got it. :D
Is there any specific reason to do so or your fork of org-mode is highly customized?
I am an org-mode contributor. I need a fork to create bugfix branches and work on my own feature branches (like my WIP work on speeding up large org files: https://orgmode.org/list/87lfh5vvrp.fsf@localhost). So, my fork basically contains things that will hopefully land on master at some point. Everything else is in my config.org.
Thanks for taking time to post a comprehensive replies. Cheers,
Please share the scripts in your ~/.local/bin/ if nothing personal in a separate repo dotfiles if convenient.
Most of my scripts are nothing more but copy-paste from google. Sharing them will serve no meaningful purpose unless I explain how I integrate those scripts with the rest of my setup. I may share my system configuration eventually (after I move more things to literate config).
Very useful call. Maybe this could be hacked to integrate qutebrowser with org-capture-ref also as you stated in https://github.com/yantar92/org-capture-ref#integration-with-qutebrowser.
How do you imagine such integration?
Glad that you speak Chinese, a language. +1
No, I don't. That's why I need the script to detect languages I do not know and translate them (as I do in my config).
This script is very handy to any polyglot (including me) if made available public.
The script is trivial
#!/usr/bin/python3.7
from langdetect import detect
import sys
text=' '.join(sys.argv[1:])
print(detect(text))
The translation part is handled by elisp (and https://www.soimort.org/translate-shell/).
DRY ;-)
I keep it around until I move all the features to org-capture-ref. Some things are not yet there.