From 3596f00cffb3f080bfb47555f4be9a6b3045dee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 25 Jun 2021 09:38:56 +0200 Subject: [PATCH] Add copy_potd.sh --- copy_potd.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 copy_potd.sh diff --git a/copy_potd.sh b/copy_potd.sh new file mode 100755 index 0000000..f228a83 --- /dev/null +++ b/copy_potd.sh @@ -0,0 +1,20 @@ +#!/bin/env bash +TODAY=$(date +%d_%m_%Y) +HOME="/home/$USER" +SOURCE="$HOME/.cache/plasma_engine_potd" +DESTINATION="$HOME/Pictures/wallpapers/" +TYPE=${1:-none} +if [[ $TYPE == "none" ]] +then + echo "No POTD type specified." + exit 1 +fi +ORIGINAL="${SOURCE}/${TYPE}" +if [[ -e $ORIGINAL ]]; then + FILENAME="${TYPE}_${TODAY}.jpg" + echo "Copying '$TYPE' to '$DESTINATION' as '$FILENAME'." + cp "$ORIGINAL" "$DESTINATION/$FILENAME" +else + echo "$ORIGINAL does not exist." + exit 1 +fi