diff --git a/docs/Compiling.md b/docs/Compiling.md index 22248e87..619b3ce9 100644 --- a/docs/Compiling.md +++ b/docs/Compiling.md @@ -85,3 +85,45 @@ cargo build --release --no-default-features \ | workspaces+sway | Enables the `workspaces` module with support for Sway. | | workspaces+hyprland | Enables the `workspaces` module with support for Hyprland. | +## Speeding up compiling + +With the full feature set, Ironbar can take a good while to compile. +There are a couple of tricks which can be used to improve compile times. + +## Linker + +The default GCC linker is *slow* - it takes nearly half of the compile time. +As an alternative, you can use [mold](https://github.com/rui314/mold). + +Install the package for your distro, create/modify the `.cargo/config.toml` file inside the project dir, +then add the following: + +```toml +[target.x86_64-unknown-linux-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=mold"] +``` + +## Codegen Backend + +> [!WARNING] +> The Cranelift backend is experimental and requires the use of the nightly compiler. +> It is designed for development builds only. + +If working on the Ironbar codebase, you may see some benefit from using the [Cranelift](https://github.com/rust-lang/rustc_codegen_cranelift) compiler backend. +This is known to shave a further few seconds off the compile time (bringing down from 10 to 7-8 on my own hardware). + +Firstly install the component: + +```shell +rustup component add rustc-codegen-cranelift-preview --toolchain nightly +``` + +Then create/modify the `.cargo/config.toml` file inside the project dir, and add the following: + +```toml +[unstable] +codegen-backend = true + +[profile.dev] +codegen-backend = "cranelift" +``` \ No newline at end of file diff --git a/examples/style.css b/examples/style.css index 6eabe844..c766da80 100644 --- a/examples/style.css +++ b/examples/style.css @@ -17,6 +17,7 @@ box, menubar, button { background-color: @color_bg; background-image: none; + box-shadow: none; } button, label { @@ -27,6 +28,11 @@ button:hover { background-color: @color_bg_dark; } +scale trough { + min-width: 1px; + min-height: 2px; +} + #bar { border-top: 1px solid @color_border; } @@ -85,7 +91,7 @@ button:hover { margin-right: 4px; } -.launcher .item:not(.focused):hover { +.launcher .ifix examtem:not(.focused):hover { background-color: @color_bg_dark; } @@ -94,7 +100,7 @@ button:hover { } .launcher .focused { - border-bottom: 2px solid @color_border_active; + border-bottom: 1px solid @color_border_active; } .launcher .urgent { diff --git a/src/desktop_file.rs b/src/desktop_file.rs index 2d10bd08..fb00ecde 100644 --- a/src/desktop_file.rs +++ b/src/desktop_file.rs @@ -110,9 +110,7 @@ fn find_desktop_file_by_filedata(app_id: &str, files: &[PathBuf]) -> Option Option { file.lines() .filter_map(|line| { - let Some((key, value)) = line.split_once('=') else { - return None; - }; + let (key, value) = line.split_once('=')?; let key = key.trim(); let value = value.trim(); @@ -190,9 +186,7 @@ fn parse_desktop_file(path: &Path) -> Option { /// Attempts to get the icon name from the app's `.desktop` file. pub fn get_desktop_icon_name(app_id: &str) -> Option { - let Some(path) = find_desktop_file(app_id) else { - return None; - }; + let path = find_desktop_file(app_id)?; let mut desktop_files_cache = lock!(desktop_files());