update: use the new package manager
This commit is contained in:
14
src/main.c
14
src/main.c
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user