diff options
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/backup | 2 | ||||
-rwxr-xr-x | .local/bin/hddmnt | 14 | ||||
-rwxr-xr-x | .local/bin/nb | 9 | ||||
-rwxr-xr-x | .local/bin/ndate | 2 | ||||
-rwxr-xr-x | .local/bin/newsboat-notif | 14 | ||||
-rwxr-xr-x | .local/bin/ref-newsboat | 48 | ||||
-rwxr-xr-x | .local/bin/ref_sfeed | 8 |
7 files changed, 18 insertions, 79 deletions
diff --git a/.local/bin/backup b/.local/bin/backup index 06b168c..5d09ddf 100755 --- a/.local/bin/backup +++ b/.local/bin/backup @@ -8,6 +8,8 @@ rsync -avhz --progress --delete-after "${HOME}"/games/ssd/ksp-kcalbeloh/GameData rsync -avhz --progress --delete-after "${XDG_DATA_HOME}"/pass zhinu:/var/mother_backup/pass/ rsync -avhz --progress --delete-after "${XDG_DATA_HOME}"/newsboat/ zhinu:/var/mother_backup/newsboat/data/ rsync -avhz --progress --delete-after "${XDG_CONFIG_HOME}"/newsboat/ zhinu:/var/mother_backup/newsboat/conf/ +rsync -avhz --progress --delete-after "${XDG_DATA_HOME}"/sfeed/ zhinu:/var/mother_backup/newsboat/data/ +rsync -avhz --progress --delete-after "${XDG_CONFIG_HOME}"/sfeed/ zhinu:/var/mother_backup/newsboat/conf/ rsync -avhz --progress --delete-after "${HOME}"/dev/c/c_dergods_realm_2 zhinu:/var/mother_backup/dr2/ rsync -avhz --progress --delete-after "${HOME}"/mid/sort zhinu:/var/mother_backup/ ssh zhinu -- 'chown -v 1000: /var/mother_backup/*' diff --git a/.local/bin/hddmnt b/.local/bin/hddmnt index a7c3b8a..c3b73d3 100755 --- a/.local/bin/hddmnt +++ b/.local/bin/hddmnt @@ -7,23 +7,23 @@ case "$(hostname -s)" in mother|po-rbo) dev=$(find /dev/sd* -type b -exec bash -c 'doas cryptsetup isLuks {} && echo {}' \; | head -n1) if [ -z "$dev" ]; then - herbe ' crypt dev not detected' + herbe ' crypt dev not detected' & exit 1 fi if ! doas cryptsetup open "$dev" "$devname"; then - herbe " failed to uncrypt dev $dev" + herbe " failed to uncrypt dev $dev" & exit 1 fi mkdir -p "$mountpoint" if ! doas mount /dev/mapper/"$devname" "$mountpoint"; then - herbe " failed to mount dev $dev" + herbe " failed to mount dev $dev" & exit 1 fi - herbe " crypt dev mounted to $mountpoint" + herbe " crypt dev mounted to $mountpoint" & ;; mars) if ! diskinfo da0 >/dev/null; then - herbe ' HDD not detected' + herbe ' HDD not detected' & exit 1 fi if mount | grep -F /dev/da0p1; then @@ -34,11 +34,11 @@ case "$(hostname -s)" in fi if ! dmenu -m 0 -p 'Enter password: ' -P | geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then - herbe ' Failed to mount HDD' + herbe ' Failed to mount HDD' & exit 1 fi mkdir -p "$HOME"/hdd mount /dev/da0p1.eli "$HOME"/hdd - herbe ' HDD mounted to ~/hdd' + herbe ' HDD mounted to ~/hdd' & ;; esac diff --git a/.local/bin/nb b/.local/bin/nb deleted file mode 100755 index 3b36835..0000000 --- a/.local/bin/nb +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -[ $(hostname -s) = "po-rbo" ] && exec newsboat -[ -f /tmp/cache.db ] && exec newsboat -c /tmp/cache.db -u /tmp/urls -cache_file="$XDG_DATA_HOME/newsboat/cache.db.gpg" -urls_file="$XDG_CONFIG_HOME/newsboat/urls.gpg" -[ -f $urls_file ] && gpg -q -d $urls_file > /tmp/urls || return -[ -f $cache_file ] && gpg -q -d $cache_file > /tmp/cache.db || return -newsboat -c /tmp/cache.db -u /tmp/urls diff --git a/.local/bin/ndate b/.local/bin/ndate index 460cf1d..7a3f6ad 100755 --- a/.local/bin/ndate +++ b/.local/bin/ndate @@ -11,4 +11,4 @@ # == ================ # ===================== -exec herbe " $(date '+%H:%M | %a, %d %b %Y')" +exec herbe " $(date '+%H:%M | %a, %d %b %Y')" & diff --git a/.local/bin/newsboat-notif b/.local/bin/newsboat-notif deleted file mode 100755 index 9962fa2..0000000 --- a/.local/bin/newsboat-notif +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# ===================== -# ==== =============== -# ===================== -# === === ==== == -# ==== == == = = -# ==== == = == = -# ==== == = == ==== -# ==== == = == = = -# = = === ==== == -# == ================ -# ===================== - -[ $1 -gt 0 ] && exec herbe " $@ new articles" diff --git a/.local/bin/ref-newsboat b/.local/bin/ref-newsboat deleted file mode 100755 index e5d9848..0000000 --- a/.local/bin/ref-newsboat +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Capture::Tiny qw(capture); - -use constant { - NEWSBOAT_PATH => 'newsboat', - NOTIFYSEND_PATH => 'herbe' -}; - -sub notify -{ - my ($str) = @_; - - my $pid = fork(); - if (not $pid) { - exec(NOTIFYSEND_PATH, $str); - } - return; -}; - -sub main -{ - my $stdout; - my $nb; - - $nb = NEWSBOAT_PATH; - if (system( - $nb, - '-x', - 'reload' - ) != 0) { - exit 1; - } - - $stdout = qx($nb -x print-unread); - $stdout =~ s/\s.+//; - chomp $stdout; - if ($stdout != 0) { - notify(' ' . $stdout . ' new articles'); - } - return; -} - -main(); - -__END__ diff --git a/.local/bin/ref_sfeed b/.local/bin/ref_sfeed new file mode 100755 index 0000000..3982bc9 --- /dev/null +++ b/.local/bin/ref_sfeed @@ -0,0 +1,8 @@ +#!/bin/sh + +pre=$(wc -l --total=only $XDG_DATA_HOME/sfeed/feeds/*) +sfeed_update $XDG_CONFIG_HOME/sfeed/sfeedrc >/dev/null 2>1 +post=$(wc -l --total=only $XDG_DATA_HOME/sfeed/feeds/*) +if [ $post -gt $pre ]; then + exec herbe " $((post-pre)) new articles" & +fi |