filou.linux schrieb:
Hi
Wie gesagt möchte ich auf diesem Weg aber keine Shell-Scripts ausführen, sonder .desktop Files. Beispiel wie es NICHT geht:
digi@digi-laptop:~$ source .config/autostart/conky.desktop
[Desktop: command not found
X-GNOME-Autostart-enabled=true: command not found
No command 'Monitor' found, did you mean:
Command 'monitor' from package 'dmucs' (universe)
Monitor: command not found
No command 'Monitor' found, did you mean:
Command 'monitor' from package 'dmucs' (universe)
Monitor: command not found
Statt 'source' suche ich einen Befehl wie 'xdg-exec' oder so.
Ich kann dir ein C-Programm anbieten:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 | #include <stdio.h>
#include <gio/gdesktopappinfo.h>
int main (int argc, char *argv[])
{
GDesktopAppInfo *appinfo;
g_type_init ();
if (argc < 2) {
fprintf (stderr, "Not enough arguments\n");
return 1;
}
appinfo = g_desktop_app_info_new_from_filename (argv[1]);
if (appinfo == NULL) {
fprintf (stderr, "Could not load '%s'\n", argv[1]);
return 1;
}
if (!g_app_info_launch (G_APP_INFO (appinfo), NULL, NULL, NULL)) {
fprintf (stderr, "Could not launch '%s'\n", argv[1]);
return 1;
}
return 0;
}
|
Zum Kompilieren brauchst du die Pakete gcc und libglib2.0-dev:
gcc xdg-exec.c -o xdg-exec `pkg-config gio-unix-2.0 --libs --cflags`