Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Remove desktop icons automatically when we uninstall apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed May 13, 2014
1 parent 0c23f64 commit a58abb5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src-sh/pbi-manager/pbi-manager
Expand Up @@ -751,6 +751,10 @@ do_pbi_delete() {
exit_err "$PBI_DELETENAME is part of PC-BSD base system and cannot be removed." exit_err "$PBI_DELETENAME is part of PC-BSD base system and cannot be removed."
fi fi


# Remove the desktop icon for all users, if it exists
del_xdg_icon "$PBI_CONFDIR" "desktop" "all"

# Enable the force flag if necessary
if [ "$PBI_FORCEDELETE" = "YES" ] ; then if [ "$PBI_FORCEDELETE" = "YES" ] ; then
pOpts="-y -f" pOpts="-y -f"
else else
Expand Down Expand Up @@ -852,6 +856,20 @@ del_xdg_icon() {
do do
$cmd uninstall `basename $i` $cmd uninstall `basename $i`
done done

if [ "$3" != "all" ] ; then return; fi
require_root

# Try to remove this for all users
for user in `ls /home`
do
# Does this user exist?
cat /etc/passwd | grep -q "^${user}:"
if [ $? -ne 0 ] ; then continue; fi

# Remove the icon
su $user -c "pbi icon del-desktop $PBI_ORIGIN" 2>/dev/null
done
} }


add_xdg_icon() { add_xdg_icon() {
Expand Down

0 comments on commit a58abb5

Please sign in to comment.