]> apps.delaporte.us Git - dotfiles.git/blob - invoke/setup-linux/tasks.py
Add some llm setup
[dotfiles.git] / invoke / setup-linux / tasks.py
1 from invoke import task
2
3 import os
4
5 HOME = os.path.expanduser('~')
6
7 @task()
8 def defaults(c):
9 c.run('update-alternatives --config gnome-www-browser')
10
11 DOTFILES=f'{HOME}/dotfiles'
12
13 @task
14 def setup_vi(c):
15 c.run('sudo apt-get install vim -y')
16 c.run(f'ln -s {DOTFILES}/files/vimrc {HOME}/.vimrc')
17 c.run(f'ls -al {HOME} | grep vimrc')
18 c.run(f'mkdir -p {HOME}/.swp')
19
20 @task
21 def debug(c):
22 pass
23
24 @task
25 def install_librewolf(c):
26 c.run(f'$HOME/dotfiles/install/librewolf.sh')
27
28 @task
29 def install_git(c):
30 c.run('sudo apt-get install git -y')
31
32 @task(install_librewolf, setup_vi, install_git)
33 def bare_minimum(c):
34 pass
35
36 @task
37 def ssh_key(c):
38 # c.run(f'ssh-keygen')
39 c.run(f'librewolf https://codeberg.org/user/settings/keys', asynchronous=True)
40 c.run(f'cat $HOME/.ssh/*.pub')
41
42 @task
43 def screen(c):
44 c.run(f'sudo apt-get install screen -y')
45 c.run(f'$HOME/dotfiles/setup/screen.sh')
46
47 @task
48 def list_ports(c):
49 c.run('sudo netstat -tunlp')
50
51 @task
52 def link_to_home(c, path, add_dot=False):
53 filename = os.path.basename(path)
54 if(add_dot):
55 filename = f'.{filename}'
56
57 if(os.path.exists(f'{HOME}/{filename}')):
58 print(f'WARNING: {HOME}/{filename} exists.')
59 else:
60 c.run(f'ln -s {HOME}/dotfiles/{path} {HOME}/{filename}')
61 c.run(f'ls -la {HOME} | grep {filename}')
62
63
64
65 @task
66 def link_all_for_invoke(c):
67 link_to_home(c, 'files/pc/tasks.py')
68 link_to_home(c, 'files/pc/bashrc', add_dot=True)