From b49e634b657475edd45aaaaad1a7c2e01390d0cd Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Mon, 16 Dec 2024 18:54:27 -0800 Subject: [PATCH] feat(wm): add transparency config to global state This commit adds various transparency related global configuration values to GlobalState, which is can be queried via the komorebic global-state command. resolve #1182 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- komorebi/src/window_manager.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a1e8260f..c0a1663d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug report description: File a bug report -labels: [ bug ] +labels: [bug] title: "[BUG]: " body: - type: markdown diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index 941096f3..0ee3172c 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -60,6 +60,8 @@ use crate::stackbar_manager::STACKBAR_TAB_WIDTH; use crate::stackbar_manager::STACKBAR_UNFOCUSED_TEXT_COLOUR; use crate::static_config::StaticConfig; use crate::transparency_manager; +use crate::transparency_manager::TRANSPARENCY_ALPHA; +use crate::transparency_manager::TRANSPARENCY_ENABLED; use crate::window::Window; use crate::window_manager_event::WindowManagerEvent; use crate::windows_api::WindowsApi; @@ -82,6 +84,7 @@ use crate::NO_TITLEBAR; use crate::OBJECT_NAME_CHANGE_ON_LAUNCH; use crate::REGEX_IDENTIFIERS; use crate::REMOVE_TITLEBARS; +use crate::TRANSPARENCY_BLACKLIST; use crate::TRAY_AND_MULTI_WINDOW_IDENTIFIERS; use crate::WORKSPACE_MATCHING_RULES; @@ -186,6 +189,9 @@ pub struct GlobalState { pub stackbar_tab_background_colour: Colour, pub stackbar_tab_width: i32, pub stackbar_height: i32, + pub transparency_enabled: bool, + pub transparency_alpha: u8, + pub transparency_blacklist: Vec, pub remove_titlebars: bool, #[serde(alias = "float_identifiers")] pub ignore_identifiers: Vec, @@ -239,6 +245,9 @@ impl Default for GlobalState { )), stackbar_tab_width: STACKBAR_TAB_WIDTH.load(Ordering::SeqCst), stackbar_height: STACKBAR_TAB_HEIGHT.load(Ordering::SeqCst), + transparency_enabled: TRANSPARENCY_ENABLED.load(Ordering::SeqCst), + transparency_alpha: TRANSPARENCY_ALPHA.load(Ordering::SeqCst), + transparency_blacklist: TRANSPARENCY_BLACKLIST.lock().clone(), remove_titlebars: REMOVE_TITLEBARS.load(Ordering::SeqCst), ignore_identifiers: IGNORE_IDENTIFIERS.lock().clone(), manage_identifiers: MANAGE_IDENTIFIERS.lock().clone(),