Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
aa7521bedc | |||
f579c8be6a | |||
258afdee29 | |||
d50d357173 |
6
Makefile
6
Makefile
@ -20,16 +20,16 @@ dist/xcfg: $(SRCS) $(HEADERS) $(PO_FILES)
|
||||
fi; \
|
||||
done
|
||||
@for po in $(PO_DIRS) ; do \
|
||||
msgfmt $$po/xcfg.po -o $$po/mp.mo ; \
|
||||
msgfmt $$po/xcfg.po -o $$po/xcfg.mo ; \
|
||||
done
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)$(prefix)/bin
|
||||
install -m755 dist/xcfg $(DESTDIR)$(prefix)/bin/xcfg
|
||||
@for po in $(PO_DIRS) ; do \
|
||||
echo "installing locale: $$po/mp.mo" ; \
|
||||
echo "installing locale: $$po/xcfg.mo" ; \
|
||||
mkdir -pv $(DESTDIR)/usr/share/$$po ; \
|
||||
cp $$po/mp.mo $(DESTDIR)/usr/share/$$po ; \
|
||||
cp $$po/xcfg.mo $(DESTDIR)/usr/share/$$po ; \
|
||||
done
|
||||
|
||||
uninstall:
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-02-21 22:39+0300\n"
|
||||
"POT-Creation-Date: 2024-02-24 20:16+0300\n"
|
||||
"PO-Revision-Date: 2024-02-20 20:36+0300\n"
|
||||
"Last-Translator: <ngn@ngn.tf>\n"
|
||||
"Language-Team: Turkish <gnome-turk@gnome.org>\n"
|
||||
@ -17,7 +17,7 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/main.c:101 src/main.c:238
|
||||
#: src/main.c:101 src/main.c:250
|
||||
#, fuzzy
|
||||
msgid "Failed to get the home directory"
|
||||
msgstr "Ev dizini bulmak başarısız oldu"
|
||||
@ -32,46 +32,64 @@ msgstr "%s dosyasını okumak için açmak başarısız oldu"
|
||||
msgid "Failed to open %s for writing"
|
||||
msgstr "%s dosyasını yazmak için açmak başarısız oldu"
|
||||
|
||||
#: src/main.c:152 src/main.c:244
|
||||
#: src/main.c:152 src/main.c:256
|
||||
#, c-format
|
||||
msgid "Failed to write to %s"
|
||||
msgstr "%s dosyasına yazmak başarısız oldu"
|
||||
|
||||
#: src/main.c:184
|
||||
#: src/main.c:164
|
||||
msgid "You should use this script as a regular user, not as root!"
|
||||
msgstr ""
|
||||
"Bu betiği normal bir kullanıcı olarak kullanmalısınız, kök kullanıcı olarak "
|
||||
"değil!"
|
||||
|
||||
#: src/main.c:175
|
||||
msgid "Lightweight desktop environment for UNIX-like operating systems"
|
||||
msgstr "UNIX-gibi işletim sistemleri için hafif bir masaütü"
|
||||
|
||||
#: src/main.c:181
|
||||
msgid "Free desktop environment with comparatively low resource requirements"
|
||||
msgstr "Nispeten düşük sistem gereksinimleri olan özgür bir masaüstü ortamı"
|
||||
|
||||
#: src/main.c:187
|
||||
msgid "Tiling window manager based on binary space partitioning"
|
||||
msgstr "İkili alan bölme tabanlı döşeme pencere yöneticisi"
|
||||
|
||||
#: src/main.c:195
|
||||
#, fuzzy
|
||||
msgid "mp is not installed!"
|
||||
msgstr "mp kurulu değil"
|
||||
|
||||
#: src/main.c:193
|
||||
#: src/main.c:204
|
||||
msgid "Install doas or sudo to use this script"
|
||||
msgstr "Bu betiği kullanmak için doas ya da sudo kurun"
|
||||
|
||||
#: src/main.c:211
|
||||
#: src/main.c:223
|
||||
msgid "Choose a desktop enviroment"
|
||||
msgstr "Bir masaüstü ortamı seçin"
|
||||
|
||||
#: src/main.c:217
|
||||
#: src/main.c:229
|
||||
msgid "Yes"
|
||||
msgstr "Evet"
|
||||
|
||||
#: src/main.c:217
|
||||
#: src/main.c:229
|
||||
msgid "No"
|
||||
msgstr "Hayır"
|
||||
|
||||
#: src/main.c:224
|
||||
#: src/main.c:236
|
||||
msgid "Add auto-startx to shell configuration?"
|
||||
msgstr "Otomatik-startx kabuk konfigürasyonu ekle?"
|
||||
|
||||
#: src/main.c:250
|
||||
#: src/main.c:262
|
||||
msgid "Configuration has been saved!"
|
||||
msgstr "Konfigürasyon kaydedildi!"
|
||||
|
||||
#: src/main.c:252
|
||||
#: src/main.c:264
|
||||
#, fuzzy, c-format
|
||||
msgid "Installing %s"
|
||||
msgstr "%s kuruluyor"
|
||||
|
||||
#: src/main.c:258
|
||||
#: src/main.c:270
|
||||
#, fuzzy
|
||||
msgid "Installation failed"
|
||||
msgstr "Kurulum başarısız oldu"
|
||||
|
34
src/main.c
34
src/main.c
@ -39,11 +39,10 @@ int ask(char* text, ITEM** items, int sz) {
|
||||
|
||||
mvprintw(1, 1, "%s", text);
|
||||
char line[strlen(text)+5];
|
||||
int i = 0;
|
||||
for (; i < strlen(text); i++){
|
||||
for (int i = 0; i < strlen(text); i++){
|
||||
line[i] = '#';
|
||||
line[i+1] = '\0';
|
||||
}
|
||||
line[i] = '\0';
|
||||
mvprintw(2, 1, "%s", line);
|
||||
|
||||
attroff(COLOR_PAIR(1) | A_BOLD);
|
||||
@ -51,7 +50,8 @@ int ask(char* text, ITEM** items, int sz) {
|
||||
|
||||
WINDOW* swin = newwin(LINES-3, COLS-1, 3, 1);
|
||||
keypad(swin, TRUE);
|
||||
MENU* menu = new_menu((ITEM **)items);
|
||||
|
||||
MENU* menu = new_menu(items);
|
||||
set_menu_win(menu, swin);
|
||||
set_menu_sub(menu, swin);
|
||||
set_menu_mark(menu, ">");
|
||||
@ -160,20 +160,31 @@ END:
|
||||
}
|
||||
|
||||
int main(int argc, char** argv, char** envp){
|
||||
if(getuid()==0){
|
||||
error(_("You should use this script as a regular user, not as root!"));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
signal(SIGINT, SIG_IGN);
|
||||
setlocale(LC_ALL, "");
|
||||
textdomain("mp");
|
||||
textdomain("xcfg");
|
||||
|
||||
struct Desktop desktops[] = {
|
||||
{
|
||||
.name="XFCE4",
|
||||
.desc="Lightweight desktop environment for UNIX-like operating systems",
|
||||
.desc=_("Lightweight desktop environment for UNIX-like operating systems"),
|
||||
.pkg="xfce4",
|
||||
.cmd="startxfce4\n",
|
||||
},
|
||||
{
|
||||
.name="LXDE",
|
||||
.desc=_("Free desktop environment with comparatively low resource requirements"),
|
||||
.pkg="lxde",
|
||||
.cmd="startlxde\n",
|
||||
},
|
||||
{
|
||||
.name="bspwm",
|
||||
.desc="Tiling window manager based on binary space partitioning",
|
||||
.desc=_("Tiling window manager based on binary space partitioning"),
|
||||
.pkg="bspwm",
|
||||
.cmd="bspwm\n"
|
||||
}
|
||||
@ -185,7 +196,7 @@ int main(int argc, char** argv, char** envp){
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
free(mpi_path);
|
||||
|
||||
|
||||
char* doas_path = check_path("doas");
|
||||
if(NULL==doas_path) {
|
||||
doas_path = check_path("sudo");
|
||||
@ -203,18 +214,19 @@ int main(int argc, char** argv, char** envp){
|
||||
init_pair(1, COLOR_BLUE, COLOR_BLUE);
|
||||
|
||||
int sz = sizeof(desktops)/sizeof(struct Desktop);
|
||||
ITEM** items = (ITEM **)malloc(sizeof(ITEM *)*(sz+1));
|
||||
ITEM** items = malloc(sizeof(ITEM *)*(sz+1));
|
||||
|
||||
for(int i = 0; i < sz; i++)
|
||||
items[i] = new_item(desktops[i].name, desktops[i].desc);
|
||||
items[sz] = NULL;
|
||||
|
||||
int indx = ask(_("Choose a desktop enviroment"), items, sz);
|
||||
int indx = ask(_("Choose a desktop enviroment"), items, sz+1);
|
||||
for (int i = 0; i < sz; i++)
|
||||
free_item(items[i]);
|
||||
free(items);
|
||||
clear();
|
||||
|
||||
char* yn[] = {_("Yes"), _("No")};
|
||||
char* yn[] = {_("Yes"), _("No"), NULL};
|
||||
sz = sizeof(yn)/sizeof(char*);
|
||||
items = (ITEM **)malloc(sizeof(ITEM *)*(sz+1));
|
||||
|
||||
|
Reference in New Issue
Block a user