You could create two actions in ~/.local/share/nemo/actions.
File remote_terminal1.nemo_action:
[Nemo Action]
Name=Open in remote terminal
Comment=Open current folder in remote terminal
Name[de]=Im entfernten Terminal öffnen
Comment[de]=Aktuellen Ordner im entfernten Terminal öffnen
Exec=<remote_terminal.py %F>
Icon-Name=terminal
Selection=none
Extensions=dir;
Dependencies=ssh;
File remote_terminal2.nemo_action:
[Nemo Action]
Name=Open in remote terminal
Comment=Open this folder in remote terminal
Name[de]=Im entfernten Terminal öffnen
Comment[de]=Diesen Ordner im entfernten Terminal öffnen
Exec=<remote_terminal.py %F>
Icon-Name=terminal
Selection=s
Extensions=dir;
Dependencies=ssh;
And finally a Python script remote_terminal.py:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
import subprocess
path = sys.argv[1]
if '/sftp:' in path:
sftp = path.split('/sftp:', 1)[1]
settings = {}
options, sep, settings['path'] = sftp.partition('/')
for opt in options.split(','):
name, sep, value = opt.partition('=') settings[name] = value
You could create two actions in ~/.local/ share/nemo/ actions.
File remote_ terminal1. nemo_action:
[Nemo Action] de]=Aktuellen Ordner im entfernten Terminal öffnen terminal. py %F>
Name=Open in remote terminal
Comment=Open current folder in remote terminal
Name[de]=Im entfernten Terminal öffnen
Comment[
Exec=<remote_
Icon-Name=terminal
Selection=none
Extensions=dir;
Dependencies=ssh;
File remote_ terminal2. nemo_action:
[Nemo Action] terminal. py %F>
Name=Open in remote terminal
Comment=Open this folder in remote terminal
Name[de]=Im entfernten Terminal öffnen
Comment[de]=Diesen Ordner im entfernten Terminal öffnen
Exec=<remote_
Icon-Name=terminal
Selection=s
Extensions=dir;
Dependencies=ssh;
And finally a Python script remote_terminal.py:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
import subprocess
path = sys.argv[1]
if '/sftp:' in path:
settings[ name] = value
sftp = path.split('/sftp:', 1)[1]
settings = {}
options, sep, settings['path'] = sftp.partition('/')
for opt in options.split(','):
name, sep, value = opt.partition('=')
cmd = ['gnome-terminal', '-e', directory' , path]
'ssh %(user)s@%(host)s -t "cd /%(path)s && bash --login"' % settings]
else:
cmd = ['gnome-terminal', '--working-
subprocess. call(cmd)