system76-scheduler icon indicating copy to clipboard operation
system76-scheduler copied to clipboard

Setting background and foreground to None in config.ron causes explicit process assignments to be ignored

Open techsy730 opened this issue 2 years ago • 1 comments

Setting your config.ron to have

{
  background: None,
  foreground: None,
}

Causes any explicit process assignments (assignments.ron and others) to be not applied.

Seems to be a regression of #12, in which it was stated the desired behavior was to still allow per-process assignments to apply even with None.

If only background is None, then per-process mappings are only applied when a process goes into the foreground. The opposite for foreground.

techsy730 avatar May 30 '22 19:05 techsy730

Given how complex the "reading the configuration for process assignments" is (mostly by necessity to both satisfy the type system and to follow idiomatic Rust practices), I'm wondering whether the "do it at all or not" needs to be pulled into it's own option. Instead of trying to treat an explicit None value specially.

This overloading of the option's meaning, combined with change to restore foreground->background niceness properly, sort of mandates these complex if let Some and Some.with_default chains.

techsy730 avatar Jun 11 '22 18:06 techsy730