diff --git a/README.md b/README.md index ac9718b5..6009d91a 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ - Network - Bluetooth - Pulseaudio +- Privacy Info - Wireplumber - Disk - Memory diff --git a/include/modules/privacy/privacy.hpp b/include/modules/privacy/privacy.hpp index c6b09b2c..b8e76768 100644 --- a/include/modules/privacy/privacy.hpp +++ b/include/modules/privacy/privacy.hpp @@ -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 backend = nullptr; }; diff --git a/include/modules/privacy/privacy_item.hpp b/include/modules/privacy/privacy_item.hpp index 40ed40c5..a0e3038b 100644 --- a/include/modules/privacy/privacy_item.hpp +++ b/include/modules/privacy/privacy_item.hpp @@ -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"; diff --git a/man/waybar-privacy.5.scd b/man/waybar-privacy.5.scd new file mode 100644 index 00000000..d13d8ed3 --- /dev/null +++ b/man/waybar-privacy.5.scd @@ -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* diff --git a/meson.build b/meson.build index 8bea0ce3..cac29747 100644 --- a/meson.build +++ b/meson.build @@ -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', diff --git a/resources/style.css b/resources/style.css index 78cdf604..e6017fdb 100644 --- a/resources/style.css +++ b/resources/style.css @@ -283,10 +283,6 @@ label:focus { padding: 0; } -#privacy > box { - padding: 0; -} - #privacy-item { padding: 0 5px; color: white; diff --git a/src/modules/privacy/privacy_item.cpp b/src/modules/privacy/privacy_item.cpp index 1d4c8a0e..a0a2da57 100644 --- a/src/modules/privacy/privacy_item.cpp +++ b/src/modules/privacy/privacy_item.cpp @@ -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