21 lines
490 B
Bash
21 lines
490 B
Bash
|
#!/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
|