citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 904d4ce5b7932770c6115a2cb95a3837676e34dc
parent 96895d771f817921f1fc98e633273a7a8122e3c6
Author: William Casarin <jb55@jb55.com>
Date:   Sun,  5 Dec 2021 19:42:24 -0800

many updates

Diffstat:
Mbin/btc-submitblocks | 8+++++---
Mbin/cols | 2+-
Mbin/fuzz-jump-branchdiff | 2+-
Mbin/gemmark | 2+-
Mbin/git-review | 2+-
Mbin/lock | 2+-
Mbin/rss | 17+++--------------
Dbin/rssurl | 10----------
Mbin/spotify-playpause | 14+++++++++++++-
Mbin/spotify-service | 6++----
Mdotfiles/.bashrc | 8+++++++-
Mdotfiles/.config/mpv/mpv.conf | 2++
Mdotfiles/.config/neomutt/neomuttrc | 4++++
Mdotfiles/.config/nvim/init.vim | 6++++--
Mdotfiles/.config/qutebrowser/config.py | 7+++++--
Mdotfiles/.gitconfig | 1+
Mdotfiles/.xbindkeysrc | 3+++
Mdotfiles/commands | 40++++++++++++++++++++++++----------------
Mnix-config/environment/desktop/default.nix | 2+-
Mnix-config/machines/monad/default.nix | 4++--
Mnix-config/nixpkgs/config.nix | 4++++
21 files changed, 85 insertions(+), 61 deletions(-)

