Compare commits
No commits in common. "3dc2c24ec566f4cd03be17838f4d02df7c6f9b29" and "eab44307f02fe73f3ea6fa05b45f2ab2eb45eaac" have entirely different histories.
3dc2c24ec5
...
eab44307f0
@ -51,4 +51,3 @@ luna_app(clock.cpp clock)
|
|||||||
target_link_libraries(clock PUBLIC ui)
|
target_link_libraries(clock PUBLIC ui)
|
||||||
luna_app(startui.cpp startui)
|
luna_app(startui.cpp startui)
|
||||||
luna_app(launch.cpp launch)
|
luna_app(launch.cpp launch)
|
||||||
luna_app(run.cpp run)
|
|
||||||
|
@ -31,7 +31,7 @@ Result<void> handle_launch_detached_message(os::IPC::ClientConnection& client)
|
|||||||
|
|
||||||
StringView args[] = { path.view() };
|
StringView args[] = { path.view() };
|
||||||
|
|
||||||
os::Process::spawn(args[0], { args, 1 }, request.search_in_path);
|
os::Process::spawn(args[0], { args, 1 }, false);
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
35
apps/run.cpp
35
apps/run.cpp
@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file run.cpp
|
|
||||||
* @author apio (cloudapio.eu)
|
|
||||||
* @brief Tiny command-line utility to start a detached program in the current GUI session.
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2024, the Luna authors.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <os/ArgumentParser.h>
|
|
||||||
#include <os/File.h>
|
|
||||||
#include <os/LocalClient.h>
|
|
||||||
#include <os/ipc/Launcher.h>
|
|
||||||
|
|
||||||
Result<int> luna_main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
StringView program;
|
|
||||||
|
|
||||||
os::ArgumentParser parser;
|
|
||||||
parser.add_description("Start a detached program in the current GUI session."_sv);
|
|
||||||
parser.add_system_program_info("run"_sv);
|
|
||||||
parser.add_positional_argument(program, "program", true);
|
|
||||||
parser.parse(argc, argv);
|
|
||||||
|
|
||||||
OwnedPtr<os::IPC::Client> launcher_client = TRY(os::IPC::Client::connect("/tmp/launch.sock", false));
|
|
||||||
|
|
||||||
os::println("Requesting to start program '%s'...", program.chars());
|
|
||||||
|
|
||||||
os::Launcher::LaunchDetachedRequest request;
|
|
||||||
SET_IPC_STRING(request.command, program.chars());
|
|
||||||
request.search_in_path = true;
|
|
||||||
launcher_client->send_async(request);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -25,7 +25,6 @@ namespace os
|
|||||||
static constexpr u8 ID = LAUNCH_DETACHED_ID;
|
static constexpr u8 ID = LAUNCH_DETACHED_ID;
|
||||||
|
|
||||||
IPC_STRING(command);
|
IPC_STRING(command);
|
||||||
bool search_in_path { false };
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user