From 9038e1a87e122d91d55ebf80b7e2d7459286cde1 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 18 Feb 2022 12:20:49 -0500 Subject: updates --- hledger-networth | 5 ++++- seeme | 4 ++-- vlog | 16 +++++----------- z | 35 +++++++++++++++++++++++++++++++++-- 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/hledger-networth b/hledger-networth index 67c8aa8..3eabcc2 100755 --- a/hledger-networth +++ b/hledger-networth @@ -1,4 +1,7 @@ #!/usr/bin/env bash # # pipe to tplot for a quick plot -hledger reg ^as ^li -V | awk -F'[[:space:]][[:space:]]+' '{print $4}' | cut -d' ' -f1 | tr -d ',' +hledger reg ^as ^li -V -XUSD \ + | awk -F'[[:space:]][[:space:]]+' '{print $4}' \ + | cut -d' ' -f1 \ + | tr -d ',' diff --git a/seeme b/seeme index f57b837..23e47db 100755 --- a/seeme +++ b/seeme @@ -1,8 +1,8 @@ #! /usr/bin/env nix-shell #! nix-shell -i bash -p ffmpeg-full # -# Window is positioned in the top-right corner, plus a small margin for systray -# This could be automatically calculated by parsing xrandr screen dimentions. +# Window is positioned in the bottom-right corner. This could be automatically +# calculated by parsing xrandr screen dimentions. set -exo pipefail diff --git a/vlog b/vlog index 8a83e59..846f55b 100755 --- a/vlog +++ b/vlog @@ -5,30 +5,24 @@ # # c.f. https://gist.github.com/dpacmittal/9f0e1aea8a3732d8f7aec7b1dadc8cda # - FILE=$(date +%Y.%m.%d..%H.%M) DIR=${VLOGDIR:-/mnt/lake/ben/videos} SIZE=1920x1080 - if [ ! -d "$DIR" ] then - echo "error: $DIR does not exist" - exit 1 + echo "error: $DIR does not exist" + exit 1 fi - - OUTFILE="$DIR/$FILE.mkv" - echo "recording to: $OUTFILE" - ffmpeg \ - -f alsa -i default \ - -f x11grab -video_size "$SIZE" -r 48 -i :0.0+0,0 \ + -f alsa -i sysdefault:CARD=PCH \ + -f x11grab -video_size cif -framerate 48 -i :0.0+0.0 \ -f video4linux2 -i /dev/video0 \ -filter_complex '[2:v]scale=480:-1[cam];[1:v][cam]overlay=W-w-10:H-h-10' \ -ab 192 -acodec pcm_s16le -qscale 0 \ -c:v libx264 \ -crf:v 18 \ -c:a flac \ - -loglevel 5 \ + -loglevel 40 \ "$OUTFILE" diff --git a/z b/z index 1a3507e..855e669 100755 --- a/z +++ b/z @@ -1,2 +1,33 @@ -#!/usr/bin/env sh -exec guile -l ~/biz/z.scm -e main -s ~/biz/z.scm "$@" 2>/tmp/z.err +#!/usr/bin/env bash +# TODO: +# -- browse tags: +# --bind "ctrl-t:unbind(change)+enable-search+preview[echo 'match: {}']+reload[rg --no-filename --only-matching '(^|\B)#\w+' | sort | uniq]" \ +# - vim function to follow wiki links +set -euo pipefail +notesdir=${NOTES:-~/notes/notes} +cd "$notesdir" +RG="rg --ignore-case --files-with-matches" +RG_VIEW="rg --no-line-number --color=always --ignore-case --pretty --context 5" +EDITOR="vim --cmd 'set wrap'" +DATEFMT="+%Y.%-m.%-d" +fzf \ + --ansi \ + --disabled \ + --header="alt+: 0=view 1=search 2=tags 3=outline 4=backlinks" \ + --header-first \ + --bind "ctrl-/:change-preview-window(90%|down|hidden|)" \ + --bind "change:reload:$RG {q} || true" \ + --bind "enter:execute($EDITOR {})" \ + --bind "alt-enter:execute($EDITOR {q}.md)" \ + --bind "ctrl-space:execute($EDITOR daily/\$(date $DATEFMT).md)" \ + --bind "ctrl-r:replace-query" \ + --bind "pgdn:preview-page-down" \ + --bind "pgup:preview-page-up" \ + --bind "alt-0:preview:bat -p --color always {}" \ + --bind "alt-1:preview($RG_VIEW {q} {})" \ + --bind "alt-1:+reload:$RG {q} || true" \ + --bind "alt-2:preview:rg --only-matching '(^|\B)#\w+' {}" \ + --bind "alt-3:preview:rg --only-matching '^[#]+ .*$' {}" \ + --bind "alt-4:reload:rg -lF \$(tr -d '.md' <<< {+}) || true" \ + --preview "$RG_VIEW {q} {}" + -- cgit v1.2.3