From 62fe3eb652f99437aa12448cbe24b0db149c924b Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Thu, 28 Nov 2024 23:33:35 +0100 Subject: [PATCH 1/7] added right click action for plasma --- build.zig | 7 +++++++ dist/linux/ghostty_dolphin.desktop | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 dist/linux/ghostty_dolphin.desktop diff --git a/build.zig b/build.zig index 15fed7ed6..2e36b7861 100644 --- a/build.zig +++ b/build.zig @@ -573,6 +573,13 @@ pub fn build(b: *std.Build) !void { b.installFile("dist/linux/app.desktop", "share/applications/com.mitchellh.ghostty.desktop"); } + // Right click menu action in case of Plasma desktop + if (env.get("DESKTOP_SESSION")) |desktop| { + if (std.mem.eql(u8, desktop, "plasma")) { + b.installFile("dist/linux/ghostty_dolphin.desktop", "share/kio/servicemenus/ghostty_dolphin.desktop"); + } + } + // Various icons that our application can use, including the icon // that will be used for the desktop. b.installFile("images/icons/icon_16x16.png", "share/icons/hicolor/16x16/apps/com.mitchellh.ghostty.png"); diff --git a/dist/linux/ghostty_dolphin.desktop b/dist/linux/ghostty_dolphin.desktop new file mode 100644 index 000000000..da46f6286 --- /dev/null +++ b/dist/linux/ghostty_dolphin.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Service +ServiceTypes=KonqPopupMenu/Plugin +MimeType=inode/directory +Actions=RunGhosttyDir + +[Desktop Action RunGhosttyDir] +Name=Open Ghostty Here +Icon=com.mitchellh.ghostty +Exec=cd %F && ghostty + From adfbf9d7f45f559bec08b261fef8ebaf40d7fd72 Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Thu, 28 Nov 2024 23:40:21 +0100 Subject: [PATCH 2/7] update readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3c3a2460d..a3921eb90 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,13 @@ support](https://www.openssh.com/txt/release-8.7) for setting `TERM` via > `xterm-256color` does not include all of Ghostty's capabilities, terminal > features beyond xterm's like colored and styled underlines will not work. +### Desktop Integration (Plasma only) +The build process detects if you are running plasma through an environment variable ```DESKTOP_SESSION``` and will install a ```.desktop``` file for a right-click menu action to open Ghostty in the working directory. To enable this, you need to give the file executable permissions: +```bash +chmod +x ~/.local/share/kio/servicemenus/ghostty_dolphin.desktop +``` +You should see an action called "Open Ghostty Here" when you right click in any directory in Dolphin. + ## Roadmap and Status The high-level ambitious plan for the project, in order: From 4be06d1c112be7bd37843bac32d302275fb14592 Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Fri, 29 Nov 2024 00:27:51 +0100 Subject: [PATCH 3/7] rename file to match package --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 2e36b7861..0f58fa6c4 100644 --- a/build.zig +++ b/build.zig @@ -576,7 +576,7 @@ pub fn build(b: *std.Build) !void { // Right click menu action in case of Plasma desktop if (env.get("DESKTOP_SESSION")) |desktop| { if (std.mem.eql(u8, desktop, "plasma")) { - b.installFile("dist/linux/ghostty_dolphin.desktop", "share/kio/servicemenus/ghostty_dolphin.desktop"); + b.installFile("dist/linux/ghostty_dolphin.desktop", "share/kio/servicemenus/com.mitchellh.ghostty.desktop"); } } From 074312c5effcfff8a68cc524e810a2bb0d1e719d Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Fri, 29 Nov 2024 11:14:17 +0100 Subject: [PATCH 4/7] updated permissions and build process Removed check for plasma in build.zig, it installs it anyways now Added executable permissions for ghostty_dolphin.desktop since Plasma requires them for context menu items --- build.zig | 8 ++------ dist/linux/ghostty_dolphin.desktop | 0 2 files changed, 2 insertions(+), 6 deletions(-) mode change 100644 => 100755 dist/linux/ghostty_dolphin.desktop diff --git a/build.zig b/build.zig index 0f58fa6c4..d233bff1f 100644 --- a/build.zig +++ b/build.zig @@ -573,12 +573,8 @@ pub fn build(b: *std.Build) !void { b.installFile("dist/linux/app.desktop", "share/applications/com.mitchellh.ghostty.desktop"); } - // Right click menu action in case of Plasma desktop - if (env.get("DESKTOP_SESSION")) |desktop| { - if (std.mem.eql(u8, desktop, "plasma")) { - b.installFile("dist/linux/ghostty_dolphin.desktop", "share/kio/servicemenus/com.mitchellh.ghostty.desktop"); - } - } + // Right click menu action for Plasma desktop + b.installFile("dist/linux/ghostty_dolphin.desktop", "share/kio/servicemenus/com.mitchellh.ghostty.desktop"); // Various icons that our application can use, including the icon // that will be used for the desktop. diff --git a/dist/linux/ghostty_dolphin.desktop b/dist/linux/ghostty_dolphin.desktop old mode 100644 new mode 100755 From 46adc2fb4366a12d2f24d6fc774049eb2126f4d6 Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Fri, 29 Nov 2024 11:14:36 +0100 Subject: [PATCH 5/7] Revert "update readme" This reverts commit adfbf9d7f45f559bec08b261fef8ebaf40d7fd72. --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 83e3437f1..861e0937a 100644 --- a/README.md +++ b/README.md @@ -363,13 +363,6 @@ support](https://www.openssh.com/txt/release-8.7) for setting `TERM` via > `xterm-256color` does not include all of Ghostty's capabilities, terminal > features beyond xterm's like colored and styled underlines will not work. -### Desktop Integration (Plasma only) -The build process detects if you are running plasma through an environment variable ```DESKTOP_SESSION``` and will install a ```.desktop``` file for a right-click menu action to open Ghostty in the working directory. To enable this, you need to give the file executable permissions: -```bash -chmod +x ~/.local/share/kio/servicemenus/ghostty_dolphin.desktop -``` -You should see an action called "Open Ghostty Here" when you right click in any directory in Dolphin. - ## Roadmap and Status The high-level ambitious plan for the project, in order: From 46afa9c4e19ed2cc969b957e4ce8decf31f523f8 Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Fri, 29 Nov 2024 11:51:10 +0100 Subject: [PATCH 6/7] use cli argument instead of cd --- dist/linux/ghostty_dolphin.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/linux/ghostty_dolphin.desktop b/dist/linux/ghostty_dolphin.desktop index da46f6286..3f2730c4e 100755 --- a/dist/linux/ghostty_dolphin.desktop +++ b/dist/linux/ghostty_dolphin.desktop @@ -7,5 +7,5 @@ Actions=RunGhosttyDir [Desktop Action RunGhosttyDir] Name=Open Ghostty Here Icon=com.mitchellh.ghostty -Exec=cd %F && ghostty +Exec=ghostty --working-directory=%F From 3048d71537a5a6f3ce512d6c36e0604c34d164ef Mon Sep 17 00:00:00 2001 From: Andrej Daskalov Date: Sun, 1 Dec 2024 13:16:56 +0100 Subject: [PATCH 7/7] added gtk-single-instance argument --- dist/linux/ghostty_dolphin.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/linux/ghostty_dolphin.desktop b/dist/linux/ghostty_dolphin.desktop index 3f2730c4e..5e8351390 100755 --- a/dist/linux/ghostty_dolphin.desktop +++ b/dist/linux/ghostty_dolphin.desktop @@ -7,5 +7,5 @@ Actions=RunGhosttyDir [Desktop Action RunGhosttyDir] Name=Open Ghostty Here Icon=com.mitchellh.ghostty -Exec=ghostty --working-directory=%F +Exec=ghostty --working-directory=%F --gtk-single-instance=false