update: use the new package manager

This commit is contained in:
ngn
2024-08-15 04:17:49 +03:00
parent 0caafc793b
commit 22364da8be
3 changed files with 20 additions and 20 deletions

View File

@ -139,9 +139,9 @@ int main(int argc, char **argv, char **envp) {
{.name = "i3", .desc = _("Improved tiling window manager"), .pkg = "i3", .cmd = "i3\n"}
};
char *mpi_path = check_path("mp-install");
char *mpi_path = check_path("matt");
if (NULL == mpi_path) {
error(_("mp is not installed!"));
error(_("matt is not installed!"));
return EXIT_FAILURE;
}
free(mpi_path);
@ -176,32 +176,32 @@ int main(int argc, char **argv, char **envp) {
term_finish();
if (autox && !add_startx())
goto FAIL;
goto fail;
char xinitrc[PATH_MAX];
if (!joinhome(xinitrc, ".xinitrc")) {
error(_("Failed to get the home directory"));
goto FAIL;
goto fail;
}
FILE *xf = fopen(xinitrc, "w");
if (fwrite(desktops[indx].cmd, 1, strlen(desktops[indx].cmd), xf) < 0) {
error(_("Failed to write to %s"), xinitrc);
fclose(xf);
goto FAIL;
goto fail;
}
fclose(xf);
success(_("Configuration has been saved!"));
info(_("Installing %s"), desktops[indx].name, mpi_path);
char *args[] = {doas_path, "mp-install", desktops[indx].pkg, NULL};
char *args[] = {doas_path, "matt", "install", "--skip", desktops[indx].pkg, NULL};
if (execvp(doas_path, args) != 0) {
error(_("Installation failed"));
}
FAIL:
fail:
free(doas_path);
return EXIT_FAILURE;
}