Skip to content

Instantly share code, notes, and snippets.

@ailtonbsj
Created December 24, 2020 20:47
Show Gist options
  • Save ailtonbsj/377f6707db9666ced22c170aa073537d to your computer and use it in GitHub Desktop.
Save ailtonbsj/377f6707db9666ced22c170aa073537d to your computer and use it in GitHub Desktop.
This script fix PDF Thumbnails on Lubuntu
#!/bin/bash
armorFile="/etc/apparmor.d/usr.bin.evince"
hadWxFixed=$(cat $armorFile | grep "WinuniX")
if [ "$hadWxFixed" == "" ]; then
NUM=$(cat $armorFile | grep 'owner /tmp/evince-thumbnailer\*/{,\*\*} rw,' -n | cut -d':' -f1)
sed -i $(($NUM+1))"i\ \ # WinuniX added this line" $armorFile
sed -i $(($NUM+2))"i\ \ owner /home/\*/.cache/thumbnails/\*/\*.\* rw," $armorFile
apparmor_parser -r $armorFile
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment