Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 21 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ wgpu = ["libcosmic/wgpu"]

[dependencies]
zbus = "4.2"
libcosmic = { git = "https://github.com/pop-os/libcosmic/", features = [
libcosmic = { git = "https://github.com/jpttrssn/libcosmic/", branch = "launch-app-in-term", features = [
"autosize",
"winit",
"wayland",
"tokio",
Expand Down Expand Up @@ -45,7 +46,7 @@ url = "2.4"
nix = "0.28"
clap = { version = "4.4.8", features = ["derive"] }
switcheroo-control = { git = "https://github.com/pop-os/dbus-settings-bindings" }
cosmic-app-list-config = { git = "https://github.com/pop-os/cosmic-applets" }
cosmic-app-list-config = { git = "https://github.com/jpttrssn/cosmic-applets", branch = "launch-app-in-term" }

[profile.release]
lto = "thin"
Expand Down
9 changes: 6 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ enum Message {
Layer(LayerEvent, SurfaceId),
Hide,
ActivateApp(usize, Option<usize>),
ActivationToken(Option<String>, String, String, Option<usize>),
ActivationToken(Option<String>, String, String, Option<usize>, bool),
SelectGroup(usize),
Delete(usize),
ConfirmDelete,
Expand Down Expand Up @@ -500,6 +500,7 @@ impl cosmic::Application for CosmicAppLibrary {
if let Some(de) = self.entry_path_input.get(i) {
let app_id = de.id.clone();
let exec = de.exec.clone().unwrap();
let terminal = de.terminal.clone();
return request_token(
Some(String::from(Self::APP_ID)),
Some(WINDOW_ID.clone()),
Expand All @@ -510,11 +511,12 @@ impl cosmic::Application for CosmicAppLibrary {
app_id.clone(),
exec.clone(),
gpu_idx,
terminal,
))
});
}
}
Message::ActivationToken(token, app_id, exec, gpu_idx) => {
Message::ActivationToken(token, app_id, exec, gpu_idx, terminal) => {
let mut env_vars = Vec::new();
if let Some(token) = token {
env_vars.push(("XDG_ACTIVATION_TOKEN".to_string(), token.clone()));
Expand All @@ -524,7 +526,8 @@ impl cosmic::Application for CosmicAppLibrary {
env_vars.extend(gpus[idx].environment.clone().into_iter());
}
tokio::spawn(async move {
cosmic::desktop::spawn_desktop_exec(exec, env_vars, Some(&app_id)).await
cosmic::desktop::spawn_desktop_exec(exec, env_vars, Some(&app_id), terminal)
.await
});
return self.update(Message::Hide);
}
Expand Down