]>
apps.delaporte.us Git - dotfiles.git/blob - files/pc/tasks.py
79fe3fa24c0368f50a2ff96a2f52166710f84e19
1 # This file is meant to sit in ~ for use from all shells.
2 from invoke
import task
4 from datetime
import datetime
as dt
7 HOME
= os
.path
.expanduser('~')
8 TODAY
= dt
.now().strftime('%Y.%m.%d')
9 KIDS_ALLOWANCE_URL
=os
.environ
.get('KIDS_ALLOWANCE_URL')
10 PAYROLL
= os
.environ
.get('PAYROLL')
11 BUDGET_URL
= os
.environ
.get('BUDGET_URL')
12 CU_URL
= os
.environ
.get('CU_URL')
13 SCHOOL
= f
"{HOME}/School"
14 PAYROLL
= f
"{HOME}/Nanny.Payroll"
20 c
.run(f
"librefox {url}", asynchronous
=True)
24 c
.run(f
"codium {path}")
32 var
= f
'URL_{bookmark.upper()}'
33 url
= os
.environ
.get(var
)
42 result
= c
.run('which minetest')
48 c
.run('xinput --disable 18')
49 c
.run('xinput --enable 18')
53 def fix_invoke_complete(c
):
54 c
.run('invoke --print-completion-script bash > ~/.invoke-complete.sh')
63 c
.run(f
'konsole --separate --workdir {path}', asynchronous
=True)
66 c
.run(f
"librewolf {url}", asynchronous
=True)
70 c
.run(f
"codium {path}")
74 c
.run(f
'dolphin {path}', asynchronous
=True)
75 # c.run(f"nemo {path}")
80 result
= c
.run('which minetest')
86 browse(c
, KIDS_ALLOWANCE_URL
)
94 # For copying the latest file in
95 folder(c
, f
"{HOME}/pixel7adocuments")
96 folder(c
, f
"{PAYROLL}/data/payroll_inbox")
103 def payroll_jupyter(c
):
105 # For running the payroll scripts
106 c
.run(f
"cd {PAYROLL};{HOME}/envs/jupyter/bin/jupyter-lab")
109 def folder_payroll(c
):
110 code(c
, f
"{PAYROLL}")
115 browse(c
, 'https://app.screego.net/#/')
119 def show_free_space(c
):
120 c
.run('df -h | grep G') # We only care about disks measured in G
123 def free_disk_space(c
, ruthless
=False):
125 c
.run('podman container cleanup --all --rm')
126 # Dolphin Trash ...should regenerate
127 c
.run(f
'sudo rm -rf {HOME}/.local/share/Trash')
128 # c.run(f'rm {HOME}/Downloads/*.iso')
129 c
.run('sudo apt-get autoclean') # Remove useless apt cache
131 c
.run(f
'rm -rf {HOME}/Downloads/*')
132 c
.run('sudo apt-get clean') # Remove all apt cache
136 def assign_school(c
):
141 print("https://rubenwardy.com/minetest_modding_book/en/quality/luacheck.html")
142 term(c
, f
'{HOME}/.var/app/net.minetest.Minetest/.minetest')
147 browse(c
, BUDGET_URL
)
152 def get_drive_info(c
):
153 # List non-squash, non-tmp drives.
154 c
.run('df -x squashfs -x tmpfs')
155 c
.run('ls /dev/disk/by-label')