Skip to content

Commit

Permalink
Merge branch 'master' into add-events
Browse files Browse the repository at this point in the history
  • Loading branch information
yavko authored Oct 24, 2024
2 parents a6dbb00 + e709502 commit 9058ffc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
38 changes: 28 additions & 10 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! # Hyprland Configuration in Rust
//!
use crate::dispatch::{gen_dispatch_str, DispatchType};
use crate::dispatch::{DispatchType, gen_dispatch_str};
use crate::keyword::Keyword;

/// Module providing stuff for adding an removing keybinds
Expand Down Expand Up @@ -71,22 +71,40 @@ pub mod binds {
/// Works when screen is locked
#[display(fmt = "l")]
l,
/// Used for mouse binds
#[display(fmt = "m")]
m,
/// Repeats when held
#[display(fmt = "e")]
e,
/// Activates on release
#[display(fmt = "r")]
r,
/// Repeats when held
#[display(fmt = "e")]
e,
/// Non-consuming, key/mouse events will be passed to the active window in addition to triggering the dispatcher.
#[display(fmt = "n")]
n,
/// Used for mouse binds
#[display(fmt = "m")]
m,
/// Transparent, cannot be shadowed by other binds.
#[display(fmt = "t")]
t,
/// Ignore mods, will ignore modifiers.
#[display(fmt = "i")]
i,
/// Separate, will arbitrarily combine keys between each mod/key
#[display(fmt = "s")]
s,
/// Has description, will allow you to write a description for your bind.
#[display(fmt = "d")]
d,
/// Bypasses the app's requests to inhibit keybinds.
#[display(fmt = "p")]
p,
}

impl Join for Vec<Flag> {
fn join(&self) -> String {
let mut buf = String::new();
for i in self {
buf.push_str(&i.to_string());
for f in self {
buf.push_str(&f.to_string());
}
buf
}
Expand Down Expand Up @@ -131,7 +149,7 @@ pub mod binds {
format!("bind{}", binding.flags.join()),
Self::gen_str(binding)?,
)
.await?;
.await?;
Ok(())
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/data/regular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn call_hyprctl_data_cmd(cmd: DataCommands) -> crate::Result<String> {
/// This pub(crate) enum holds every socket command that returns data
#[derive(Debug, Display, Clone, Copy, PartialEq, Eq)]
pub(crate) enum DataCommands {
#[display(fmt = "monitors")]
#[display(fmt = "monitors all")]
Monitors,
#[display(fmt = "workspaces")]
Workspaces,
Expand Down Expand Up @@ -122,6 +122,8 @@ pub struct Monitor {
pub dpms_status: bool,
/// VRR state
pub vrr: bool,
/// Is the monitor disabled or not
pub disabled: bool,
}

impl HyprDataActive for Monitor {
Expand Down Expand Up @@ -430,6 +432,15 @@ pub struct Version {
pub dirty: bool,
/// The git commit message
pub commit_message: String,
/// The git commit date
pub commit_date: String,
/// The git tag hyprland was built on
pub tag: String,
/// The amount of commits to Hyprland at buildtime
pub commits: String,
/// Aquamarine version
#[serde(rename = "buildAquamarine")]
pub build_aquamarine: String,
/// The flags that Hyprland was built with
pub flags: Vec<String>,
}
Expand Down

0 comments on commit 9058ffc

Please sign in to comment.