Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added remaining bind flags #273

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading