Format again...
This commit is contained in:
parent
0701c4e4cf
commit
fa0ab2f1fa
13 changed files with 41 additions and 79 deletions
|
|
@ -521,22 +521,13 @@ impl ActionParser<'_> {
|
|||
})
|
||||
}
|
||||
|
||||
fn parse_global_shortcut(
|
||||
&mut self,
|
||||
span: Span,
|
||||
ext: &mut Extractor<'_>,
|
||||
) -> ParseResult<Self> {
|
||||
let (name_opt, app_id_opt, id_opt) = ext.extract((
|
||||
opt(str("name")),
|
||||
opt(str("app_id")),
|
||||
opt(str("id")),
|
||||
))?;
|
||||
fn parse_global_shortcut(&mut self, span: Span, ext: &mut Extractor<'_>) -> ParseResult<Self> {
|
||||
let (name_opt, app_id_opt, id_opt) =
|
||||
ext.extract((opt(str("name")), opt(str("app_id")), opt(str("id"))))?;
|
||||
let (app_id, id) = match (app_id_opt, id_opt, name_opt) {
|
||||
(Some(a), Some(i), _) => (a.value.to_string(), i.value.to_string()),
|
||||
(None, None, Some(n)) => match n.value.split_once(':') {
|
||||
Some((a, i)) if !a.is_empty() && !i.is_empty() => {
|
||||
(a.to_string(), i.to_string())
|
||||
}
|
||||
Some((a, i)) if !a.is_empty() && !i.is_empty() => (a.to_string(), i.to_string()),
|
||||
_ => {
|
||||
return Err(
|
||||
ActionParserError::GlobalShortcutBadName(n.value.to_string())
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ impl Parser for BlurConfigParser<'_> {
|
|||
table: &IndexMap<Spanned<String>, Spanned<Value>>,
|
||||
) -> ParseResult<Self> {
|
||||
let mut ext = Extractor::new(self.0, span, table);
|
||||
let (passes_val, size_val) =
|
||||
ext.extract((opt(int("passes")), opt(fltorint("size"))))?;
|
||||
let (passes_val, size_val) = ext.extract((opt(int("passes")), opt(fltorint("size"))))?;
|
||||
let passes = passes_val.despan().and_then(|v| u8::try_from(v).ok());
|
||||
let size = size_val.despan().map(|v| v as f32);
|
||||
Ok(BlurConfig { passes, size })
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use {
|
|||
parsers::{
|
||||
action::ActionParser,
|
||||
actions::ActionsParser,
|
||||
blur::BlurConfigParser,
|
||||
clean_logs_older_than::CleanLogsOlderThanParser,
|
||||
client_rule::ClientRulesParser,
|
||||
color_management::ColorManagementParser,
|
||||
|
|
@ -23,7 +24,6 @@ use {
|
|||
input::InputsParser,
|
||||
input_mode::InputModesParser,
|
||||
keymap::KeymapParser,
|
||||
blur::BlurConfigParser,
|
||||
layer_rule::LayerRulesParser,
|
||||
libei::LibeiParser,
|
||||
log_level::LogLevelParser,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ impl Parser for ModifiedKeysymParser {
|
|||
}
|
||||
let Some(new) = Keysym::from_str(part) else {
|
||||
return Err(
|
||||
ModifiedKeysymParserError::UnknownKeysym(part.to_string()).spanned(span),
|
||||
ModifiedKeysymParserError::UnknownKeysym(part.to_string()).spanned(span)
|
||||
);
|
||||
};
|
||||
let new = KeySym(new.0);
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ mod toml;
|
|||
use {
|
||||
crate::{
|
||||
config::{
|
||||
Action, ClientRule, Config, ConfigConnector, ConfigDrmDevice, ConfigKeymap,
|
||||
BlurConfig, ConnectorMatch, DrmDeviceMatch, Exec, Input, InputMatch, LayerKind,
|
||||
LayerRule, Output,
|
||||
Action, BlurConfig, ClientRule, Config, ConfigConnector, ConfigDrmDevice, ConfigKeymap,
|
||||
ConnectorMatch, DrmDeviceMatch, Exec, Input, InputMatch, LayerKind, LayerRule, Output,
|
||||
OutputMatch, SimpleCommand, Status, Theme, WindowRule, parse_config,
|
||||
},
|
||||
rules::{MatcherTemp, RuleMapper},
|
||||
|
|
@ -24,7 +23,8 @@ use {
|
|||
ahash::{AHashMap, AHashSet},
|
||||
error_reporter::Report,
|
||||
jay_config::{
|
||||
Axis,
|
||||
_private::{BlurConfigIpc, LayerKindIpc, LayerMatchIpc, LayerRuleIpc},
|
||||
_set_blur_config, _set_layer_rules, Axis,
|
||||
client::Client,
|
||||
config, config_dir,
|
||||
exec::{Command, set_env, unset_env},
|
||||
|
|
@ -38,8 +38,6 @@ use {
|
|||
is_reload,
|
||||
keyboard::Keymap,
|
||||
logging::{clean_logs_older_than, set_log_level},
|
||||
_set_blur_config, _set_layer_rules,
|
||||
_private::{BlurConfigIpc, LayerKindIpc, LayerMatchIpc, LayerRuleIpc},
|
||||
on_devices_enumerated, on_idle, on_unload, quit, reload, set_autotile,
|
||||
set_color_management_enabled, set_corner_radius, set_default_workspace_capture,
|
||||
set_explicit_sync_enabled, set_float_above_fullscreen, set_floating_titles, set_idle,
|
||||
|
|
@ -511,11 +509,9 @@ impl Action {
|
|||
Action::Resize { dx1, dy1, dx2, dy2 } => {
|
||||
window_or_seat!(s, s.resize(dx1, dy1, dx2, dy2))
|
||||
}
|
||||
Action::TriggerGlobalShortcut { app_id, id } => {
|
||||
b.new(move || {
|
||||
jay_config::trigger_global_shortcut(&app_id, &id);
|
||||
})
|
||||
}
|
||||
Action::TriggerGlobalShortcut { app_id, id } => b.new(move || {
|
||||
jay_config::trigger_global_shortcut(&app_id, &id);
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue