toumei 1.0.0

Detects system tray transparency on macOS, Windows, and Linux
Documentation

Info

Supports macOS, Windows, and Linux.

  • On macOS it detects transparency of the System Tray (Top Bar) is transparent or opaque. It checks the transparency by seeing if the Reduce Transparency setting in Universal Access is turned on or off.
  • On Windows it detects the transparency of the Windows Taskbar. It first checks if TranslucentTB is changing the Taskbar transparency. It also checks if either the Layered window attributes, DWM color attribute, or DWM backdrop type (Windows 11) is changing the Taskbar transparency.
  • On Linux it detects the transparency of the Top Bar. It checks if XDG Desktop Portal has set the Transparency. On GNOME it also checks if gnome-extension transparent-top-bar is changing the Top Bar transparency.

API Documentation

Toumei: 透明 【とうめい】tōmei, meaning: transparent; clear.

Usage

Add to your project:

cargo add toumei

Detect tray transparency

You can detect the tray transparency mode by using the detect_tray_transparency function. This function returns a Mode value.

fn main() -> Result<(), toumei::Error> {
    match toumei::detect_tray_transparency()? {
        toumei::Mode::Transparent => println!("🎉 System tray transparency is enabled!"),
        toumei::Mode::Opaque => println!("🔒 System tray transparency is disabled"),
    }
    Ok(())
}

Author

kuvaus

License

This project is licensed under the MIT License