diff --git a/dist/linux/app.desktop b/dist/linux/app.desktop index 4475617f9..6e464ea87 100644 --- a/dist/linux/app.desktop +++ b/dist/linux/app.desktop @@ -1,10 +1,8 @@ [Desktop Entry] -Version=1.0 Name=Ghostty Type=Application Comment=A terminal emulator -TryExec=ghostty -Exec=ghostty --launched-from=desktop +Exec=ghostty Icon=com.mitchellh.ghostty Categories=System;TerminalEmulator; Keywords=terminal;tty;pty; @@ -18,8 +16,7 @@ X-TerminalArgTitle=--title= X-TerminalArgAppId=--class= X-TerminalArgDir=--working-directory= X-TerminalArgHold=--wait-after-command -DBusActivatable=true [Desktop Action new-window] Name=New Window -Exec=ghostty --launched-from=desktop +Exec=ghostty diff --git a/dist/linux/dbus.service b/dist/linux/dbus.service deleted file mode 100644 index 67a80d5dd..000000000 --- a/dist/linux/dbus.service +++ /dev/null @@ -1,4 +0,0 @@ -[D-BUS Service] -Name=com.mitchellh.ghostty -SystemdService=com.mitchellh.ghostty.service -Exec=ghostty --launched-from=dbus diff --git a/dist/linux/systemd.service b/dist/linux/systemd.service deleted file mode 100644 index 9699dccdf..000000000 --- a/dist/linux/systemd.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Ghostty - -[Service] -Type=dbus -BusName=com.mitchellh.ghostty -ExecStart=ghostty --launched-from=systemd diff --git a/flatpak/com.mitchellh.ghostty-debug.yml b/flatpak/com.mitchellh.ghostty-debug.yml index 0ac8851e0..8a2c0056e 100644 --- a/flatpak/com.mitchellh.ghostty-debug.yml +++ b/flatpak/com.mitchellh.ghostty-debug.yml @@ -52,13 +52,6 @@ modules: --prefix /app --search-prefix /app --system $PWD/vendor/p - - # Rename to match service and drop systemd references - - sed -e 's/^Name=.*/\0-debug/' - -e '/^SystemdService=/d' - /app/share/dbus-1/services/com.mitchellh.ghostty.service - > /app/share/dbus-1/services/com.mitchellh.ghostty-debug.service - - rm /app/share/dbus-1/services/com.mitchellh.ghostty.service sources: - type: dir path: .. diff --git a/flatpak/com.mitchellh.ghostty.yml b/flatpak/com.mitchellh.ghostty.yml index 9ba64dc0e..1b119c11b 100644 --- a/flatpak/com.mitchellh.ghostty.yml +++ b/flatpak/com.mitchellh.ghostty.yml @@ -47,10 +47,6 @@ modules: --prefix /app --search-prefix /app --system $PWD/vendor/p - - # Remove references to the user service. Flatpak does not export those. - - sed -i '/^SystemdService=/d' - /app/share/dbus-1/services/com.mitchellh.ghostty.service sources: - type: dir path: .. diff --git a/nix/package.nix b/nix/package.nix index 9b793bc4b..08dfd710b 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -117,11 +117,6 @@ in mkdir -p "$out/nix-support" - sed -i -e "s@^Exec=.*ghostty@Exec=$out/bin/ghostty@" $out/share/applications/com.mitchellh.ghostty.desktop - sed -i -e "s@^TryExec=.*ghostty@TryExec=$out/bin/ghostty@" $out/share/applications/com.mitchellh.ghostty.desktop - sed -i -e "s@^Exec=.*ghostty@Exec=$out/bin/ghostty@" $out/share/dbus-1/services/com.mitchellh.ghostty.service - sed -i -e "s@^ExecStart=.*ghostty@ExecStart=$out/bin/ghostty@" $out/lib/systemd/user/com.mitchellh.ghostty.service - mkdir -p "$terminfo/share" mv "$terminfo_src" "$terminfo/share/terminfo" ln -sf "$terminfo/share/terminfo" "$terminfo_src" diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 93e069376..7c9c15191 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -405,15 +405,11 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { // This just calls the `activate` signal but its part of the normal startup // routine so we just call it, but only if the config allows it (this allows // for launching Ghostty in the "background" without immediately opening - // a window). An initial window will not be immediately created if we were - // launched by D-Bus activation or systemd. D-Bus activation will send it's - // own `activate` or `new-window` signal later. + // a window) // // https://gitlab.gnome.org/GNOME/glib/-/blob/bd2ccc2f69ecfd78ca3f34ab59e42e2b462bad65/gio/gapplication.c#L2302 - if (config.@"initial-window") switch (config.@"launched-from".?) { - .desktop, .cli => gio_app.activate(), - .dbus, .systemd => {}, - }; + if (config.@"initial-window") + gio_app.activate(); // Internally, GTK ensures that only one instance of this provider exists in the provider list // for the display. @@ -1687,17 +1683,6 @@ fn gtkActionShowGTKInspector( }; } -fn gtkActionNewWindow( - _: *gio.SimpleAction, - _: ?*glib.Variant, - self: *App, -) callconv(.c) void { - log.info("received new window action", .{}); - _ = self.core_app.mailbox.push(.{ - .new_window = .{}, - }, .{ .forever = {} }); -} - /// This is called to setup the action map that this application supports. /// This should be called only once on startup. fn initActions(self: *App) void { @@ -1717,9 +1702,7 @@ fn initActions(self: *App) void { .{ "reload-config", gtkActionReloadConfig, null }, .{ "present-surface", gtkActionPresentSurface, t }, .{ "show-gtk-inspector", gtkActionShowGTKInspector, null }, - .{ "new-window", gtkActionNewWindow, null }, }; - inline for (actions) |entry| { const action = gio.SimpleAction.new(entry[0], entry[2]); defer action.unref(); diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 5c886e663..cf8d651dd 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -2325,15 +2325,6 @@ pub fn defaultTermioEnv(self: *Surface) !std.process.EnvMap { env.remove("GDK_DISABLE"); env.remove("GSK_RENDERER"); - // Remove some environment variables that are set when Ghostty is launched - // from a `.desktop` file, by D-Bus activation, or systemd. - env.remove("GIO_LAUNCHED_DESKTOP_FILE"); - env.remove("GIO_LAUNCHED_DESKTOP_FILE_PID"); - env.remove("DBUS_STARTER_ADDRESS"); - env.remove("DBUS_STARTER_BUS_TYPE"); - env.remove("INVOCATION_ID"); - env.remove("JOURNAL_STREAM"); - // Unset environment varies set by snaps if we're running in a snap. // This allows Ghostty to further launch additional snaps. if (env.get("SNAP")) |_| { diff --git a/src/build/GhosttyResources.zig b/src/build/GhosttyResources.zig index 5a4455a89..640491fd6 100644 --- a/src/build/GhosttyResources.zig +++ b/src/build/GhosttyResources.zig @@ -228,16 +228,6 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources { b.path("dist/linux/app.desktop"), "share/applications/com.mitchellh.ghostty.desktop", ).step); - // DBus service for DBus activation - try steps.append(&b.addInstallFile( - b.path("dist/linux/dbus.service"), - "share/dbus-1/services/com.mitchellh.ghostty.service", - ).step); - // systemd user service - try steps.append(&b.addInstallFile( - b.path("dist/linux/systemd.service"), - "lib/systemd/user/com.mitchellh.ghostty.service", - ).step); // AppStream metainfo so that application has rich metadata within app stores try steps.append(&b.addInstallFile( diff --git a/src/config/Config.zig b/src/config/Config.zig index 4fedce110..be719a239 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -942,17 +942,12 @@ title: ?[:0]const u8 = null, /// The setting that will change the application class value. /// /// This controls the class field of the `WM_CLASS` X11 property (when running -/// under X11), the Wayland application ID (when running under Wayland), and the -/// bus name that Ghostty uses to connect to DBus. +/// under X11), and the Wayland application ID (when running under Wayland). /// /// Note that changing this value between invocations will create new, separate /// instances, of Ghostty when running with `gtk-single-instance=true`. See that /// option for more details. /// -/// Changing this value may break launching Ghostty from `.desktop` files, via -/// DBus activation, or systemd user services as the system is expecting Ghostty -/// to connect to DBus using the default `class` when it is launched. -/// /// The class name must follow the requirements defined [in the GTK /// documentation](https://docs.gtk.org/gio/type_func.Application.id_is_valid.html). ///