Initial commit

This commit is contained in:
2019-05-29 17:53:24 -04:00
parent 3a94884410
commit d07839b44b
8 changed files with 77 additions and 335 deletions

View File

@@ -1,9 +1,11 @@
# ulauncher-remmina # ulauncher-x2goclient
🖥 [Ulauncher](https://ulauncher.io) extension for quick access to [Remmina](https://remmina.org) profiles. 🖥 [Ulauncher](https://ulauncher.io) extension for quick access to [x2goclient](https://wiki.x2go.org/doku.php) sessions.
You can enter several queries to match strings in profiles' descriptions (e.g. `r ssh stan`) You can enter several queries to match strings in sessions' descriptions (e.g. `x ssh stan`)
Some icons from the [Numix project](https://github.com/numixproject) and [Remmina](https://github.com/FreeRDP/Remmina). Icons from the [Numix project](https://github.com/numixproject).
![ulauncher-remmina extension screenshot](screenshot.png) Adapted from [ulauncher-remmina](https://github.com/noam09/ulauncher-remmina) by noam09.
![ulauncher-x2goclient extension screenshot](screenshot.png)

View File

@@ -1,148 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="444.66092"
height="444.66092"
viewBox="0 0 117.64988 117.64986"
version="1.1"
id="svg8"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="icon_color.svg"
inkscape:export-filename="/home/anxhelo/works/Remmina/PNG/icon_color.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.52467208"
inkscape:cx="102.72298"
inkscape:cy="224.46532"
inkscape:document-units="px"
inkscape:current-layer="g875"
inkscape:document-rotation="0"
showgrid="false"
borderlayer="true"
inkscape:showpageshadow="true"
units="px"
inkscape:pagecheckerboard="false"
showguides="true"
inkscape:window-width="1366"
inkscape:window-height="715"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
objecttolerance="10"
guidetolerance="10"
inkscape:snap-tangential="true"
inkscape:snap-perpendicular="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="xygrid"
id="grid10"
dotted="false"
originx="-75.247744"
originy="-8.9404304" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-75.247731,-170.4097)">
<g
id="g875"
transform="matrix(0.64508605,0,0,0.64508605,73.187616,170.4097)">
<g
id="g1019"
transform="matrix(2.3733304,0,0,2.3733304,3.19355,0)">
<g
id="g863">
<g
id="g855">
<polygon
style="fill:#20aa73"
class="st1"
points="20.618,17.742 20.618,26.923 29.549,32.877 20.618,38.831 20.618,48.012 43.32,32.877 "
id="polygon853" />
</g>
<g
id="g861">
<g
id="g859">
<polygon
style="fill:#4a93dd"
class="st2"
points="55.388,59.232 55.388,50.051 46.457,44.097 55.388,38.143 55.388,28.962 32.685,44.097 "
id="polygon857" />
</g>
</g>
</g>
<g
id="g873">
<g
id="g867">
<path
style="fill:#20aa73"
inkscape:connector-curvature="0"
class="st1"
d="m 64.776,23.074 c 2.632,4.509 4.147,9.75 4.147,15.348 0,16.845 -13.656,30.5 -30.5,30.5 -9.922,0 -18.734,-4.741 -24.304,-12.077 L 7.53,61.238 c 7.005,9.461 18.243,15.607 30.892,15.607 21.186,0 38.423,-17.236 38.423,-38.423 0,-7.215 -2.002,-13.97 -5.476,-19.744 z"
id="path865" />
</g>
<g
id="g871">
<path
style="fill:#4a93dd"
inkscape:connector-curvature="0"
class="st2"
d="m 7.922,38.423 c 0,-16.845 13.656,-30.5 30.5,-30.5 9.826,0 18.561,4.652 24.139,11.868 l 6.596,-4.397 C 62.142,6.053 50.976,0 38.423,0 17.236,0 0,17.236 0,38.423 0,45.543 1.954,52.212 5.343,57.936 L 11.937,53.54 C 9.387,49.083 7.922,43.925 7.922,38.423 Z"
id="path869" />
</g>
</g>
</g>
</g>
</g>
<style
id="style835"
type="text/css">
.st0{fill:#333333;}
.st1{fill:#20AA73;}
.st2{fill:#4A93DD;}
</style>
<style
id="style905"
type="text/css">
.st0{fill:#333333;}
.st1{fill:#20AA73;}
.st2{fill:#4A93DD;}
</style>
</svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,41 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
<defs>
<linearGradient id="linearGradient3764" x1="1" x2="47" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0,-1,1,0,-1.5e-6,47.999998)">
<stop style="stop-color:#e4e4e4;stop-opacity:1"/>
<stop offset="1" style="stop-color:#eee;stop-opacity:1"/>
</linearGradient>
</defs>
<g>
<path d="m 36.31 5 c 5.859 4.062 9.688 10.831 9.688 18.5 c 0 12.426 -10.07 22.5 -22.5 22.5 c -7.669 0 -14.438 -3.828 -18.5 -9.688 c 1.037 1.822 2.306 3.499 3.781 4.969 c 4.085 3.712 9.514 5.969 15.469 5.969 c 12.703 0 23 -10.298 23 -23 c 0 -5.954 -2.256 -11.384 -5.969 -15.469 c -1.469 -1.475 -3.147 -2.744 -4.969 -3.781 z m 4.969 3.781 c 3.854 4.113 6.219 9.637 6.219 15.719 c 0 12.703 -10.297 23 -23 23 c -6.081 0 -11.606 -2.364 -15.719 -6.219 c 4.16 4.144 9.883 6.719 16.219 6.719 c 12.703 0 23 -10.298 23 -23 c 0 -6.335 -2.575 -12.06 -6.719 -16.219 z" style="opacity:0.05"/>
<path d="m 41.28 8.781 c 3.712 4.085 5.969 9.514 5.969 15.469 c 0 12.703 -10.297 23 -23 23 c -5.954 0 -11.384 -2.256 -15.469 -5.969 c 4.113 3.854 9.637 6.219 15.719 6.219 c 12.703 0 23 -10.298 23 -23 c 0 -6.081 -2.364 -11.606 -6.219 -15.719 z" style="opacity:0.1"/>
<path d="m 31.25 2.375 c 8.615 3.154 14.75 11.417 14.75 21.13 c 0 12.426 -10.07 22.5 -22.5 22.5 c -9.708 0 -17.971 -6.135 -21.12 -14.75 a 23 23 0 0 0 44.875 -7 a 23 23 0 0 0 -16 -21.875 z" style="opacity:0.2"/>
</g>
<g>
<path d="m 24 1 c 12.703 0 23 10.297 23 23 c 0 12.703 -10.297 23 -23 23 -12.703 0 -23 -10.297 -23 -23 0 -12.703 10.297 -23 23 -23 z" style="fill:url(#linearGradient3764);fill-opacity:1"/>
</g>
<g>
<g>
<g transform="translate(1,1)">
<g style="opacity:0.1">
<!-- color: #eeeeee -->
<g>
<path d="m 11.531 13 c -0.297 0.031 -0.531 0.297 -0.531 0.594 l 0 10.816 c 0 0.316 0.277 0.594 0.594 0.594 l 5.406 0 l 0 2 l -4 0 l 0 2 l 7.281 0 l 0 -6 l -6.84 0 c -0.211 0 -0.41 -0.195 -0.41 -0.41 l 0 -7.184 c -0.004 -0.188 0.129 -0.371 0.313 -0.406 c 0.023 -0.004 0.066 -0.004 0.094 0 l 11.125 0 c 0.207 0 0.406 0.191 0.406 0.406 l 0 2.875 l 2.031 0 l 0 -4.691 c 0 -0.313 -0.281 -0.594 -0.594 -0.594 m -14.875 0" style="fill:#000;fill-opacity:1;stroke:none;fill-rule:nonzero"/>
<path d="m 21.535 19 c -0.293 0.031 -0.539 0.305 -0.539 0.598 l 0 10.809 c 0 0.313 0.289 0.598 0.602 0.598 l 5.398 0 l 0 2.992 l 4 0 l 0 -2.992 l 5.402 0 c 0.313 0 0.598 -0.285 0.598 -0.598 l 0 -10.809 c 0 -0.316 -0.289 -0.598 -0.598 -0.598 m -13.05 2 c 0.023 -0.004 0.047 -0.004 0.074 0 l 11.145 0 c 0.211 0 0.402 0.191 0.402 0.402 l 0 7.203 c 0 0.207 -0.191 0.398 -0.402 0.398 l -11.145 0 c -0.211 0 -0.402 -0.191 -0.402 -0.398 l 0 -7.203 c -0.004 -0.188 0.145 -0.367 0.328 -0.402 m -0.352 12 l 0 2 l 12 0 l 0 -2 m -12 0" style="fill:#000;fill-opacity:1;stroke:none;fill-rule:nonzero"/>
</g>
</g>
</g>
</g>
</g>
<g>
<g>
<!-- color: #eeeeee -->
<g>
<path d="m 11.531 13 c -0.297 0.031 -0.531 0.297 -0.531 0.594 l 0 10.816 c 0 0.316 0.277 0.594 0.594 0.594 l 5.406 0 l 0 2 l -4 0 l 0 2 l 7.281 0 l 0 -6 l -6.84 0 c -0.211 0 -0.41 -0.195 -0.41 -0.41 l 0 -7.184 c -0.004 -0.188 0.129 -0.371 0.313 -0.406 c 0.023 -0.004 0.066 -0.004 0.094 0 l 11.125 0 c 0.207 0 0.406 0.191 0.406 0.406 l 0 2.875 l 2.031 0 l 0 -4.691 c 0 -0.313 -0.281 -0.594 -0.594 -0.594 m -14.875 0" style="fill:#c0274b;fill-opacity:1;stroke:none;fill-rule:nonzero"/>
<path d="m 21.535 19 c -0.293 0.031 -0.539 0.305 -0.539 0.598 l 0 10.809 c 0 0.313 0.289 0.598 0.602 0.598 l 5.398 0 l 0 2.992 l 4 0 l 0 -2.992 l 5.402 0 c 0.313 0 0.598 -0.285 0.598 -0.598 l 0 -10.809 c 0 -0.316 -0.289 -0.598 -0.598 -0.598 m -13.05 2 c 0.023 -0.004 0.047 -0.004 0.074 0 l 11.145 0 c 0.211 0 0.402 0.191 0.402 0.402 l 0 7.203 c 0 0.207 -0.191 0.398 -0.402 0.398 l -11.145 0 c -0.211 0 -0.402 -0.191 -0.402 -0.398 l 0 -7.203 c -0.004 -0.188 0.145 -0.367 0.328 -0.402 m -0.352 12 l 0 2 l 12 0 l 0 -2 m -12 0" style="fill:#283751;fill-opacity:1;stroke:none;fill-rule:nonzero"/>
</g>
</g>
</g>
<g>
<path d="m 40.03 7.531 c 3.712 4.084 5.969 9.514 5.969 15.469 0 12.703 -10.297 23 -23 23 c -5.954 0 -11.384 -2.256 -15.469 -5.969 4.178 4.291 10.01 6.969 16.469 6.969 c 12.703 0 23 -10.298 23 -23 0 -6.462 -2.677 -12.291 -6.969 -16.469 z" style="opacity:0.1"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 48 48" width="48" height="48"><defs><clipPath id="_clipPath_arE3vWAN7RkXd8FTLNLuqo1WJ5r2YolW"><rect width="48" height="48"/></clipPath></defs><g clip-path="url(#_clipPath_arE3vWAN7RkXd8FTLNLuqo1WJ5r2YolW)"><path d=" M 0.606 24 C 0.606 11.089 11.089 0.606 24 0.606 C 36.911 0.606 47.394 11.089 47.394 24 C 47.394 36.911 36.911 47.394 24 47.394 C 11.089 47.394 0.606 36.911 0.606 24 Z " fill="rgb(46,46,46)"/><path d=" M 0 24 C -0.001 22.377 0.162 20.758 0.488 19.166 C 0.805 17.622 1.273 16.113 1.887 14.662 C 3.096 11.811 4.842 9.221 7.033 7.033 C 9.221 4.842 11.811 3.096 14.662 1.887 C 16.113 1.273 17.622 0.805 19.166 0.488 C 20.756 0.162 22.377 -0.001 24 0 C 25.623 -0.001 27.244 0.162 28.834 0.488 C 30.378 0.805 31.887 1.273 33.338 1.887 C 36.189 3.096 38.779 4.842 40.967 7.033 C 43.158 9.221 44.904 11.811 46.113 14.662 C 46.727 16.113 47.195 17.622 47.512 19.166 C 47.838 20.756 48.001 22.377 48 24 C 48.001 25.623 47.838 27.244 47.512 28.834 C 47.195 30.378 46.727 31.887 46.113 33.338 C 44.904 36.189 43.158 38.779 40.967 40.967 C 38.779 43.158 36.189 44.904 33.338 46.113 C 31.887 46.727 30.378 47.195 28.834 47.512 C 27.244 47.838 25.623 48.001 24 48 C 22.377 48.001 20.756 47.838 19.166 47.512 C 17.622 47.195 16.113 46.727 14.662 46.113 C 11.811 44.904 9.221 43.158 7.033 40.967 C 4.842 38.779 3.096 36.189 1.887 33.338 C 1.273 31.887 0.805 30.378 0.488 28.834 C 0.162 27.244 -0.001 25.623 0 24 Z M 1.212 24 C 1.211 22.458 1.367 20.92 1.675 19.41 C 1.976 17.944 2.421 16.512 3.004 15.135 C 4.152 12.428 5.81 9.967 7.89 7.89 C 9.967 5.81 12.428 4.152 15.135 3.004 C 16.512 2.421 17.944 1.976 19.41 1.675 C 20.92 1.367 22.458 1.211 24 1.212 C 25.542 1.211 27.08 1.367 28.59 1.675 C 30.056 1.976 31.488 2.421 32.865 3.004 C 35.572 4.152 38.033 5.81 40.11 7.89 C 42.19 9.967 43.848 12.428 44.996 15.135 C 45.579 16.512 46.024 17.944 46.325 19.41 C 46.633 20.92 46.789 22.458 46.788 24 C 46.789 25.542 46.633 27.08 46.325 28.59 C 46.024 30.056 45.579 31.488 44.996 32.865 C 43.848 35.572 42.19 38.033 40.11 40.11 C 38.033 42.19 35.572 43.848 32.865 44.996 C 31.488 45.579 30.056 46.024 28.59 46.325 C 27.08 46.633 25.542 46.789 24 46.788 C 22.458 46.789 20.92 46.633 19.41 46.325 C 17.944 46.024 16.512 45.579 15.135 44.996 C 12.428 43.848 9.967 42.19 7.89 40.11 C 5.81 38.033 4.152 35.572 3.004 32.865 C 2.421 31.488 1.976 30.056 1.675 28.59 C 1.367 27.08 1.211 25.542 1.212 24 Z " fill-rule="evenodd" fill="rgb(111,111,111)"/><path d=" M 18.735 21.13 L 10.579 18.444 L 10.579 14.622 L 23.367 19.823 L 23.367 23.048 L 10.579 28.263 L 10.579 24.426 L 18.721 21.698 L 19.588 21.414 L 18.735 21.13 Z M 37.421 30.295 L 37.421 33.378 L 24.462 33.378 L 24.462 30.295 L 37.421 30.295 Z " fill-rule="evenodd" fill="rgb(232,232,232)"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,23 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
<defs>
<linearGradient id="linearGradient3764-6" x1="1" x2="47" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0,-1,1,0,-2e-6,47.999999)">
<stop style="stop-color:#e4e4e4;stop-opacity:1"/>
<stop offset="1" style="stop-color:#eee;stop-opacity:1"/>
</linearGradient>
</defs>
<g>
<path d="m 36.31,5 c 5.859,4.062 9.688,10.831 9.688,18.5 0,12.426 -10.07,22.5 -22.5,22.5 -7.669,0 -14.438,-3.828 -18.5,-9.688 1.037,1.822 2.306,3.499 3.781,4.969 4.085,3.712 9.514,5.969 15.469,5.969 12.703,0 23,-10.298 23,-23 0,-5.954 -2.256,-11.384 -5.969,-15.469 C 39.81,7.306 38.132,6.037 36.31,5 Z m 4.969,3.781 c 3.854,4.113 6.219,9.637 6.219,15.719 0,12.703 -10.297,23 -23,23 -6.081,0 -11.606,-2.364 -15.719,-6.219 4.16,4.144 9.883,6.719 16.219,6.719 12.703,0 23,-10.298 23,-23 0,-6.335 -2.575,-12.06 -6.719,-16.219 z" style="opacity:0.05"/>
<path d="m 41.28 8.781 c 3.712 4.085 5.969 9.514 5.969 15.469 0 12.703 -10.297 23 -23 23 -5.954 0 -11.384 -2.256 -15.469 -5.969 4.113 3.854 9.637 6.219 15.719 6.219 12.703 0 23 -10.298 23 -23 0 -6.081 -2.364 -11.606 -6.219 -15.719 z" style="opacity:0.1"/>
<path d="M 31.25,2.375 C 39.865,5.529 46,13.792 46,23.505 c 0,12.426 -10.07,22.5 -22.5,22.5 -9.708,0 -17.971,-6.135 -21.12,-14.75 a 23,23 0 0 0 44.875,-7 23,23 0 0 0 -16,-21.875 z" style="opacity:0.2"/>
</g>
<g>
<path d="M 24,1 C 36.703,1 47,11.297 47,24 47,36.703 36.703,47 24,47 11.297,47 1,36.703 1,24 1,11.297 11.297,1 24,1 Z" style="fill:url(#linearGradient3764-6);fill-opacity:1"/>
</g>
<g>
<path d="m 40.03,7.531 c 3.712,4.084 5.969,9.514 5.969,15.469 0,12.703 -10.297,23 -23,23 C 17.045,46 11.615,43.744 7.53,40.031 11.708,44.322 17.54,47 23.999,47 c 12.703,0 23,-10.298 23,-23 0,-6.462 -2.677,-12.291 -6.969,-16.469 z" style="opacity:0.1"/>
</g>
<path d="m 10.01 15 l 7.05 20.639 c 0.288 0.85 0.94 1.366 1.811 1.359 c 0.865 -0.005 1.498 -0.515 1.781 -1.359 l 7.02 -20.639 l -3.779 0 l -5.04 15.68 l -5.117 -15.68 l -3.729 0 z m 22.99 0 c -2.77 0 -5 2.23 -5 5 l 0 5 l 3 0 l 0 -5 c 0 -1.108 0.892 -2 2 -2 c 1.108 0 2 0.892 2 2 l 0 5 l 3 0 l 0 -5 c 0 -2.77 -2.23 -5 -5 -5 z m 0 12 c -2.77 0 -5 2.23 -5 5 c 0 2.77 2.23 5 5 5 l 5 0 l 0 -3 l -5 0 c -1.108 0 -2 -0.892 -2 -2 c 0 -1.108 0.892 -2 2 -2 l 5 0 l 0 -3 l -5 0 z" style="fill:#000;opacity:0.1;fill-opacity:1;stroke:none;fill-rule:evenodd"/>
<path d="m 9 14 3.738 0 5.117 15.679 5.04 -15.679 3.778 0 -7.02 20.638 c -0.283 0.844 -0.917 1.356 -1.782 1.361 -0.871 0.007 -1.523 -0.511 -1.811 -1.361 l -7.05 -20.638" style="fill:#f13e3e;fill-opacity:1;stroke:none;fill-rule:evenodd"/>
<path d="m 32 14 c -2.77 0 -5 2.23 -5 5 l 0 5 3 0 0 -5 c 0 -1.108 0.892 -2 2 -2 1.108 0 2 0.892 2 2 l 0 5 3 0 0 -5 c 0 -2.77 -2.23 -5 -5 -5 z" style="fill:#49d74a;opacity:1;fill-opacity:1;stroke:none"/>
<path d="m 27 31 c 0 2.77 2.23 5 5 5 l 5 0 0 -3 -5 0 c -1.108 0 -2 -0.892 -2 -2 0 -1.108 0.892 -2 2 -2 l 5 0 0 -3 -5 0 c -2.77 0 -5 2.23 -5 5 z" style="fill:#4747d8;opacity:1;fill-opacity:1;stroke:none"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

16
images/x2goclient.svg Normal file
View File

@@ -0,0 +1,16 @@
<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="bg" x2="0" y1="1" y2="47" gradientUnits="userSpaceOnUse">
<stop style="stop-color:#99c1fb" offset="0"/>
<stop style="stop-color:#85b5fa" offset="1"/>
</linearGradient>
</defs>
<path d="m36.31 5c5.859 4.062 9.688 10.831 9.688 18.5 0 12.426-10.07 22.5-22.5 22.5-7.669 0-14.438-3.828-18.5-9.688 1.037 1.822 2.306 3.499 3.781 4.969 4.085 3.712 9.514 5.969 15.469 5.969 12.703 0 23-10.298 23-23 0-5.954-2.256-11.384-5.969-15.469-1.469-1.475-3.147-2.744-4.969-3.781zm4.969 3.781c3.854 4.113 6.219 9.637 6.219 15.719 0 12.703-10.297 23-23 23-6.081 0-11.606-2.364-15.719-6.219 4.16 4.144 9.883 6.719 16.219 6.719 12.703 0 23-10.298 23-23 0-6.335-2.575-12.06-6.719-16.219z" style="opacity:.05"/>
<path d="m41.28 8.781c3.712 4.085 5.969 9.514 5.969 15.469 0 12.703-10.297 23-23 23-5.954 0-11.384-2.256-15.469-5.969 4.113 3.854 9.637 6.219 15.719 6.219 12.703 0 23-10.298 23-23 0-6.081-2.364-11.606-6.219-15.719z" style="opacity:.1"/>
<path d="m31.25 2.375c8.615 3.154 14.75 11.417 14.75 21.13 0 12.426-10.07 22.5-22.5 22.5-9.708 0-17.971-6.135-21.12-14.75a23 23 0 0 0 44.875-7 23 23 0 0 0-16-21.875z" style="opacity:.2"/>
<circle cx="24" cy="24" r="23" style="fill:url(#bg)"/>
<path d="m13 15v2h9v-2zm11 0v1h1.5l4 9-4.5 9h-1v1h4v-1h-1.5l3.6992-7.4004 3.3008 7.4004h-1.5v1h5v-1h-1l-4.4004-10 3.9004-8h1.5v-1h-5v1h2l-3.1758 6.3535-2.8242-6.3535h2v-1zm-11 3v2h12.09l-0.88867-2h-2.2012zm0 3v2h13.424l-0.88867-2zm0 3v2h13.764l0.52539-1.0508-0.42187-0.94922zm0 3v2h12.264l1-2zm0 3v2h10.764l1-2zm0 3v2h9v-2z" style="opacity:.1;paint-order:normal"/>
<path d="m40.03 7.531c3.712 4.084 5.969 9.514 5.969 15.469 0 12.703-10.297 23-23 23-5.954 0-11.384-2.256-15.469-5.969 4.178 4.291 10.01 6.969 16.469 6.969 12.703 0 23-10.298 23-23 0-6.462-2.677-12.291-6.969-16.469z" style="opacity:.1"/>
<path d="m23 14v1h1.5l4 9-4.5 9h-1v1h4v-1h-1.5l3.7-7.3998 3.3 7.3998h-1.5v1h5v-1h-1l-4.4-9.9998 3.9-8.0002h1.5v-1h-5v1h2l-3.1758 6.3535-2.8242-6.3535h2v-1z" style="fill:#484848;paint-order:normal"/>
<path d="m12 14v2h9v-2h-9zm0 3v2h12.09l-0.88867-2h-2.2012-9zm0 3v2h13.424l-0.88867-2h-12.535zm0 3v2h13.764l0.52539-1.0508-0.42187-0.94922h-13.867zm0 3v2h12.264l1-2h-13.264zm0 3v2h9 1.7637l1-2h-11.764zm0 3v2h9v-2h-9z" style="fill:#484848;paint-order:normal"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

151
main.py
View File

@@ -27,77 +27,69 @@ if os.path.exists(usage_db):
# JSON to dict # JSON to dict
usage_cache = json.loads(raw) usage_cache = json.loads(raw)
# Initialize items cache and Remmina profiles path # Initialize items cache and x2goclient sessions file path
remmina_bin = "" x2goclient_bin = ""
# Locate Remmina profiles and binary # Locate x2goclient profiles and binary
default_paths = ["{}/.local/share/remmina".format(os.environ.get('HOME')), x2go_sessions_path = ["{}/.x2goclient/sessions".format(os.environ.get('HOME'))]
"{}/.remmina".format(os.environ.get('HOME'))] x2goclient_bin = distutils.spawn.find_executable('x2goclient')
# remmina_profiles_path = "{}/.local/share/remmina".format(os.environ.get('HOME')) # This extension is useless without x2goclient
# remmina_profiles_path_alt = "{}/.remmina".format(os.environ.get('HOME')) if x2goclient_bin is None or x2goclient_bin == "":
remmina_bin = distutils.spawn.find_executable('remmina') logger.error("x2goclient executable path could not be determined")
# This extension is useless without remmina
if remmina_bin is None or remmina_bin == "":
logger.error("Remmina executable path could not be determined")
exit() exit()
# Check if Remmina profiles directory exists # Check if x2goclient sessions file exists
remmina_profiles_path = None x2go_sessions_path_exists = None
# Check default paths first # Check default paths first
for p in default_paths: if os.path.isfile(x2go_sessions_path):
if os.path.isdir(p): x2go_sessions_path_exists = True
remmina_profiles_path = p
class RemminaExtension(Extension): class x2goclientExtension(Extension):
def __init__(self): def __init__(self):
super(RemminaExtension, self).__init__() super(x2goclientExtension, self).__init__()
self.subscribe(KeywordQueryEvent, KeywordQueryEventListener()) self.subscribe(KeywordQueryEvent, KeywordQueryEventListener())
self.subscribe(ItemEnterEvent, ItemEnterEventListener()) self.subscribe(ItemEnterEvent, ItemEnterEventListener())
def list_profiles(self, query): def list_sessions(self, query):
profiles = [] items = []
items_cache = [] with open('/home/bryan/.x2goclient/sessions') as lines:
try: for line in lines:
# Get list of profile files from Remmina directory if line.startswith('host=') or line.startswith('name='):
for profile in os.listdir(remmina_profiles_path): line = line.rstrip()
if profile.endswith(".remmina"): line = line.split('=',1)
profiles.append(os.path.join(remmina_profiles_path, profile)) item = line[1]
# Get sorted list of profiles items.append(item)
temp = profiles it_items = iter(items)
profiles = sorted(temp) sessions = list(zip(it_items, it_items))
except Exception as e: for session in sessions:
logger.error("Failed getting Remmina profile files") host = session[0]
for p in profiles: name = session[1]
base = os.path.basename(p)
title, desc, proto = profile_details(p)
# Search for query inside filename and profile description # Search for query inside filename and profile description
# Multiple strings can be used to search in description # Multiple strings can be used to search in description
# all() is used to achieve a AND search (include all keywords) # all() is used to achieve a AND search (include all keywords)
keywords = query.split(" ") keywords = query.split(" ")
# if (query in base.lower()) or (query in desc.lower()): # if (query in base.lower()) or (query in desc.lower()):
if (query.lower() in base.lower()) or \ if (query.lower() in host.lower()) or (query.lower() in name.lower()):
(query.lower() in title.lower()) or \ items_cache.append(create_item(host, name))
all(x.lower() in desc.lower() for x in keywords):
items_cache.append(create_item(title, proto, p, desc, p))
items_cache = sorted(items_cache, key=sort_by_usage, reverse=True) items_cache = sorted(items_cache, key=sort_by_usage, reverse=True)
return items_cache return items_cache
class KeywordQueryEventListener(EventListener): class KeywordQueryEventListener(EventListener):
def on_event(self, event, extension): def on_event(self, event, extension):
global remmina_profiles_path global x2go_sessions_path
if extension.preferences["profiles"] is not "" \ if extension.preferences["sessions"] is not "" or not x2go_sessions_path:
or not remmina_profiles_path:
# Tilde (~) won't work alone, need expanduser() # Tilde (~) won't work alone, need expanduser()
remmina_profiles_path = os.path.expanduser(extension.preferences["profiles"]) x2go_sessions_path = os.path.expanduser(extension.preferences["sessions"])
# pref_profiles_path = extension.preferences['profiles'] # pref_sessions_path = extension.preferences['sessions']
logger.debug("Remmina profiles path: {}".format(remmina_profiles_path)) logger.debug("x2goclient sessions path: {}".format(x2go_sessions_path))
# Get query # Get query
term = (event.get_argument() or "").lower() term = (event.get_argument() or "").lower()
# Display all items when query empty # Display all items when query empty
profiles_list = extension.list_profiles(term) sessions_list = extension.list_sessions(term)
return RenderResultListAction(profiles_list[:8]) return RenderResultListAction(sessions_list[:8])
class ItemEnterEventListener(EventListener): class ItemEnterEventListener(EventListener):
@@ -117,16 +109,16 @@ class ItemEnterEventListener(EventListener):
# Update usage JSON # Update usage JSON
with open(usage_db, 'w') as db: with open(usage_db, 'w') as db:
db.write(json.dumps(usage_cache, indent=2)) db.write(json.dumps(usage_cache, indent=2))
return RunScriptAction('#!/usr/bin/env bash\n{} -c {}\n'.format(remmina_bin, on_enter), None).run() return RunScriptAction('#!/usr/bin/env bash\n{} --session {}\n'.format(x2goclient_bin, on_enter), None).run()
def create_item(name, icon, keyword, description, on_enter): def create_item(host, name):
return ExtensionResultItem( return ExtensionResultItem(
name=name, name=name,
description=description, description=host,
icon="images/{}.svg".format(icon), icon="images/x2goclient.svg",
on_enter=ExtensionCustomAction( on_enter=ExtensionCustomAction(
{"id": on_enter}) {"id": name})
) )
@@ -141,61 +133,6 @@ def sort_by_usage(i):
return 0 return 0
def profile_details(profile_path):
if os.path.isfile(profile_path):
with open(profile_path, "r") as f:
# Read profile file lines
lines = f.read().split("\n")
# Initialize strings
desc = name = username = group = proto = ""
# Parse lines for relevant details
for line in lines:
# Profile name
if line.startswith("name="):
elem = line.split("name=")
if len(elem[1]) > 0:
name = elem[1]
# Profile username (optional)
if "username=" in line:
elem = line.split("username=")
# if len(elem) > 1:
if len(elem[0]) == 0 and len(elem[1]) > 0:
username = elem[1]
elif len(elem[0]) > 0 and len(elem[1]) > 0:
username = elem[1]
# Profile server and port
if line.startswith("server="):
elem = line.split("server=")
if len(elem[1]) > 0:
server = elem[1]
# Profile group name
if line.startswith("group="):
elem = line.split("group=")
if len(elem[1]) > 0:
group = elem[1]
# Profile protocol (for different icons)
if line.startswith("protocol="):
elem = line.split("protocol=")
if len(elem[1]) > 0:
proto = elem[1].strip().lower()
else:
pass
if len(username) > 0:
server = "{username}@{server}".format(username=username,
server=server)
if len(proto) > 0:
server = "{proto}://{server}".format(proto=proto,
server=server)
if len(group) > 0:
group = " | {group}".format(group=group)
# Final description string
desc = "{server} {group}".format(server=server,
group=group)
return name, desc, proto
else:
# Default values
return "", "", "rdp"
if __name__ == "__main__": if __name__ == "__main__":
RemminaExtension().run() x2goclientExtension().run()

View File

@@ -1,25 +1,25 @@
{ {
"required_api_version": "^2.0.0", "required_api_version": "^2.0.0",
"name": "Remmina", "name": "x2goclient",
"description": "Quick access to Remmina profiles", "description": "Quick access to x2goclient sessions",
"developer_name": "noam09", "developer_name": "cryobry",
"icon": "images/icon.svg", "icon": "images/icon.svg",
"options": { "options": {
"query_debounce": 0.1 "query_debounce": 0.1
}, },
"preferences": [ "preferences": [
{ {
"id": "remmina", "id": "x2goclient",
"type": "keyword", "type": "keyword",
"name": "Remmina", "name": "x2goclient",
"description": "Quick access to Remmina profiles", "description": "Quick access to x2goclient sessions",
"default_value": "r" "default_value": "x"
}, },
{ {
"id": "profiles", "id": "sessions",
"type": "input", "type": "input",
"name": "Remmina Profiles Directory", "name": "x2goclient sessions file",
"description": "Where Remmina stores profile configuration files <br /><code>~/.local/share/remmina</code> and <code>~/.remmina</code> are checked by default", "description": "Where x2goclient stores its profile configuration file <br /><code>~/.x2goclient/sessions</code> is checked by default",
"default_value": "" "default_value": ""
} }
] ]