Code Monkey home page Code Monkey logo

gnome-shell-extension-ssh-quick-connect's Introduction

Overview

ATTENTION: Hi everyone. I try to keep this up to date but fall behind often. No, this isn't abandonened. If you want to help/submit a PR I'll do my best to get them merged ASAP!

Lists entries from your ~/.ssh/config file, and launches them in the default terminal when clicked.

Easy Install

Head on over to the GNOME Shell Extension page and toggle it on. https://extensions.gnome.org/extension/3237/ssh-quick-connect/

WIP

  • Allow more/other files than ~/.ssh/config
  • Setting screen

TODO

  • Custom terminal command
    • Do we need custom, or just proper handling of default terminal?
    • Can see this becoming a rabbit hole into "per-entry" options
      • Might not be unreasonable if unrecognized options are ignored/not errored by default
  • Long/large list handling (scroll)
  • Watch for file changes. (Answer, Docs)

Wishlist

  • Search

Misc

To recompile the schema (for < GNOME44) , run glib-compile-schemas schemas/

gnome-shell-extension-ssh-quick-connect's People

Contributors

ibrokemycomputer avatar worldwidewoogie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gnome-shell-extension-ssh-quick-connect's Issues

Use terminals other than nano. Add setting-entry to set your own terminal and exec-command.

Hi there!
Thanks for maintaining this extension!

Now it does not work with other terminals than "nano".

Just for my own use, I changed the following lines in the code to make it work with "gnome-terminal":

getTerminalCommand() {
<...>
    const SSH_COMMAND = ' -- ssh';
    let LINUX_TERMINAL = 'gnome-terminal';
<...>
}

Please include such fields in the settings if possible, so that users can configure their own terminal!

Broken on Gnome 45 (Ubuntu 23.10)

The SSH Quick Connect extension is broken on a stock Ubuntu 23.10 install. The following error is emitted:

The settings of extension [email protected] had an error:

SyntaxError: import declarations may only appear at top level of a module

Stack trace:

@file:///home/hcs/.local/share/gnome-shell/extensions/[email protected]/prefs.js:3:24
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

Ubuntu 22.04 - gnome 42.4 - update to latest version - cannot run

Error during initialization. Previous installed and upgraded to newest.

Error code:
Expected type string for argument 'schema_id' but got type undefined

syslog error:
Nov 12 14:16:17 Latitude-E5450 gnome-shell[680268]: JS ERROR: Extension [email protected]: Error: Expected type string for argument 'schema_id' but got type undefined#012getSettings@resource:///org/gnome/shell/misc/extensionUtils.js:207:34#012_init@/home/xxx/.local/share/gnome-shell/extensions/[email protected]/extension.js:28:36#012ButtonBox@resource:///org/gnome/shell/ui/panelMenu.js:11:1#012PanelMenuButton@resource:///org/gnome/shell/ui/panelMenu.js:97:4#012SSHQuickConnect@/home/xxx/.local/share/gnome-shell/extensions/[email protected]/extension.js:23:23#012enable@/home/xxx/.local/share/gnome-shell/extensions/[email protected]/extension.js:207:15#012_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:183:32#012loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:384:26#012_loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:640:18#012collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28#012_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:615:19#012_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:646:18#012_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:666:14#012init@resource:///org/gnome/shell/ui/extensionSystem.js:56:14#012_initializeUI@resource:///org/gnome/shell/ui/main.js:298:22#012start@resource:///org/gnome/shell/ui/main.js:175:5#012@resource:///org/gnome/shell/ui/init.js:6:17

Using alternative config file

OS is Ubuntu Jammy
my default ssh config is in .ssh/config

I set up a extension_config file for this extension and set that as the "SSH Config Locations" field in the gui.

While it reads the hosts from the extension_config file in the display list, I discovered that it reads the actual configs from the config file still. So to make it work i have to setup the config in config and then only the Host in extension_config.

Working setup:
.ssh/config:

Host server1
  HostName 192.168.10.12
  User admin
  IdentiyFile ~/.ssh/id_rsa.1

.ssh/extension_config:

Host server1

Not working setup:
.ssh/config:

.ssh/extension_config:

Host server1
  HostName 192.168.10.12
  User admin
  IdentiyFile ~/.ssh/id_rsa.1

Update for gnome 43?

Hi,

Is it possible to make the extension compatible with gnome 43?

Thank you very much!!

Ability to run sftp concurrently on each ssh entry

