-
Notifications
You must be signed in to change notification settings - Fork 0
/
animeWall
executable file
·60 lines (52 loc) · 1.05 KB
/
animeWall
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
55
56
57
58
59
#!/bin/bash
workdir="$HOME/.animate"
## get system name -> uname -v | awk '{print $1}' | awk -F "-" '{print $2}'
trap printout SIGINT
printout(){
echo "EXIT!"
exit
}
runWall(){
data=$(ls -l $workdir | awk '{print $9}')
while [ True ];do
for wall in $data;do
feh --bg-fill $workdir/$wall
done
done &
}
makeWall(){
rm -rf $workdir
mkdir $workdir
echo "Preparando..."
ffmpeg -i $1 $workdir/thumb%04d.jpg -hide_banner > /dev/null 2>&1
if [ $? != 0 ];then
clear
echo "Erro durante preparação do vídeo!"
exit
fi
#ffmpeg -i wall.mp4 -r 1/1 ./sequence/thumb%04d.jpg -hide_banner
}
install(){
case $1 in
"ubuntu")
sudo apt install ffmpeg feh -y
mkdir $workdir
sudo cp ./animeWall /usr/bin
echo "Instalação finalizada!"
;;
"arch")
sudo pacman -S --noconfirm ffmpeg feh
mkdir $workdir
sudo cp ./animeWall /usr/bin
echo "Instalação finalizada!"
;;
*)echo "informe o seu sistema: ubuntu, arch.";;
esac
}
case $1 in
"make")makeWall $2;;
"run")runWall;;
"install")install $2;;
"stop")killall animeWall;;
*)echo "opção inválida";;
esac