update: use the new package manager
This commit is contained in:
parent
0caafc793b
commit
22364da8be
22
Makefile
22
Makefile
@ -14,7 +14,7 @@ dist/xcfg: $(CSRCS) $(HEADERS)
|
|||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
$(CC) $(CFLAGS) $(CSRCS) -o $@ -lncurses -lmenu -lm
|
$(CC) $(CFLAGS) $(CSRCS) -o $@ -lncurses -lmenu -lm
|
||||||
|
|
||||||
locale/%.mo: locale/%.po
|
locale/%.mo: locale/%.po
|
||||||
msgfmt $^ -o $@
|
msgfmt $^ -o $@
|
||||||
|
|
||||||
locale/%.po: locale/xcfg.pot
|
locale/%.po: locale/xcfg.pot
|
||||||
@ -24,7 +24,7 @@ locale/%.po: locale/xcfg.pot
|
|||||||
echo "merge success: $@" ; \
|
echo "merge success: $@" ; \
|
||||||
else \
|
else \
|
||||||
echo "merge failed: $@" ; \
|
echo "merge failed: $@" ; \
|
||||||
mv $@.old $@ ; \
|
install -m644 $@.old $@ ; \
|
||||||
fi; \
|
fi; \
|
||||||
|
|
||||||
locale/xcfg.pot: $(CSRCS)
|
locale/xcfg.pot: $(CSRCS)
|
||||||
@ -32,25 +32,25 @@ locale/xcfg.pot: $(CSRCS)
|
|||||||
xgettext -k_ -c $^ -o $@
|
xgettext -k_ -c $^ -o $@
|
||||||
|
|
||||||
install:
|
install:
|
||||||
mkdir -pv $(DESTDIR)$(prefix)/bin
|
mkdir -pv $(DESTDIR)/$(prefix)/bin
|
||||||
install -v -m755 dist/xcfg $(DESTDIR)$(prefix)/bin/xcfg
|
install -v -m755 dist/xcfg $(DESTDIR)/$(prefix)/bin/xcfg
|
||||||
@for po in $(PO_DIRS) ; do \
|
@for po in $(PO_DIRS) ; do \
|
||||||
echo "installing locale: $$po/xcfg.mo" ; \
|
echo "installing locale: $$po/xcfg.mo" ; \
|
||||||
mkdir -pv $(DESTDIR)/usr/share/$$po ; \
|
install -v -Ddm755 $(DESTDIR)/usr/share/$$po ; \
|
||||||
cp $$po/xcfg.mo $(DESTDIR)/usr/share/$$po ; \
|
install -m644 $$po/xcfg.mo $(DESTDIR)/usr/share/$$po ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -v $(DESTDIR)$(prefix)/bin/xcfg
|
rm -v $(DESTDIR)/$(prefix)/bin/xcfg
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm dist/xcfg
|
rm -v dist/xcfg
|
||||||
rm locale/xcfg.pot
|
rm -v locale/xcfg.pot
|
||||||
@for po in $(PO_DIRS) ; do \
|
@for po in $(PO_DIRS) ; do \
|
||||||
rm $$po/xcfg.mo ; \
|
rm $$po/xcfg.mo ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
format:
|
format:
|
||||||
clang-format -i -style=file $(HEADERS) $(CSRCS)
|
clang-format -i -style=file $(HEADERS) $(CSRCS)
|
||||||
|
|
||||||
.PHONY: install defcfg uninstall clean
|
.PHONY: install uninstall clean
|
||||||
|
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-05-01 13:06+0300\n"
|
"POT-Creation-Date: 2024-08-15 04:16+0300\n"
|
||||||
"PO-Revision-Date: 2024-02-20 20:36+0300\n"
|
"PO-Revision-Date: 2024-02-20 20:36+0300\n"
|
||||||
"Last-Translator: <ngn@ngn.tf>\n"
|
"Last-Translator: <ngn@ngn.tf>\n"
|
||||||
"Language-Team: Turkish <gnome-turk@gnome.org>\n"
|
"Language-Team: Turkish <gnome-turk@gnome.org>\n"
|
||||||
@ -61,7 +61,7 @@ msgstr "Geliştirilmiş döşeme pencere yöneticisi"
|
|||||||
|
|
||||||
#: src/main.c:144
|
#: src/main.c:144
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "mp is not installed!"
|
msgid "matt is not installed!"
|
||||||
msgstr "mp kurulu değil"
|
msgstr "mp kurulu değil"
|
||||||
|
|
||||||
#: src/main.c:153
|
#: src/main.c:153
|
||||||
|
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"}
|
{.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) {
|
if (NULL == mpi_path) {
|
||||||
error(_("mp is not installed!"));
|
error(_("matt is not installed!"));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
free(mpi_path);
|
free(mpi_path);
|
||||||
@ -176,32 +176,32 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
term_finish();
|
term_finish();
|
||||||
|
|
||||||
if (autox && !add_startx())
|
if (autox && !add_startx())
|
||||||
goto FAIL;
|
goto fail;
|
||||||
|
|
||||||
char xinitrc[PATH_MAX];
|
char xinitrc[PATH_MAX];
|
||||||
if (!joinhome(xinitrc, ".xinitrc")) {
|
if (!joinhome(xinitrc, ".xinitrc")) {
|
||||||
error(_("Failed to get the home directory"));
|
error(_("Failed to get the home directory"));
|
||||||
goto FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *xf = fopen(xinitrc, "w");
|
FILE *xf = fopen(xinitrc, "w");
|
||||||
if (fwrite(desktops[indx].cmd, 1, strlen(desktops[indx].cmd), xf) < 0) {
|
if (fwrite(desktops[indx].cmd, 1, strlen(desktops[indx].cmd), xf) < 0) {
|
||||||
error(_("Failed to write to %s"), xinitrc);
|
error(_("Failed to write to %s"), xinitrc);
|
||||||
fclose(xf);
|
fclose(xf);
|
||||||
goto FAIL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(xf);
|
fclose(xf);
|
||||||
success(_("Configuration has been saved!"));
|
success(_("Configuration has been saved!"));
|
||||||
|
|
||||||
info(_("Installing %s"), desktops[indx].name, mpi_path);
|
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) {
|
if (execvp(doas_path, args) != 0) {
|
||||||
error(_("Installation failed"));
|
error(_("Installation failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
FAIL:
|
fail:
|
||||||
free(doas_path);
|
free(doas_path);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user