dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 180848110ca26564b4dd87b2b9ba941005ca6819
parent 7bb4438051014226eaac5f1dae9295cfe83b191a
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Wed, 27 Jan 2021 11:02:46 +0100

newsrefreshd: ask for BW password because Miniflux

Diffstat:
Mscripts/newsrefreshd | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/newsrefreshd b/scripts/newsrefreshd @@ -6,5 +6,12 @@ notidie() { exit 1 } -newsboat -x reload 2>&1 || notidie "Newsboat: error reloading" "Unable to reload" -newsboat -x print-unread | xargs -I{} terminal-notifier -group news -sender news -title 'Newsboat reloaded' -message "{}" +os=$(uname -s | tr '[:upper:]' '[:lower:]') +case "$os" in + darwin*) + seshkey="$(printf "%s\n" "$(osascript -e 'tell application "System Events" to get text returned of (display dialog "Unlock your Bitwarden vault" default answer "" hidden answer true giving up after 0 with title "Newsboat Refresh")')" | bw unlock --raw 2>/dev/null)" + ;; +esac + +BW_SESSION="$seshkey" newsboat -x reload 2>&1 || notidie "Newsboat: error reloading" "Unable to reload" +BW_SESSION="$seshkey" newsboat -x print-unread | xargs -I{} terminal-notifier -group news -sender news -title 'Newsboat reloaded' -message "{}"