Skip to content

Instantly share code, notes, and snippets.

@Hiradur
Last active May 29, 2022 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hiradur/89e31174ba2bd1bffcdc8b7299a29480 to your computer and use it in GitHub Desktop.
Save Hiradur/89e31174ba2bd1bffcdc8b7299a29480 to your computer and use it in GitHub Desktop.
Shell script to toggle between light and dark theme for GTK and QT applications
#!/bin/sh
# toggle_theme_gtk_qt.sh
# Original author: Hiradur
# License: CC0
# This script toggles between light and dark theme for GTK and QT applications
if [ $(gsettings get org.gnome.desktop.interface gtk-theme) = "'Adwaita-dark'" ]; then
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita"
sed -i 's/style=Adwaita-Dark/style=Adwaita/g' .config/qt5ct/qt5ct.conf
else
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
sed -i 's/style=Adwaita/style=Adwaita-Dark/g' .config/qt5ct/qt5ct.conf
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment