]>
apps.delaporte.us Git - dotfiles.git/blob - files/pc/tasks.py
52ea8c6bf8d3c76c23da8563dc9d0b7f852471f4
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 PAYROLL
= os
.environ
.get('PAYROLL')
10 SCHOOL
= f
"{HOME}/School"
25 for url
in expect_URLs
:
26 key
= f
'URL_{url.upper()}'
27 result
= os
.environ
.get(key
)
29 raise ValueError(f
'Missing expected {key} in environment.')
34 for path
in expect_PATHs
:
35 key
= f
'PATH_{path.upper()}'
36 result
= os
.environ
.get(key
)
38 raise ValueError(f
'Missing expected {key} in environment.')
43 c
.run(f
"librefox {url}", asynchronous
=True)
47 c
.run(f
"codium {path}")
52 c
.run(f
"dolphin {path}")
56 var
= f
'URL_{bookmark.upper()}'
57 url
= os
.environ
.get(var
)
66 result
= c
.run('which minetest')
72 c
.run('xinput --disable 18')
73 c
.run('xinput --enable 18')
77 def fix_invoke_complete(c
):
78 c
.run('invoke --print-completion-script bash > ~/.invoke-complete.sh')
87 c
.run(f
'konsole --separate --workdir {path}', asynchronous
=True)
90 c
.run(f
"librewolf {url}", asynchronous
=True)
94 c
.run(f
"codium {path}")
98 c
.run(f
'dolphin {path}', asynchronous
=True)
99 # c.run(f"nemo {path}")
104 result
= c
.run('which minetest')
110 browse(c
, URLS
['allowance'])
113 def payroll_folders(c
):
114 # For copying the latest file in
115 folder(c
, f
"{HOME}/pixel7adocuments")
116 folder(c
, f
"{PAYROLL}/data/payroll_inbox")
117 folder(c
, f
"{PAYROLL}")
127 code(c
, f
"{PAYROLL}")
132 browse(c
, 'https://app.screego.net/#/')
136 def show_free_space(c
):
137 c
.run('df -h | grep G') # We only care about disks measured in G
140 def free_disk_space(c
, ruthless
=False):
142 c
.run('podman container cleanup --all --rm')
143 # Dolphin Trash ...should regenerate
144 c
.run(f
'sudo rm -rf {HOME}/.local/share/Trash')
145 # c.run(f'rm {HOME}/Downloads/*.iso')
146 c
.run('sudo apt-get autoclean') # Remove useless apt cache
148 c
.run(f
'rm -rf {HOME}/Downloads/*')
149 c
.run('sudo apt-get clean') # Remove all apt cache
153 def assign_school(c
):
158 print("https://rubenwardy.com/minetest_modding_book/en/quality/luacheck.html")
159 term(c
, f
'{HOME}/.var/app/net.minetest.Minetest/.minetest')
164 browse(c
, URLS
['budget'])
165 browse(c
, URLS
['cu'])
169 def get_drive_info(c
):
170 # List non-squash, non-tmp drives.
171 c
.run('df -x squashfs -x tmpfs')
172 c
.run('ls /dev/disk/by-label')
177 folder(c
, PATHS
['podcasts'])