from invoke import task

import os

HOME = os.path.expanduser('~')

@task()
def defaults(c):
    c.run('update-alternatives --config gnome-www-browser')

DOTFILES=f'{HOME}/dotfiles'

@task
def setup_vi(c):
    c.run(f'ln -s {DOTFILES}/files/vimrc {HOME}/.vimrc')
    c.run(f'ls -al {HOME} | grep vimrc')
    c.run(f'mkdir -p {HOME}/.swp')

@task
def debug(c):
	pass

@task
def install_librewolf(c):
		c.run(f'$HOME/dotfiles/install/librewolf.sh')

@task(install_librewolf, setup_vi)
def bare_minimum(c):
	pass

@task
def ssh_key(c):
	# c.run(f'ssh-keygen')
	c.run(f'librewolf https://codeberg.org/user/settings/keys', asynchronous=True)
	c.run(f'cat $HOME/.ssh/*.pub')

@task
def screen(c):
		c.run(f'sudo apt-get install screen -y')
		c.run(f'$HOME/dotfiles/setup/screen.sh')
	

	
