diff options
Diffstat (limited to 'vendor/libghostty-vt/src/apprt/gtk/ipc')
| -rw-r--r-- | vendor/libghostty-vt/src/apprt/gtk/ipc/toggle_quick_terminal.zig | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/apprt/gtk/ipc/toggle_quick_terminal.zig b/vendor/libghostty-vt/src/apprt/gtk/ipc/toggle_quick_terminal.zig new file mode 100644 index 00000000..702ad3df --- /dev/null +++ b/vendor/libghostty-vt/src/apprt/gtk/ipc/toggle_quick_terminal.zig @@ -0,0 +1,24 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; + +const apprt = @import("../../../apprt.zig"); +const DBus = @import("DBus.zig"); + +/// Use a D-Bus method call to toggle the quick terminal on GTK. +/// +/// `ghostty +toggle-quick-terminal` is equivalent to the following command +/// (on a release build): +/// +/// ```sh +/// gdbus call --session \ +/// --dest com.mitchellh.ghostty \ +/// --object-path /com/mitchellh/ghostty \ +/// --method org.gtk.Actions.Activate \ +/// toggle-quick-terminal [] [] +/// ``` +pub fn toggleQuickTerminal(alloc: Allocator, target: apprt.ipc.Target) (Allocator.Error || std.Io.Writer.Error || apprt.ipc.Errors)!bool { + var dbus = try DBus.init(alloc, target, "toggle-quick-terminal"); + defer dbus.deinit(alloc); + try dbus.send(); + return true; +} |
