Xfce Forum

Sub domains
 

You are not logged in.

#1 2013-05-05 03:37:26

lphilpot
Member
From: Louisiana, USA
Registered: 2011-01-07
Posts: 11
Website

Single click theme application (4.10)?

Is there a way to call xfce4-appearance-settings where a theme name could be specified, so that it could be applied with a single click? The command line help doesn't seem to indicate anything along those lines, but I figured I'd ask.

The reason I want this is that I use my laptop in the field while observing through my telescope at night (amateur astronomer). Under such conditions, I choose a specially modifed theme that turns everything dark red. So, I'd like to be able to put a single menu choice that does nothing other than apply that theme. Currently, I just have a shortcut to xfce4-appearance-settings in a handy place, but I still have to explicitly choose the proper theme and apply it. I'd like to do this all in one step if possible.

Thanks!

Offline

#2 2013-05-06 01:47:12

ozjd
Member
From: Hawkesbury NSW Australia
Registered: 2012-02-05
Posts: 560
Website

Re: Single click theme application (4.10)?

You could set up a separate user for those occasions. It may require you to have a shared directory somewhere if you want both users to access the same data.

Offline

#3 2013-05-06 10:40:51

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

Re: Single click theme application (4.10)?

Create a script file with the following content:

#!/bin/bash
THEME1="Bluebird"
THEME2="Greybird"

to_THEME () {
	xfconf-query -c xfwm4 -p /general/theme -s "$1"
        xfconf-query -c xsettings -p /Net/ThemeName -s "$1"
}

[ $(xfconf-query -c xsettings -p /Net/ThemeName) == "$THEME2" ] && to_THEME $THEME1 || to_THEME $THEME2 

...and change the THEME1 and THEME2 variables to suit.

Make the file executable.

Then create either a menu entry or launcher to run this script.

This will toggle both the GTK appearance and xfwm Window Manager theme at the same time between the two themes.

Last edited by ToZ (2013-05-06 13:06:47)


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

#4 2013-05-08 02:01:30

lphilpot
Member
From: Louisiana, USA
Registered: 2011-01-07
Posts: 11
Website

Re: Single click theme application (4.10)?

Thanks for the script - That gives me the command lines I need. I don't need to change the WM but it's nice to know how.

Update - After that quick reply I read the script more closely and see that it doesn't just set the theme, it toggles between two, which is even better. Thanks!

Last edited by lphilpot (2013-05-08 02:37:11)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 8 queries executed - Memory usage: 529.23 KiB (Peak: 530.52 KiB) ]