From: b Date: Wed, 12 Jul 2023 22:05:18 +0000 (+0200) Subject: improve install and desktop entry X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;ds=inline;p=botm%2Fruncwd improve install and desktop entry --- diff --git a/makefile b/makefile index f2433c6..9cee506 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,8 @@ CC=/usr/bin/gcc CF=-g -Wall -all: runcwd runcwdi test +all: runcwd runcwdi + runcwd: runcwd.c $(CC) $(CF) -o runcwd runcwd.c @@ -9,5 +10,17 @@ runcwd: runcwd.c runcwdi: runcwdi.c $(CC) $(CF) -o runcwdi runcwdi.c -test: test.c - $(CC) $(CF) -o test test.c + +install: cp_bin cp_dt + + +cp_bin: runcwd runcwdi + cp runcwd runcwdi /usr/bin/ + +cp_dt: runcwd-exe.desktop runcwd-jar.desktop runcwd-wine.desktop + cp runcwd-exe.desktop runcwd-jar.desktop runcwd-wine.desktop /usr/share/applications + +clean: + rm -f runcwd runcwdi + +PHONY: all cp_bin cp_dt install clean \ No newline at end of file diff --git a/runcwd-exe.desktop b/runcwd-exe.desktop new file mode 100644 index 0000000..3459359 --- /dev/null +++ b/runcwd-exe.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=execwd +Exec=/usr/bin/runcwdi %f %f +Categories=Other;System +NoDisplay=true +MimeType=application/x-sharedlib +Terminal=true diff --git a/runcwd-jar.desktop b/runcwd-jar.desktop new file mode 100644 index 0000000..d66e318 --- /dev/null +++ b/runcwd-jar.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=java jar +Exec=/usr/bin/runcwdi %f /usr/bin/java -jar %f +Categories=Other;System; +NoDisplay=true +MimeType=application/x-java-archive +Terminal=false diff --git a/runcwd-wine.desktop b/runcwd-wine.desktop new file mode 100644 index 0000000..ef94d10 --- /dev/null +++ b/runcwd-wine.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=winecwd +Exec=/usr/bin/runcwdi %f /usr/bin/wine %f +Categories=Other;System; +NoDisplay=true +MimeType=application/x-ms-dos-executable +Terminal=false diff --git a/runcwd.c b/runcwd.c index 118f6a5..ccc11b7 100644 --- a/runcwd.c +++ b/runcwd.c @@ -1,5 +1,10 @@ -//Niezła wymota -//This generic wrapper allows to run a program with specified CWD. First argument is the CWD, second is the program to run, rest are the parameters passed to that program +/* +This generic wrapper allows to run a program with specified CWD. +First argument is the CWD +(must end with "/", anything after it is ignored), +second is the program to run, +rest are the parameters passed to that program +*/ #include #include @@ -12,7 +17,7 @@ int main(int argc, char *argv[], char *envp[]) fprintf(stderr,"%s\n","CWD missing."); return 1; } - else if (argc <3) { + else if (argc<3) { fprintf(stderr,"%s\n","Command missing."); return 1; } diff --git a/runcwdi.c b/runcwdi.c index 3f304b2..13c4cce 100644 --- a/runcwdi.c +++ b/runcwdi.c @@ -1,5 +1,10 @@ -//Niezła wymota -//This generic wrapper allows to run a program with specified CWD. First argument is the CWD (must end with "/", anything after it is ignored), second is the program to run, rest are the parameters passed to that program +/* +This generic wrapper allows to run a program with specified CWD. +First argument is the CWD +(must end with "/", anything after it is ignored), +second is the program to run, +rest are the parameters passed to that program +*/ #include #include @@ -13,7 +18,7 @@ int main(int argc, char *argv[], char *envp[]) fprintf(stderr,"%s\n","CWD missing."); return 1; } - else if (argc <3) { + else if (argc<3) { fprintf(stderr,"%s\n","Command missing."); return 1; }