├── .gitattributes
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── docs
├── dconf-editor-terminal.png
├── logo.png
├── logo.xcf
├── preferences.png
└── screenshot.jpg
├── meson-gse.build
├── meson.build
├── po
├── LINGUAS
├── POTFILES
├── fr.po
├── meson.build
├── nl.po
└── ssh-search-provider.pot
├── schemas
└── org.gnome.shell.extensions.ssh-search-provider.gschema.xml
└── src
├── extension.js
├── metadata.json.in
└── prefs.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | /docs/** linguist-documentation
2 | /meson-gse/** linguist-vendored
3 | /meson.build linguist-generated
4 | /po/meson.build linguist-generated
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | \#*#
2 | .#*
3 | *~
4 | *.backup
5 |
6 | /build
7 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "meson-gse"]
2 | path = meson-gse
3 | url = https://github.com/F-i-f/meson-gse
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
SSH Search Provider Reborn
2 | =================================================================================================
3 |
4 | [
](https://extensions.gnome.org/extension/1714/ssh-search-provider-reborn/)
7 |
8 | A Gnome Shell extension which searches the ssh config and known_hosts
9 | file and provides the found ssh connections in your shell overview.
10 |
11 | 
12 |
13 | ## This is a fork
14 |
15 | This project is a fork of the
16 | [gnome-shell-extension-sshsearch](https://github.com/brot/gnome-shell-extension-sshsearch)
17 | project which has been unmaintained for a while.
18 |
19 | ## Features
20 |
21 | * It parses `~/.ssh/config`, `/etc/ssh/ssh_config` and
22 | `/etc/ssh_config` files (if they exist) and searches for host names.
23 |
24 | * It parses `~/.ssh/known_hosts`, `/etc/ssh/ssh_known_hosts` and
25 | `/etc/ssh_known_hosts` files (if they exist) and reads all host
26 | names (to use this feature you have to set the ssh setting
27 | "HashKnownHosts" to "no").
28 |
29 | * You can prepend a host name with a user name as in `user@host`.
30 |
31 | ## Configuration
32 |
33 | SSH Search Provider Reborn comes with a preference panel which can be
34 | found from the "Tweaks" application or the [Gnome Shell Extensions
35 | page](https://extensions.gnome.org/local/).
36 |
37 | 
38 |
39 | The _Arguments_ and _Pass SSH command line as a single argument_
40 | parameters are automatically filled if the picked _Terminal
41 | Application_ is one of the following supported applications:
42 |
43 | - Gnome Terminal (`org.gnome.Terminal.desktop`, the default)
44 |
45 | - Guake (`guake.desktop`)
46 |
47 | - RXVT (`rxvt.desktop`)
48 |
49 | - Tilix (`com.gexperts.Tilix.desktop`)
50 |
51 | - XTerm (`xterm.desktop`)
52 |
53 | If the configured _Terminal Application_'s `.desktop` file cannot be
54 | found, the extension falls back to using the
55 | `org.gnome.desktop.applications.terminal.exec` and
56 | `org.gnome.desktop.applications.terminal.exec-args` dconf keys. You
57 | can set them up as described in the [documentation for the extension
58 | version
59 | 3](https://github.com/F-i-f/ssh-search-provider/blob/5a960aff1cc6b3f2ca79d8b7b0fd3bb2ea4e2612/README.md#selecting-your-preferred-terminal-application).
60 |
61 | ## Examples
62 |
63 | Assume the ~/.ssh/config file looks like:
64 |
65 | Host desktop
66 | User user
67 | HostName 192.168.1.100
68 |
69 | Host desktop1
70 | User user
71 | HostName 192.168.1.101
72 |
73 | host vserver
74 | User user
75 | Port 2222
76 | HostName 11.11.111.111
77 |
78 | and the ~/.ssh/known_hosts file looks like:
79 |
80 | [11.11.111.111]:2222 ssh-rsa AAAAB...
81 | github.com,207.97.227.239 ssh-rsa AAAAB...
82 | user.webfactional.com,22.22.222.222 ssh-rsa AAAAB...
83 | 192.168.1.100 ssh-rsa AAAAB...
84 |
85 | Here are some example searches and the search results:
86 |
87 | * search-term: **desk**
88 | 1. desktop
89 | 2. desktop1
90 |
91 | * search-term: **rv**
92 | 1. vserver
93 |
94 | * search-term: **11**
95 | 1. 11.11.111.111:2222
96 |
97 | * search-term: **97**
98 | 1. 207.97.227.239
99 |
100 | * search-term: **user@** (all host names are in the search results)
101 | 1. user@desktop
102 | 2. user@desktop1
103 | 3. user@vserver
104 | 4. user@11.11.111.111:2222
105 | 5. user@github.com
106 | 6. user@207.97.227.239
107 | 7. user@user.webfactional.com
108 | 8. user@22.22.222.222
109 | 9. user@192.168.1.100
110 |
111 | * search-term: **user@des**
112 | 1. user@desktop
113 | 2. user@desktop1
114 |
115 | ## License
116 |
117 | SSH Search Provider Reborn is free software: you can redistribute it
118 | and/or modify it under the terms of the GNU General Public License as
119 | published by the Free Software Foundation, either version 3 of the
120 | License, or (at your option) any later version.
121 |
122 | This program is distributed in the hope that it will be useful, but
123 | WITHOUT ANY WARRANTY; without even the implied warranty of
124 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
125 | General Public License for more details.
126 |
127 | You should have received a copy of the GNU General Public License
128 | along with this program. If not, see [http://www.gnu.org/licenses/].
129 |
130 | ## Download / Install
131 |
132 | Install directly from the [Gnome Shell Extensions
133 | site](https://extensions.gnome.org/extension/1714/ssh-search-provider-reborn/).
134 |
135 | Or download the [zip
136 | file](https://github.com/F-i-f/ssh-search-provider/releases/download/v19/ssh-search-provider@extensions.gnome-shell.fifi.org.v19.shell-extension.zip)
137 | from the GitHub [releases
138 | page](https://github.com/F-i-f/ssh-search-provider/releases) and run:
139 |
140 | ``` shell
141 | gnome-extensions install ssh-search-provider@extensions.gnome-shell.fifi.org.v19.shell-extension.zip
142 | ```
143 |
144 | ## Building from source
145 |
146 | ### Requirements
147 |
148 | - [meson](http://mesonbuild.com/) v1.4.0 or later.
149 |
150 | ### Running the build
151 |
152 | - Check out: `git clone --recurse-submodules https://github.com/F-i-f/ssh-search-provider`
153 |
154 | - `cd ssh-search-provider`
155 |
156 | - Run meson: `meson setup build`
157 |
158 | - To install in your your gnome shell extensions' directory (~/.local/share/gnome-shell/extensions), run ninja: `ninja -C build install`
159 |
160 | - To build the extension zip files, run: `ninja -C build extension.zip`, the extension will be found under `build/extension.zip`.
161 |
162 | ## Changelog
163 |
164 | ### Version 19
165 | #### February 12, 2025
166 |
167 | - Gnome Shell 48 compatibility.
168 | - Update meson-gse:
169 | - Eslint configuration update.
170 |
171 | ### Version 18
172 | #### September 11, 2024
173 |
174 | - Gnome Shell 47 compatibility.
175 |
176 | ### Version 17
177 | #### September 9, 2024
178 |
179 | - Opens the Guake overlay window when starting an SSH session.
180 | Contributed by Victor Westerhuis .
181 | - Update meson-gse:
182 | - Now requires meson 1.4.0 or later.
183 | - Build now runs eslint on test, added prettier target.
184 | - Update to pass eslint.
185 | - Code ran through prettier.
186 |
187 | ### Version 16
188 | #### April 5, 2024
189 |
190 | - Gnome Shell 46 compatibility.
191 | - Provide defaults for Gnome Console.
192 |
193 | ### Version 15
194 | #### January 10, 2024
195 |
196 | - Bugs fixed.
197 | - Code improved thanks to Gnome Shell code review.
198 |
199 | ### Version 14
200 | #### January 9, 2024
201 |
202 | - Gnome Shell 45 compatibility.
203 | - Now incompatible with all older Gnome Shell lower than 45.
204 | - Version 13 works for Gnome Shell 43 and 44.
205 | - Version 11 works for Gnome Shell 32 through 42.
206 |
207 | ### Version 13
208 | #### January 9, 2024
209 |
210 | - Gnome Shell 44 compatibility.
211 | - Update meson-gse:
212 | - js102 support
213 |
214 | ### Version 12
215 | #### September 23, 2022
216 |
217 | - Gnome Shell 43 compatibility.
218 | - Now incompatible with all older Gnome Shell lower than 43. Version
219 | 11 still works fine for these older installations.
220 | - Update meson-gse:
221 | - js91 support
222 | - Support meson 0.61 and later when building.
223 |
224 | ### Version 11
225 | #### March 12, 2022
226 |
227 | - Gnome Shell 42 compatibility.
228 | - Update instructions to use `gnome-extensions` instead of manually
229 | unzipping.
230 |
231 | ### Version 10
232 | #### December 22, 2021
233 |
234 | - Declare compatibility with version 40 and 41 of Gnome Shell instead
235 | of using minor versions (40.0 and 41.1). This should clear reports
236 | of the extension being incompatible with well-supported versions.
237 | - Drop compatibility with Gnome Shell 3.28 and 3.30 (which do not have
238 | getSettings/initTranslations in ExtensionUtils).
239 | - Update meson-gse:
240 | - Fix build issues with meson 0.60.0.
241 | - Bump minimum meson version to 0.50.0.
242 | - Clean up code:
243 | - Remove Lang imports.
244 | - Use ExtensionUtils for getSettings/initTranslations instead of
245 | using meson-gse's convenience.js.
246 | - Drop old Gnome Shell 3.28 compatibility code.
247 |
248 | ### Version 9
249 | #### December 18, 2021
250 |
251 | - Gnome Shell 41 compatibility.
252 | - Update meson-gse to latest:
253 | - Bug fix for preferences logging.
254 | - Add Dutch translation (courtesy of @Vistaus).
255 |
256 | ### Version 8
257 | #### March 25, 2021
258 |
259 | - Gnome-shell 40.0 compatibility.
260 | - Update extensions for Gnome-Shell 40.0.
261 | - Update preferences for Gtk4.
262 | - Update meson-gse to latest:
263 | - Now prints the GJS version in the system log at start-up (if debug
264 | is enabled).
265 | - Support more mozjs version (78, 68, 52) for build-time syntax
266 | checks (`ninja test`).
267 |
268 | ### Version 7
269 | #### October 6, 2020
270 |
271 | - Declare gnome-shell 3.38 compatibility (no code changes required).
272 |
273 | ### Version 6
274 | #### March 11, 2020
275 |
276 | - Declare gnome-shell 3.36 compatibility (no code changes required).
277 | - Fix deprecation warning in preferences.
278 | - Update meson-gse to latest.
279 | - Now prints the gnome-shell version and the session type on start-up.
280 |
281 | ### Version 5
282 | #### September 30, 2019.
283 |
284 | - Declare compatibility with shell versions 3.33.90 and 3.34 (no code
285 | changes required).
286 | - Added Travis CI support in build tree.
287 | - Added license in README.md.
288 |
289 | ### Version 4
290 | #### April 16, 2019.
291 |
292 | This is a complete overhaul of the extension.
293 |
294 | New features:
295 |
296 | - Preference panel for configuring the preferred terminal application.
297 |
298 | - Supports literal IPv6 hosts.
299 |
300 | - Supports gnome-shell 3.28 (and potentially older versions) (GitHub
301 | Issue #3).
302 |
303 | - Fully handle terminal emulators other than Gnome Terminal. Sensible
304 | defaults are provided for: Gnome Terminal, Guake, RXVT, Tilix and
305 | XTerm, but any other terminal emulator can be used.
306 |
307 | - Also parse and monitor `/etc/ssh_config` and `/etc/ssh/ssh_config`,
308 | if they exist.
309 |
310 | - If the any of the ssh configuration files is a symbolic link, the
311 | link target is also monitored for changes.
312 |
313 | - Added debug logging (configurable in preferences).
314 |
315 | - Faster (sub-)search.
316 |
317 | - Internationalized, french translation.
318 |
319 | Changes:
320 |
321 | - The results now appear under the "SSH" Gnome Shell overview heading
322 | (used to be the name of the terminal emulator application).
323 |
324 | - `~/.ssh/known_hosts` (and related) entries containing ports (eg.
325 | `[localhost]:1234`) are now displayed (and can be searched) by using
326 | the bracketed syntax. This allows for parsing ports in IPv6 literal
327 | addresses correctly.
328 |
329 | - The Terminal Emulator arguments must be fully specified for Gnome
330 | Terminal (the extension used to silently inject the `--command`
331 | switch, not anymore).
332 |
333 | - Use Subset search when applicable to speed-up searching.
334 |
335 | - Almost complete under-the-hood re-implementation.
336 |
337 | Bugs fixed:
338 |
339 | - No more hidden dependencies on Gnome Terminal (GitHub Issue #2).
340 |
341 | - Don't drop/recreate settings and settings signals when the terminal
342 | emulator application is changed.
343 |
344 | - Ignore wildcards when parsing the `~/.ssh/config` (and related)
345 | files.
346 |
347 | - Fix terminal emulator command line when launching an host of the
348 | form `user@host:port`.
349 |
350 | - Don't allow completing `@host` (no user part).
351 |
352 | - Don't give completions until at least one letter of the host name is
353 | entered (otherwise `user@` would display all possible hosts).
354 |
355 | - Icons are now the same in the overview search heading and the
356 | individual search results.
357 |
358 | - Avoid re-parsing the files needlessly (better filtering of
359 | Gio.file.monitor_file() events).
360 |
361 | ### Version 3
362 | #### March 27, 2019.
363 |
364 | - The host names read from `~/.ssh/config` are not coerced to lower-case.
365 |
366 | ### Version 2
367 | #### March 26, 2019.
368 |
369 | - ES6 / Gnome-Shell 3.32 compatibility (still compatible with 3.30 and
370 | lower).
371 |
372 | - Updated meson-gse to latest.
373 |
374 | - Minor doc updates.
375 |
376 | ### Version 1
377 | #### March 24, 2019.
378 |
379 | - First release, based upon [the
380 | original](https://github.com/brot/gnome-shell-extension-sshsearch).
381 |
382 | ## Credits
383 |
384 | - The [`meson-gse` credits](https://github.com/F-i-f/meson-gse/) are
385 | included here by reference.
386 |
387 | - Bernd Schlapsi for the original extension.
388 |
389 |
391 |
393 |
395 |
397 |
399 |
401 |
403 |
405 |
407 |
--------------------------------------------------------------------------------
/docs/dconf-editor-terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/F-i-f/ssh-search-provider/9d7313c0fa69475e91b6679556036210d874160f/docs/dconf-editor-terminal.png
--------------------------------------------------------------------------------
/docs/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/F-i-f/ssh-search-provider/9d7313c0fa69475e91b6679556036210d874160f/docs/logo.png
--------------------------------------------------------------------------------
/docs/logo.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/F-i-f/ssh-search-provider/9d7313c0fa69475e91b6679556036210d874160f/docs/logo.xcf
--------------------------------------------------------------------------------
/docs/preferences.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/F-i-f/ssh-search-provider/9d7313c0fa69475e91b6679556036210d874160f/docs/preferences.png
--------------------------------------------------------------------------------
/docs/screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/F-i-f/ssh-search-provider/9d7313c0fa69475e91b6679556036210d874160f/docs/screenshot.jpg
--------------------------------------------------------------------------------
/meson-gse.build:
--------------------------------------------------------------------------------
1 | # ssh-search-provider - Add ssh hosts as search results
2 | # Copyright (C) 2019-2025 Philippe Troin (F-i-f on Github)
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 |
17 | gse_project({ssh-search-provider},
18 | {extensions.gnome-shell.fifi.org},
19 | {19},
20 | {
21 | gse_sources += []
22 | gse_libs += gse_lib_logger
23 | gse_data += []
24 | gse_schemas += []
25 | gse_dbus_interfaces += []
26 | })
27 |
--------------------------------------------------------------------------------
/meson.build:
--------------------------------------------------------------------------------
1 | # -*- meson -*-
2 | # AUTOGENERATED FILE - DO NOT EDIT
3 | # This file has been generated from meson-gse/meson.build.m4 and meson-gse.build
4 |
5 | # ssh-search-provider - Add ssh hosts as search results
6 | # Copyright (C) 2019-2025 Philippe Troin (F-i-f on Github)
7 | #
8 | # This program is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # This program is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU General Public License
19 | # along with this program. If not, see .
20 |
21 | # meson-gse - Library for gnome-shell extensions
22 | # Copyright (C) 2019-2024 Philippe Troin (F-i-f on Github)
23 | #
24 | # This program is free software: you can redistribute it and/or modify
25 | # it under the terms of the GNU General Public License as published by
26 | # the Free Software Foundation, either version 3 of the License, or
27 | # (at your option) any later version.
28 | #
29 | # This program is distributed in the hope that it will be useful,
30 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
31 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 | # GNU General Public License for more details.
33 | #
34 | # You should have received a copy of the GNU General Public License
35 | # along with this program. If not, see .
36 |
37 | # Boilerplate
38 | project('ssh-search-provider',
39 | version: '19',
40 | meson_version: '>= 1.4.0',
41 | license: 'GPL3' )
42 |
43 | gnome = import('gnome')
44 | i18n = import('i18n')
45 |
46 | gse_lib_convenience = files('meson-gse/lib/convenience.js')
47 | gse_lib_logger = files('meson-gse/lib/logger.js')
48 |
49 | gse_gettext_domain = meson.project_name()
50 | gse_sources = files('src/extension.js')
51 | gse_libs = []
52 | gse_data = []
53 | gse_schemas = []
54 | gse_dbus_interfaces = []
55 |
56 | gse_run_command_obj = run_command('test', '-f', 'src/prefs.js', check : false)
57 | if gse_run_command_obj.returncode() == 0
58 | gse_sources += files('src/prefs.js')
59 | endif
60 |
61 | gse_run_command_obj = run_command('test', '-f', 'src/stylesheet.css', check : false)
62 | if gse_run_command_obj.returncode() == 0
63 | gse_data += files('src/stylesheet.css')
64 | endif
65 |
66 | gse_schema_main = 'schemas/org.gnome.shell.extensions.'+ meson.project_name() + '.gschema.xml'
67 | gse_run_command_obj = run_command('test', '-f', gse_schema_main, check : false)
68 | if gse_run_command_obj.returncode() == 0
69 | gse_schemas += files(gse_schema_main)
70 | endif
71 |
72 | gse_npm_command_obj = find_program('npm', required:false)
73 |
74 | # Include extension-specific settings
75 |
76 | gse_sources += []
77 | gse_libs += gse_lib_logger
78 | gse_data += []
79 | gse_schemas += []
80 | gse_dbus_interfaces += []
81 | # End of extension-specific settings
82 |
83 | # Boilerplate
84 | gse_run_command_obj = run_command('sh', '-c', 'echo $HOME', check : false)
85 | if gse_run_command_obj.returncode() != 0
86 | error('HOME not found, exit=@0@'.format(gse_run_command_obj.returncode()))
87 | endif
88 | home = gse_run_command_obj.stdout().strip()
89 |
90 | gse_uuid = meson.project_name() + '@extensions.gnome-shell.fifi.org'
91 | gse_target_dir = home + '/.local/share/gnome-shell/extensions/' + gse_uuid
92 | gse_target_dir_schemas = join_paths(gse_target_dir, 'schemas')
93 | gse_target_locale_dir = join_paths(gse_target_dir, 'locale')
94 | gse_target_dir_dbus_intf = join_paths(gse_target_dir, 'dbus-interfaces')
95 |
96 | meson_extra_scripts = 'meson-gse/meson-scripts'
97 |
98 | gse_metadata_conf = configuration_data()
99 | git_rev_cmd = run_command('git', 'describe', '--tags', '--long', '--always', check : false)
100 | if git_rev_cmd.returncode() != 0
101 | warning('git rev-parse exit=@0@'.format(git_rev_cmd.returncode()))
102 | gse_metadata_conf.set('VCS_TAG', 'unknown')
103 | else
104 | gse_metadata_conf.set('VCS_TAG', git_rev_cmd.stdout().strip())
105 | endif
106 | gse_metadata_conf.set('uuid', gse_uuid)
107 | gse_metadata_conf.set('version', meson.project_version())
108 | gse_metadata_conf.set('gettext_domain', gse_gettext_domain)
109 |
110 | gse_data += configure_file(input: 'src/metadata.json.in',
111 | output: 'metadata.json',
112 | configuration: gse_metadata_conf)
113 |
114 | # This should work but doesn't:
115 | #gse_metadata = vcs_tag(command: ['git', 'rev-parse', 'HEAD'],
116 | # input: files('metadata.json.in'),
117 | # output: 'metadata.json',
118 | # fallback: 'unknown')
119 | #gse_data += gse_metadata
120 |
121 | if gse_schemas != []
122 | custom_target(build_by_default: true,
123 | command: ['sh', '-c', 'glib-compile-schemas --targetdir . $(dirname @INPUT0@)'],
124 | input: gse_schemas,
125 | output: 'gschemas.compiled',
126 | install: true,
127 | install_dir: gse_target_dir_schemas)
128 | install_data(gse_schemas,
129 | install_dir: gse_target_dir_schemas)
130 | endif
131 |
132 | gse_cleaner_targets = []
133 | gse_cleaner_targets += custom_target(build_by_default: false,
134 | install: false,
135 | build_always_stale: true,
136 | command: ['find', meson.current_source_dir(), '-name', '*~', '-exec', 'rm', '{}', ';'],
137 | output: ['cleaner-backup-files'])
138 |
139 | if gse_npm_command_obj.found()
140 | gse_meson_gse_dir = join_paths(meson.current_source_dir(), 'meson-gse')
141 | gse_npm_install_target = custom_target(build_by_default: false,
142 | install: false,
143 | depend_files: [join_paths(gse_meson_gse_dir, 'package.json'), join_paths(gse_meson_gse_dir, 'package-lock.json')],
144 | command: ['sh', '-c', 'pushd "@0@" && "@1@" --fund false install && popd && touch npm-install'.format(gse_meson_gse_dir, gse_npm_command_obj.full_path())],
145 | output: ['npm-install'])
146 |
147 | foreach gse_source : gse_sources + gse_libs
148 | test('Linting @0@...'.format(gse_source.full_path()),
149 | gse_npm_command_obj,
150 | args: ['run-script', '--', 'eslint', '--config', join_paths(gse_meson_gse_dir, 'eslint.config.js'), gse_source],
151 | depends: gse_npm_install_target,
152 | workdir: gse_meson_gse_dir)
153 | endforeach
154 |
155 | gse_npm_prettier_targets = []
156 | foreach gse_source : gse_sources + gse_libs
157 | gse_npm_prettier_targets += custom_target(build_always_stale: true,
158 | build_by_default: false,
159 | install: false,
160 | depends: gse_npm_install_target,
161 | command: ['sh', '-c', 'cd "@0@" && "@1@" run-script -- prettier --config "@2@" "@3@"'. format(gse_meson_gse_dir, gse_npm_command_obj.full_path(), join_paths(gse_meson_gse_dir, 'prettier.config.js'), gse_source.full_path())],
162 | output: 'prettier-@0@'.format(gse_source.full_path().replace('/', '_')))
163 | endforeach
164 | gse_npm_install_target = custom_target(build_always_stale: true,
165 | build_by_default: false,
166 | install: false,
167 | depends: gse_npm_prettier_targets,
168 | command: ['sh', '-c', 'exit 0'],
169 | output: ['prettier'])
170 | gse_cleaner_targets += custom_target(build_always_stale: true,
171 | build_by_default: false,
172 | install: false,
173 | command: ['rm', '-fr', join_paths(gse_meson_gse_dir, 'node_modules')],
174 | output: ['cleaner-node-modules'])
175 | endif
176 | custom_target(build_by_default: false,
177 | install: false,
178 | build_always_stale: true,
179 | depends: gse_cleaner_targets,
180 | command: ['sh', '-c', 'true'],
181 | output: ['cleaner'])
182 |
183 | install_data(gse_sources + gse_data + gse_libs,
184 | install_dir: gse_target_dir)
185 |
186 | install_data(gse_dbus_interfaces,
187 | install_dir: gse_target_dir_dbus_intf)
188 |
189 | custom_target(build_by_default: false,
190 | install: false,
191 | command: [files(join_paths(meson_extra_scripts, 'make-extension')), gse_target_dir, '@OUTDIR@', '@OUTPUT@'],
192 | output: 'extension.zip')
193 |
194 | gse_run_command_obj = run_command('test', '-d', 'po', check : false)
195 | if gse_run_command_obj.returncode() == 0
196 | subdir('po')
197 | endif
198 |
--------------------------------------------------------------------------------
/po/LINGUAS:
--------------------------------------------------------------------------------
1 | fr
2 | nl
3 |
--------------------------------------------------------------------------------
/po/POTFILES:
--------------------------------------------------------------------------------
1 | src/extension.js
2 | src/prefs.js
3 | schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml
4 |
--------------------------------------------------------------------------------
/po/fr.po:
--------------------------------------------------------------------------------
1 | # French translations for the ssh-search-provider gnome shell extension
2 | # Copyright (C) 2019 THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the tweaks-system-menu package.
4 | # Philippe Troin, 2019.
5 | msgid ""
6 | msgstr ""
7 | "Project-Id-Version: ssh-search-provider\n"
8 | "Report-Msgid-Bugs-To: \n"
9 | "POT-Creation-Date: 2025-02-12 02:47-0800\n"
10 | "PO-Revision-Date: 2025-02-12 02:47-0800\n"
11 | "Last-Translator: Philippe Troin \n"
12 | "Language-Team: none\n"
13 | "Language: fr\n"
14 | "MIME-Version: 1.0\n"
15 | "Content-Type: text/plain; charset=UTF-8\n"
16 | "Content-Transfer-Encoding: 8bit\n"
17 |
18 | #: src/extension.js:363
19 | msgid "SSH"
20 | msgstr "SSH"
21 |
22 | #: src/prefs.js:61
23 | msgid "SSH Search Provider Reborn"
24 | msgstr "Recherche de connections SSH renée"
25 |
26 | #: src/prefs.js:74
27 | msgid "Version"
28 | msgstr "Version"
29 |
30 | #: src/prefs.js:107
31 | msgid "Terminal Application:"
32 | msgstr "Émulateur de terminal :"
33 |
34 | #: src/prefs.js:150
35 | msgid "Arguments:"
36 | msgstr "Arguments :"
37 |
38 | #: src/prefs.js:173
39 | msgid "Pass SSH command line as a single argument:"
40 | msgstr "Passer la ligne de commande SSH en un unique argument :"
41 |
42 | #: src/prefs.js:194
43 | msgid "Debug:"
44 | msgstr "Débogage :"
45 |
46 | #: src/prefs.js:216
47 | msgid ""
48 | "Copyright © 2017-2025 Philippe Troin (F-"
49 | "i-f on GitHub)"
50 | msgstr ""
51 | "Copyright © 2017-2025 Philippe Troin (F-"
52 | "i-f sur GitHub)"
53 |
54 | #: src/prefs.js:219
55 | msgid "Copyright © 2013 Bernd Schlapsi"
56 | msgstr "Copyright © 2013 Bernd Schlapsi"
57 |
58 | #: src/prefs.js:239
59 | msgid "Choose Terminal Emulator"
60 | msgstr "Choisir un émulateur de terminal"
61 |
62 | #: src/prefs.js:244
63 | msgid "Cancel"
64 | msgstr "Annuler"
65 |
66 | #: src/prefs.js:245
67 | msgid "Select"
68 | msgstr "Choisir"
69 |
70 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:7
71 | msgid "Terminal application."
72 | msgstr "Emulateur de terminal."
73 |
74 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:8
75 | msgid "The Terminal Application used to launch new SSH sessions with."
76 | msgstr ""
77 | "L'émulateur de terminal avec lequel les nouvelles sessions SSH seront "
78 | "lancées."
79 |
80 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:13
81 | msgid "Terminal application arguments."
82 | msgstr "Arguments de l'émulateur de terminal."
83 |
84 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:14
85 | msgid ""
86 | "The arguments passed to the Terminal Application. The command \"ssh [-p "
87 | "] [user@]\" is appended after the provided arguments."
88 | msgstr ""
89 | "Les arguments passés à l'émulatuer de terminal. La commande \"ssh [-p\n"
90 | "] [user@]\" sera ajoutée après les arguments fournis."
91 |
92 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:20
93 | msgid "SSH command line is passed as a single argument."
94 | msgstr "La ligne de commande ssh est passée en un unique argument."
95 |
96 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:21
97 | msgid ""
98 | "Whether or not the \"ssh [-p ] [user@]\" command line is "
99 | "appended as a single argument. If not, the command line will be broken up "
100 | "and passed as multiple arguments. Depends on the Terminal Emulator "
101 | "Application used."
102 | msgstr ""
103 | "Si la ligne de commande \"ssh [-p ] [user@]\" est passée en\n"
104 | "un unique argument. Sinon, la ligne de commande sera décomposée et\n"
105 | "passée dans de multiples arguments. Dépend de l'émulateur de terminal\n"
106 | "choisi."
107 |
108 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:29
109 | msgid "Debugging."
110 | msgstr "Débogage."
111 |
112 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:30
113 | msgid "Enable debugging for the extension."
114 | msgstr "Activer le mode débogage de l'extension."
115 |
--------------------------------------------------------------------------------
/po/meson.build:
--------------------------------------------------------------------------------
1 | # meson-gse - Library for gnome-shell extensions
2 | # Copyright (C) 2019, 2021 Philippe Troin (F-i-f on Github)
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 |
17 | i18n.gettext(gse_gettext_domain, preset: 'glib', install: true, install_dir: gse_target_locale_dir)
18 |
--------------------------------------------------------------------------------
/po/nl.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the ssh-search-provider package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: ssh-search-provider\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2025-02-12 02:47-0800\n"
11 | "PO-Revision-Date: 2025-02-12 02:47-0800\n"
12 | "Last-Translator: Heimen Stoffels \n"
13 | "Language-Team: \n"
14 | "Language: nl\n"
15 | "MIME-Version: 1.0\n"
16 | "Content-Type: text/plain; charset=UTF-8\n"
17 | "Content-Transfer-Encoding: 8bit\n"
18 | "X-Generator: Poedit 3.0\n"
19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20 |
21 | #: src/extension.js:363
22 | msgid "SSH"
23 | msgstr "SSH"
24 |
25 | #: src/prefs.js:61
26 | msgid "SSH Search Provider Reborn"
27 | msgstr "SSH-zoekdienst"
28 |
29 | #: src/prefs.js:74
30 | msgid "Version"
31 | msgstr "Versie"
32 |
33 | #: src/prefs.js:107
34 | msgid "Terminal Application:"
35 | msgstr "Terminaltoepassing:"
36 |
37 | #: src/prefs.js:150
38 | msgid "Arguments:"
39 | msgstr "Opdrachtregelopties:"
40 |
41 | #: src/prefs.js:173
42 | msgid "Pass SSH command line as a single argument:"
43 | msgstr "SSH-opdrachtregel uitvoeren als één opdracht:"
44 |
45 | #: src/prefs.js:194
46 | msgid "Debug:"
47 | msgstr "Foutopsporing:"
48 |
49 | #: src/prefs.js:216
50 | msgid ""
51 | "Copyright © 2017-2025 Philippe Troin (F-"
52 | "i-f on GitHub)"
53 | msgstr ""
54 | "Copyright © 2017-2025 Philippe Troin (F-"
55 | "i-f op GitHub)"
56 |
57 | #: src/prefs.js:219
58 | msgid "Copyright © 2013 Bernd Schlapsi"
59 | msgstr "Copyright © 2013 Bernd Schlapsi"
60 |
61 | #: src/prefs.js:239
62 | msgid "Choose Terminal Emulator"
63 | msgstr "Kies een terminalemulator"
64 |
65 | #: src/prefs.js:244
66 | msgid "Cancel"
67 | msgstr "Annuleren"
68 |
69 | #: src/prefs.js:245
70 | msgid "Select"
71 | msgstr "Kiezen"
72 |
73 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:7
74 | msgid "Terminal application."
75 | msgstr "Terminaltoepassing."
76 |
77 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:8
78 | msgid "The Terminal Application used to launch new SSH sessions with."
79 | msgstr ""
80 | "De terminaltoepassing die moet worden gebruikt om nieuwe ssh-sessies mee op "
81 | "te zetten."
82 |
83 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:13
84 | msgid "Terminal application arguments."
85 | msgstr "Opdrachtregelopties voor de terminaltoepassing."
86 |
87 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:14
88 | msgid ""
89 | "The arguments passed to the Terminal Application. The command \"ssh [-p "
90 | "] [user@]\" is appended after the provided arguments."
91 | msgstr ""
92 | "De opdrachtregelopties die moeten worden doorgegeven aan de "
93 | "terminaltoepassing. De opdracht ‘ssh [-p ] [user@]’ wordt "
94 | "automatisch toegevoegd aan het einde van de regel."
95 |
96 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:20
97 | msgid "SSH command line is passed as a single argument."
98 | msgstr "De ssh-opdrachtregel wordt uitgevoerd als één opdracht."
99 |
100 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:21
101 | msgid ""
102 | "Whether or not the \"ssh [-p ] [user@]\" command line is "
103 | "appended as a single argument. If not, the command line will be broken up "
104 | "and passed as multiple arguments. Depends on the Terminal Emulator "
105 | "Application used."
106 | msgstr ""
107 | "Of ‘ssh [-p ] [user@]’ al dan niet als één opdracht moet worden "
108 | "toegevoegd. Als dat niet het geval is, dan wordt de regel opgebroken in "
109 | "meerdere delen. Of dit werkt is afhankelijk van de gebruikte "
110 | "terminalemulator."
111 |
112 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:29
113 | msgid "Debugging."
114 | msgstr "Foutopsporing."
115 |
116 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:30
117 | msgid "Enable debugging for the extension."
118 | msgstr "Schakel foutopsporing van deze uitbreiding in."
119 |
--------------------------------------------------------------------------------
/po/ssh-search-provider.pot:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the ssh-search-provider package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | #, fuzzy
7 | msgid ""
8 | msgstr ""
9 | "Project-Id-Version: ssh-search-provider\n"
10 | "Report-Msgid-Bugs-To: \n"
11 | "POT-Creation-Date: 2025-02-12 02:47-0800\n"
12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 | "Last-Translator: FULL NAME \n"
14 | "Language-Team: LANGUAGE \n"
15 | "Language: \n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 |
20 | #: src/extension.js:363
21 | msgid "SSH"
22 | msgstr ""
23 |
24 | #: src/prefs.js:61
25 | msgid "SSH Search Provider Reborn"
26 | msgstr ""
27 |
28 | #: src/prefs.js:74
29 | msgid "Version"
30 | msgstr ""
31 |
32 | #: src/prefs.js:107
33 | msgid "Terminal Application:"
34 | msgstr ""
35 |
36 | #: src/prefs.js:150
37 | msgid "Arguments:"
38 | msgstr ""
39 |
40 | #: src/prefs.js:173
41 | msgid "Pass SSH command line as a single argument:"
42 | msgstr ""
43 |
44 | #: src/prefs.js:194
45 | msgid "Debug:"
46 | msgstr ""
47 |
48 | #: src/prefs.js:216
49 | msgid ""
50 | "Copyright © 2017-2025 Philippe Troin (F-"
51 | "i-f on GitHub)"
52 | msgstr ""
53 |
54 | #: src/prefs.js:219
55 | msgid "Copyright © 2013 Bernd Schlapsi"
56 | msgstr ""
57 |
58 | #: src/prefs.js:239
59 | msgid "Choose Terminal Emulator"
60 | msgstr ""
61 |
62 | #: src/prefs.js:244
63 | msgid "Cancel"
64 | msgstr ""
65 |
66 | #: src/prefs.js:245
67 | msgid "Select"
68 | msgstr ""
69 |
70 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:7
71 | msgid "Terminal application."
72 | msgstr ""
73 |
74 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:8
75 | msgid "The Terminal Application used to launch new SSH sessions with."
76 | msgstr ""
77 |
78 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:13
79 | msgid "Terminal application arguments."
80 | msgstr ""
81 |
82 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:14
83 | msgid ""
84 | "The arguments passed to the Terminal Application. The command \"ssh [-p "
85 | "] [user@]\" is appended after the provided arguments."
86 | msgstr ""
87 |
88 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:20
89 | msgid "SSH command line is passed as a single argument."
90 | msgstr ""
91 |
92 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:21
93 | msgid ""
94 | "Whether or not the \"ssh [-p ] [user@]\" command line is "
95 | "appended as a single argument. If not, the command line will be broken up "
96 | "and passed as multiple arguments. Depends on the Terminal Emulator "
97 | "Application used."
98 | msgstr ""
99 |
100 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:29
101 | msgid "Debugging."
102 | msgstr ""
103 |
104 | #: schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:30
105 | msgid "Enable debugging for the extension."
106 | msgstr ""
107 |
--------------------------------------------------------------------------------
/schemas/org.gnome.shell.extensions.ssh-search-provider.gschema.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | "org.gnome.Terminal.desktop"
7 | Terminal application.
8 | The Terminal Application used to launch new SSH
9 | sessions with.
10 |
11 |
12 | "--"
13 | Terminal application arguments.
14 | The arguments passed to the Terminal Application.
15 | The command "ssh [-p <port>] [user@]<host>" is appended after the
16 | provided arguments.
17 |
18 |
19 | false
20 | SSH command line is passed as a single
21 | argument. Whether or not the "ssh [-p
22 | <port>] [user@]<host>" command line is appended as a
23 | single argument. If not, the command line will be broken up and
24 | passed as multiple arguments. Depends on the Terminal Emulator
25 | Application used.
26 |
27 |
28 | false
29 | Debugging.
30 | Enable debugging for the extension.
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/extension.js:
--------------------------------------------------------------------------------
1 | // -*- indent-tabs-mode: nil; -*-
2 | // Ssh Search Provider for Gnome Shell
3 | // Copyright (C) 2017-2025 Philippe Troin (F-i-f on Github)
4 | // Copyright (c) 2013 Bernd Schlapsi
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program. If not, see .
18 |
19 | import {
20 | Extension,
21 | gettext as _,
22 | } from 'resource:///org/gnome/shell/extensions/extension.js';
23 | import * as Util from 'resource:///org/gnome/shell/misc/util.js';
24 | import * as Main from 'resource:///org/gnome/shell/ui/main.js';
25 | import Gio from 'gi://Gio';
26 | import GLib from 'gi://GLib';
27 | import St from 'gi://St';
28 |
29 | import * as Logger from './logger.js';
30 |
31 | // Settings
32 | const DEFAULT_TERMINAL_SCHEMA =
33 | 'org.gnome.desktop.default-applications.terminal';
34 | const DEFAULT_TERMINAL_KEY = 'exec';
35 | const DEFAULT_TERMINAL_ARGS_KEY = 'exec-arg';
36 | const FALLBACK_TERMINAL = {exec: 'gnome-terminal', args: '--', single: false};
37 | const HOST_SEARCHSTRING = 'host ';
38 |
39 | // A generic file, source of host names
40 | class HostsSourceFile {
41 | constructor(logger, path) {
42 | this._logger = logger;
43 | this._lastSearchHadUserPart = null;
44 | this._hosts = [];
45 |
46 | this._canonicalPath = path;
47 | this._canonicalFile = Gio.file_new_for_path(this._canonicalPath);
48 |
49 | this._path = this._canonicalPath;
50 | this._file = this._canonicalFile;
51 |
52 | this._symlinkTarget = null;
53 | this._symlinkPath = null;
54 | this._symlinkFile = null;
55 |
56 | this._symlinkChangeMonitor = null;
57 | this._symlinkChangeSignal = null;
58 |
59 | this._fileChangeMonitor = this._file.monitor_file(
60 | Gio.FileMonitorFlags.NONE,
61 | null
62 | );
63 | this._fileChangeSignal = this._fileChangeMonitor.connect(
64 | 'changed',
65 | this.onFileChange.bind(this)
66 | );
67 |
68 | this.onFileChange(
69 | this._fileChangeMonitor,
70 | this._file,
71 | null,
72 | Gio.FileMonitorEvent.CHANGES_DONE_HINT
73 | );
74 | }
75 |
76 | cleanup() {
77 | if (this._symlinkChangeMonitor !== null) {
78 | this._symlinkChangeMonitor.disconnect(this._symlinkChangeSignal);
79 | this._symlinkChangeSignal = null;
80 | this._symlinkChangeMonitor.cancel();
81 | this._symlinkChangeMonitor = null;
82 | }
83 | this._fileChangeMonitor.disconnect(this._fileChangeSignal);
84 | this._fileChangeSignal = null;
85 | this._fileChangeMonitor.cancel();
86 | this._fileChangeMonitor = null;
87 | }
88 |
89 | getHosts() {
90 | return this._hosts;
91 | }
92 |
93 | _changeLinkTarget(target) {
94 | this._symlinkTarget = target;
95 | this._path = this._symlinkTarget;
96 | if (this._path[0] !== '/') {
97 | this._path =
98 | this._symlinkFile.get_parent().get_path() + '/' + this._path;
99 | }
100 | this._file = Gio.file_new_for_path(this._path);
101 | this._fileChangeMonitor = this._file.monitor_file(
102 | Gio.FileMonitorFlags.NONE,
103 | null
104 | );
105 | this._fileChangeSignal = this._fileChangeMonitor.connect(
106 | 'changed',
107 | this.onFileChange.bind(this)
108 | );
109 | }
110 |
111 | onSymlinkChange(filemonitor, file, other_file, event_type) {
112 | if (
113 | (this._symlinkFile === null ||
114 | file.get_path() === this._symlinkFile.get_path()) &&
115 | (event_type === Gio.FileMonitorEvent.CHANGES_DONE_HINT ||
116 | event_type === Gio.FileMonitorEvent.DELETED)
117 | ) {
118 | this._logger.log_debug(
119 | 'HostsSourceFile.onSymlinkChange(' +
120 | file.get_path() +
121 | ', ' +
122 | event_type +
123 | ')'
124 | );
125 | let queryinfo = null;
126 | try {
127 | queryinfo = this._canonicalFile.query_info('standard', 0, null);
128 | } catch (ex) {
129 | this._logger.log_debug(
130 | 'HostsSourceFile.onSymlinkChange(' +
131 | file.get_path() +
132 | '): ' +
133 | "file doesn't exist: " +
134 | ex
135 | );
136 | }
137 | if (queryinfo !== null && queryinfo.get_is_symlink()) {
138 | let curLinkTarget = queryinfo.get_symlink_target();
139 | if (curLinkTarget === this._symlinkTarget) {
140 | this._logger.log_debug(
141 | 'HostsSourceFile.onSymlinkChange(' +
142 | file.get_path() +
143 | '): ' +
144 | 'symlink target still ' +
145 | this._symlinkTarget
146 | );
147 | } else if (this._symlinkTarget === null) {
148 | this._logger.log_debug(
149 | 'HostsSourceFile.onSymlinkChange(' +
150 | file.get_path() +
151 | '): ' +
152 | 'changed from regular to symlink to ' +
153 | curLinkTarget
154 | );
155 |
156 | this._fileChangeMonitor.disconnect(this._fileChangeSignal);
157 | this._symlinkPath = this._path;
158 | this._symlinkFile = this._file;
159 | this._symlinkChangeMonitor = this._fileChangeMonitor;
160 | this._symlinkChangeSignal =
161 | this._symlinkChangeMonitor.connect(
162 | 'changed',
163 | this.onSymlinkChange.bind(this)
164 | );
165 |
166 | this._changeLinkTarget(curLinkTarget);
167 | } else {
168 | this._logger.log_debug(
169 | 'HostsSourceFile.onSymlinkChange(' +
170 | file.get_path() +
171 | '): ' +
172 | 'symlink target changed from ' +
173 | this._symlinkTarget +
174 | ' to ' +
175 | curLinkTarget
176 | );
177 |
178 | this._fileChangeMonitor.disconnect(this._fileChangeSignal);
179 | this._fileChangeMonitor.cancel();
180 |
181 | this._changeLinkTarget(curLinkTarget);
182 |
183 | this._logger.log_debug(
184 | 'HostsSourceFile.onSymlinkChange(' +
185 | file.get_path() +
186 | '): triggering onFileChange()'
187 | );
188 | this.onFileChange(
189 | this._fileChangeMonitor,
190 | this._file,
191 | null,
192 | Gio.FileMonitorEvent.CHANGES_DONE_HINT
193 | );
194 | }
195 | } else {
196 | if (this._symlinkTarget === null) {
197 | this._logger.log_debug(
198 | 'HostsSourceFile.onSymlinkChange(' +
199 | file.get_path() +
200 | '): ' +
201 | 'still not a symlink'
202 | );
203 | } else {
204 | this._logger.log_debug(
205 | 'HostsSourceFile.onSymlinkChange(' +
206 | file.get_path() +
207 | '): ' +
208 | 'changed from symlink to regular'
209 | );
210 |
211 | this._fileChangeMonitor.disconnect(this._fileChangeSignal);
212 | this._fileChangeMonitor.cancel();
213 |
214 | this._symlinkChangeMonitor.disconnect(
215 | this._symlinkChangeSignal
216 | );
217 |
218 | this._path = this._symlinkPath;
219 | this._file = this._symlinkFile;
220 | this._fileChangeMonitor = this._symlinkChangeMonitor;
221 |
222 | this._symlinkTarget = null;
223 | this._symlinkFile = null;
224 | this._symlinkPath = null;
225 | this._symlinkChangeMonitor = null;
226 | this._symlinkChangeSignal = null;
227 |
228 | this._fileChangeMonitor.connect(
229 | 'changed',
230 | this.onFileChange.bind(this)
231 | );
232 | this._logger.log_debug(
233 | 'HostsSourceFile.onSymlinkChange(' +
234 | file.get_path() +
235 | '): triggering onFileChange()'
236 | );
237 | this.onFileChange(
238 | this._fileChangeMonitor,
239 | this._file,
240 | null,
241 | Gio.FileMonitorEvent.CHANGES_DONE_HINT
242 | );
243 | }
244 | }
245 | }
246 | }
247 |
248 | onFileChange(filemonitor, file, other_file, event_type) {
249 | if (
250 | file.get_path() === this._file.get_path() &&
251 | (event_type === Gio.FileMonitorEvent.CHANGES_DONE_HINT ||
252 | event_type === Gio.FileMonitorEvent.DELETED)
253 | ) {
254 | this._logger.log_debug(
255 | 'HostsSourceFile.onFileChange(' +
256 | file.get_path() +
257 | ', ' +
258 | event_type +
259 | ')'
260 | );
261 |
262 | if (this._symlinkTarget === null) {
263 | this._logger.log_debug(
264 | 'HostsSourceFile.onFileChange(' +
265 | file.get_path() +
266 | '): triggering onSymlinkChange()'
267 | );
268 | this.onSymlinkChange(
269 | null,
270 | this._canonicalFile,
271 | null,
272 | event_type
273 | );
274 | }
275 |
276 | let hosts = [];
277 | if (file.query_exists(null)) {
278 | let contents = this._canonicalFile.load_contents(null);
279 | let decoder = new TextDecoder();
280 | let filelines = decoder.decode(contents[1]).trim().split('\n');
281 | for (let i in this.parse(filelines)) {
282 | hosts.push(i);
283 | }
284 | }
285 | this._hosts = hosts;
286 | this._logger.log_debug(
287 | 'HostsSourceFile.onFileChange(' +
288 | file.get_path() +
289 | ') = ' +
290 | this._hosts.length +
291 | '[' +
292 | this._hosts +
293 | ']'
294 | );
295 | }
296 | }
297 | }
298 |
299 | // SSH config file
300 | class ConfigHostsSourceFile extends HostsSourceFile {
301 | parse(filelines) {
302 | let hostsDict = {};
303 |
304 | // search for all lines which begins with "host"
305 | for (let i = 0; i < filelines.length; i++) {
306 | let line = filelines[i].toString();
307 | if (line.toLowerCase().lastIndexOf(HOST_SEARCHSTRING, 0) === 0) {
308 | // read all hostnames in the host definition line
309 | let hostnames = line.slice(HOST_SEARCHSTRING.length).split(' ');
310 | for (let j = 0; j < hostnames.length; j++) {
311 | let h = hostnames[j];
312 | if (h.indexOf('*') === -1) {
313 | hostsDict[h] = 1;
314 | }
315 | }
316 | }
317 | }
318 |
319 | return hostsDict;
320 | }
321 | }
322 |
323 | // SSH Known hosts file
324 | class SshKnownHostsSourceFile extends HostsSourceFile {
325 | parse(filelines) {
326 | let hostsDict = {};
327 |
328 | for (let i = 0; i < filelines.length; i++) {
329 | let hostnames = filelines[i].split(' ')[0];
330 |
331 | // if hostname had a 60 char length, it looks like
332 | // the hostname is hashed and we ignore it here
333 | if (
334 | hostnames.length > 0 &&
335 | hostnames[0] !== '#' &&
336 | (hostnames.length !== 60 || hostnames.search(',') >= 0)
337 | ) {
338 | hostnames = hostnames.split(',');
339 | for (let j = 0; j < hostnames.length; j++) {
340 | hostsDict[hostnames[j]] = 1;
341 | }
342 | }
343 | }
344 |
345 | return hostsDict;
346 | }
347 | }
348 |
349 | // The Search provider
350 | class SshSearchProvider {
351 | constructor(extension) {
352 | this._settings = extension._settings;
353 | this._logger = extension._logger;
354 |
355 | this._logger.log_debug('SshSearchProvider.constructor()');
356 |
357 | this.id = extension.metadata.uuid;
358 | this.appInfo = Gio.DesktopAppInfo.new(
359 | this._settings.get_string('terminal-application')
360 | );
361 | if (this.appInfo !== null) {
362 | this.appInfo.get_name = function () {
363 | return _('SSH');
364 | };
365 | }
366 | this.title = 'SSHSearch';
367 |
368 | this._hostsSources = [];
369 |
370 | this._hostsSources.push(
371 | new ConfigHostsSourceFile(
372 | this._logger,
373 | GLib.build_filenamev([GLib.get_home_dir(), '/.ssh/', 'config'])
374 | )
375 | );
376 | this._hostsSources.push(
377 | new ConfigHostsSourceFile(this._logger, '/etc/ssh_config')
378 | );
379 | this._hostsSources.push(
380 | new ConfigHostsSourceFile(this._logger, '/etc/ssh/ssh_config')
381 | );
382 |
383 | this._hostsSources.push(
384 | new SshKnownHostsSourceFile(
385 | this._logger,
386 | GLib.build_filenamev([
387 | GLib.get_home_dir(),
388 | '/.ssh/',
389 | 'known_hosts',
390 | ])
391 | )
392 | );
393 | this._hostsSources.push(
394 | new SshKnownHostsSourceFile(this._logger, '/etc/ssh_known_hosts')
395 | );
396 | this._hostsSources.push(
397 | new SshKnownHostsSourceFile(
398 | this._logger,
399 | '/etc/ssh/ssh_known_hosts'
400 | )
401 | );
402 | }
403 |
404 | _cleanup() {
405 | this._logger.log_debug('SshSearchProvider._cleanup()');
406 |
407 | for (let i = 0; i < this._hostsSources.length; ++i) {
408 | this._hostsSources[i].cleanup();
409 | }
410 | }
411 |
412 | // Search API
413 | createResultObject(_result, _terms) {
414 | // this._logger.log_debug('SshSearchProvider.createResultObject('+terms+')');
415 | return null;
416 | }
417 |
418 | _createIcon(size) {
419 | let icon = this.appInfo?.get_icon();
420 | if (!icon) {
421 | icon = Gio.icon_new_for_string('applications-other');
422 | }
423 | return new St.Icon({gicon: icon, icon_size: size});
424 | }
425 |
426 | async getResultMetas(resultIds, _cancellable) {
427 | this._logger.log_debug(
428 | 'SshSearchProvider.getResultMetas(' + resultIds + ')'
429 | );
430 | let results = [];
431 | for (let i = 0; i < resultIds.length; ++i) {
432 | results.push({
433 | id: resultIds[i],
434 | name: resultIds[i],
435 | createIcon: this._createIcon.bind(this),
436 | });
437 | }
438 | return results;
439 | }
440 |
441 | activateResult(id) {
442 | this._logger.log_debug('SshSearchProvider.activateResult(' + id + ')');
443 | let terminal_definition = this._getDefaultTerminal();
444 | let cmd = [terminal_definition.exec];
445 | cmd.push.apply(cmd, terminal_definition.args.trim().split(/\s+/));
446 |
447 | let host = id;
448 | let user = null;
449 | let port = null;
450 |
451 | let atIndex = host.indexOf('@');
452 | if (atIndex >= 0) {
453 | user = host.slice(0, atIndex);
454 | host = host.slice(atIndex + 1);
455 | }
456 |
457 | if (host[0] === '[') {
458 | let parts = host.slice(1).split(']:');
459 | if (parts.length === 2) {
460 | host = parts[0];
461 | port = parts[1];
462 | }
463 | }
464 |
465 | if (user !== null) {
466 | host = user + '@' + host;
467 | }
468 |
469 | let sshCmd;
470 | if (port === null) {
471 | sshCmd = ['ssh', host];
472 | } else {
473 | sshCmd = ['ssh', '-p', port, host];
474 | }
475 |
476 | if (terminal_definition.single) {
477 | cmd.push(sshCmd.join(' '));
478 | } else {
479 | cmd.push.apply(cmd, sshCmd);
480 | }
481 |
482 | // start terminal with ssh command
483 | this._logger.log_debug(
484 | 'SshSearchProvider.activateResult(): cmd=' + cmd
485 | );
486 | Util.spawn(cmd);
487 | }
488 |
489 | filterResults(providerResults, maxResults) {
490 | this._logger.log_debug(
491 | 'SshSearchProvider.filterResults(' + maxResults + ')'
492 | );
493 | return providerResults;
494 | }
495 |
496 | async getInitialResultSet(terms, _cancellable) {
497 | this._logger.log_debug(
498 | 'SshSearchProvider.getInitialResultSet(' + terms + ')'
499 | );
500 |
501 | // check if a found host-name begins like the search-term
502 | let resultsDict = {};
503 | this._lastSearchHadUserPart = false;
504 |
505 | for (let ti = 0; ti < terms.length; ti++) {
506 | let user = null;
507 | let host = terms[ti];
508 | let host_at_sign = host.indexOf('@');
509 | if (host_at_sign === 0 || host_at_sign === host.length - 1) {
510 | // Invalid user name or nothing after @ sign: skip search term
511 | continue;
512 | } else if (host_at_sign > 0) {
513 | user = host.slice(0, host_at_sign);
514 | host = host.slice(host_at_sign + 1);
515 | this._lastSearchHadUserPart = true;
516 | }
517 |
518 | for (let hsi = 0; hsi < this._hostsSources.length; ++hsi) {
519 | let hostnames = this._hostsSources[hsi].getHosts();
520 | for (let i = 0; i < hostnames.length; i++) {
521 | if (hostnames[i].indexOf(host) >= 0) {
522 | let ssh_name = hostnames[i];
523 | if (user !== null) {
524 | ssh_name = user + '@' + ssh_name;
525 | }
526 | resultsDict[ssh_name] = 1;
527 | }
528 | }
529 | }
530 | }
531 |
532 | let results = [];
533 | for (let i in resultsDict) {
534 | results.push(i);
535 | }
536 |
537 | this._logger.log_debug(
538 | 'SshSearchProvider.getInitialResultSet(' +
539 | terms +
540 | ') = ' +
541 | results.length +
542 | '[' +
543 | results +
544 | ']'
545 | );
546 |
547 | return results;
548 | }
549 |
550 | async getSubsearchResultSet(previousResults, terms, cancellable) {
551 | this._logger.log_debug(
552 | 'SshSearchProvider.getSubsearchResultSet(' + terms + ')'
553 | );
554 | let results;
555 |
556 | results = [];
557 | for (let ti = 0; ti < terms.length; ti++) {
558 | let term = terms[ti];
559 | let termAtIndex = term.indexOf('@');
560 | if (termAtIndex === term.length - 1) {
561 | // Skip term if nothing is present after the @ sign.
562 | continue;
563 | }
564 | if (
565 | (termAtIndex >= 0 && !this._lastSearchHadUserPart) ||
566 | (termAtIndex < 0 && this._lastSearchHadUserPart)
567 | ) {
568 | // If the query switches from having to not having a user
569 | // part, we must restart the search from scratch.
570 | return this.getInitialResultSet(terms, cancellable);
571 | }
572 | let termHost = term;
573 | if (termAtIndex >= 0) {
574 | termHost = term.slice(termAtIndex + 1);
575 | }
576 | for (let i = 0; i < previousResults.length; ++i) {
577 | let previousResult = previousResults[i];
578 | let previousResultAtIndex = previousResult.indexOf('@');
579 | let previousHost = previousResult;
580 | if (previousResultAtIndex >= 0) {
581 | previousHost = previousResult.slice(
582 | previousResultAtIndex + 1
583 | );
584 | }
585 | if (previousHost.indexOf(termHost) >= 0) {
586 | results.push(previousResult);
587 | }
588 | }
589 | }
590 | this._logger.log_debug(
591 | 'SshSearchProvider.getSubsearchResultSet(' +
592 | terms +
593 | ') = ' +
594 | results.length +
595 | '[' +
596 | results +
597 | ']'
598 | );
599 | return results;
600 | }
601 |
602 | // try to find the default terminal app. fallback is gnome-terminal
603 | _getDefaultTerminal() {
604 | if (this.appInfo !== null) {
605 | return {
606 | exec: this.appInfo.get_string('Exec'),
607 | args: this._settings.get_string(
608 | 'terminal-application-arguments'
609 | ),
610 | single: this._settings.get_boolean(
611 | 'ssh-command-single-argument'
612 | ),
613 | };
614 | }
615 |
616 | try {
617 | if (
618 | Gio.Settings.list_schemas().indexOf(DEFAULT_TERMINAL_SCHEMA) ===
619 | -1
620 | ) {
621 | return FALLBACK_TERMINAL;
622 | }
623 |
624 | let terminal_setting = new Gio.Settings({
625 | schema: DEFAULT_TERMINAL_SCHEMA,
626 | });
627 | return {
628 | exec: terminal_setting.get_string(DEFAULT_TERMINAL_KEY),
629 | args: terminal_setting.get_string(DEFAULT_TERMINAL_ARGS_KEY),
630 | single: false,
631 | };
632 | } catch (ex) {
633 | this._logger.log_debug(
634 | 'SshSearchProvider._getDefaultTerminal(): ' + ex
635 | );
636 | return FALLBACK_TERMINAL;
637 | }
638 | }
639 | }
640 |
641 | // The extension
642 | export default class SshSearchProviderExtension extends Extension {
643 | constructor(metadata) {
644 | super(metadata);
645 | this._logger = null;
646 | this._debugSettingChangedConnection = null;
647 | this._onTerminalApplicationChangedSignal = null;
648 | this._settings = null;
649 | this._sshSearchProvider = null;
650 | this._searchResults = null;
651 | this._delayedRegistration = null;
652 | }
653 |
654 | _on_debug_change() {
655 | this._logger.set_debug(this._settings.get_boolean('debug'));
656 | this._logger.log_debug(
657 | 'SshSearchProviderExtension._on_debug_change(): debug = ' +
658 | this._logger.get_debug()
659 | );
660 | }
661 |
662 | _on_terminal_application_change() {
663 | this._logger.log_debug(
664 | 'SshSearchProviderExtension._on_terminal_application_change()'
665 | );
666 | this._unregisterProvider();
667 | this._registerProvider();
668 | }
669 |
670 | _registerProvider() {
671 | this._logger.log_debug(
672 | 'SshSearchProviderExtension._registerProvider()'
673 | );
674 | if (!this._sshSearchProvider) {
675 | this._sshSearchProvider = new SshSearchProvider(this);
676 | this._searchResults._registerProvider(this._sshSearchProvider);
677 | }
678 | }
679 |
680 | enable() {
681 | if (!this._logger) {
682 | this._logger = new Logger.Logger(
683 | 'Ssh-Search-Provider',
684 | this.metadata
685 | );
686 | }
687 |
688 | if (!this._settings) {
689 | this._settings = this.getSettings();
690 | }
691 |
692 | // Gnome-Shell 40 compatibility
693 | if (Main.overview._overview.controls !== undefined) {
694 | // GS 40+
695 | this._searchResults =
696 | Main.overview._overview.controls._searchController._searchResults;
697 | } else {
698 | // GS 38-
699 | this._searchResults = Main.overview.viewSelector._searchResults;
700 | }
701 |
702 | this._on_debug_change();
703 | this._logger.log_debug('SshSearchProviderExtension.enable()');
704 |
705 | if (!this._onDebugChangedSignal) {
706 | this._onDebugChangedSignal = this._settings.connect(
707 | 'changed::debug',
708 | this._on_debug_change.bind(this)
709 | );
710 | }
711 |
712 | if (!this._onTerminalApplicationChangedSignal) {
713 | this._onTerminalApplicationChangedSignal = this._settings.connect(
714 | 'changed::terminal-application',
715 | this._on_terminal_application_change.bind(this)
716 | );
717 | }
718 |
719 | this._delayedRegistration = GLib.idle_add(
720 | GLib.PRIORITY_DEFAULT_IDLE,
721 | function () {
722 | this._registerProvider();
723 | this._delayedRegistration = null;
724 | return GLib.SOURCE_REMOVE;
725 | }.bind(this)
726 | );
727 |
728 | this._logger.log_debug('extension enabled');
729 | }
730 |
731 | _unregisterProvider() {
732 | this._logger.log_debug(
733 | 'SshSearchProviderExtension._unregisterProvider()'
734 | );
735 |
736 | if (this._delayedRegistration !== null) {
737 | GLib.source_remove(this._delayedRegistration);
738 | this._delayedRegistration = null;
739 | }
740 |
741 | if (this._sshSearchProvider) {
742 | this._searchResults._unregisterProvider(this._sshSearchProvider);
743 | this._sshSearchProvider._cleanup();
744 | this._sshSearchProvider = null;
745 | }
746 | }
747 |
748 | disable() {
749 | this._logger.log_debug('SshSearchProviderExtension.disable()');
750 |
751 | this._unregisterProvider();
752 |
753 | if (this._onTerminalApplicationChangedSignal) {
754 | this._settings.disconnect(this._onTerminalApplicationChangedSignal);
755 | this._onTerminalApplicationChangedSignal = null;
756 | }
757 |
758 | if (this._onDebugChangedSignal) {
759 | this._settings.disconnect(this._onDebugChangedSignal);
760 | this._onDebugChangedSignal = null;
761 | }
762 |
763 | this._searchResults = null;
764 | this._settings = null;
765 |
766 | this._logger.log_debug('extension disabled');
767 | this._logger = null;
768 | }
769 | }
770 |
--------------------------------------------------------------------------------
/src/metadata.json.in:
--------------------------------------------------------------------------------
1 | {
2 | "description": "Provide SSH search results in overview.\n\nThis is a fork of the original \"SSH Search Provider\", updated to work with newer Gnome-Shells.",
3 | "gettext-domain": "@gettext_domain@",
4 | "name": "SSH Search Provider Reborn",
5 | "settings-schema": "org.gnome.shell.extensions.ssh-search-provider",
6 | "shell-version": [
7 | "45",
8 | "46",
9 | "47",
10 | "48"
11 | ],
12 | "url": "https://github.com/F-i-f/ssh-search-provider",
13 | "uuid": "@uuid@",
14 | "vcs_revision": "@VCS_TAG@",
15 | "version": @version@
16 | }
17 |
--------------------------------------------------------------------------------
/src/prefs.js:
--------------------------------------------------------------------------------
1 | // -*- indent-tabs-mode: nil; -*-
2 | // Ssh Search Provider for Gnome Shell
3 | // Copyright (C) 2019-2025 Philippe Troin (F-i-f on Github)
4 | //
5 | // This program is free software: you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 3 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program. If not, see .
17 |
18 | import {
19 | ExtensionPreferences,
20 | gettext as _,
21 | } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
22 | import Adw from 'gi://Adw';
23 | import Gio from 'gi://Gio';
24 | import Gtk from 'gi://Gtk';
25 |
26 | import * as Logger from './logger.js';
27 |
28 | const ArgumentsForTerminalApp = {
29 | 'guake.desktop': {args: '-n new --show -e', single: true},
30 | 'rxvt.desktop': {args: '-e', single: false},
31 | 'org.gnome.Console.desktop': {args: '--', single: false},
32 | 'org.gnome.Terminal.desktop': {args: '--', single: false},
33 | 'com.gexperts.Tilix.desktop': {args: '-e', single: true},
34 | 'xterm.desktop': {args: '-e', single: true},
35 | };
36 |
37 | export default class SshSearchProviderSettings extends ExtensionPreferences {
38 | fillPreferencesWindow(window) {
39 | const grid = new Gtk.Grid();
40 | grid.margin_top = 12;
41 | grid.margin_bottom = grid.margin_top;
42 | grid.margin_start = 48;
43 | grid.margin_end = grid.margin_start;
44 | grid.row_spacing = 6;
45 | grid.column_spacing = grid.row_spacing;
46 | grid.orientation = Gtk.Orientation.VERTICAL;
47 |
48 | const settings = this.getSettings();
49 | const logger = new Logger.Logger(
50 | 'Ssh-Search-Provider/prefs',
51 | this.metadata
52 | );
53 | logger.set_debug(settings.get_boolean('debug'));
54 |
55 | let ypos = 1;
56 |
57 | const title_label = new Gtk.Label({
58 | use_markup: true,
59 | label:
60 | '' +
61 | _('SSH Search Provider Reborn') +
62 | '',
63 | hexpand: true,
64 | halign: Gtk.Align.CENTER,
65 | });
66 | grid.attach(title_label, 1, ypos, 2, 1);
67 |
68 | ypos += 1;
69 |
70 | const version_label = new Gtk.Label({
71 | use_markup: true,
72 | label:
73 | '' +
74 | _('Version') +
75 | ' ' +
76 | logger.get_version() +
77 | '',
78 | hexpand: true,
79 | halign: Gtk.Align.CENTER,
80 | });
81 | grid.attach(version_label, 1, ypos, 2, 1);
82 |
83 | ypos += 1;
84 |
85 | const link_label = new Gtk.Label({
86 | use_markup: true,
87 | label:
88 | '' +
91 | this.metadata.url +
92 | '',
93 | hexpand: true,
94 | halign: Gtk.Align.CENTER,
95 | margin_bottom: grid.margin_bottom,
96 | });
97 | grid.attach(link_label, 1, ypos, 2, 1);
98 |
99 | ypos += 1;
100 |
101 | const term_app_descr = _(
102 | settings.settings_schema
103 | .get_key('terminal-application')
104 | .get_description()
105 | );
106 | const term_app_label = new Gtk.Label({
107 | label: _('Terminal Application:'),
108 | halign: Gtk.Align.START,
109 | });
110 | term_app_label.set_tooltip_text(term_app_descr);
111 |
112 | const term_app_control_image = new Gtk.Image();
113 | const term_app_control_label = new Gtk.Label();
114 | this._on_terminal_application_change(
115 | settings,
116 | term_app_control_label,
117 | term_app_control_image
118 | );
119 | const term_app_control_box = new Gtk.Box({
120 | orientation: Gtk.Orientation.HORIZONTAL,
121 | homogeneous: false,
122 | spacing: 10,
123 | });
124 | term_app_control_box.append(term_app_control_image);
125 | term_app_control_box.append(term_app_control_label);
126 | const term_app_control = new Gtk.Button({child: term_app_control_box});
127 | term_app_control.set_tooltip_text(term_app_descr);
128 | term_app_control.connect('clicked', () => {
129 | this._on_click_terminal_app(settings, grid);
130 | });
131 |
132 | grid.attach(term_app_label, 1, ypos, 1, 1);
133 | grid.attach(term_app_control, 2, ypos, 1, 1);
134 | settings.connect('changed::terminal-application', () => {
135 | this._on_terminal_application_change(
136 | settings,
137 | term_app_control_label,
138 | term_app_control_image
139 | );
140 | });
141 |
142 | ypos += 1;
143 |
144 | const term_app_args_descr = _(
145 | settings.settings_schema
146 | .get_key('terminal-application-arguments')
147 | .get_description()
148 | );
149 | const term_app_args_label = new Gtk.Label({
150 | label: _('Arguments:'),
151 | halign: Gtk.Align.START,
152 | });
153 | term_app_args_label.set_tooltip_text(term_app_args_descr);
154 | const term_app_args_control = new Gtk.Entry();
155 | term_app_args_control.set_tooltip_text(term_app_args_descr);
156 | grid.attach(term_app_args_label, 1, ypos, 1, 1);
157 | grid.attach(term_app_args_control, 2, ypos, 1, 1);
158 | settings.bind(
159 | 'terminal-application-arguments',
160 | term_app_args_control,
161 | 'text',
162 | Gio.SettingsBindFlags.DEFAULT
163 | );
164 |
165 | ypos += 1;
166 |
167 | const ssh_single_arg_descr = _(
168 | settings.settings_schema
169 | .get_key('ssh-command-single-argument')
170 | .get_description()
171 | );
172 | const ssh_single_arg_label = new Gtk.Label({
173 | label: _('Pass SSH command line as a single argument:'),
174 | halign: Gtk.Align.START,
175 | });
176 | ssh_single_arg_label.set_tooltip_text(ssh_single_arg_descr);
177 | const ssh_single_arg_control = new Gtk.Switch({halign: Gtk.Align.END});
178 | ssh_single_arg_control.set_tooltip_text(ssh_single_arg_descr);
179 | grid.attach(ssh_single_arg_label, 1, ypos, 1, 1);
180 | grid.attach(ssh_single_arg_control, 2, ypos, 1, 1);
181 | settings.bind(
182 | 'ssh-command-single-argument',
183 | ssh_single_arg_control,
184 | 'active',
185 | Gio.SettingsBindFlags.DEFAULT
186 | );
187 |
188 | ypos += 1;
189 |
190 | const debug_descr = _(
191 | settings.settings_schema.get_key('debug').get_description()
192 | );
193 | const debug_label = new Gtk.Label({
194 | label: _('Debug:'),
195 | halign: Gtk.Align.START,
196 | });
197 | debug_label.set_tooltip_text(debug_descr);
198 | const debug_control = new Gtk.Switch({halign: Gtk.Align.END});
199 | debug_control.set_tooltip_text(debug_descr);
200 | grid.attach(debug_label, 1, ypos, 1, 1);
201 | grid.attach(debug_control, 2, ypos, 1, 1);
202 | settings.bind(
203 | 'debug',
204 | debug_control,
205 | 'active',
206 | Gio.SettingsBindFlags.DEFAULT
207 | );
208 |
209 | ypos += 1;
210 |
211 | const copyright_label = new Gtk.Label({
212 | use_markup: true,
213 | label:
214 | '' +
215 | _(
216 | 'Copyright © 2017-2025 Philippe Troin (F-i-f on GitHub)'
217 | ) +
218 | '\n' +
219 | _('Copyright © 2013 Bernd Schlapsi') +
220 | '',
221 | hexpand: true,
222 | halign: Gtk.Align.CENTER,
223 | margin_top: grid.margin_top,
224 | });
225 | grid.attach(copyright_label, 1, ypos, 2, 1);
226 |
227 | ypos += 1;
228 |
229 | const group = new Adw.PreferencesGroup();
230 | group.add(grid);
231 | const page = new Adw.PreferencesPage();
232 | page.add(group);
233 |
234 | window.add(page);
235 | }
236 |
237 | _on_click_terminal_app(settings, grid) {
238 | const dialog = new Gtk.Dialog({
239 | title: _('Choose Terminal Emulator'),
240 | transient_for: grid.get_root(),
241 | use_header_bar: true,
242 | modal: true,
243 | });
244 | dialog.add_button(_('Cancel'), Gtk.ResponseType.CANCEL);
245 | dialog.add_button(_('Select'), Gtk.ResponseType.OK);
246 | dialog.set_default_response(Gtk.ResponseType.CANCEL);
247 |
248 | const chooser = new Gtk.AppChooserWidget({
249 | show_all: true,
250 | hexpand: true,
251 | vexpand: true,
252 | });
253 |
254 | chooser.connect('application-activated', (_w, _appInfo) => {
255 | dialog.response(Gtk.ResponseType.OK);
256 | });
257 | chooser.connect('application-selected', (_w, _appInfo) => {
258 | dialog.set_default_response(Gtk.ResponseType.OK);
259 | });
260 | dialog.get_content_area().append(chooser);
261 |
262 | dialog.connect('response', (dialog_p, id) => {
263 | if (id === Gtk.ResponseType.OK) {
264 | const chosen_app_id = chooser.get_app_info().get_id();
265 | settings.set_string('terminal-application', chosen_app_id);
266 | if (chosen_app_id in ArgumentsForTerminalApp) {
267 | settings.set_string(
268 | 'terminal-application-arguments',
269 | ArgumentsForTerminalApp[chosen_app_id].args
270 | );
271 | settings.set_boolean(
272 | 'ssh-command-single-argument',
273 | ArgumentsForTerminalApp[chosen_app_id].single
274 | );
275 | }
276 | }
277 |
278 | dialog_p.destroy();
279 | });
280 | dialog.show();
281 | }
282 |
283 | _on_terminal_application_change(
284 | settings,
285 | term_app_control_label,
286 | term_app_control_image
287 | ) {
288 | const app_desktop_file = settings.get_string('terminal-application');
289 | const app_info = Gio.DesktopAppInfo.new(app_desktop_file);
290 | if (app_info !== null) {
291 | term_app_control_label.label = app_info.get_display_name();
292 | term_app_control_image.gicon = app_info.get_icon();
293 | } else {
294 | term_app_control_label.label = app_desktop_file;
295 | term_app_control_image.gicon =
296 | Gio.icon_new_for_string('applications-other');
297 | }
298 | }
299 | }
300 |
--------------------------------------------------------------------------------