Ich habe mal den Script so geändert das automatisch der richtige Path gesetzt wird.
Dazu in den Ordner von Purebasic wechseln und den Script (Ohne sudo) aufrufen. './register_local.sh' und Rechner neu starten
register_local.sh
Zitat:
#!/bin/bash
# Get Script directory
PUREDIR=$PWD
# Goto home
cd $HOME
# Make sure, dir exist
mkdir -p .local/share/mime/packages
# change to dir for purebasic.xml
cd .local/share/mime/packages
# Remove old purebasic.xml
if [ -f "purebasic.xml" ]
then
rm purebasic.xml
fi
# Create purebasic.xml
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > purebasic.xml
echo "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>" >> purebasic.xml
echo " <mime-type type=\"text/purebasic\">" >> purebasic.xml
echo " <comment>PureBasic source code</comment>" >> purebasic.xml
echo " <glob pattern=\"*.pb\"/>" >> purebasic.xml
echo " <glob pattern=\"*.pbi\"/>" >> purebasic.xml
echo " <glob pattern=\"*.pbf\"/>" >> purebasic.xml
echo " </mime-type>" >> purebasic.xml
echo "</mime-info>" >> purebasic.xml
# change to home
cd $HOME
# Make sure, dir exist
mkdir -p .local/share/applications
# change to dir for PureBasic.desktop
cd .local/share/applications
# Remove old Purebasic.desktop
if [ -f "PureBasic.desktop" ]
then
rm PureBasic.desktop
fi
# Create PureBasic.desktop
echo "[Desktop Entry]" > PureBasic.desktop
echo "Comment=PureBasic IDE" >> PureBasic.desktop
echo "Terminal=false" >> PureBasic.desktop
echo "Name=PureBasic" >> PureBasic.desktop
echo "Type=Application" >> PureBasic.desktop
echo "MimeType=text/purebasic" >> PureBasic.desktop
echo "Categories=Development;" >> PureBasic.desktop
echo "StartupNotify=true" >> PureBasic.desktop
# check environment var
if [ "$PUREBASIC_HOME" == "" ]
then
echo "Exec=${PUREDIR}/compilers/purebasic" >> PureBasic.desktop
echo "Icon=${PUREDIR}/logo.png" >> PureBasic.desktop
else
echo "Exec=${PUREBASIC_HOME}/compilers/purebasic" >> PureBasic.desktop
echo "Icon=${PUREBASIC_HOME}/logo.png" >> PureBasic.desktop
fi
# Update Databases
update-desktop-database ~/.local/share/applications
update-mime-database ~/.local/share/mime
echo "File extensions .pb, .pbi, .pbf are now registered for PureBasic."
unregister_local.sh
Zitat:
#!/bin/bash
# change to home
cd $HOME
# change to dir for purebasic.xml
cd .local/share/mime/packages
# purebasic.xml remove
if [ -f "purebasic.xml" ]
then
rm purebasic.xml
fi
# change to home
cd $HOME
# Make sure, dir exist
mkdir -p .local/share/applications
# change to dir for PureBasic.desktop
cd .local/share/applications
# PureBasic.desktop remove
if [ -f "PureBasic.desktop" ]
then
rm PureBasic.desktop
fi
# Update Databases
update-desktop-database ~/.local/share/applications
update-mime-database ~/.local/share/mime
echo "Purebasic and File extensions .pb, .pbi, .pbf are now unregistered."
P.S. Nach dem speichern unter Eigenschaften Zugriffsrechte 'Als Programm ausführen' nicht vergessen...