33OS=` lsb_release -si | tr ' [:upper:]' ' [:lower:]' ` # Retrieve name of OS release
44pip3pm=` which pip3` # Retrieve path of pip3
55cairo=` which cairosvg` # Retrieve path of cairosvg
6-
6+ im= ` which convert ` # Retrieve path of convert part of imagemagick
77
88declare -A osInfo; # Retrieving default package manager
99osInfo[/etc/redhat-release]=yum
@@ -16,7 +16,6 @@ for f in ${!osInfo[@]}
1616do
1717 if [[ -f $f ]]; then
1818 var=" ${osInfo[$f]} "
19-
2019 fi
2120done
2221
@@ -29,8 +28,8 @@ elif [ "$1" = "--help" ] || [ "$1" = "-h" ]; #Help
2928then
3029 echo " "
3130 echo " # To use script you have to be root usr : sudo su "
32- echo " # Format goes like this ./tuxsplash PATH/tux.svg "
33- echo " # If you want to find your generated tux from tuxArt go to ~/Pictures"
31+ echo " # Format goes like this ./tuxsplash.sh / PATH/tux.png or .svg "
32+ echo " # If you want to splash your generated tux from tuxArt go to ~/Pictures"
3433 exit 1
3534
3635elif [ ! -f $1 ] # Checking if file exist
7877 fi
7978 fi
8079
80+ if [ -z $im ]
81+ then
82+
83+ $var install imagemagick
84+
85+ fi
86+
87+
88+ if [[ $1 == * .png ]]
89+ then
90+ convert $1 -resize " 140x165" -quality 100 $1
91+ cd /usr/share/plymouth/themes/* -logo
92+ mv * -logo.png old-splash.png
93+ cp $1 ./$OS -logo.png
94+ echo " This may take a few seconds please be patient and wait =)"
95+ update-initramfs -u
96+ fi
8197
82- cairosvg $1 -o ~ /Pictures/tuxsplash.png # Making png copy of svg tux in Picture directory
83- cd /usr/share/plymouth/themes/* -logo
84- mv * -logo.png old-splash.png
85- cp ~ /Pictures/tuxsplash.png ./$OS -logo.png
86- echo " This may take a few seconds please be patient and wait =)"
87- update-initramfs -u
88-
98+ if [[ $1 == * .svg ]]
99+ then
100+ cairosvg -s 0.50 $1 -o ~ /Pictures/tuxsplash.png # Making png copy of svg tux in Picture directory
101+ cd /usr/share/plymouth/themes/* -logo
102+ mv * -logo.png old-splash.png
103+ cp ~ /Pictures/tuxsplash.png ./$OS -logo.png
104+ echo " This may take a few seconds please be patient and wait =)"
105+ update-initramfs -u
106+ fi
89107
90108fi
91109
0 commit comments