-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·51 lines (40 loc) · 1.51 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·51 lines (40 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
import glob
import os
import subprocess
from setuptools import setup, Command
class InstallScripts(Command):
description = "Installs the main python script and assets"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print('Installing tailscale-systray')
subprocess.run(["sudo", "apt", "update"])
subprocess.run(["sudo", "apt", "install", "-y", "libappindicator3-dev", "gir1.2-appindicator3-0.1"])
# Install at /usr/share/tailscale-systray
install_dir = "/usr/share/tailscale-systray"
# os.makedirs(install_dir, exist_ok=True)
# os.system(f"cp -r src/* {install_dir}")
# os.system(f"cp assets/* {install_dir}")
subprocess.run(["mkdir", "-p", install_dir])
for file in glob.glob("src/*"):
subprocess.run(["cp", "-r", file, install_dir])
for file in glob.glob("assets/*"):
subprocess.run(["cp", file, install_dir])
# Install the desktop file
desktop_file = "/usr/share/applications/tailscale-systray.desktop"
subprocess.run(["cp", "tailscale-systray.desktop", desktop_file])
setup(
name="tailscale-systray",
version="0.1.0",
description="Tailscale systray app",
author="Stathi Weir",
packages=["tailscale_systray"],
cmdclass={
"install": InstallScripts,
},
entry_points={"console_scripts": ["tailscale-systray=src.tailscale_systray:main"]},
)