]> us-delaporte.pagekite.me Git - dotfiles.git/blob - files/tab/tasks.py
Simple OCR script for Ollama
[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 --separate --workdir {path}', asynchronous=True)
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(c)
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 payroll_jupyter(c)
54
55 @task
56 def payroll_jupyter(c):
57
58 # For running the payroll scripts
59 c.run(f"cd {PAYROLL};{HOME}/envs/jupyter/bin/jupyter-lab")
60
61
62 @task()
63 def screenshare(c):
64
65 browse(c, 'https://app.screego.net/#/')
66 c.run('dino')
67
68 @task
69 def show_free_space(c):
70 c.run('df -h | grep G') # We only care about disks measured in G
71
72 @task()
73 def free_disk_space(c, ruthless=False):
74 show_free_space(c)
75 c.run('podman container cleanup --all --rm')
76 # Dolphin Trash ...should regenerate
77 c.run(f'sudo rm -rf {HOME}/.local/share/Trash')
78 # c.run(f'rm {HOME}/Downloads/*.iso')
79 c.run('sudo apt-get autoclean') # Remove useless apt cache
80 if ruthless:
81 c.run(f'rm -rf {HOME}/Downloads/*')
82 c.run('sudo apt-get clean') # Remove all apt cache
83 show_free_space(c)
84
85
86
87
88 SCHOOL = f"{HOME}/School"
89
90 @task
91 def assign_school(c):
92 term(c, f'{SCHOOL}')
93 # c.run(f"cd {SCHOOL};{HOME}/envs/jupyter/bin/jupyter lab", asynchronous=True)
94
95 @task
96 def mod_luanti(c):
97 print("https://rubenwardy.com/minetest_modding_book/en/quality/luacheck.html")
98 term(c, f'{HOME}/.var/app/net.minetest.Minetest/.minetest')
99
100