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

Fix hyprctl Color and Icon problem #58

Merged
merged 9 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions src/ctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ pub mod set_error {
pub mod notify {
use super::*;
use std::time::Duration;
#[repr(u8)]
yavko marked this conversation as resolved.
Show resolved Hide resolved

#[allow(missing_docs)]
#[derive(Copy, Clone)]
#[repr(i8)]
pub enum Icon {
NoIcon = -1,
Warning = 0,
Info = 1,
Hint = 2,
Expand All @@ -189,7 +192,7 @@ pub mod notify {
command!(
Empty,
"notify {} {} {color} {msg}",
icon as u8,
icon as i8,
time.as_millis()
),
)?;
Expand All @@ -207,7 +210,7 @@ pub mod notify {
command!(
Empty,
"notify {} {} {color} {msg}",
icon as u8,
icon as i8,
time.as_millis()
),
)
Expand All @@ -217,8 +220,8 @@ pub mod notify {
}

/// A 8-bit color with a alpha channel
#[derive(MDisplay, Constructor)]
#[display(fmt = "rgba({},{},{},{})", "_0", "_1", "_2", "_3")]
#[derive(Copy, Clone, MDisplay, Constructor)]
#[display(fmt = "rgba({:02x}{:02x}{:02x}{:02x})", "_0", "_1", "_2", "_3")]
pub struct Color(u8, u8, u8, u8);

/// Provides things to setting props
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ pub(crate) mod unix_async {
}

/// This type provides the result type used everywhere in Hyprland-rs
pub type Result<T> = std::result::Result<T, shared::HyprError>;
pub type Result<T> = std::result::Result<T, shared::HyprError>;
yavko marked this conversation as resolved.
Show resolved Hide resolved