merge workspaces_dev
This commit is contained in:
commit
74f6c2eca6
22 changed files with 1275 additions and 155 deletions
|
|
@ -34,7 +34,9 @@ impl CosmicPanelAppButtonWindow {
|
|||
..add_css_class("root_window");
|
||||
};
|
||||
|
||||
if let Some(apps_desktop_info) = DesktopAppInfo::new(&format!("{}.desktop", app_desktop_file_name)) {
|
||||
if let Some(apps_desktop_info) =
|
||||
DesktopAppInfo::new(&format!("{}.desktop", app_desktop_file_name))
|
||||
{
|
||||
let app_button = cascade! {
|
||||
Button::new();
|
||||
..add_css_class("apps");
|
||||
|
|
@ -54,16 +56,16 @@ impl CosmicPanelAppButtonWindow {
|
|||
container.append(&image);
|
||||
|
||||
app_button.set_child(Some(&container));
|
||||
dbg!(apps_desktop_info.string("Exec").unwrap().as_str());
|
||||
let app_id = app_desktop_file_name.to_string();
|
||||
app_button.connect_clicked(move |_| {
|
||||
let _ = Command::new("xdg-shell-wrapper")
|
||||
.env_remove("WAYLAND_SOCKET")
|
||||
.arg(apps_desktop_info.string("Exec").unwrap().as_str())
|
||||
.arg(&app_id)
|
||||
.spawn();
|
||||
});
|
||||
self_.set_child(Some(&app_button));
|
||||
} else {
|
||||
panic!("Requested application is not installed");
|
||||
panic!("{} is not installed", app_desktop_file_name);
|
||||
}
|
||||
|
||||
self_
|
||||
|
|
|
|||
|
|
@ -44,7 +44,14 @@ fn main() {
|
|||
localize();
|
||||
gio::resources_register_include!("compiled.gresource").unwrap();
|
||||
let app = gtk4::Application::new(None, ApplicationFlags::default());
|
||||
app.add_main_option("id", glib::Char::from(b'i'), glib::OptionFlags::NONE, glib::OptionArg::String, "id of the launched application", None);
|
||||
app.add_main_option(
|
||||
"id",
|
||||
glib::Char::from(b'i'),
|
||||
glib::OptionFlags::NONE,
|
||||
glib::OptionArg::String,
|
||||
"id of the launched application",
|
||||
None,
|
||||
);
|
||||
app.connect_handle_local_options(|_app, args| {
|
||||
if let Ok(Some(id)) = args.lookup::<String>("id") {
|
||||
ID.set(id).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue