Hi all.
I’ve tried xfconf-query to set Xfce theme from the command line and it works well except with Firefox. I configured the latter to adapt to the current desktop theme by setting “Web site apparence” in “General” to auto. So when I use Xfce GUI to switch themes, Firefox does follow. When I use the above command line tool to do the same thing, it doesn’t.
Why’s that and how can I make Firefox react to switching themes from the command line?
Thanks in advance.
EDIT: for the record, here’s my script.
#!/bin/sh
#
# Toggle between light and dark Matcha themes for Xfce
# Fail on error
set -e
switch_theme()
{
local theme="$1"
xfconf-query -c xsettings -p /Net/ThemeName -s "${theme}" && \
xfconf-query -c xfwm4 -p /general/theme -s "${theme}-hdpi"
}
CURRENT_THEME=$(xfconf-query -c xsettings -p /Net/ThemeName)
[ -n "$CURRENT_THEME" ] || {
echo "Current theme does not exist"
exit 1
}
# Swap current theme between dark and not dark
case "$CURRENT_THEME" in
Matcha-dark-*)
switch_theme "${CURRENT_THEME/dark-/}" ;;
Matcha-*)
switch_theme "${CURRENT_THEME/Matcha-/Matcha-dark-}" ;;
*)
echo "Theme '${CURRENT_THEME}' not supported"
esac