One use case which I would love to see:

  • nautilus (or other software) can access ssh servers with sftp/scp interface
  • I constantly is working on ssh machines but have sometimes to connect to selected machine via sftp (upload/download something)
  • it would be great to have additional button beside the ssh connection name in order to execute such thing eg. nautilus sftp://ssh-server-dev1

Was looking at the implementation of Menu in shell extension and right now does not see anything suitable other than construct custom composite widget for this. Toggle could not be used for this, submenu is awkward because one cannot start ssh with one click.

Flexible "Start Terminal Command"

Hi there!
Thanks fpr the nice extension.

Please give a way to set the best fashion to start the terminal.
Different GUIs may have different ways to call the standard terminal.
Ex. at Fedora "x-terminal-emulator" does NOT work at all.

BR

Filter out hosts with wildcards/ separate multi-line entries

ssh.config 'Host' line allows Multiple space-separated entries, and wildcards. Neither works with ssh command.
I suggest splitting each Host line, and filtering out any entry with a wildcard.
I have done limited testing with the following minimal change to the parseHosts function, and it appears to work (I am not proficient in javaScript, so there is likely a better way to do it):

/**
   * 
   * @param {String} sshConfig The ssh config file to parse
   * @returns {Array} An array of hosts
   */
  parseHosts(sshConfig) {
    var ret = []
    var allHostLines = sshConfig
          .split('\n')
          .join('{{NEWLINE}}')
          .split('\r')
          .join('{{NEWLINE}}')
          .split('{{NEWLINE}}')
          .map(item => item.trim())
          .filter(item => item.indexOf('Host ') === 0)
          .map(item => item = item.split('Host ')[1]);
    allHostLines.forEach(hostLine => {
        // need to replace multiple spaces with single speces to the split doesn't have null entries
        hostLine.replace(/\s\s+/g, " ").split(" ").forEach(hostStr => {
            if (!["*","?"].some(v => hostStr.includes(v))) {
                ret.push(hostStr)
            }
        });
    });
    return ret;
  }

Last update doesn't work on GNOME Shell 3.36.9

Hi, I tested the last pushed version and it still not working on Ubuntu 20.04 gnome 3.36.9

This is the log shown when I press the config button on the extension manager:

Error: Requiring Adw, version none: Typelib file for namespace 'Adw' (any version) not found

Stack trace:
  @/home/fjm/.local/share/gnome-shell/extensions/[email protected]/prefs.js:1:27
  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
  run@resource:///org/gnome/gjs/modules/script/package.js:222:19
  start@resource:///org/gnome/gjs/modules/script/package.js:206:5
  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
  

This is the screenshot of the extension manager:

imagen

Thank you in advance and cheers

Quick Connect stopped working

ssh-quick-connect has been working great until recently. I am on ubuntu 22.04 and up to date on system.
this is the error I get in syslog when I attempt to start a session.

May 2 10:57:30 BEE-XPS15-9500 gnome-shell[3769]: JS ERROR: ReferenceError: isDebian is not defined#012getTerminalCommand@/home/beckstein/.local/share/gnome-shell/extensions/[email protected]/extension.js:184:9#012sshToItem@/home/beckstein/.local/share/gnome-shell/extensions/[email protected]/extension.js:121:32#012createMenu/</<@/home/beckstein/.local/share/gnome-shell/extensions/[email protected]/extension.js:85:43#012addAction/<@resource:///org/gnome/shell/ui/popupMenu.js:555:21#012activate@resource:///org/gnome/shell/ui/popupMenu.js:197:14#012vfunc_button_release_event@resource:///org/gnome/shell/ui/popupMenu.js:141:14

any idea how to fix the problem?

breaking when trying to open a session

Hello,

I'm experiencing a bug where the extension can't open a terminal session after clicking in one of the servers. I can see a window opening really fast and closing immediately after, in less than 1 second. I trying looking for an error in gnome-shell looking-glass but it shows no such a thing. I can try to debug further if you give me some instruction on how to do it.

Is there something I can change in the configuration for the SSH Command settings that can remediate this?

I'm using Gnome 44.4 on Manjaro with Wayland.

Thanks,

Kemel Zaidan

FEAT: Allow for list to be scrollable/searchable

I just found this and it's great! The only issue I have is that I have about 100 SSH connections configured. I can only access part of that list since this is not scrollable. Unfortunately, the one's I need to use the most are not visible so I can't use this. Please make the list scrollable please!

Also, a search feature would be very helpful too! I would like to search and filter the list that way.

Update to support Gnome 45

Hello my friend!

I don't know how much work it can turn to be, but it would be very good to have the extension working again, after updating to Gnome 45.

Many thanks for all your efforts, and for providing this good extension!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.