X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2Flinux-install.sh;h=957b1aadf985ca2d7d19b5538a50bdf6bc0a04ad;hp=c5101eb4136e1bb35fc10fc670c47db90c40bc94;hb=c860d837a0c97a091c5f47fce91bdb8beb4602d3;hpb=95f5a6ef52947088993d395874cf6aa502fd2503 diff --git a/altosui/linux-install.sh b/altosui/linux-install.sh index c5101eb4..957b1aad 100644 --- a/altosui/linux-install.sh +++ b/altosui/linux-install.sh @@ -141,13 +141,15 @@ esac BIN="$target_abs"/AltOS -desktop="$target"/AltOS/altos.desktop - -rm -f "$desktop" -sed "s;%BIN%;$BIN;" "$target"/AltOS/altos.desktop.in > "$desktop" +for infile in "$target"/AltOS/*.desktop.in; do + desktop="$target"/AltOS/`basename "$infile" .in` + rm -f "$desktop" + sed -e "s;%bindir%;$BIN;" -e "s;%icondir%;$BIN;" "$infile" > "$desktop" + chmod +x "$desktop" +done # -# Figure out where to install the .desktop file. If we can, write it +# Figure out where to install the .desktop files. If we can, write it # to the public /usr/share/applications, otherwise, write it to the # per-user ~/.local/share/applications # @@ -172,9 +174,9 @@ case "$apps" in ;; esac -echo -n "Installing .desktop file to $apps..." +echo -n "Installing .desktop files to $apps..." -cp "$desktop" "$apps" +cp "$target"/AltOS/*.desktop "$apps" case "$?" in 0) @@ -185,6 +187,53 @@ case "$?" in ;; esac +# +# Install icon to desktop if desired +# + +if [ -d $HOME/Desktop ]; then + default_desktop=n + if [ "$can_ask" = "y" ]; then + : + else + default_desktop=y + fi + + answered=n + while [ "$answered" = "n" ]; do + echo -n "Install icons to desktop? [default: $default_desktop] " + if [ "$can_ask" = "y" ]; then + read do_desktop + else + echo + do_desktop="" + fi + + case "$do_desktop" in + "") + do_desktop=$default_desktop + ;; + esac + + case "$do_desktop" in + [yYnN]*) + answered=y + ;; + esac + done + + echo -n "Installing desktop icons..." + case "$do_desktop" in + [yY]*) + for d in "$target"/AltOS/*.desktop; do + ln -f -s "$d" "$HOME/Desktop/" + done + ;; + esac + + echo " done." +fi + finish 0 __ARCHIVE_BELOW__