|
@@ -1,11 +1,16 @@
|
1
|
1
|
import os.path
|
2
|
2
|
import sys
|
3
|
3
|
|
|
4
|
+from piket_client.gui import PiketMainWindow
|
|
5
|
+
|
|
6
|
+icons_dir = PiketMainWindow.icons_dir
|
|
7
|
+
|
4
|
8
|
systemd_user_dir = os.path.expanduser("~/.config/systemd/user")
|
5
|
9
|
|
6
|
10
|
python_interpreter_dir = os.path.dirname(sys.executable)
|
7
|
11
|
uwsgi_path = os.path.join(python_interpreter_dir, "uwsgi")
|
8
|
12
|
piket_client_path = os.path.join(python_interpreter_dir, "piket-client")
|
|
13
|
+piket_manage_people_path = os.path.join(python_interpreter_dir, "piket-manage-people")
|
9
|
14
|
|
10
|
15
|
server_template = f"""[Unit]
|
11
|
16
|
Description=piket server daemon
|
|
@@ -42,4 +47,35 @@ with open(os.path.join(systemd_user_dir, "piket-server.service"), "w") as f:
|
42
|
47
|
with open(os.path.join(systemd_user_dir, "piket-client.service"), "w") as f:
|
43
|
48
|
f.write(client_template)
|
44
|
49
|
|
|
50
|
+# Desktop files
|
|
51
|
+main_template = f"""[Desktop Entry]
|
|
52
|
+Version=0.1.0
|
|
53
|
+Type=Application
|
|
54
|
+Name=Start Bierlijst
|
|
55
|
+Terminal=False
|
|
56
|
+Comment=V-V-V-OUWEN!!!
|
|
57
|
+Exec=systemctl --user start piket-client
|
|
58
|
+Icon={os.path.join(icons_dir, "white_beer_bottle.svg")}
|
|
59
|
+"""
|
|
60
|
+
|
|
61
|
+manage_people = f"""[Desktop Entry]
|
|
62
|
+Version=0.1.0
|
|
63
|
+Type=Application
|
|
64
|
+Name=Personen aanwezig
|
|
65
|
+Terminal=False
|
|
66
|
+Comment=Stel in wie er is.
|
|
67
|
+Exec={sys.executable} -m piket_client.set_active
|
|
68
|
+Icon={os.path.join(icons_dir, "white_add_person.svg")}
|
|
69
|
+"""
|
|
70
|
+
|
|
71
|
+with open(
|
|
72
|
+ os.path.join(os.path.expanduser("~/Desktop"), "piket-client.desktop"), "w"
|
|
73
|
+) as f:
|
|
74
|
+ f.write(main_template)
|
|
75
|
+
|
|
76
|
+with open(
|
|
77
|
+ os.path.join(os.path.expanduser("~/Desktop"), "piket-manage-people.desktop"), "w"
|
|
78
|
+) as f:
|
|
79
|
+ f.write(manage_people)
|
|
80
|
+
|
45
|
81
|
print("Done! Don't forget to systemctl --user daemon-reload.")
|