Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added terminal support and up to Gnome 3.24 (dev) compatibility #59

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b2eef29
Port to Gnome 3.12
jozog Jul 28, 2014
f8130bf
Merge remote-tracking branch 'upstream/master'
jozog Oct 15, 2014
689cda5
Gnome 3.14 support
jozog Oct 15, 2014
9041b1f
Remove search provider on disable to avoid duplicated search provider…
jozog Oct 16, 2014
068395f
Fix #51
gerdriesselmann Apr 8, 2015
cf2afa8
Update metadata.json
dariolesca May 21, 2015
b0cd7ec
merge
nonZero Nov 1, 2015
4f87806
updated to gnome 3.18
nonZero Nov 1, 2015
8e3cbd1
Merge pull request #1 from nonZero/master
jozog Nov 2, 2015
cd0b860
Gnome does not like results set containing id=0 ("Invalid result meta…
jozog Nov 2, 2015
e3bac5d
Fix #51
gerdriesselmann Apr 8, 2015
4208461
Update terminals.js
dariolesca May 21, 2015
327bb72
Update connmgr.py
dariolesca May 21, 2015
1686b5d
Added XFCE Terminal support
Sep 13, 2016
b8de9d0
add support for multiple Gnome versions including 3.22. Debian Testin…
Sep 13, 2016
47677d6
Bump UI version number to same one reported in metadata.json
Sep 13, 2016
3d946e9
Add Terminix Terminal
returntrip Oct 22, 2016
370bba5
Fixe issue: missing comma from supportedTermsSite
returntrip Oct 22, 2016
7d71711
Fix issue: missing comma from supportedTermsSite
returntrip Oct 22, 2016
7fe61c8
Merge branch 'master' of https://github.com/returntrip/connectionmana…
returntrip Oct 22, 2016
04b404e
Merge pull request #1 from jozog/master
Silarn Mar 17, 2017
60a2815
Merge pull request #2 from returntrip/master
Silarn Mar 17, 2017
2db78d3
Gnome 3.24 compat changes - fixing outdated JS functions
Silarn Mar 17, 2017
cb86ceb
Merge pull request #3 from gerdriesselmann/patch-2
Silarn Mar 17, 2017
d6b5687
the option rename-tab renames the first tab instead of the new one, r…
koter84 May 10, 2017
d0e542f
Merge pull request #4 from koter84/fix-tab-rename-guake
Silarn May 10, 2017
f73e7e8
Update metadata support
Silarn Oct 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 15 additions & 26 deletions connmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@
import re
import sys

VERSION = '0.8.3'
VERSION = '0.8.5'

supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm"]
supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm"]
supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/",
"http://www.tenshu.net/p/terminator.html",
"http://guake.org/",
supportedTerms = ["Gnome Terminal", "Terminator", "Guake", "TMux", "urxvt", "urxvt256c", "LilyTerm", "Mate Terminal", "XFCE Terminal", "Terminix"]
supportedTermsCmd = ["gnome-terminal", "terminator", "guake", "tmux", "urxvt", "urxvt256c", "lilyterm", "mate-terminal", "xfce4-terminal", "terminix"]
supportedTermsSite = ["http://library.gnome.org/users/gnome-terminal/stable/",
"http://www.tenshu.net/p/terminator.html",
"http://guake.org/",
"http://tmux.sourceforge.net/",
"http://software.schmorp.de/pkg/rxvt-unicode.html",
"http://software.schmorp.de/pkg/rxvt-unicode.html",
"http://lilyterm.luna.com.tw/index.html"
"http://lilyterm.luna.com.tw/index.html",
"http://www.mate-desktop.org",
"http://www.xfce.org/",
"https://github.com/gnunn1/terminix"
]


Expand Down Expand Up @@ -625,28 +628,14 @@ def a_host(line):
lines = [line.strip() for line in file(SSH_CONFIG_FILE)]
comments_removed = [remove_comment(line) for line in lines]
blanks_removed = [line for line in comments_removed if line]
non_hosts_removed = [line for line in blanks_removed if a_host(line)]

block = itertools.groupby(blanks_removed, not_a_host)

first_block = False
for key, group in block:
Info = dict([line.split(None, 1) for line in group])

if (not key):
if (not first_block):
first_block = True
importedHost = Info['Host']
if (key and first_block):
if 'HostName' in Info:
importedHostname = Info['HostName']
if 'User' in Info:
importedHostname = Info['User']+'@'+importedHostname
if 'Port' in Info:
importedHostname = '-p '+Info['Port']+' '+importedHostname

for line in non_hosts_removed:
importedHosts = line.split(None)[1:]
for importedHost in importedHosts:
if importedHost != '*':
treestore.append(import_iter, ['__item__',
importedHost, importedHostname, 'Unnamed', 'ssh'])
importedHost, importedHost, 'Unnamed', 'ssh'])

