summaryrefslogtreecommitdiff
path: root/dist/linux
diff options
context:
space:
mode:
authorJeffrey C. Ollie <jeff@ocjtech.us>2025-06-24 22:56:17 -0500
committerMitchell Hashimoto <m@mitchellh.com>2025-06-26 10:28:46 -0700
commit81403f59ce98009d16dc6719635b543a88cc2ad5 (patch)
treedd07c9a3ab55a0b193312861fd02f7801f4cbe45 /dist/linux
parentfa47db5363bedc5c3c9add87a83427447a273a90 (diff)
dbus and systemd activation - take 2
This replaces #7433. The improvements are: 1) Install the systemd user service in the proper directory depending on if it's a 'user' install or a 'system' install. This is controlled either by using the `--system` build flag (as most packages will) or by the `-Dsystem-package` flag. 2) Add the absolute path to the `ghostty` binary in the application file, the DBus service, and the systemd user service. This is done so that they do not depend on `ghostty` being in the `PATH` of whatever is launching Ghostty. That `PATH` is not necessarily the same as the `PATH` in a user shell (especially for DBus activation and systemd user services). 3) Adjust the DBus bus name that is expected by the system depending on the optimization level that Ghostty is compiled with.
Diffstat (limited to 'dist/linux')
-rw-r--r--dist/linux/app.desktop11
-rw-r--r--dist/linux/dbus.service4
-rw-r--r--dist/linux/systemd.service7
3 files changed, 18 insertions, 4 deletions
diff --git a/dist/linux/app.desktop b/dist/linux/app.desktop
index 6e464ea87..7dc0062f7 100644
--- a/dist/linux/app.desktop
+++ b/dist/linux/app.desktop
@@ -1,13 +1,15 @@
[Desktop Entry]
-Name=Ghostty
+Version=1.0
+Name=Ghostty@@NAME@@
Type=Application
Comment=A terminal emulator
-Exec=ghostty
+TryExec=@@GHOSTTY@@
+Exec=@@GHOSTTY@@ --launched-from=desktop
Icon=com.mitchellh.ghostty
Categories=System;TerminalEmulator;
Keywords=terminal;tty;pty;
StartupNotify=true
-StartupWMClass=com.mitchellh.ghostty
+StartupWMClass=com.mitchellh.ghostty@@DEBUG@@
Terminal=false
Actions=new-window;
X-GNOME-UsesNotifications=true
@@ -16,7 +18,8 @@ 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
+Exec=ghostty --launched-from=desktop
diff --git a/dist/linux/dbus.service b/dist/linux/dbus.service
new file mode 100644
index 000000000..f9c5ce7a4
--- /dev/null
+++ b/dist/linux/dbus.service
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=com.mitchellh.ghostty@@DEBUG@@
+SystemdService=com.mitchellh.ghostty@@DEBUG@@.service
+Exec=@@GHOSTTY@@ --launched-from=dbus
diff --git a/dist/linux/systemd.service b/dist/linux/systemd.service
new file mode 100644
index 000000000..2d1acdaea
--- /dev/null
+++ b/dist/linux/systemd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Ghostty@@NAME@@
+
+[Service]
+Type=dbus
+BusName=com.mitchellh.ghostty@@DEBUG@@
+ExecStart=@@GHOSTTY@@ --launched-from=systemd