Commit e4e55c75 authored by Danial Behzadi's avatar Danial Behzadi
Browse files

add desktop support

parent c47878b4
......@@ -10,7 +10,7 @@ In Debian based distros, make sure that you have `software-properties-common` pa
If you are using a distro other than Ubuntu, please check if the release name in the relevant file located in `/etc/apt/sources.list.d/` is a supported one (e.g. bionic).
If your distro is not Debian based or you don't want to use PPA, just copy `carburetor` file to `/usr/bin/` directory, but note that you will miss the updates to it. However you are welcome in contributing package build recepie of your distro to carburetor.
If your distro is not Debian based or you don't want to use PPA, just copy `carburetor` file to `/usr/bin/` directory, but note that you will miss the updates and many desktop features. However you are welcome in contributing package build recepie of your distro to carburetor.
## Run
you can run `carburetor` by command line for now, but a `.desktop` file is on the way for launching it through desktop environment.
you can run `carburetor` by command line or through your desktop environment.
......@@ -8,7 +8,8 @@ from gi.repository import Gio, Gtk, GLib
import notify2
import os
import re
from subprocess import PIPE, Popen
from subprocess import PIPE, Popen, call
import time
command = "tractor "
dconf = Gio.Settings.new("org.tractor")
......@@ -61,11 +62,25 @@ class StartButton(ToolButton):
def on_start_clicked(self, button):
if self.is_running():
stop = Popen(command + "stop", stdout=PIPE, shell=True)
stop.wait()
#task = asyncio.create_subprocess_shell(command + "stop", stdout=PIPE)
task = Popen(command + "stop", stdout=PIPE, shell=True)
#stop.wait()
else:
start = Popen(command + "start", stdout=PIPE, shell=True)
start.wait()
task = Popen(command + "start", stdout=PIPE, shell=True)
#start.wait()
#task = asyncio.create_subprocess_shell(command + "start", stdout=PIPE)
#task.send(None)
#print(task.wait())
#result = asyncio.wait(task)
#print(result)
while task.returncode != 0:
now = time.time()
while time.time() - now < 0.5:
try:
task.communicate()
except:
pass
Gtk.main_iteration_do(False)
self.update_label()
class SetButton(ToolButton):
......
carburetor (2.2-1) bionic; urgency=medium
* Add desktop entry
-- Danial Behzadi <dani.behzi@ubuntu.com> Sat, 04 Aug 2018 15:25:00 +0430
carburetor (2.1-1) bionic; urgency=medium
* Add exit node selection
......
carburetor usr/bin
desktop/carburetor.desktop /usr/share/applications
desktop/carburetor.svg /usr/share/icons/hicolor/scalable/apps
[Desktop Entry]
Version=1.1
Name=Carburetor
Name[fa]=کاربراتور
Comment=Settings for Tractor
Comment[fa]=تنظیمات تراکتور
Exec=carburetor
Terminal=false
Type=Application
Icon=carburetor
Actions=new-id;
Keywords=Tor;Tractor;Carburetor
Categories=Network;
[Desktop Action new-id]
Name=New ID
Name[fa]=شناسهٔ جدید
Exec=tractor newid
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<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"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="512px"
height="512px"
viewBox="0 0 569.613 569.614"
style="enable-background:new 0 0 569.613 569.614;"
xml:space="preserve"
sodipodi:docname="gear-outline.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)"><metadata
id="metadata45"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs43">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1533"
inkscape:window-height="873"
id="namedview41"
showgrid="false"
inkscape:zoom="0.65186406"
inkscape:cx="46.989964"
inkscape:cy="247.68881"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<path
style="fill:#7d4698;fill-opacity:1;stroke-width:0.99999994"
d="M 322.4043 2.0800781 C 321.73292 2.0596675 321.05928 2.0715285 320.38672 2.1171875 C 319.04158 2.2085055 317.7 2.4334963 316.37891 2.7910156 C 315.05939 3.1501079 313.78801 3.6364563 312.58203 4.2382812 C 311.37605 4.8401063 310.23515 5.5561307 309.17383 6.3769531 C 308.11251 7.1977756 307.13163 8.1225873 306.24609 9.1386719 C 305.36055 10.154756 304.56926 11.261607 303.89062 12.449219 L 276.54688 60.222656 C 273.00404 59.849182 269.45459 59.571899 265.90234 59.390625 C 262.3501 59.209351 258.79547 59.123923 255.24219 59.134766 C 251.6889 59.145608 248.1358 59.254157 244.58984 59.457031 C 241.04389 59.659905 237.50486 59.958694 233.97461 60.353516 L 206.29297 12.810547 C 205.60467 11.627879 204.80582 10.525291 203.91211 9.515625 C 203.0184 8.5059588 202.03062 7.5885167 200.96289 6.7753906 C 199.89516 5.9622646 198.74744 5.2532035 197.53711 4.6601562 C 196.32677 4.0671091 195.05201 3.5916171 193.73047 3.2421875 C 192.40825 2.8936567 191.06618 2.6793115 189.7207 2.5976562 C 188.37523 2.5160011 187.02712 2.5659858 185.69727 2.7460938 C 184.36741 2.9262016 183.05466 3.2351161 181.7793 3.671875 C 180.50393 4.1086339 179.26598 4.6730305 178.08398 5.3613281 L 76.464844 64.558594 C 75.234649 65.27543 74.105792 66.100322 73.083984 67.013672 C 72.062177 67.927022 71.147185 68.927941 70.34375 70 C 69.540315 71.072059 68.848514 72.215239 68.273438 73.408203 C 67.69836 74.601167 67.239077 75.84503 66.902344 77.121094 C 66.56561 78.397158 66.350122 79.704031 66.261719 81.025391 C 66.173315 82.34675 66.212902 83.682868 66.382812 85.011719 C 66.552724 86.34057 66.854756 87.6624 67.292969 88.960938 C 67.731181 90.259474 68.304985 91.533253 69.021484 92.763672 L 96.675781 140.25195 C 94.536059 143.16604 92.501484 146.10363 90.564453 149.08008 C 88.627422 152.05652 86.786263 155.07223 85.03125 158.13867 C 83.276686 161.20556 81.611082 164.31797 80.025391 167.49609 C 78.439699 170.67422 76.934433 173.91838 75.503906 177.24414 L 20.548828 177.45508 C 19.124818 177.46058 17.736215 177.60874 16.394531 177.88867 C 15.052847 178.16861 13.759181 178.57887 12.527344 179.10547 C 11.295506 179.63207 10.123768 180.27597 9.0292969 181.02148 C 7.9348259 181.767 6.915912 182.61412 5.9863281 183.55078 C 5.0567443 184.48744 4.2176451 185.51323 3.4804688 186.61328 C 2.7432923 187.71333 2.1090454 188.88931 1.5917969 190.125 C 1.0745484 191.36069 0.67409711 192.65644 0.40429688 194 C 0.13449663 195.34356 -0.0051684121 196.73453 0 198.1582 L 0.43164062 315.75781 C 0.43703375 317.12542 0.57840726 318.47976 0.84765625 319.80078 C 1.1169053 321.1218 1.5150698 322.41032 2.0332031 323.64844 C 2.5513365 324.88655 3.1893602 326.07447 3.9414062 327.19336 C 4.6934524 328.31225 5.5583095 329.36282 6.5292969 330.32617 C 7.4953404 331.28547 8.5459299 332.13773 9.6640625 332.87891 C 10.782195 333.62008 11.968492 334.24923 13.203125 334.75781 C 14.437758 335.2664 15.721566 335.65449 17.037109 335.91602 C 18.352653 336.17754 19.699681 336.3125 21.060547 336.3125 L 21.138672 336.3125 L 76.150391 336.10742 C 77.595748 339.35498 79.127749 342.5578 80.746094 345.7168 C 82.364439 348.87579 84.070149 351.98964 85.859375 355.05664 C 87.648601 358.12364 89.522469 361.14365 91.480469 364.11523 C 93.438468 367.08682 95.478849 370.01007 97.603516 372.88281 L 70.267578 420.65039 C 69.588269 421.83778 69.032776 423.07915 68.605469 424.35742 C 68.178162 425.63569 67.879373 426.95055 67.708984 428.28125 C 67.538595 429.61195 67.498399 430.95806 67.589844 432.30273 C 67.681288 433.64741 67.903525 434.99035 68.261719 436.31055 C 68.620586 437.63007 69.107201 438.89943 69.708984 440.10547 C 70.310767 441.31151 71.028731 442.45409 71.849609 443.51562 C 72.670488 444.57717 73.595173 445.55927 74.611328 446.44531 C 75.627483 447.33136 76.734264 448.12125 77.921875 448.80078 L 179.97266 507.20508 C 181.5888 508.1291 183.27737 508.81139 184.99609 509.26172 C 186.71482 509.71204 188.4652 509.93164 190.20312 509.93164 C 191.99229 509.93164 193.76821 509.69753 195.48633 509.24414 C 197.20445 508.79075 198.86485 508.11822 200.41992 507.23633 C 201.975 506.35444 203.42457 505.26402 204.72461 503.97852 C 206.02465 502.69301 207.17394 501.21109 208.12695 499.54688 L 235.46875 451.77344 C 239.019 452.14893 242.57331 452.4273 246.12891 452.60938 C 249.68451 452.79144 253.24064 452.8782 256.79297 452.86719 C 260.3453 452.85618 263.89316 452.74868 267.43359 452.54492 C 270.97403 452.34116 274.50743 452.0407 278.02734 451.64453 L 305.71094 499.18555 C 306.39991 500.36754 307.19791 501.46923 308.0918 502.47852 C 308.98568 503.4878 309.97524 504.40384 311.04297 505.2168 C 312.1107 506.02975 313.25825 506.73903 314.46875 507.33203 C 315.67925 507.92504 316.95318 508.40252 318.27539 508.75195 C 319.59626 509.10071 320.93857 509.31476 322.2832 509.39648 C 323.62783 509.47821 324.97333 509.42637 326.30273 509.24609 C 327.63214 509.06582 328.94551 508.75756 330.2207 508.32031 C 331.4959 507.88306 332.73402 507.3181 333.91602 506.62891 L 435.5332 447.43555 C 436.7152 446.74725 437.81693 445.9484 438.82617 445.05469 C 439.83542 444.16097 440.75166 443.17124 441.56445 442.10352 C 442.37724 441.03579 443.08706 439.89002 443.67969 438.67969 C 444.27231 437.46935 444.7489 436.19459 445.09766 434.87305 C 445.44709 433.54993 445.66057 432.20693 445.74219 430.86133 C 445.8238 429.51573 445.7723 428.16735 445.5918 426.83789 C 445.4113 425.50843 445.10098 424.19853 444.66406 422.92383 C 444.22715 421.64913 443.66419 420.40983 442.97656 419.22852 L 415.32031 371.76367 C 417.47262 368.83161 419.51318 365.88472 421.45312 362.90625 C 423.39308 359.92778 425.23265 356.91682 426.98047 353.85938 C 428.73009 350.80372 430.39422 347.69517 431.98047 344.51367 C 433.56672 341.33218 435.07506 338.07782 436.51367 334.73633 L 491.44531 334.53906 C 492.81292 334.53434 494.16564 334.3922 495.48633 334.12305 C 496.80701 333.8539 498.09632 333.45764 499.33398 332.93945 C 500.57165 332.42126 501.7584 331.78113 502.87695 331.0293 C 503.99551 330.27746 505.04447 329.41345 506.00781 328.44336 C 506.97116 327.4726 507.82845 326.41515 508.57227 325.29102 C 509.31608 324.16689 509.94777 322.97591 510.45703 321.73438 C 510.96629 320.49283 511.35361 319.20191 511.61328 317.87891 C 511.87295 316.55591 512.00494 315.20054 512 313.83203 L 511.56836 196.23242 C 511.56297 194.86414 511.42166 193.5106 511.15234 192.18945 C 510.88302 190.86831 510.48499 189.57974 509.9668 188.3418 C 509.44861 187.10385 508.8106 185.91555 508.05859 184.79688 C 507.30659 183.67819 506.44147 182.62936 505.4707 181.66602 C 504.50466 180.70671 503.45233 179.85259 502.33398 179.11133 C 501.21564 178.37007 500.03167 177.74112 498.79688 177.23242 C 497.56207 176.72373 496.27635 176.33583 494.96094 176.07422 C 493.64552 175.81261 492.29964 175.67773 490.93945 175.67773 L 490.85938 175.67773 L 435.86523 175.89453 C 434.41718 172.64472 432.88362 169.43932 431.26367 166.2793 C 429.64373 163.11928 427.938 160.00433 426.14844 156.9375 C 424.35887 153.87067 422.48425 150.85111 420.52734 147.88086 C 418.57044 144.91061 416.53017 141.99136 414.4082 139.12109 L 441.75 91.351562 C 442.45717 90.115526 443.02277 88.837224 443.45117 87.535156 C 443.87957 86.233089 444.1702 84.908457 444.33008 83.578125 C 444.48995 82.247793 444.51832 80.912628 444.41992 79.591797 C 444.32152 78.270966 444.09642 76.96497 443.75 75.691406 C 443.40358 74.417842 442.93576 73.176812 442.35156 71.988281 C 441.76736 70.79975 441.06759 69.663388 440.25586 68.597656 C 439.44413 67.531924 438.52119 66.536027 437.49219 65.630859 C 436.46318 64.725692 435.32783 63.909962 434.0918 63.203125 L 332.03906 4.7949219 C 330.85235 4.1156127 329.61193 3.5618619 328.33398 3.1347656 C 327.05604 2.7076694 325.74091 2.4085018 324.41016 2.2382812 C 323.74478 2.153171 323.07567 2.1004887 322.4043 2.0800781 z "
transform="matrix(1.1125273,0,0,1.1125273,-5e-4,0)"
id="path4588" />
<path
inkscape:connector-curvature="0"
d="m 357.21357,76.507462 c -26.4956,19.088428 -49.57323,40.746608 -64.10173,69.517808 l 10.25997,-40.74724 c -15.35202,27.35465 -25.88437,55.64521 -29.24962,83.30432 l -20.59981,-13.78642 -3.69952,2.84773 c 18.51895,33.32899 8.83816,50.99347 -0.27942,57.26164 -18.51895,12.82024 -45.59082,28.77098 -58.97828,42.73002 -25.92626,26.49337 -33.33949,51.84938 -31.05953,85.18049 2.56362,42.7345 33.62204,78.34098 75.21336,92.30002 18.23103,5.98461 35.03903,6.83997 53.84177,6.83997 30.19792,0 61.25142,-7.97185 83.75657,-26.77446 23.92987,-19.94142 38.17894,-49.85757 38.17894,-80.90885 0,-31.33694 -13.10613,-60.97289 -36.18276,-82.05334 -12.25067,-11.10962 -27.64178,-20.21816 -43.59498,-29.04995 -7.12152,-3.99045 -29.05834,-21.07855 -21.65114,-45.57786 l -15.86237,-2.16913 c 22.01234,-34.46121 50.65036,-68.7146 86.51125,-100.683585 -27.63229,9.401265 -52.123,23.650235 -70.35616,49.290585 10.82596,-22.50515 28.48128,-45.016565 47.85346,-67.521748 z m -99.41952,107.111098 16.12849,6.65373 c 0,0.0112 10e-4,0.0179 0,0.0268 l 7.09292,3.08728 H 280.8557 V 350.4533 c -3.14437,9.41466 -5.8501,10.94048 -13.36054,19.78815 -8.82978,10.25661 -10.29996,25.35814 -10.29996,37.60668 0,5.12936 2.04925,10.82417 4.04542,16.23497 2.27783,5.69882 4.22586,11.37754 7.35905,15.64953 4.03927,5.94071 9.05044,9.67475 12.25603,11.08494 v 0.73201 c -10.95657,-2.33693 -23.50643,-6.22839 -31.01954,-12.66862 -15.09784,-13.10379 -28.47055,-35.01949 -30.18116,-54.10789 -1.42258,-15.66741 13.08323,-38.76907 33.30843,-50.44826 17.09212,-9.97071 21.06257,-21.32971 24.76511,-39.56286 -5.12725,15.9532 -9.9458,29.3268 -26.46835,37.87292 -23.92997,12.53422 -36.20398,33.56741 -35.06506,53.50894 1.70837,25.63824 11.97872,43.00765 32.20381,56.96892 5.86641,4.10654 15.22063,8.37965 23.74048,11.20471 -31.07707,-7.1918 -34.15708,-10.5433 -43.11602,-21.13207 0,-0.56945 -2.27548,-1.99896 -2.27548,-2.56831 -11.39542,-13.10591 -25.93218,-35.32684 -31.05942,-55.83783 -1.7105,-7.12129 -3.41809,-14.80703 -1.42393,-21.93056 9.39913,-33.61679 29.91068,-46.72047 50.42166,-60.68152 5.12725,-3.41686 9.96758,-6.84343 14.81116,-10.26007 11.39553,-8.83191 14.2569,-32.47184 16.82052,-45.57775 -4.84559,16.23687 -9.69408,36.18007 -18.52386,42.7299 -4.55779,3.70254 -10.24701,6.55463 -15.0907,9.68782 -21.36612,14.52861 -42.45327,28.20353 -52.13819,62.95723 -2.27783,8.83391 -0.57024,15.37861 1.42381,23.92663 5.41092,21.36635 19.94623,44.15863 31.91121,57.83389 0,0 1.98277,1.99181 1.98277,2.27559 5.42935,6.26505 12.4283,10.69726 20.6531,14.25221 -7.15571,-1.98523 -14.07031,-4.50606 -20.63981,-7.69165 -33.32909,-16.23888 -55.55751,-50.99738 -56.98221,-79.48504 -3.13308,-57.83031 24.79471,-74.63954 50.43496,-95.71999 14.52849,-11.96487 34.45751,-17.66861 46.1367,-38.75107 2.27996,-4.55566 3.42859,-14.81037 0.86497,-25.35054 -1.14104,-3.70254 -6.56245,-16.52624 -8.55661,-19.37565 z m 24.21944,10.20678 7.83802,3.40669 c 0.0983,3.56445 0.0972,7.05181 0.067,10.44632 -0.0246,-1.16852 -0.0302,-2.36609 0,-3.57964 -0.84509,15.22342 -1.07736,20.84125 1.76993,31.95098 3.13308,12.25067 19.09142,29.90174 25.64326,50.12895 12.53455,38.74414 9.41041,89.45764 0.29283,129.05491 -1.60481,6.55553 -6.05601,14.48872 -11.9899,21.74431 2.09058,-3.82465 3.89414,-7.98716 5.14981,-12.3492 9.1177,-31.90652 12.81543,-46.71488 8.54355,-82.04006 -0.56957,-3.42099 -1.99931,-15.10298 -7.41234,-27.63943 -7.97666,-19.08829 -19.36347,-37.30871 -20.78617,-41.01326 -2.56563,-5.98048 -5.99098,-31.90853 -6.56045,-49.56999 0.2858,14.81216 1.42773,42.44545 5.41606,53.2694 1.13892,3.70253 11.67775,19.947 19.08282,39.60274 5.12937,13.67537 6.26415,26.21238 7.1194,29.91492 3.41887,16.23911 -0.84843,43.58058 -6.54726,69.50449 -2.34408,11.49228 -9.33187,25.29044 -17.92491,33.62785 -0.10725,0.0782 -0.21172,0.16245 -0.31942,0.23943 5.34097,-5.40622 10.54732,-14.45331 13.70654,-25.33725 4.27412,-15.09784 5.97021,-34.4183 5.68218,-46.66885 -0.28568,-7.12152 -3.43004,-22.54315 -9.12876,-36.50219 -3.13308,-7.69086 -7.94984,-15.38653 -11.08504,-20.79946 -3.41463,-5.41716 -3.43943,-17.09345 -5.14993,-30.7667 0.2858,14.81428 -1.16082,22.24707 2.54173,32.78936 2.27772,6.26605 9.97607,14.81261 12.25603,23.07506 3.13319,11.11174 6.54234,23.35962 6.25454,30.7666 0,8.54824 -0.52924,24.50479 -4.23178,41.59892 -2.77243,13.86832 -9.09535,25.79163 -19.68167,32.72288 -0.18189,0.11899 -0.36132,0.24323 -0.54555,0.35931 v -0.51896 c 0.0939,0.0279 0.19105,0.0715 0.27942,0.0939 0.0179,0 0.0469,0 0.067,0 0.0637,0.0145 0.13954,0.0547 0.19954,0.0659 v -0.33271 c 5.52745,-6.16259 8.84755,-12.28139 9.96725,-18.44409 1.42482,-7.40709 1.75307,-14.82859 2.6082,-23.66049 0.85324,-7.4072 0.23764,-17.38495 -1.75652,-27.63944 -2.84729,-12.82012 -7.65367,-25.89834 -9.64784,-35.01178 0.28367,9.97082 4.27994,22.74425 5.98831,35.85016 1.42672,9.68704 0.81816,19.42391 0.53237,27.97215 -0.28166,9.89395 -3.58579,27.61508 -8.09096,36.23594 -0.0514,-0.0235 -0.0961,-0.0436 -0.14636,-0.067 v -252.481 z m -1.15779,157.49294 v 94.40255 c -3.31464,-1.79943 -4.90212,-3.91369 -7.35894,-7.1061 -3.41686,-4.84358 -5.74441,-9.68659 -8.02436,-15.38341 -1.70838,-4.27412 -3.70712,-9.15434 -4.56449,-14.85104 -1.13892,-8.546 -0.82218,-21.92184 8.86285,-35.59721 6.82601,-9.97675 8.81046,-11.4838 11.08494,-21.46479 z"
id="path2554-4"
style="fill:#ffffff;fill-opacity:1;stroke-width:1.11724138" /></svg>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment