https://github.com/pacstall/pacmime
https://github.com/pacstall/pacmime
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pacstall/pacmime
- Owner: pacstall
- Created: 2025-02-27T23:05:24.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-27T23:22:46.000Z (over 1 year ago)
- Last Synced: 2025-10-27T12:34:52.114Z (8 months ago)
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pacscript MIME integration
This repo hosts the minimal files for pacscript MIME integration on desktop environments.
### Dependencies
- `xdg-utils`
- `desktop-file-utils`
- `shared-mime-info`
- `gtk-update-icon-cache` (GTK-based environments only)
### Installation
```bash
# Create directories
MIMEDIR="/usr/share/mime"
APPDIR="/usr/share/applications"
ICONDIR="/usr/share/icons/hicolor"
sudo mkdir -p "${ICONDIR}/scalable/mimetypes" "${MIMEDIR}/packages" "${APPDIR}"
# Install files to their locations
sudo install -Dm644 "application-x-pacscript.svg" -t "${ICONDIR}/scalable/mimetypes"
sudo install -Dm644 "pacscript.xml" -t "${MIMEDIR}/packages"
sudo install -Dm644 "pacscript.desktop" -t "${APPDIR}"
# Update caches
sudo update-mime-database "${MIMEDIR}" 2>/dev/null
sudo update-desktop-database "${APPDIR}"
if command -v update-icon-caches > /dev/null; then
sudo update-icon-caches "${ICONDIR}"
fi
# Set as default MIME type
if ! { [[ -f "${APPDIR}/mimeapps.list" ]] && \
grep -q '^application/x-pacscript=' "${APPDIR}/mimeapps.list"; }; then
{ ! [[ -f "${APPDIR}/mimeapps.list" ]] && echo -e '\n[Default Applications]';
echo 'application/x-pacscript=pacscript.desktop';
} | sudo tee -a "${APPDIR}/mimeapps.list" > /dev/null
fi
```