Added documentation

This commit is contained in:
Erik Reider 2023-11-04 14:12:45 +01:00
parent ca7c9a68f1
commit 6050fa3a43
7 changed files with 88 additions and 18 deletions

View File

@ -17,6 +17,7 @@
- Network
- Bluetooth
- Pulseaudio
- Privacy Info
- Wireplumber
- Disk
- Memory

View File

@ -33,7 +33,7 @@ class Privacy : public AModule {
Gtk::Box box_;
uint iconSpacing = 4;
uint iconSize = 20;
uint transition_duration = 500;
uint transition_duration = 250;
std::shared_ptr<util::PipewireBackend::PipewireBackend> backend = nullptr;
};

View File

@ -36,7 +36,6 @@ class PrivacyItem : public Gtk::Revealer {
bool init = false;
bool in_use = false;
std::string lastStatus;
// Config
std::string iconName = "image-missing-symbolic";

85
man/waybar-privacy.5.scd Normal file
View File

@ -0,0 +1,85 @@
waybar-privacy(5)
# NAME
waybar - privacy module
# DESCRIPTION
The *privacy* module displays if any application is capturing audio, sharing ++
the screen or playing audio.
# CONFIGURATION
*icon-spacing*: ++
typeof: integer ++
default: 4 ++
The spacing between each privacy icon.
*icon-size*: ++
typeof: integer ++
default: 20 ++
The size of each privacy icon.
*transition-duration*: ++
typeof: integer ++
default: 250 ++
Option to disable tooltip on hover.
*modules* ++
typeof: array of objects ++
default: [{"type": "screenshare"}, {"type": "audio-in"}] ++
Which privacy modules to monitor. See *MODULES CONFIGURATION* for++
more information.
# MODULES CONFIGURATION
*type*: ++
typeof: string ++
values: "screenshare", "audio-in", "audio-out" ++
Specifies which module to use and configure.
*tooltip*: ++
typeof: bool ++
default: true ++
Option to disable tooltip on hover.
*tooltip-icon-size*: ++
typeof: integer ++
default: 24 ++
The size of each icon in the tooltip.
# EXAMPLES
```
"privacy": {
"icon-spacing": 4,
"icon-size": 18,
"transition-duration": 250,
"modules": [
{
"type": "screenshare",
"tooltip": true,
"tooltip-icon-size": 24
},
{
"type": "audio-out",
"tooltip": true,
"tooltip-icon-size": 24
},
{
"type": "audio-in",
"tooltip": true,
"tooltip-icon-size": 24
}
]
},
```
# STYLE
- *#privacy*
- *#privacy-item*
- *#privacy-item.screenshare*
- *#privacy-item.audio-in*
- *#privacy-item.audio-out*

View File

@ -467,6 +467,7 @@ if scdoc.found()
'waybar-network.5.scd',
'waybar-pulseaudio.5.scd',
'waybar-pulseaudio-slider.5.scd',
'waybar-privacy.5.scd',
'waybar-river-mode.5.scd',
'waybar-river-tags.5.scd',
'waybar-river-window.5.scd',

View File

@ -283,10 +283,6 @@ label:focus {
padding: 0;
}
#privacy > box {
padding: 0;
}
#privacy-item {
padding: 0 5px;
color: white;

View File

@ -158,18 +158,6 @@ void PrivacyItem::set_in_use(bool in_use) {
set_reveal_child(false);
}
this->init = true;
// CSS status class
const std::string status = this->in_use ? "in-use" : "";
// Remove last status if it exists
if (!lastStatus.empty() && get_style_context()->has_class(lastStatus)) {
get_style_context()->remove_class(lastStatus);
}
// Add the new status class to the Box
if (!status.empty() && !get_style_context()->has_class(status)) {
get_style_context()->add_class(status);
}
lastStatus = status;
}
} // namespace waybar::modules::privacy