mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-17 09:17:02 +02:00
feat(cli): add version as state query variant
This commit adds a new StateQuery::Version, which allows integrators to make decisions about how to handle different versions of komorebi's state schema based on the version of komorebi that is running on a user's machine.
This commit is contained in:
@@ -329,6 +329,7 @@ pub enum StateQuery {
|
|||||||
FocusedContainerIndex,
|
FocusedContainerIndex,
|
||||||
FocusedWindowIndex,
|
FocusedWindowIndex,
|
||||||
FocusedWorkspaceName,
|
FocusedWorkspaceName,
|
||||||
|
Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
|
|||||||
@@ -239,6 +239,8 @@ pub static REMOVE_TITLEBARS: AtomicBool = AtomicBool::new(false);
|
|||||||
|
|
||||||
pub static SLOW_APPLICATION_COMPENSATION_TIME: AtomicU64 = AtomicU64::new(20);
|
pub static SLOW_APPLICATION_COMPENSATION_TIME: AtomicU64 = AtomicU64::new(20);
|
||||||
|
|
||||||
|
shadow_rs::shadow!(build);
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn current_virtual_desktop() -> Option<Vec<u8>> {
|
pub fn current_virtual_desktop() -> Option<Vec<u8>> {
|
||||||
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ use komorebi::HOME_DIR;
|
|||||||
use komorebi::INITIAL_CONFIGURATION_LOADED;
|
use komorebi::INITIAL_CONFIGURATION_LOADED;
|
||||||
use komorebi::SESSION_ID;
|
use komorebi::SESSION_ID;
|
||||||
|
|
||||||
shadow_rs::shadow!(build);
|
|
||||||
|
|
||||||
fn setup(log_level: LogLevel) -> Result<(WorkerGuard, WorkerGuard)> {
|
fn setup(log_level: LogLevel) -> Result<(WorkerGuard, WorkerGuard)> {
|
||||||
if std::env::var("RUST_LIB_BACKTRACE").is_err() {
|
if std::env::var("RUST_LIB_BACKTRACE").is_err() {
|
||||||
std::env::set_var("RUST_LIB_BACKTRACE", "1");
|
std::env::set_var("RUST_LIB_BACKTRACE", "1");
|
||||||
@@ -165,7 +163,7 @@ enum LogLevel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[clap(author, about, version = build::CLAP_LONG_VERSION)]
|
#[clap(author, about, version = komorebi::build::CLAP_LONG_VERSION)]
|
||||||
struct Opts {
|
struct Opts {
|
||||||
/// Allow the use of komorebi's custom focus-follows-mouse implementation
|
/// Allow the use of komorebi's custom focus-follows-mouse implementation
|
||||||
#[clap(short, long = "ffm")]
|
#[clap(short, long = "ffm")]
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ use crate::animation::ANIMATION_STYLE_GLOBAL;
|
|||||||
use crate::border_manager;
|
use crate::border_manager;
|
||||||
use crate::border_manager::IMPLEMENTATION;
|
use crate::border_manager::IMPLEMENTATION;
|
||||||
use crate::border_manager::STYLE;
|
use crate::border_manager::STYLE;
|
||||||
|
use crate::build;
|
||||||
use crate::colour::Rgb;
|
use crate::colour::Rgb;
|
||||||
use crate::config_generation::WorkspaceMatchingRule;
|
use crate::config_generation::WorkspaceMatchingRule;
|
||||||
use crate::current_virtual_desktop;
|
use crate::current_virtual_desktop;
|
||||||
@@ -1377,6 +1378,7 @@ impl WindowManager {
|
|||||||
.focused_workspace_name()
|
.focused_workspace_name()
|
||||||
.unwrap_or_else(|| focused_monitor.focused_workspace_idx().to_string())
|
.unwrap_or_else(|| focused_monitor.focused_workspace_idx().to_string())
|
||||||
}
|
}
|
||||||
|
StateQuery::Version => build::RUST_VERSION.to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
reply.write_all(response.as_bytes())?;
|
reply.write_all(response.as_bytes())?;
|
||||||
|
|||||||
Reference in New Issue
Block a user