diff --git a/bin/btc-submitblocks b/bin/btc-submitblocks @@ -7,6 +7,7 @@ mkdir -p /tmp/blocks nncp-toss blocks=$(bitcoin-cli getblockcount) +results=$(mktemp) cd /tmp/blocks blocklist=$(ls -1 | sort -n) @@ -15,17 +16,18 @@ printf "%d blocks to submit...\n" "$to_submit" >&2 for block in $blocklist do - printf "submitting block $block ... " >&2 - res=$(<$block bitcoin-cli -stdin submitblock) - printf "$res\n" >&2 + echo "$res" >> $results if [ "$res" = "prev-blk-not-found" ]; then exit 42 fi done +echo "$(sortur < $results)" +rm $results + blocks2=$(bcli getblockcount) printf "%d to height %d, processed %d blocks\n" $blocks $blocks2 $(bc <<<"$blocks2 - $blocks") diff --git a/bin/cols b/bin/cols @@ -1,4 +1,4 @@ #!/usr/bin/env sh -cols=${1:-80} +cols=${1:-$(tput cols)} shift fold -w $cols -s "$@" diff --git a/bin/fuzz-jump-branchdiff b/bin/fuzz-jump-branchdiff @@ -1,3 +1,3 @@ #!/usr/bin/env bash set -eou pipefail -find .git/refs | sed 's,^.git/,...,g' | fzf | xargs fuzz-edit-diff-line +find .git/refs | sed 's,^.git/refs/,...,g' | fzf | xargs fuzz-edit-diff-line diff --git a/bin/gemmark b/bin/gemmark @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -eou pipefail url=$(<~/dotfiles/gemmarks ct | fzf | awkp 2) -gemini "$url" +echo gemini "$url" diff --git a/bin/git-review b/bin/git-review @@ -24,7 +24,7 @@ rm -rf "$DIR" mkdir -p "$DIR" printf "git format-patch origin/%s..FETCH_HEAD -o %s\n" "$BASE" "$DIR" -git format-patch origin/$BASE..FETCH_HEAD -o "$DIR" +git format-patch -U8 origin/$BASE..FETCH_HEAD -o "$DIR" printf "$DIR\n" diff --git a/bin/lock b/bin/lock @@ -1,6 +1,6 @@ #!/usr/bin/env bash -#lockmac & +lockmac & slock & diff --git a/bin/rss b/bin/rss @@ -1,17 +1,6 @@ #!/usr/bin/env bash - set -eou pipefail -if [ -z "$1" ]; then - printf "usage: rss <something.com>\n" - exit 1 -fi - -rsshref=$(curl -sL "$1" | rsslink) - -if [ -z "$rsshref" ]; then - printf "no rss feed found on '%s'\n" "$1" - exit 2 -fi - -rssurl "$rsshref" +<~/var/rss.tsv datefmt '%m-%d' | +fzf --tac --no-sort | +cutt -f4 diff --git a/bin/rssurl b/bin/rssurl @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -eou pipefail - -if [ -z "$1" ]; then - printf "usage: rssurl <some.link/rss.xml>\n" - exit 1 -fi - -curl -sL "$1" | xq -rc '.rss.channel.item[] | [.title,.link] | @tsv' | fzf | cutt -f2 | xargs plainweb diff --git a/bin/spotify-playpause b/bin/spotify-playpause @@ -1,2 +1,14 @@ #!/usr/bin/env bash -dbus-send --print-reply --dest="$(spotify-service)" /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause + +bus=$(dbus-send \ + --print-reply=literal \ + --dest=org.freedesktop.DBus \ + --type=method_call \ + /org/freedesktop/DBus \ + org.freedesktop.DBus.ListNames | + tr ' ' '\n' | + grep 'org.mpris.MediaPlayer2' | + head -n 1 + ) + +dbus-send --print-reply --dest="$bus" /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause diff --git a/bin/spotify-service b/bin/spotify-service @@ -1,6 +1,4 @@ #!/usr/bin/env bash -options=$(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames \ - | grep spotify \ - | sedcut '"([^"]+)"') -grep 'spotify$' <<<"$options" || grep -v 'spotify$' <<<"$options" +service=${1:-spotify} + diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc @@ -35,7 +35,13 @@ UNDISTRACT="$HOME/dotfiles/bash-undistract-me/undistract-me.sh" export PAGER="less" export LESS="-cix8RM --save-marks" -TERM_THEME="$(basename $(readlink ~/.Xresources.d/themes/current))" +TERM_THEME="dark" +if [ -f ~/.Xresources.d/themes/current ]; then + TERM_THEME="$(basename $(readlink ~/.Xresources.d/themes/current))" +fi + +# private stuff +. ~/.bash_private if [ "$TERM_THEME" == "light" ] then diff --git a/dotfiles/.config/mpv/mpv.conf b/dotfiles/.config/mpv/mpv.conf @@ -1 +1,3 @@ force-window=yes +save-position-on-quit +script-opts=ytdl_hook-ytdl_path=yt-dlp diff --git a/dotfiles/.config/neomutt/neomuttrc b/dotfiles/.config/neomutt/neomuttrc @@ -12,6 +12,10 @@ set mime_forward=no unset markers set text_flowed +set reverse_name=yes +set reverse_realname=no +alternates ^jb55@jb55.com$ ^will.casarin@steamoji.com$ + set sort = threads set sort_aux = reverse-last-date-received diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim @@ -8,6 +8,8 @@ set hlsearch set colorcolumn=80 set nowrap set hidden +set rnu +set wrap hi ColorColumn ctermbg=8 @@ -40,9 +42,9 @@ imap <A-,> = imap <A-Space> <CR> autocmd FileType go autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe gofmt\<esc>:loadview\<esc>`z" -autocmd FileType go set wrap rnu +autocmd FileType go set wrap autocmd FileType rust autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe rustfmt\<esc>:loadview\<esc>`z" -autocmd filetype javascript set sw=4 ts=4 expandtab +autocmd FileType javascript autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe jsfmt\<esc>:loadview\<esc>`z" "autocmd filetype html set sw=2 ts=2 expandtab diff --git a/dotfiles/.config/qutebrowser/config.py b/dotfiles/.config/qutebrowser/config.py @@ -15,6 +15,8 @@ config.load_autoconfig(False) # Type: Dict c.aliases = {'q': 'quit', 'w': 'session-save', 'wq': 'quit --save'} +config.set('downloads.location.directory', '~/dl') + # Enable JavaScript. # Type: Bool config.set('content.javascript.enabled', True, 'file://*') @@ -82,9 +84,10 @@ config.set('tabs.select_on_remove', 'last-used') config.set('url.default_page', 'about:blank') + config.set('url.searchengines', { - 'DEFAULT': 'https://google.com/search?q={}', - 'ddg': 'http://duckduckgo.com/?q={}', + #'DEFAULT': 'https://google.com/search?q={}', + 'DEFAULT': 'http://duckduckgo.com/?q={}', 'star': 'https://github.com/stars?utf8=%E2%9C%93&q={}', 'so': 'https://google.com/search?q=site:stackoverflow.com {}', 'gl': 'http://www.google.com/search?q={}&btnI=Im+Feeling+Lucky', diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig @@ -74,6 +74,7 @@ tg = log --date-order --tags --simplify-by-decoration --pretty=format:'%ai %h %d' try = merge --no-commit --no-ff co = checkout + sw = switch fixes = show -s --pretty='format:Fixes: %h (\"%s\")' pushall = !git remote | parallel -L1 -I R git push R master [rebase] diff --git a/dotfiles/.xbindkeysrc b/dotfiles/.xbindkeysrc @@ -16,6 +16,9 @@ "xbacklight -dec 5" XF86MonBrightnessDown +"toggle-mute" + XF86AudioMute + "xbacklight -inc 5" XF86MonBrightnessUp diff --git a/dotfiles/commands b/dotfiles/commands @@ -1,3 +1,10 @@ +acl app > cal > list echo pcal list +aci app > cal > interactive echo pcal interactive +afh app > fedi > home echo fedi-timeline home +afi app > fedi > interesting echo fedi-timeline list/260 +ar app > rss > feeds fuzz-rss +are app > rss > edit feeds echo edit ~/dotfiles/rssfeeds +ars app > rss > show feeds echo cat ~/dotfiles/rssfeeds bt btc txs fuzz-btc-txs cc compile fuzz-compile cd change directory fuzz-cd-dirname @@ -6,33 +13,33 @@ ce compile error fuzz-compile-error cR compile repeat error fuzz-compile-repeat-error cr compile repeat fuzz-compile-repeat cs compile show build echo cat .build-result +dsa docs->stripe->api ~/docs/stripe/jumpapi +dsg docs->stripe->go fuzzdoc ~/docs/stripe/go-v72.txt '^type ' ecc edit vdirsyncer config echo edit ~/.config/vdirsyncer/config ec edit commands fuzz-edit-scripts ed edit default.nix echo edit default.nix eFc edit fuzz command fuzz-edit-command eFl edit fuzz command list fuzz-edit-command-list egc edit git config echo edit ~/.gitconfig -egm edit gemmarks echo edit ~/dotfiles/gemmarks +eG edit gemmarks echo edit ~/dotfiles/gemmarks elf edit last files fuzz-last-files edit eM edit mimi echo edit ~/.config/mimi/mime.conf em edit mutt config echo edit ~/.config/neomutt/neomuttrc -vim edit vim config echo edit ~/.config/nvim/init.vim ff create file echo fuzz-create-file gb git branches echo git bvr -G gemini echo gemmark +G gemini gemmark ghi github issues fuzz-gh-issue-list ghp github prf fuzz-gh-pr-list gpm git mlap echo git mlap h run history fuzz-run-hist jt jump tag fuzz-jump-tag -kp khal personal echo pcal nai notmuch archive inbox fuzz-notmuch-archive-inbox nam notmuch am fuzz-notmuch-am nat notmuch archive fuzz-notmuch-archive Nc new command echo make-script ni notmuch inbox fuzz-notmuch-inbox -nt notmuch threads fuzz-notmuch-threads nT email today echo f nt query:today +nt notmuch threads fuzz-notmuch-threads of open file fuzz-open-file olf open last files fuzz-last-files open pc cat project file fuzz-cat-file @@ -40,23 +47,24 @@ pf edit project file fuzz-edit-file ps edit project skeletons fuzz-edit-file --dir ~/dotfiles/skeletons rf recent files fuzz-recent-files sc show command fuzz-show-script -dsa docs->stripe->api ~/docs/stripe/jumpapi -dsg docs->stripe->go fuzzdoc ~/docs/stripe/go-v72.txt '^type ' -Ssg steamoji service gql fuzzedit schema '^' -Ssm steamoji service mutations fuzzedit mutation '^func ' -Ssq steamoji service queries fuzzedit query '^func ' -Sd edit steamoji doc echo edit /home/jb55/projects/steamoji/doc/$(ls -1pt /home/jb55/projects/steamoji/doc | grep -v / | head -n1) sFc show fuzz command fuzz-show-fuzz-command sf search project file funcs fuzz-funcs +sgb search git branch fuzz-jump-branchdiff sgd search git diff fuzz-edit-diff-line sgh search git head fuzz-edit-diff-line HEAD^- sgs search git staged diff fuzz-edit-diff-line --staged -sgb search git branch fuzz-jump-branchdiff sh show history fuzz-show-hist sp search project fuzz-search-files ss search project file fuzz-search-file -ts trello sprint fuzz-trello-sprint -tsi trello sprint inprogress fuzz-trello-sprint "^In Progress " -tsb trello sprint backlog fuzz-trello-sprint "^Backlog " -tst trello sprint todo fuzz-trello-sprint "^Todo " +st search TODOs fuzz-search-files TODO +vim edit vim config echo edit ~/.config/nvim/init.vim +wn work notes echo edit /home/jb55/projects/steamoji/doc/$(ls -1pt /home/jb55/projects/steamoji/doc | grep -v / | head -n1) +wsg work service gql fuzzedit schema '^' +wsm work service mutations fuzzedit mutation '^func ' +wsq work service queries fuzzedit query '^func ' +wtb work > trello backlog fuzz-trello-sprint "^Backlog " +wti work > trello inprogress fuzz-trello-sprint "^In Progress " +wtr work > trello refresh echo trello refresh +wts work > trello sprint fuzz-trello-sprint +wtt work > trello todo fuzz-trello-sprint "^Todo " z fz echo fz diff --git a/nix-config/environment/desktop/default.nix b/nix-config/environment/desktop/default.nix @@ -16,7 +16,7 @@ let gtk2rc = pkgs.writeText "gtk2rc" '' jb55pkgs = import <jb55pkgs> { inherit pkgs; }; jbpkgs = with jb55pkgs; [ - #snap + snap cmdtree zoom-link-opener x11-rename diff --git a/nix-config/machines/monad/default.nix b/nix-config/machines/monad/default.nix @@ -225,7 +225,7 @@ in }; virtualisation.libvirtd.enable = false; - virtualisation.libvirtd.qemuOvmf = true; + virtualisation.libvirtd.qemuOvmf = false; virtualisation.libvirtd.qemuVerbatimConfig = '' user = "jb55" group = "kvm" @@ -256,7 +256,7 @@ in environment.systemPackages = [ pkgs.virt-manager ]; - virtualisation.virtualbox.host.enable = true;#if extra.is-minimal then false else true; + virtualisation.virtualbox.host.enable = false; virtualisation.virtualbox.host.enableHardening = false; #virtualization.virtualbox.host.enableExtensionPack = true; diff --git a/nix-config/nixpkgs/config.nix b/nix-config/nixpkgs/config.nix @@ -21,6 +21,10 @@ in { smbdSupport = true; }; + mpv = super.mpv-with-scripts.override { + scripts = [ pkgs.mpvScripts.mpris ]; + }; + # /run/current-system/sw/bin/ls $HOME/.emacs.d/elpa | sed 's/-[[:digit:]].*//g;s/\+$/-plus/g' | sort -u #emacs = super.emacsHead; nur = import (builtins.fetchTarball {