]>
us-delaporte.pagekite.me Git - dotfiles.git/blob - invoke/setup-linux/tasks.py
1 from invoke
import task
3 from datetime
import datetime
as dt
6 HOME
= os
.path
.expanduser('~')
7 TODAY
= dt
.now().strftime('%Y.%m.%d')
12 c
.run('update-alternatives --config gnome-www-browser')
14 DOTFILES
=f
'{HOME}/dotfiles'
18 c
.run('sudo apt-get install vim -y')
19 c
.run(f
'ln -s {DOTFILES}/files/vimrc {HOME}/.vimrc')
20 c
.run(f
'ls -al {HOME} | grep vimrc')
21 c
.run(f
'mkdir -p {HOME}/.swp')
28 def install_librewolf(c
):
29 c
.run(f
'$HOME/dotfiles/install/librewolf.sh')
33 c
.run('sudo apt-get install git -y')
35 @task(install_librewolf
, setup_vi
, install_git
)
41 # c.run(f'ssh-keygen')
42 c
.run(f
'librewolf https://codeberg.org/user/settings/keys', asynchronous
=True)
43 c
.run(f
'cat $HOME/.ssh/*.pub')
47 c
.run(f
'sudo apt-get install screen -y')
48 c
.run(f
'$HOME/dotfiles/setup/screen.sh')
52 c
.run('sudo netstat -tunlp')
55 def link_to_home(c
, path
, add_dot
=False):
56 filename
= os
.path
.basename(path
)
58 filename
= f
'.{filename}'
60 if(os
.path
.exists(f
'{HOME}/{filename}')):
61 print(f
'WARNING: {HOME}/{filename} exists.')
63 c
.run(f
'ln -s {HOME}/dotfiles/{path} {HOME}/{filename}')
64 c
.run(f
'ls -la {HOME} | grep {filename}')
69 c
.run(f
'mv {HOME}/.bashrc {HOME}/bashrc_bak_{TODAY}')
70 link_to_home(c
, 'files/pc/bashrc', add_dot
=True)
74 def link_all_for_invoke(c
):
75 link_to_home(c
, 'files/pc/tasks.py')
76 link_to_home(c
, 'files/pc/bashrc', add_dot
=True)
80 add_vim_plugin(c
, 'https://github.com/preservim/nerdtree.git', 'nerdtree')
84 add_vim_plugin(c
, 'https://github.com/preservim/vim-markdown.git', 'markdown')
88 add_vim_plugin(c
, 'https://github.com/vim-airline/vim-airline.git', 'airline')
92 add_vim_plugin(c
, 'https://github.com/gergap/vim-ollama.git', 'vim-ollama')
95 def add_vim_plugin(c
, git_path
, folder
):
96 c
.run(f
'mkdir -p {HOME}/.vim/pack/')
97 c
.run(f
'mkdir -p {HOME}/.vim/pack/vendor')
98 c
.run(f
'mkdir -p {HOME}/.vim/pack/vendor/opt')
99 c
.run(f
'git clone --depth 1 {git_path} {HOME}/.vim/pack/vendor/opt/{folder}')
100 c
.run(f
'ls -l {HOME}/.vim/pack/vendor/opt')
101 print(f
"Use `packadd {folder}` in .vimrc to enable")