Ejemplo n.º 1
0
def install():
    repo_path = clone_repo('https://github.com/dylanaraps/neofetch.git')
    cwd = os.getcwd()
    os.chdir(repo_path)
    run_bash_command(f'sudo make install')
    os.chdir(cwd)
    shutil.rmtree(repo_path)
Ejemplo n.º 2
0
def install_system_applications():
    run_bash_command('apt update')
    subprocess.call([
        'apt',
        'install',
        '-y',
        'vim',
        'htop',
        'gdebi',
        'git',
        'docker.io',
        'openjdk-11-jre',
        'openjdk-11-jdk',
        'openjdk-8-jdk',
        'openjdk-8-jre',
        'qt5-style-plugins',
        'gnome-tweak-tool',
        'gnome-system-monitor',
        'gnome-calculator',
        'pinta',
        'fortunes',
        'cowsay',
        'lolcat',
        'fonts-firacode',
        'make',
        'gcc',
        'curl',
    ])
Ejemplo n.º 3
0
def install():
    if check_installed("flatpak"):
        message("flatpak is already installed.")
        return

    install_from_ppa('ppa:alexlarsson/flatpak',
                     'flatpak')

    run_bash_command(
        'flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo')
Ejemplo n.º 4
0
def clone_repo(repo_url):
    repo_name = None
    for token in repo_url.split("/"):
        if ".git" in token:
            repo_name = token[:-4]
    if repo_name is None:
        raise ValueError("Could not parse git repository name from URL")

    if pathlib.Path(repo_name).exists():
        shutil.rmtree(repo_name)

    run_bash_command(f'git clone {repo_url}')
    return pathlib.Path(repo_name).resolve()
Ejemplo n.º 5
0
def install_fonts():
    fonts_path = PATHS.LOCAL_FONTS_PATH()

    copy_directory_contents(RESOURCES.FONTS(), fonts_path)

    take_ownership_current_user(fonts_path)
    run_bash_command('fc-cache -f -v')

    set_gsetting('org.gnome.desktop.wm.preferences',
                 'titlebar-font', "'Roboto Condensed, Condensed 13'")
    set_gsetting('org.gnome.desktop.interface',
                 'font-name', "'Roboto Condensed, Condensed 12'")
    set_gsetting('org.gnome.desktop.interface',
                 'document-font-name', "'Sans 11'")
Ejemplo n.º 6
0
def install():
    if check_installed("code"):
        message("VS Code is already installed.")
        return

    url = "https://go.microsoft.com/fwlink/?LinkID=760868"
    output_file = "vscode.deb"

    message("Downloading VS Code...")
    response = requests.get(url, allow_redirects=True)
    message("Finished downloading VS Code.")
    with open(output_file, 'wb') as file:
        file.write(response.content)
        install_dpkg(output_file)
    os.remove(output_file)

    # Install Extensions
    run_bash_command('code --install-extension eamodio.gitlens')
    #run_bash_command('code --install-extension hoovercj.vscode-power-mode')
    run_bash_command('code --install-extension ms-python.python')
    run_bash_command('code --install-extension ms-vscode.cpptools')
    run_bash_command('code --install-extension PKief.material-icon-theme')
    run_bash_command('code --install-extension zhuangtongfa.Material-theme')
Ejemplo n.º 7
0
def install():
    if check_installed("vscodium"):
        message("VSCodium is already installed.")
        return

    url = "https://github.com/VSCodium/vscodium/releases/download/1.33.1/vscodium_1.33.1-1556929548_amd64.deb"
    output_file = "vscodium.deb"

    message("Downloading VSCodium...")
    response = requests.get(url, allow_redirects=True)
    message("Finished downloading VSCodium.")
    with open(output_file, 'wb') as file:
        file.write(response.content)
        install_dpkg(output_file)
    os.remove(output_file)

    # Install Extensions
    run_bash_command('vscodium --install-extension eamodio.gitlens')
    #run_bash_command('code --install-extension hoovercj.vscode-power-mode')
    run_bash_command('vscodium --install-extension ms-python.python')
    run_bash_command('vscodium --install-extension ms-vscode.cpptools')
    run_bash_command('vscodium --install-extension PKief.material-icon-theme')
    run_bash_command(
        'vscodium --install-extension zhuangtongfa.Material-theme')
Ejemplo n.º 8
0
def install_papirus_icon_theme_from_github():
    repo_path = clone_repo(
        'https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.git')
    run_bash_command(f'{repo_path}/install.sh')
    set_gsetting('org.gnome.desktop.interface', 'icon-theme', 'Papirus')
    shutil.rmtree(repo_path)
Ejemplo n.º 9
0
def take_ownership(user, path):
    if user == 'root' and not is_root_user():
        raise EnvironmentError(
            "The current user must be root in order to take root ownership")
    run_bash_command(f'chown -R {user}: {path}')
Ejemplo n.º 10
0
def install_from_ppa(ppa_name, application_name):
    run_bash_command(f'add-apt-repository {ppa_name}')
    run_bash_command('apt update')
    run_bash_command(f'apt install -y {application_name}')
Ejemplo n.º 11
0
def uninstall_dpkg(dpkg):
    run_bash_command(f'apt remove {dpkg}')
Ejemplo n.º 12
0
def install_dpkg(dpkg):
    run_bash_command(f'gdebi {dpkg}')