Skip to content

Commit

Permalink
runonce-entries: add /usr/local/bin and `/usr/local/share/applicati…
Browse files Browse the repository at this point in the history
…ons` folder

also bind mount `/usr/local/share/applications` to `/usr/share/applications/usr-local-temporary` if `/usr/local/share` is not in `XDG_DATA_DIRS`
  • Loading branch information
theofficialgman committed Jul 29, 2023
1 parent 88e5c7c commit d8f9a3e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion etc/runonce-entries
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,25 @@ runonce <<"EOF"
fi
EOF

#add /opt if not present
#add /opt /usr/local/bin and /usr/local/share/applications if not present
runonce <<"EOF"
if [ ! -d /opt ]; then
sudo_popup mkdir /opt
fi
if [ ! -d /usr/local/bin ]; then
sudo_popup mkdir -p /usr/local/bin
fi
if [ ! -d /usr/local/share/applications ]; then
sudo_popup mkdir -p /usr/local/share/applications
#Pi-Apps tries to avoid unnecessary reboots at all cost. desktop launchers can be installed to /usr/local/share/applications, which is often not searched by default if /usr/local/share did not exist on boot.
#This path is added to $XDG_DATA_DIRS on the next reboot, but we don't want to wait for that!
#If XDG_DATA_DIRS is missing /usr/local/share, then bind-mount /usr/local/share/applications to /usr/share/applications
if [[ "$XDG_DATA_DIRS" != */usr/local/share* ]] && [ -z "$(ls /usr/share/applications/usr-local-temporary)" ];then
sudo_popup mkdir -p /usr/share/applications/usr-local-temporary
sudo_popup mount --bind /usr/local/share/applications /usr/share/applications/usr-local-temporary
fi
fi
EOF

true

0 comments on commit d8f9a3e

Please sign in to comment.