]> us-delaporte.pagekite.me Git - dotfiles.git/blob - files/tab/tasks.py
cedc6755be9f6798bfce4724a15dcc9b9ffb240b
[dotfiles.git] / files / tab / tasks.py
1
2
3 # This file is meant to sit in ~ for use from all shells.
4 from invoke import task
5
6 from datetime import datetime as dt
7 import os
8
9 HOME = os.path.expanduser('~')
10 TODAY = dt.now().strftime('%Y.%m.%d')
11
12 KIDS_ALLOWANCE_URL=os.environ.get('KIDS_CASH_URL')
13 PAYROLL = os.environ.get('PAYROLL')
14
15
16 def browse(c, url):
17 c.run(f"librewolf {url}", asynchronous=True)
18
19
20 def code(c, path):
21 c.run(f"codium {path}")
22
23
24 def folder(c, path):
25 c.run(f'dolphin {path}', asynchronous=True)
26 # c.run(f"nemo {path}")
27
28
29 @task
30 def debug(c):
31 result = c.run('which minetest')
32 print(result.ok)
33
34
35 @task
36 def allowance(c):
37 browse(c, KIDS_ALLOWANCE_URL)
38
39
40
41 @task
42 def payroll(c):
43
44 allowance()
45
46 # For copying the latest file in
47 folder(c, f"{HOME}/pixel7adocuments")
48 folder(c, f"{PAYROLL}/data/payroll_inbox")
49
50 # For editing files
51 code(c, f"{PAYROLL}")
52
53 # For running the payroll scripts
54 c.run(f"cd {PAYROLL};{HOME}/envs/jupyter/bin/jupyter-lab")
55
56
57 @task()
58 def screenshare(c):
59
60 browse(c, 'https://app.screego.net/#/')
61 c.run('dino')
62
63 @task()
64 def free_disk_space(c):
65 c.run('podman container cleanup --all --rm')
66
67
68 SCHOOL = f"{HOME}/School"
69
70 @task
71 def assign_school(c):
72 c.run(f"cd {SCHOOL};{HOME}/envs/jupyter/bin/jupyter lab")
73
74