Skip to content

Commit

Permalink
Don't default use battery status, update default config and test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusGrass committed Apr 9, 2022
1 parent 0a2f9b2 commit dd0a038
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
3 changes: 1 addition & 2 deletions pgwm-core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ fn init_status_checks(
) -> heapless::CopyVec<crate::status::checker::Check, STATUS_BAR_UNIQUE_CHECK_LIMIT> {
use crate::status::checker::{Check, CheckType, CpuFormat, DateFormat, MemFormat, NetFormat};
let mut checks = heapless::CopyVec::new();
/*
/* Commented out because I'm usually not using a computer with batteries and configure those with config files
let mut battery_threshholds = heapless::CopyVec::new();
// BatFormat takes a threshold and an associated icon which is displayed when below that threshold.
crate::push_heapless!(
Expand Down Expand Up @@ -755,7 +755,6 @@ fn init_status_checks(
}
)
.unwrap();
*/

// The CpuFormat takes an amount of decimals to use when displaying load
Expand Down
9 changes: 1 addition & 8 deletions pgwm-core/src/util/load_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,7 @@ mod tests {
fn example_cfg_is_same_as_default() {
let cfg = read_cfg_from_root();
let default = Cfg::default();
assert_eq!(default.sizing, cfg.sizing);
assert_eq!(default.colors, cfg.colors);
assert_eq!(default.mouse_mappings, cfg.mouse_mappings);
#[cfg(feature = "status-bar")]
assert_eq!(default.key_mappings, cfg.key_mappings);
assert_eq!(default.char_remap, cfg.char_remap);
assert_eq!(default.fonts, cfg.fonts);
assert_eq!(default.workspaces, cfg.workspaces);
assert_eq!(cfg, default);
}

fn read_cfg_from_root() -> Cfg {
Expand Down
27 changes: 14 additions & 13 deletions pgwm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ center_leader = 2.0
# the modifier at index 0, the top-right window will increase in height while its below neighbour will be displaced.
# With only two windows, the modifier on index 1 does not change any window's claim on the monitor real estate, as
# that window will then tile vertically while already taking up maximum height.
# CONSTRAINTS: All above 0.0, no longer than number of workspaces - 1
vertically_tiled = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
# CONSTRAINTS: All above 0.0, no longer than `WS_WINDOW_LIMIT` - 1
vertically_tiled = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]

# Colors, RGBA color values
# CONSTRAINTS: All RGBA values has unsigned byte sizing
Expand Down Expand Up @@ -161,21 +161,22 @@ name = "\uf02c"

[bar]
[[bar.shortcuts]]
name = "\uf02b"
name = "\uf304"
[[bar.shortcuts]]
name = "\uf02b"
name = "\uf502"
# Status bar checks
# Ordering will determine the order that the checks are displayed
# Constraints, The icon + content can at most be `STATUS_BAR_CHECK_CONTENT_LIMIT`, probably fine just keep it short
[[bar.status_checks]]
interval = 1000
check_type = { kind = "Battery", args = [
{above = 90, icon = "\uf240 "}, # Adding one space because this icon just doesn't fit right
{above = 75, icon = "\uf241 "},
{above = 50, icon = "\uf242 "},
{above = 25, icon = "\uf243 "},
{above = 0, icon = "\uf244 "},
]}
# Commented out to avoid weirdness if not using batteries
# [[bar.status_checks]]
# interval = 1000
# check_type = { kind = "Battery", args = [
# {above = 90, icon = "\uf240 "}, # Adding one space because this icon just doesn't fit right
# {above = 75, icon = "\uf241 "},
# {above = 50, icon = "\uf242 "},
# {above = 25, icon = "\uf243 "},
# {above = 0, icon = "\uf244 "},
# ]}
[[bar.status_checks]]
interval = 1000
check_type = { kind = "Cpu", args = { icon = "\uf2db", decimals = 1 }}
Expand Down

0 comments on commit dd0a038

Please sign in to comment.