From c43147e79bf153e5d4e65c84a2d905651d326bbe Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 13 Jul 2020 04:56:26 -0500 Subject: [PATCH] file upload screenshots --- dot_local/scripts/executable_screenshot.sh | 16 ++++++++++++++-- dot_zshrc | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dot_local/scripts/executable_screenshot.sh b/dot_local/scripts/executable_screenshot.sh index 51a7e14..b5b46f3 100644 --- a/dot_local/scripts/executable_screenshot.sh +++ b/dot_local/scripts/executable_screenshot.sh @@ -1,8 +1,20 @@ #!/bin/bash +set -e + SCREENSHOT=$HOME/.cargo/bin/leanshot # choose some file to save it to -FILE="/home/michael/Screenshots/$(date +%Y-%m-%d-%H:%M:%S).png" +FILENAME="$(date +%Y-%m-%d-%H:%M:%S).png" +FILE="$HOME/Screenshots/$FILENAME" $SCREENSHOT $1 -o $FILE -# optional: copy to clipboard + +# copy to clipboard XCLIP=/usr/bin/xclip $XCLIP -selection clipboard -t image/png -i $FILE +notify-send "captured $FILENAME" + +# upload it +url=$(ssh -vv -i $HOME/.ssh/id_rsa homelab $HOME/.local/bin/file-upload $FILENAME < $FILE 2> log) +url=${url%$'\n'} +$XCLIP -selection clipboard <<< "$url" +notify-send "uploaded $FILENAME" + diff --git a/dot_zshrc b/dot_zshrc index d2f04e8..5e647d2 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -18,6 +18,7 @@ export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" export EDITOR=nvim source $HOME/.cargo/env +source $HOME/.ghcup/env export PATH="$HOME/.local/bin:$HOME/.local/scripts:$HOME/.dotnet/tools:$PATH:$HOME/go/bin" [ -f "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/env" ] && source "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/env"