def is_folder(self, iter):
if self.treestore.get_value(iter, 0) == '__folder__':
Expand Down
18 changes: 13 additions & 5 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ const ConnectionManager = new Lang.Class({
this._searchProvider = new Search.SshSearchProvider('CONNECTION MANAGER');

if( typeof Main.overview.viewSelector === "object" &&
typeof Main.overview.viewSelector._searchResults === "object" &&
typeof Main.overview.viewSelector._searchResults._searchSystem === "object" &&
typeof Main.overview.viewSelector._searchResults._searchSystem.addProvider === "function") {
typeof Main.overview.viewSelector._searchResults === "object") {
if(typeof Main.overview.viewSelector._searchResults._registerProvider === "function") { //3.14
Main.overview.viewSelector._searchResults._registerProvider(this._searchProvider);
} else if(typeof Main.overview.viewSelector._searchResults._searchSystem === "object" &&
typeof Main.overview.viewSelector._searchResults._searchSystem.addProvider === "function") { //3.12
Main.overview.viewSelector._searchResults._searchSystem.addProvider(this._searchProvider);
}
}
}

this._readConf();
},
Expand Down Expand Up @@ -300,7 +303,7 @@ const ConnectionManager = new Lang.Class({
mycommand += commandTab[c]+' ';
}

Util.spawnCommandLine(' sh -c '+(sshparamsTab[0]+' '+term+' '+mycommand).quote()+' &');
Util.spawnCommandLine(' sh -c '+JSON.stringify(sshparamsTab[0]+' '+term+' '+mycommand)+' &');
});
}

Expand Down Expand Up @@ -328,6 +331,11 @@ function enable() {
}

function disable() {
if(cm._searchProvider!=null) {
Main.overview.removeSearchProvider(cm._searchProvider);
cm._searchProvider = null;
}

cm.monitor.cancel();
cm.destroy();
}
Expand Down
13 changes: 11 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"shell-version": ["3.12"],
"version": "0.8.3",
"shell-version": [
"3.12",
"3.14",
"3.16",
"3.18",
"3.20",
"3.22",
"3.24",
"3.26"
],
"version": "0.8.5",
"uuid": "connectionmanager2@ciancio.net",
"name": "Connection Manager",
"description": "Simple GUI app for Gnome 3 that provides a menu for initiating SSH/Telnet/Custom Apps connections.",
Expand Down
9 changes: 5 additions & 4 deletions search.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const SshSearchProvider = new Lang.Class({
for (var j=0; j<terms.length; j++) {
let pattern = new RegExp(terms[j],"gi");
if (this.sshNames[i].name.match(pattern)) {
searching.push(i);
// +1 because id 0 breaks search results
searching.push(i+1);
}
}
}
Expand All @@ -73,7 +74,7 @@ const SshSearchProvider = new Lang.Class({
let app = null;

for (let i=0; i<resultIds.length; i++) {
let result = this.sshNames[resultIds[i]]
let result = this.sshNames[resultIds[i]-1]
let appSys = Shell.AppSystem.get_default();
let app = null;

Expand All @@ -98,7 +99,7 @@ const SshSearchProvider = new Lang.Class({
else
icon = new St.Icon({ gicon: Gio.icon_new_for_string('emblem-cm-symbolic'),
icon_size: size });

return icon;
}
})
Expand All @@ -108,6 +109,6 @@ const SshSearchProvider = new Lang.Class({
},

activateResult: function(id) {
Util.spawnCommandLine(this.sshNames[id].command);
Util.spawnCommandLine(this.sshNames[id-1].command);
},
});
Loading