Add native shell launcher with themed search and browsing
This commit is contained in:
1 parent
2a400b26d0
commit
d8bdb68b2a
43 files changed
+3351
-115
No files matched your search
@@ -19,6 +19,11 @@ pub struct Cli {
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Command {
|
||||
/// Show or hide the application launcher.
|
||||
Launcher {
|
||||
#[command(subcommand)]
|
||||
action: LauncherAction,
|
||||
},
|
||||
/// Publish bounded activity data owned by the invoking shell.
|
||||
Activity {
|
||||
#[command(subcommand)]
|
||||
@@ -235,10 +240,18 @@ fn value_name(value: &impl ValueEnum) -> String {
|
||||
.to_owned()
|
||||
}
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum LauncherAction {
|
||||
Toggle,
|
||||
}
|
||||
|
||||
impl Command {
|
||||
pub fn ipc(&self) -> Option<(&'static str, Value)> {
|
||||
let (command, args) = match self {
|
||||
Self::Activity { .. } | Self::Run { .. } => return None,
|
||||
Self::Launcher {
|
||||
action: LauncherAction::Toggle,
|
||||
} => ("toggle-launcher", json!({})),
|
||||
Self::FocusedWindow => ("get-focused-window", json!({})),
|
||||
Self::Windows => ("get-windows", json!({})),
|
||||
Self::IdleInhibition => ("get-idle-inhibition", json!({})),
|
||||
|
||||
@@ -38,6 +38,7 @@ fn help_exits_successfully_without_a_session_and_has_hidden_legacy_aliases() {
|
||||
for args in [
|
||||
&["--help"][..],
|
||||
&["theme", "--help"],
|
||||
&["launcher", "--help"],
|
||||
&["media", "--help"],
|
||||
&["xwayland", "--help"],
|
||||
&["screenshot", "--help"],
|
||||
@@ -470,3 +471,17 @@ sys.exit(19)
|
||||
.unwrap();
|
||||
assert!(elapsed < 1.5, "stdout reader stalled the child for {elapsed}s");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn launcher_toggle_uses_the_shell_command() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let path = directory.path().join("ipc.sock");
|
||||
let server = serve(&path, "toggle-launcher", json!({}));
|
||||
success(
|
||||
ctl(&["launcher", "toggle"])
|
||||
.env("FERESE_SOCKET", &path)
|
||||
.output()
|
||||
.unwrap(),
|
||||
);
|
||||
server.join().unwrap();
|
||||
}
|
||||
Reference in new issue
Block a user