mkimage-profiles/features.in/arm-rpi4/image-scripts.d/81-mplayer-to-celluloid-in-mimeapps

16 lines
757 B
Plaintext
Raw Normal View History

#!/bin/sh -efu
# Change the default application for all file types from mplayer to celluloid
cfile="/usr/share/applications/io.github.celluloid_player.Celluloid.desktop"
mimeappsfile="/usr/share/applications/mimeapps.list"
mimeappslocalfile="/etc/skel/.config/mimeapps.list"
if [ -f "$cfile" -a -f "$mimeappsfile" ]
then
echo "[Default Applications]" > "$mimeappslocalfile"
sed '/[=;]mplayer.desktop/!d ; /[=;]mplayer.desktop/s/=.*/=io.github.celluloid_player.Celluloid.desktop;/' "$mimeappsfile" >> "$mimeappslocalfile"
echo "" >> "$mimeappslocalfile"
echo "[Added Associations]" >> "$mimeappslocalfile"
sed '/[=;]mplayer.desktop/!d ; /[=;]mplayer.desktop/s/=.*/=io.github.celluloid_player.Celluloid.desktop;/' "$mimeappsfile" >> "$mimeappslocalfile"
fi