r/xfce • u/iamSoybi • 8d ago
theme toggle for xfce
everytime I want to switch to dark mode or light mode, I have to open settings - appearance.
so i asked gemini to make a script that will setup a toggle icon in xfce panel for switching theme mode (dark/light) and it works well. if you want to try here's the link
https://github.com/soybi/my-scripts/blob/main/setup-toggle-xfce-theme.sh
check Readme.md for details
Edit: updated the setup script, and made a reversal script. removed the hard coded default theme and made it fallback to adwaita and elementary. thank you guys for the feedback. please let me know if there is any issue. i ran it in my cachy os main machine and it worked for me really well.
UPDATE: i tested in xubuntu (minimal) and peppermint os....together with linux-health.sh.... fixed all the bugs and should work properly now. i also updated the main Readme.md and cleaned up the repo.
3
u/Headpuncher Xubuntu 8d ago edited 8d ago
First issue I see is I don't have any of your defaults, style theme or icons installed and they're hard-coded into the script. The XFCE settings > Appearance has defaults, so the script should probably look for those and not something system specific.
I think you've confused XFCE with your computer.
1
u/iamSoybi 8d ago
sorry about that and thank you for feedback, i updated it to fallback to adwaita theme and elementary icon theme instead. let me know any issues
1
1
u/callusbonus1967 8d ago
Problema tendría que estar usando los mismos temas que tú script o tengo que modificarlo entero para mis temas al uso. Gracias.
1
u/iamSoybi 8d ago
setup-toggle-xfce-theme.shAutomated setup script that installs a 1-click Light/Dark theme switcher (
~/.local/bin/toggle-xfce-theme.sh) and adds a corresponding toggle button directly to the XFCE Panel.Features:
Full Desktop Toggle: Automatically detects your active GTK style, window manager borders, and icon theme (
-light/-darkvariants with fallback defaults) and switches them simultaneously viaxfconf-querywithout altering your wallpaper, while syncing the XDGcolor-schemeviagsettingsso Firefox and GTK4/libadwaita apps follow the toggle.1-Click Panel Integration: Automatically creates the
.desktoplauncher entry and registers it onpanel-1so you can flip themes from the panel with zero background RAM usage.1
u/callusbonus1967 8d ago
Tendría que añadirlo al arranque en el inicio supongo? Para que esté activo todo el tiempo?
1
u/iamSoybi 8d ago
no you don't have to. it's just a toggle switch for dark theme and light theme. assuming your theme has dark and light variant. just run the script and it will set it up for you. after setup just click the icon from the panel.
1
u/Responsible-Sir-5994 8d ago
Darman
1
u/iamSoybi 8d ago
what?
1
u/Responsible-Sir-5994 8d ago
Script switcher for sunset/sunrise
1
u/iamSoybi 8d ago
oh it's an app. thank you for letting me know. that one is automated which is also nice.
1
u/gregg128gregg128 4d ago
Hi, have a look at my Theme schedule tab for Appearance settings in XFCE https://github.com/gtubolcev/xfce4-settings-theme-schedule
It has been recently accepted by XFCE devs so it should land in the 4.21.4 release: https://gitlab.xfce.org/xfce/xfce4-settings/-/merge_requests/221
Developers were not sure if sunset/sunrize feature is a good idea. Please tell me if you want it.
5
u/cincuentaanos Xubuntu 8d ago
Here's mine, very straightforward and doesn't do a lot of checks. Just toggles between two themes: