From 22638fee0ebf5f669b99e4df36ebc5a9e6e8660d Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 8 Sep 2024 12:08:00 -0400 Subject: fix recoll installation --- .chezmoiignore | 3 ++- dot_emacs.d/elpa/private_gnupg/private_pubring.kbx | Bin 2413 -> 0 bytes 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 dot_emacs.d/elpa/private_gnupg/private_pubring.kbx diff --git a/.chezmoiignore b/.chezmoiignore index f4aa1fa..7c7bb6b 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -64,7 +64,8 @@ afs .mutt/cache .mutt/tmp .opam -.recoll +.recoll/* +!.recoll/recoll.conf .ssh/known_hosts.old .ssh/keys/{{ .chezmoi.hostname }}/id_ed25519 .ssh/keys/{{ .chezmoi.hostname }}/id_rsa diff --git a/dot_emacs.d/elpa/private_gnupg/private_pubring.kbx b/dot_emacs.d/elpa/private_gnupg/private_pubring.kbx deleted file mode 100644 index e5f5b58..0000000 Binary files a/dot_emacs.d/elpa/private_gnupg/private_pubring.kbx and /dev/null differ -- cgit v1.2.3 From f3031643ad1c00a9b71abc0258ad0715e312cb62 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 8 Sep 2024 12:08:15 -0400 Subject: install wc-mode --- dot_emacs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dot_emacs b/dot_emacs index 08ff547..1bb56dc 100644 --- a/dot_emacs +++ b/dot_emacs @@ -1068,6 +1068,9 @@ If not, issue a warning." :config (add-to-list 'vc-handled-backends 'git)) +(use-package wc-mode + :ensure t) + (use-package windmove :config (windmove-default-keybindings) -- cgit v1.2.3 From fd7a467d8430682ad665a3db0b6e60aeea4c721f Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 8 Sep 2024 12:16:31 -0400 Subject: swaybg randomize background hourly --- bin/executable_swaybg-random | 13 +------- .../symlink_swaybg-random.service | 1 + dot_config/systemd/user/hourly@.timer | 10 ++++++ dot_config/systemd/user/swaybg-random.service | 12 +++++++ dot_config/systemd/user/tmpreaper@.service | 38 ++++++++++++++++++++++ dot_config/systemd/user/tmpreaper@.timer | 11 +++++++ 6 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service create mode 100644 dot_config/systemd/user/hourly@.timer create mode 100644 dot_config/systemd/user/swaybg-random.service create mode 100644 dot_config/systemd/user/tmpreaper@.service create mode 100644 dot_config/systemd/user/tmpreaper@.timer diff --git a/bin/executable_swaybg-random b/bin/executable_swaybg-random index 6184e33..ba4baa1 100644 --- a/bin/executable_swaybg-random +++ b/bin/executable_swaybg-random @@ -1,15 +1,4 @@ #!/bin/sh # Usage: swaybg-random directory -DIR=$1 -PIDFILE=$XDG_RUNTIME_DIR/swaybg.pid - -if test -z "$DIR"; then - echo "Usage: swaybg-random dir" - exit 1 -fi - -swaybg -i $(find $DIR/. -type f | shuf -n1) -m fill -o \* & -NEWPID=$! -pkill -F $PIDFILE -echo $NEWPID > $PIDFILE +exec swaybg -i "$(find ~/bg/. -type f | shuf -n1)" -m fill diff --git a/dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service b/dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service new file mode 100644 index 0000000..2ebb1f9 --- /dev/null +++ b/dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service @@ -0,0 +1 @@ +/home/rak/.config/systemd/user/swaybg-random.service diff --git a/dot_config/systemd/user/hourly@.timer b/dot_config/systemd/user/hourly@.timer new file mode 100644 index 0000000..0b3a0db --- /dev/null +++ b/dot_config/systemd/user/hourly@.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Hourly Timer for %i service + +[Timer] +OnCalendar=*-*-* *:00:00 +Persistent=true +Unit=%i.service + +[Install] +WantedBy=default.target diff --git a/dot_config/systemd/user/swaybg-random.service b/dot_config/systemd/user/swaybg-random.service new file mode 100644 index 0000000..37cd49d --- /dev/null +++ b/dot_config/systemd/user/swaybg-random.service @@ -0,0 +1,12 @@ +[Unit] +Description=randomize background + +[Service] +Type=exec +Restart=always +RuntimeMaxSec=1h + +ExecStart=/home/rak/bin/swaybg-random + +[Install] +WantedBy=default.target diff --git a/dot_config/systemd/user/tmpreaper@.service b/dot_config/systemd/user/tmpreaper@.service new file mode 100644 index 0000000..200dd69 --- /dev/null +++ b/dot_config/systemd/user/tmpreaper@.service @@ -0,0 +1,38 @@ +[Unit] +Description=tmpreaper cleanup + +[Service] +Type=oneshot +LockPersonality=true +MemoryDenyWriteExecute=yes +NoNewPrivileges=yes +ProtectControlGroups=yes +ProtectHostname=yes +RestrictAddressFamilies= +RestrictNamespaces=yes +RestrictRealtime=yes +RestrictSUIDSGID=yes +SystemCallArchitectures=native +SystemCallFilter=@system-service +SystemCallErrorNumber=EPERM +# To restrict write access further, change "ProtectSystem" to "strict" and uncomment +# "ReadWritePaths", "ReadOnlyPaths", "ProtectHome", and "BindPaths". Then add any local repository +# paths to the list of "ReadWritePaths" and local backup source paths to "ReadOnlyPaths". This +# leaves most of the filesystem read-only to borgmatic. +ProtectSystem=strict +ReadWritePaths=%I + +# Lower CPU and I/O priority. +Nice=19 +CPUSchedulingPolicy=batch +IOSchedulingClass=best-effort +IOSchedulingPriority=7 +IOWeight=100 + +Restart=no +LogRateLimitIntervalSec=0 + +# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and +# dbus-user-session to be installed. +#ExecStartPre=sleep 1m +ExecStart=/usr/sbin/tmpreaper --test --mtime-dir 60d %I diff --git a/dot_config/systemd/user/tmpreaper@.timer b/dot_config/systemd/user/tmpreaper@.timer new file mode 100644 index 0000000..a1968c7 --- /dev/null +++ b/dot_config/systemd/user/tmpreaper@.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Run tmpreaper daily + +[Timer] +OnCalendar=daily +RandomizedDelaySec=1h +AccuracySec=3h +Persistent=true + +[Install] +WantedBy=timers.target -- cgit v1.2.3 From 06a0c335025c1e8f73bb15013e451d968b9789e3 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 8 Sep 2024 12:16:54 -0400 Subject: mutt_oauth2 update --- bin/executable_mutt_oauth2.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) mode change 100755 => 100644 bin/executable_mutt_oauth2.py diff --git a/bin/executable_mutt_oauth2.py b/bin/executable_mutt_oauth2.py old mode 100755 new mode 100644 index b32fc11..559811f --- a/bin/executable_mutt_oauth2.py +++ b/bin/executable_mutt_oauth2.py @@ -39,13 +39,13 @@ import shlex import socket import http.server import subprocess +import readline # The token file must be encrypted because it contains multi-use bearer tokens # whose usage does not require additional verification. Specify whichever # encryption and decryption pipes you prefer. They should read from standard -# input and write to standard output. The example values here invoke GPG, -# although won't work until an appropriate identity appears in the first line. -ENCRYPTION_PIPE = ['gpg', '--encrypt', '--recipient', 'YOUR_GPG_IDENTITY'] +# input and write to standard output. The example values here invoke GPG. +ENCRYPTION_PIPE = ['gpg', '--encrypt', '--default-recipient-self'] DECRYPTION_PIPE = ['gpg', '--decrypt'] registrations = { @@ -93,7 +93,7 @@ ap.add_argument('--decryption-pipe', type=shlex.split, default=DECRYPTION_PIPE, help='decryption command (string), reads from stdin and writes ' 'to stdout, default: "{}"'.format( " ".join(DECRYPTION_PIPE))) -ap.add_argument('--encryption-pipe', type=shlex.split, +ap.add_argument('--encryption-pipe', type=shlex.split, default=ENCRYPTION_PIPE, help='encryption command (string), reads from stdin and writes ' 'to stdout, suggested: "{}"'.format( " ".join(ENCRYPTION_PIPE))) @@ -140,6 +140,8 @@ if args.debug: if not token: if not args.authorize: sys.exit('You must run script with "--authorize" at least once.') + if not ENCRYPTION_PIPE: + sys.exit("You need to provide a suitable --encryption-pipe setting") print('', ) token['registration'] = args.provider or input( 'Available app and endpoint registrations: {regs}\nOAuth2 registration: '.format( @@ -241,7 +243,7 @@ if args.authorize: if 'code' in querydict: authcode = querydict['code'][0] self.do_HEAD() - self.wfile.write(b'Authorizaton result') + self.wfile.write(b'Authorization result') self.wfile.write(b'

Authorization redirect completed. You may ' b'close this window.

') with http.server.HTTPServer(('127.0.0.1', listen_port), MyHandler) as httpd: @@ -259,6 +261,7 @@ if args.authorize: 'code': authcode, 'client_secret': token['client_secret'], 'code_verifier': verifier}) + print('Exchanging the authorization code for an access token') try: response = urllib.request.urlopen(registration['token_endpoint'], urllib.parse.urlencode(p).encode()) -- cgit v1.2.3 From 29ca65ec24bd3fa51126d47c0a3397ed6087f823 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 8 Sep 2024 12:17:10 -0400 Subject: fix keychain bug in zshrc --- dot_zshrc.tmpl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index ed06714..c672966 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -587,9 +587,7 @@ NO_verbose \ # GPG / SSH AGENT if command -v keychain > /dev/null && test -d ~/.ssh/keys/{{ .chezmoi.hostname }}; then - ls ~/.ssh/keys/{{ .chezmoi.hostname }}/id_* | \ - grep -E -v '\.pub$' | \ - xargs keychain {{ if (eq .chezmoi.os "linux") -}} --systemd {{- end }} + keychain {{ if (eq .chezmoi.os "linux") -}} --systemd {{- end }} ~/.ssh/keys/{{ .chezmoi.hostname }}/id_*[^p][^u][^b] [ -z "$HOSTNAME" ] && HOSTNAME=`uname -n` [ -f $HOME/.keychain/$HOSTNAME-sh ] && . $HOME/.keychain/$HOSTNAME-sh -- cgit v1.2.3 From f065aea8b37a933bdb603af5545a46ae553a525d Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 8 Sep 2024 12:17:19 -0400 Subject: fix thread sorting neomutt --- dot_config/neomutt/neomuttrc.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dot_config/neomutt/neomuttrc.tmpl b/dot_config/neomutt/neomuttrc.tmpl index a9b3547..96091e8 100644 --- a/dot_config/neomutt/neomuttrc.tmpl +++ b/dot_config/neomutt/neomuttrc.tmpl @@ -56,7 +56,8 @@ macro index .n "~N|~O