mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 08:28:11 +09:00
open ghostty
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user