complete-computing-environment/shared_cce_helpers.org

111 lines
2.7 KiB
Org Mode

:PROPERTIES:
:ID: cce/shared_cce_helpers
:ROAM_ALIASES: cce-common
:END:
#+TITLE: Shared CCE Helpers
#+filetags: :CCE:
#+PROPERTY: header-args :mkdirp yes
#+PROPERTY: header-args:emacs-lisp :comments link
#+ARCOLOGY_KEY: cce/cce-common
#+ARCOLOGY_ALLOW_CRAWL: t
#+AUTO_TANGLE: t
This constitutes the backbone of [[id:cce/cce][The Complete Computing Environment]]. These functions rely on =#+KEYWORD= style metadata embedded throughout my [[id:cce/org-roam][org-roam]] [[id:knowledge_base][Knowledge Base]] and some custom extensions to org-roam to enable this [[id:e050ed03-044f-4a48-912d-72579bef9a26][keyword caching]]. Taken together, these functions provide a concrete API (or at the inspiration for a generic API) for building limited [[id:cce/literate_programming][Literate Programming]] applications, [[id:128ab0e8-a1c7-48bf-9efe-0c23ce906a48][org-mode meta applications]] which can answer interesting questions from across your knowledge base. It's unfortunate that this relies on patches to org-roam which aren't upstreamed, I'm awaiting a plugin architecture that lets me decouple this. In the meantime my [[id:cce/home-manager][home-manager]] installs the version of [[id:cce/org-roam][org-roam]] which has these additions. I've constructed an Ouroboros.
* CCE Git Ignore
:PROPERTIES:
:ID: cce-git-ignore
:END:
#+begin_src shell :tangle .gitignore
,*.el
,*.elc
,*.shell
,*.conf
,*-capture.org
,*-template.org
morning-routine-capture
reference-capture-template
gnus-respond
gnus-review
remote-video-capture-template
,*.desktop
,*.service
emacs-pager-bin
mbsync-endpointrc
termux-url-opener
termux-imap-tunnel
inventory
,*.yml
roles
ggs
bash_profile.d
bashrc.d
syncthing.list
userChrome.css
userContent.css
Xmodmap
udev/*
nixlib/*/*.nix
nixlib/*.nix
captures/*
wireguard/*
fehbg.sh
pam_u2f_cfg
env
xmonad.hs
ytmusic-auth.json
ytmusic-cookie.txt
bandcamp-cookie.txt
vdirsyncer-config.txt
#+end_src
* Predicate Functions
:PROPERTIES:
:ID: cce-predicate-fns
:END:
#+ARROYO_EMACS_MODULE: cce-common
These are simple predicate functions which can be used in the =CCE_PREDICATE=:
#+begin_src emacs-lisp :results none :tangle cce-common.el
(defun cce/using-termux ()
"A CCE predicate"
(or (not (string-blank-p (or (getenv "ANDROID_DATA") "")))
(and (boundp 'building-for-termux)
building-for-termux)))
(defun cce/has-display-frames ()
"Dynamic CCE predicate"
(and (not (cce/using-termux))
(> (length (frame-list)) 0)))
(defun cce/using-exwm ()
"Dynamic CCE predicate"
(and (not (cce/using-termux))
(not (string-blank-p (getenv "DISPLAY")))))
(defun cce/using-linux ()
"Dynamic CCE predicate"
(eq 'gnu/linux system-type))
#+end_src