Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-11-28 10:44:29

James7426
Member
Registered: 2022-11-28
Posts: 5

Workspace switcher : Style / CSS / theme individual panels?

Hi Guys,

I'm very much relying on workspace switcher for all my activities. And I like to work on different projects simultaneously. So I'd like to make workspace switcher a little bit more convenient. I know about general styling with wnck-pager in the gtk.css. I can replicate that. However I'd like to stlye like this

wnck-pager#ws1, wnck-pager#ws2 {
	background-color: #0000ff;
}
wnck-pager#ws3, wnck-pager#ws4 {
	background-color: #00ff00;
}

whereas the ids #ws1 etc stand for each individual workspace panel in the workspace switcher.

Is something like this possible?

Cheers,
James

Offline

#2 2022-11-28 12:48:27

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: Workspace switcher : Style / CSS / theme individual panels?

Nope. It doesn't have child elements. It's a single box.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#3 2022-11-28 13:59:59

James7426
Member
Registered: 2022-11-28
Posts: 5

Re: Workspace switcher : Style / CSS / theme individual panels?

Thanks. Hmm, is there any other way to accomplish something similar? It's really a shame. I would have liked to color 2x2 panels the same color and optically have my separated "sub workspaces"

Offline

#4 2022-11-28 23:29:44

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: Workspace switcher : Style / CSS / theme individual panels?

I don't think so. Might be worth creating a feature request.

You can try making the selected one more distinct with:

wnck-pager:selected {
	background-color: red
}

Or you can do the hardcore way: creating 4 launchers with different icons or colors and setting their command to switch to appropriate workspaces.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#5 2022-11-29 08:00:29

James7426
Member
Registered: 2022-11-28
Posts: 5

Re: Workspace switcher : Style / CSS / theme individual panels?

Thank you again, KBar!

The selected pseudo-class wouldn't help unfortunately. The standard light-red is good I tihink. I was also experimenting with other CSS-pseudo-classes like

wnck-pager:first-child {
	background-color: green;
}
wnck-pager:nth-child(2) {
	background-color: green;
}
wnck-pager:nth-of-type(4) {
	background-color: green;
}

But none of them worked. And the launchers ... then I don't have the benefit of the mini previews which are great.

How do I create a feature request? - In General Discussion like this? https://forum.xfce.org/viewtopic.php?id=13946

Offline

#6 2022-11-29 09:37:38

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: Workspace switcher : Style / CSS / theme individual panels?

James7426 wrote:

Thank you again, KBar!

Don't mention it.

But none of them worked.

Obviously, because wnck-pager has no child elements.

And the launchers ... then I don't have the benefit of the mini previews which are great.

It should be possible to write a shell script that updates the launcher's icon either every N seconds or continuously, although that would probably take a toll on your system.

When a new launcher is added to the the panel, a new desktop entry is written and saved in $HOME/.config/xfce4/panel/launcher-%d/, where %d is the launcher's internal ID represented in (signed, positive anyway) integer. The name of the desktop file is the concatenation of the UNIX time (at its creation) and the launcher's counter (indexed from 1), followed by the usual .desktop suffix, e.g. 16697130481.desktop. It contains all the standard keys, including Icon, which you can modify at will during runtime. You can set up your script to monitor the _NET_ACTIVE_WINDOW X property of the root window in each workspace, fetch their icon names and do a simple string substitution in each launcher's desktop file. The whole thing can be simplified with wmctrl, but xprop is good enough and is pre-installed anyway.

If you don't have launchers yet, their names would align nicely: UNIXtime1.desktop (for Workspace 1), UNIXtime2.desktop (for Workspace 2) and so on.

How do I create a feature request? - In General Discussion like this? https://forum.xfce.org/viewtopic.php?id=13946

Certainly not here. This plug-in is internal to the panel, so the right place to create new issues is here. Some guides and documentation are available:
https://docs.xfce.org/contribute/start#feature_requests
https://docs.xfce.org/xfce/xfce4-panel/bugs


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#7 2022-11-29 09:57:01

chardmain
Member
From: South East Asia
Registered: 2020-04-13
Posts: 8

Re: Workspace switcher : Style / CSS / theme individual panels?

It would be possible if using workspace switcher (button). Something like this:

#xfce-panel-toggle-button:nth-child(1),
#xfce-panel-toggle-button:nth-child(2) {
	background: green;
}

#xfce-panel-toggle-button:nth-child(3),
#xfce-panel-toggle-button:nth-child(4) {
	background: blue;
}

#xfce-panel-toggle-button:checked,
#xfce-panel-toggle-button:hover {
	box-shadow: inset 1px 1px white, inset -1px -1px white;
}

Offline

#8 2022-11-29 10:09:49

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: Workspace switcher : Style / CSS / theme individual panels?

If you don't have other buttons, that is. If you have weather-plugin, you're out of luck because it's unreliable and almost random. I tried something similar with status notifiers and the rule applied to the wrong element half the time even though their position on the panel never changed.

Still worth a shot if you don't mind having text shown instead of icons.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#9 2022-11-30 10:44:43

James7426
Member
Registered: 2022-11-28
Posts: 5

Re: Workspace switcher : Style / CSS / theme individual panels?

Thanks KBar. I understand.

About the script that's probably "above my pay grade".

I will probably go with the feature request

Offline

#10 2022-11-30 10:46:17

James7426
Member
Registered: 2022-11-28
Posts: 5

Re: Workspace switcher : Style / CSS / theme individual panels?

chardmain wrote:

It would be possible if using workspace switcher (button). Something like this:

Thanks chardmain. This is a really good suggestion and works for me. But I'd also like to see where I have open windows so the text view is not so ideal for me. But maybe for some use case I will use this!

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 558.05 KiB (Peak: 574.89 KiB) ]