Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-09-20 04:34:51

PedroMonteiro
Member
Registered: 2016-09-20
Posts: 8

Change theme at startup

I wanna change the theme of my Xfce at startup, I wrote a simple script that uses xfconf-query:

#!/bin/bash
xfconf-query -c xsettings -p /Net/ThemeName -s  "ThinIce"

when I run it manually, it works well, but when I set it to run at startup using crontab and @reboot, it doesn't work.

Any sugestion to a solution?

Offline

#2 2016-09-20 08:43:12

onkelho
Member
Registered: 2010-07-28
Posts: 21

Re: Change theme at startup

use it as on in xfce4-settings-manager "Application Autostart";

for example (" ") :
create a executable under /usr/bin/"change-to-theme" - with:
((you can do it as root-user with mousepad, open a new file, edit with bellow text[your lines above], safe it as /usr/bin/change-to-theme, and check in thunar as root-user the permissions, there owner should be root have read+write, all others only read and this must be executable ))

#!/bin/bash
xfconf-query -c xsettings -p /Net/ThemeName -s  "ThinIce"


then add it under xfce4-settings-manager > session and startup > application autostart > Add...
give them a NAME: ,a DESCRIPTION: and as COMMAND: /usr/bin/change-to-theme
- the /usr/bin is not always needed 
>> the advantage is, xfce4 sorted it to work

Offline

#3 2016-09-21 04:20:07

PedroMonteiro
Member
Registered: 2016-09-20
Posts: 8

Re: Change theme at startup

It worked, thanks!
Is there a way to do that in command line?
Because I'm customizing an ISO using the terminal, and I can't use the GUI.
Or could I modify an script of the system and just add the command to change the theme?

Offline

#4 2016-09-21 08:36:24

onkelho
Member
Registered: 2010-07-28
Posts: 21

Re: Change theme at startup

many differences on different systems/distributions
i use and work on pclinuxos, others have other startup-script's, ...
sorry, but i can not knowing all

Offline

#5 2016-09-21 10:39:25

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,012

Re: Change theme at startup

Try creating a .desktop file in /etc/xdg/autostart with the following content:

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Change Theme
Comment=Change the theme on startup
Exec=/usr/local/bin/change-theme
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

...create the file /usr/local/bin/change-theme with the content:

#!/bin/bash
xfconf-query -c xsettings -p /Net/ThemeName -s  "ThinIce"

...and make the file executable.

This will get executed on Xfce startup.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2016-09-23 00:14:48

PedroMonteiro
Member
Registered: 2016-09-20
Posts: 8

Re: Change theme at startup

It worked!
Thank you so much!

Offline

Board footer

Powered by FluxBB