This commit is contained in:
Penelope Gwen 2026-05-14 13:43:31 -07:00
parent 7977caafb3
commit 1d0af9a389
5 changed files with 12 additions and 4 deletions

2
Cargo.lock generated
View file

@ -1754,7 +1754,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "sway-de-utils"
version = "0.1.13"
version = "0.1.14"
dependencies = [
"clap",
"clap_complete",

View file

@ -1,6 +1,6 @@
[package]
name = "sway-de-utils"
version = "0.1.13"
version = "0.1.14"
authors = ["Penelope Gwen <support@pogmom.me>"]
edition = "2024"
license-file = "LICENSE.md"

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
sway-de-utils (0.1.14-1) unstable; urgency=medium
* fix workspace number detection
-- Penelope Gwen <support@pogmom.me> Thu, 14 May 2026 13:41:44 -0700
sway-de-utils (0.1.13-1) unstable; urgency=medium
* add ability to append arguments to sdu launch program calls

View file

@ -222,6 +222,7 @@ fn initialize(
}
pub fn profile_from_index(profiles: Vec<Profile>, index: usize) -> Profile {
debug!("profile index: {}", index);
profiles
.get(index)
.expect("Profile not found for index")

View file

@ -15,14 +15,15 @@ use {
};
pub fn focused_workspace_profile(profiles: Vec<Profile>) -> Profile {
let focused_ws_index = get_sway_connection()
let mut focused_ws_index = get_sway_connection()
.get_workspaces()
.expect("unable to parse workspaces")
.iter()
.find(|w| w.focused)
.map(|w| w.num)
.unwrap_or_default() as usize
/ 10;
- 1;
focused_ws_index = focused_ws_index / 10;
debug!("found profile {:?} for focused workspace", focused_ws_index);
profile_from_index(profiles, focused_ws_index)
}