From d236dcc8c7f8263d3662f8329176eae96287806c Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Wed, 18 Oct 2023 00:37:29 +0200 Subject: [PATCH] updated screenshot scripts --- .local/share/scripts/set-bg.sh | 12 +++++------- .local/share/scripts/share-screenshot.sh | 7 ++----- .local/share/scripts/take-screenshot.sh | 4 +++- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.local/share/scripts/set-bg.sh b/.local/share/scripts/set-bg.sh index 566a946..2dfb302 100755 --- a/.local/share/scripts/set-bg.sh +++ b/.local/share/scripts/set-bg.sh @@ -1,19 +1,17 @@ #!/usr/bin/env sh -# required packages: -# - feh set -e SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") -[ -z "$@" ] && exit 0 +[ -z "$1" ] && exit 0 LAST_BG_LOCATION="$XDG_CACHE_HOME/last-bg" -feh --no-fehbg --bg-fill $@ +echo "$(realpath $1)" > $LAST_BG_LOCATION -rm -f "$LAST_BG_LOCATION" -ln -s $1 $(realpath "$LAST_BG_LOCATION") +hyprctl hyprpaper preload "$1" +hyprctl hyprpaper wallpaper "HDMI-A-1,$1" +hyprctl hyprpaper unload all -$SCRIPTPATH/set-color.sh diff --git a/.local/share/scripts/share-screenshot.sh b/.local/share/scripts/share-screenshot.sh index 98448c8..97799e1 100755 --- a/.local/share/scripts/share-screenshot.sh +++ b/.local/share/scripts/share-screenshot.sh @@ -1,6 +1,4 @@ #!/usr/bin/env sh -# required packages: -# - xclicp set -e @@ -8,9 +6,8 @@ SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") $SCRIPTPATH/take-selected-screenshot.sh \ - | $SCRIPTPATH/nc-share-file.sh \ - | awk '{print $1"/preview"}' \ - | xclip -i -selection "clipboard" + | $SCRIPTPATH/upload-image.sh \ + | wl-copy notify-send -u low "Upload complete" diff --git a/.local/share/scripts/take-screenshot.sh b/.local/share/scripts/take-screenshot.sh index 180b47d..79df64c 100755 --- a/.local/share/scripts/take-screenshot.sh +++ b/.local/share/scripts/take-screenshot.sh @@ -8,7 +8,9 @@ set -e TMPDIR=$(mktemp -d) -deepin-screenshot -n -s "$TMPDIR" 2>/dev/null +cd $TMPDIR + +grim -g "$(slurp)" filename="$(date +"%d-%m-%y-%H-%M-%Z").png"