<commit_before>from pathlib import Path

from libdotfiles import HOME_DIR, PKG_DIR, packages, util

FZF_DIR = HOME_DIR / ".fzf"

if util.distro_name() == "arch":
    packages.try_install("fzf")  # super opener
    packages.try_install(
        "silver-searcher-git"
    )  # super grep (vim-fzf dependency)
    packages.try_install("ripgrep")  # super grep (shell)

elif util.distro_name() == "linuxmint":
    packages.try_install("silversearcher-ag")

    if not packages.has_installed("ripgrep"):
        util.run_verbose(
            [
                "curl",
                "-LO",
                "https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgrep_11.0.2_amd64.deb",
            ]
        )
        util.run_verbose(["sudo", "dpkg", "-i", "ripgrep_11.0.2_amd64.deb"])

    util.run_verbose(
        [
            "git",
            "clone",
            "--depth",
            "1",
            "https://github.com/junegunn/fzf.git",
            FZF_DIR,
        ]
    )
    util.run_verbose(
        [
            FZF_DIR / "install",<commit_msg>cfg/search: fix installation on Arch<commit_after>from pathlib import Path

from libdotfiles import HOME_DIR, PKG_DIR, packages, util

FZF_DIR = HOME_DIR / ".fzf"

if util.distro_name() == "arch":
    packages.try_install("fzf")  # super opener
    packages.try_install("the_silver_searcher")  # fzf dependency
    packages.try_install("ripgrep")  # super grep (shell)

elif util.distro_name() == "linuxmint":
    packages.try_install("silversearcher-ag")

    if not packages.has_installed("ripgrep"):
        util.run_verbose(
            [
                "curl",
                "-LO",
                "https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgrep_11.0.2_amd64.deb",
            ]
        )
        util.run_verbose(["sudo", "dpkg", "-i", "ripgrep_11.0.2_amd64.deb"])

    util.run_verbose(
        [
            "git",
            "clone",
            "--depth",
            "1",
            "https://github.com/junegunn/fzf.git",
            FZF_DIR,
        ]
    )
    util.run_verbose(
        [
            FZF_DIR / "install",
{'fraction_non_alphanumeric': 0.1401124648547329, 'fraction_numerical': 0.015932521087160263, 'mean_word_length': 1.920656634746922, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7210953', 'n_tokens_mistral': 780, 'n_tokens_neox': 733, 'n_words': 110}