Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add systray class when it is empty #1093

Open
jlo62 opened this issue May 2, 2024 · 3 comments
Open

[FEATURE] Add systray class when it is empty #1093

jlo62 opened this issue May 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jlo62
Copy link

jlo62 commented May 2, 2024

Description of the requested feature

This would allow to completely hide the systray (via css) if it is empty.

I have not been able to do this otherwise, also not via reveal.

Proposed configuration syntax

.systray_empty {padding: 0}

Additional context

No response

@jlo62 jlo62 added the enhancement New feature or request label May 2, 2024
@vnva
Copy link
Contributor

vnva commented May 5, 2024

I think that instead of the class it is worth adding the visible-empty property, I wanted to do this but could not install the dependencies с:

error: could not compile `winnow` (lib) due to 3149 previous errors

@vnva
Copy link
Contributor

vnva commented May 5, 2024

I implemented it in this PR

@vnva
Copy link
Contributor

vnva commented May 5, 2024

#!/bin/bash

count=0

dbus-monitor --session "interface='org.kde.StatusNotifierWatcher'" |
while read -r signal; do
    if [[ $signal == *"StatusNotifierItemRegistered"* ]]; then
      count=$(($count + 1))
    elif [[ $signal == *"StatusNotifierItemUnregistered"* ]] then
      count=$(($count - 1))
    fi

    echo $count
done
(deflisten systray-items-count :initial 0 "path-to-script")
(systray :visible "${systray-items-count > 0}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants