-
Notifications
You must be signed in to change notification settings - Fork 14
/
bing_wallpaper.sh
executable file
·54 lines (45 loc) · 1.14 KB
/
bing_wallpaper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#
# Software requirment
# sudo apt install imagemagick
#
#set -x
#for debug
function __echo () {
echo $1
echo $1 >> $DrawFile
}
function _echo () {
echo $1 >> $DrawFile
}
# download image from https://blog.atwork.at/post/Use-the-Daily-Bing-picture-in-Teams-calls
ImageFile="images/dailyImage.jpeg"
python bing_wallpaper.py ${ImageFile}
DrawFile="./draw.txt"
if [ -f ${DrawFile} ]; then
rm $DrawFile
fi
#Inquiry tft information
screen_width=`./draw width`
screen_height=`./draw height`
driver_name=`./draw driver`
echo -n "Your TFT is "
echo -n ${driver_name}
echo -n " "
echo -n ${screen_width}
echo -n "x"
echo ${screen_height}
#resize image using convert
finalImageFile="images/dailyImage2.jpeg"
cp ${ImageFile} ${finalImageFile}
install=`which convert | grep -c convert`
if [ $install = 1 ]; then
convert -resize ${screen_width}x${screen_height} ${ImageFile} ${finalImageFile}
echo "convert -resize ${screen_width}x${screen_height} ${ImageFile} ${finalImageFile}"
else
echo "imagemagick not install. sudo apt install imagemagick"
fi
#Black(0x000000)
_echo "FillScrren,0x0000"
_echo "JPEG,${finalImageFile}"
./draw $DrawFile > /dev/null