Xfce Forum

Sub domains
 

You are not logged in.

#1 2026-02-04 05:06:43

sudorat87
Member
Registered: 2025-07-28
Posts: 5
Windows 10Firefox 147.0

Workspaces - Simple Buttons

I currently have my workspaces in simple buttons set up like this: HX9utMl.png

The current workspace in blue, the rest greyed. Is there a way through css to add color to a workspace that isn't the current one but that has a window opened or app running?

Thank you

Offline

#2 2026-02-06 00:00:00

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,478
LinuxFirefox 147.0

Re: Workspaces - Simple Buttons

Unfortunately, there are no CSS classes available that would indicate number of open windows in a workspace.

As an option, you could use the genmon plugin to display an output of the current state similar to what you have. The only difference would be you can't really interact with it to change the workspace, you'd have to use keyboard shortcuts or some other method. Here is a proof of concept script:

#!/bin/bash

INDICATOR="  ●  "
COL_ACTIVE="lightblue"
COL_HAS="yellow"
COL_NONE="grey"

WSPACES=$(xfconf-query -c xfwm4 -p /general/workspace_count)
CURRENT=$(wmctrl -d | grep "*" | awk '{print $1}')

while read -r number; do
	((WTOT[$number]++))
done < <(wmctrl -lv | grep -v " -1 " | awk '{print $2}')

# Display results
for ((num=0; num<WSPACES; num++)); do
    if [ $num = $CURRENT ]; then
        STR="$STR<span foreground='$COL_ACTIVE'>$INDICATOR</span>"
    else    
        if (( WTOT[$num] > 0 )); then
            STR="$STR<span foreground='$COL_HAS'>$INDICATOR</span>"
        else
            STR="$STR<span foreground='$COL_NONE'>$INDICATOR</span>"
        fi
    fi
done

STR="<txt>$STR</txt>"
STR="$STR<tool></tool>"

echo -e $STR

exit 0

...add the genmon plugin to the panel, point to this script (make it executable). uncheck the label and set the cycle to however fast you want it to refresh (1 second? 2 seconds?).


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2026-02-10 18:22:05

sudorat87
Member
Registered: 2025-07-28
Posts: 5
Windows 10Firefox 147.0

Re: Workspaces - Simple Buttons

^ Thank you for your input, I'll give that a try to see if it works out for me.  smile

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.020 seconds, 8 queries executed - Memory usage: 538.2 KiB (Peak: 539.17 KiB) ]