file upload screenshots
This commit is contained in:
parent
cab46024db
commit
c43147e79b
2 changed files with 15 additions and 2 deletions
|
@ -1,8 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
SCREENSHOT=$HOME/.cargo/bin/leanshot
|
SCREENSHOT=$HOME/.cargo/bin/leanshot
|
||||||
# choose some file to save it to
|
# 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
|
$SCREENSHOT $1 -o $FILE
|
||||||
# optional: copy to clipboard
|
|
||||||
|
# copy to clipboard
|
||||||
XCLIP=/usr/bin/xclip
|
XCLIP=/usr/bin/xclip
|
||||||
$XCLIP -selection clipboard -t image/png -i $FILE
|
$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"
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
|
||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
|
source $HOME/.ghcup/env
|
||||||
|
|
||||||
export PATH="$HOME/.local/bin:$HOME/.local/scripts:$HOME/.dotnet/tools:$PATH:$HOME/go/bin"
|
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"
|
[ -f "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/env" ] && source "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/env"
|
||||||
|
|
Loading…
Reference in a new issue