+pdfwc() { local f; for f; do echo "$f" "$(pdfinfo "$f" | awk '/^Pages:/ {print $2}')"; done }
+
+
+# nvm install script appended this to my .bashrc. I dont want to run it all the time,
+# so put it in a function.
+nvm-init() {
+ export NVM_DIR="$HOME/.nvm"
+ # shellcheck disable=SC1091 # may not exist, & third party
+ [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # This loads nvm
+ # shellcheck disable=SC1091 # may not exist, & third party
+ [ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion" # This loads nvm bash_completion
+}
+
+
+leap-year() {
+ if date -d 'february 29' &>/dev/null; then
+ year_days=366
+ else
+ year_days=365
+ fi
+ echo $year_days
+}
+
+# on-battery
+on-bat() {
+ if [[ -e /sys/class/power_supply/AC/online && $(</sys/class/power_supply/AC/online) == 0 ]]; then
+ return 1
+ fi
+}
+
+# make vim work with my light colortheme terminal.
+vim() {
+ if [[ -e ~/.vimrc ]]; then
+ command vim "$@"
+ else
+ command vim -c ':colorscheme peachpuff' "$@"
+ fi
+}
+
+# ls count. usage: pass a directory, get the number of files.
+# https://unix.stackexchange.com/questions/90106/whats-the-most-resource-efficient-way-to-count-how-many-files-are-in-a-director
+lsc() {
+ # shellcheck disable=SC2790 disable=SC2012 # intentional
+ ls -Uq "$@"|wc -l
+}
+
+# run then notify. close notification after the next prompt.
+rn() {
+ "$@"
+ dunstify -u critical "$*"
+ _psrun=(dunstctl close-all)
+}
+n() {
+ dunstify -u critical n
+ _psrun=(dunstctl close-all)
+}
+
+catnew() {
+ local dir file
+ dir="$1"
+ inotifywait -m "$dir" -e create -e moved_to | while read -r _ _ file; do
+ hr
+ cat "$dir/$file"
+ done
+}
+# cat mail
+cm() {
+ catnew /m/md/$1/new
+}
+