Added directory checking to make icons function in case it is ran by itself

This commit is contained in:
TangoBravo14
2019-02-24 13:53:01 +00:00
parent 83bef40291
commit 9e8ef0108b
+29
View File
@@ -1400,6 +1400,35 @@ fi
function create_icons() {
function assign_directories() {
UNSETDIRS=$(yad --image=/tmp/banner.png --center --form --separator="|" \
--title "Set Installed Directories" \
--field="Tip:TXT" "One or more of the Directory Variables have not been set. Likely due to running install icons by itself.
Please inform the installer of the following Directories so it can make the requested desktop icons.
The default locations are prefilled.
If you did not install any programs for the associated section, you can leave the selection at default." \
--field="Radio Directory:MDIR" "$HOME/Radio" \
--field="Packet Directory:MDIR" "$HOME/Radio/Packet" \
--field="Security Directory:MDIR" "$HOME/Security" \
${r} ${c})
USERDIR=$(echo $UNSETDIRS | awk -F "|" '{print $2}')
PACKETDIR=$(echo $UNSETDIRS | awk -F "|" '{print $3}')
SECDIR=$(echo $UNSETDIRS | awk -F "|" '{print $4}')
}
if ( [[ $USERDIR == "" ]] || [[ $SECDIR == "" ]] || [[ $PACKETDIR == "" ]] ); then
assign_directories
fi
if hash fldigi 2>/dev/null; then
echo "[Desktop Entry]
Name=Fldigi