]> us-delaporte.pagekite.me Git - dotfiles.git/blob - files/tab/tasks.py
Add PDF helper. Etc.
[dotfiles.git] / files / tab / tasks.py
1 # This file is meant to sit in ~ for use from all shells.
2 from invoke import task
3
4 from datetime import datetime as dt
5 import os
6
7 HOME = os.path.expanduser('~')
8 TODAY = dt.now().strftime('%Y.%m.%d')
9
10 KIDS_ALLOWANCE_URL=os.environ.get('KIDS_CASH_URL')
11 PAYROLL = os.environ.get('PAYROLL')
12
13 def term(c, path):
14 c.run(f'konsole --workdir {path}')
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 term(c, f'{SCHOOL}')
73 # c.run(f"cd {SCHOOL};{HOME}/envs/jupyter/bin/jupyter lab", asynchronous=True)
74
75