open ghostty

This commit is contained in:
2026-08-04 16:49:56 +09:00
parent 2a3f7ee6ff
commit 5fb55f2e6a
2 changed files with 24 additions and 1 deletions
@@ -25,6 +25,7 @@ in
systemd.user.sessionVariables.NAUTILUS_4_EXTENSION_DIR = nautilusExtensionDir; systemd.user.sessionVariables.NAUTILUS_4_EXTENSION_DIR = nautilusExtensionDir;
xdg.dataFile."nautilus-python/extensions/open-in-editor.py".text = '' xdg.dataFile."nautilus-python/extensions/open-in-editor.py".text = ''
import os
import subprocess import subprocess
from gi.repository import GObject, Nautilus from gi.repository import GObject, Nautilus
@@ -75,6 +76,12 @@ in
return paths return paths
@staticmethod
def get_working_directory(paths):
path = paths[0]
return path if os.path.isdir(path) else os.path.dirname(path)
@staticmethod @staticmethod
def launch(_item, command): def launch(_item, command):
subprocess.Popen( subprocess.Popen(
@@ -101,6 +108,22 @@ in
items.append(item) items.append(item)
item = Nautilus.MenuItem(
name=f"OpenInEditor::{context}::ghostty",
label="Ghostty で開く",
)
item.connect(
"activate",
self.launch,
[
"${lib.getExe pkgs.ghostty}",
f"--working-directory={self.get_working_directory(paths)}",
],
)
items.append(item)
return items return items
def get_file_items(self, files): def get_file_items(self, files):
+1 -1
View File
@@ -193,7 +193,7 @@ in
}; };
wallpaper = { wallpaper = {
enabled = true; enabled = lib.mkDefault true;
directory = "~/.wallpapers"; directory = "~/.wallpapers";
fill_mode = "crop"; fill_mode = "crop";
automation = { automation = {