Last active
March 25, 2022 12:14
-
-
Save siddhpant/a2fb56b3aeb1274fcc293467508f2175 to your computer and use it in GitHub Desktop.
Force light theme on Libreoffice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit when any command fails | |
set -e | |
# Check for sudo/root | |
if [ "$EUID" -ne 0 ] | |
then echo "Run this script with superuser privileges!" | |
echo "This is because it needs access to /usr/lib/libreoffice/program/soffice" | |
exit 1 | |
fi | |
# Make backup | |
echo "Moving previous config to /usr/lib/libreoffice/program/soffice.bak" | |
mv /usr/lib/libreoffice/program/soffice /usr/lib/libreoffice/program/soffice.bak | |
# Append the string | |
sed -e '/export LC_ALL/a\' -e '\n# Force Adwaita light theme\nexport GTK_THEME=Adwaita:light' /usr/lib/libreoffice/program/soffice.bak > /usr/lib/libreoffice/program/soffice | |
# Copy perms from original file | |
sudo chmod --reference=/usr/lib/libreoffice/program/soffice.bak /usr/lib/libreoffice/program/soffice | |
sudo chown --reference=/usr/lib/libreoffice/program/soffice.bak /usr/lib/libreoffice/program/soffice | |
# Yay! | |
echo "Done! If you encounter any problems, restore from the previous config." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You must run this everytime libreoffice is updated.