Merge pull request #417 from JakeStanger/various

Various Small Changes
This commit is contained in:
Jake Stanger 2024-01-24 23:26:06 +00:00 committed by GitHub
commit bfec31254f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 53 additions and 11 deletions

View File

@ -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"
```

View File

@ -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 {

View File

@ -110,9 +110,7 @@ fn find_desktop_file_by_filedata(app_id: &str, files: &[PathBuf]) -> Option<Path
let files = files
.iter()
.filter_map(|file| {
let Some(parsed_desktop_file) = parse_desktop_file(file) else {
return None;
};
let parsed_desktop_file = parse_desktop_file(file)?;
desktop_files_cache.insert(file.clone(), parsed_desktop_file.clone());
Some((file.clone(), parsed_desktop_file))
@ -165,9 +163,7 @@ fn parse_desktop_file(path: &Path) -> Option<DesktopFile> {
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<DesktopFile> {
/// Attempts to get the icon name from the app's `.desktop` file.
pub fn get_desktop_icon_name(app_id: &str) -> Option<String> {
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());