Add copy_potd.sh

This commit is contained in:
Lukáš Kucharczyk 2021-06-25 09:38:56 +02:00
parent d0dbc61551
commit 3596f00cff
No known key found for this signature in database
GPG Key ID: 65524498C0196B64
1 changed files with 20 additions and 0 deletions

20
copy_potd.sh Executable file
View File

@ -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