~charles/dotfiles

07337eb39eb438e53f20a229ce51d38cab78bffe — Charles Daniels 2 years ago c7fd447
Add mimeassoc back
3 files changed, 41 insertions(+), 0 deletions(-)

A applymime.sh
M install.sh
A mimeassoc.tsv
A applymime.sh => applymime.sh +24 -0
@@ 0,0 1,24 @@
#!/bin/sh

cd "$(dirname "$0")"

if [ ! -x "$(which lsdesktopf)" ] ; then
	echo "FAIL (no lsdesktopf in PATH)"
	exit 1
fi


if [ ! -x "$(which xdg-mime)" ] ; then
	echo "FAIL (no xdg-mime in PATH)"
	exit 1
fi

while read -r line ; do
	mimetype="$(echo "$line" | cut -f 1)"
	desktop="$(echo "$line" | cut -f 2)"
	echo "$line -> use $desktop for $mimetype"
	# make sure the desktop file exists
	if lsdesktopf | grep -i "$desktop" > /dev/null 2>&1 ; then
		xdg-mime default "$desktop" "$mimetype"
	fi
done < "./mimeassoc.tsv"

M install.sh => install.sh +2 -0
@@ 66,4 66,6 @@ curl -SsfLo ~/.zsh/completions/_docker-compose https://raw.githubusercontent.com
mkdir -p ~/.local/share/xfce4/terminal/colorschemes
curl -SsfLo ~/.local/share/xfce4/terminal/colorschemes/gruvbox-dark.theme 'https://raw.githubusercontent.com/morhetz/gruvbox-contrib/master/xfce4-terminal/gruvbox-dark.theme'

./applymime.sh

exit 0

A mimeassoc.tsv => mimeassoc.tsv +15 -0
@@ 0,0 1,15 @@
inode/directory	pcmanfm.desktop
application/pdf	atril.desktop
text/plain	gedit.desktop
image/png	geeqie.desktop
image/jpeg	geeqie.desktop
image/vnd.djvu	atril.desktop
image/djvu	atril.desktop
image/x-canon-cr2	geeqie.desktop
image/tiff	geeqie.desktop
text/plain	gedit.desktop
text/x-csrc	gedit.desktop
text/x-chdr	gedit.desktop
application/zip	engrampa.desktop
application/x-compressed-tar	engrampa.desktop
application/x-tar	engrampa.desktop