Prevent panel and background from being started accidentally

This commit is contained in:
K. Lange 2018-05-10 21:54:19 +09:00
parent 6d34a3c966
commit aa343f74c6
3 changed files with 23 additions and 3 deletions

View File

@ -39,6 +39,16 @@ static void resize_finish_wallpaper(int width, int height) {
int main (int argc, char ** argv) {
if (argc < 2 || strcmp(argv[1],"--really")) {
fprintf(stderr,
"%s: Desktop environment wallpaper\n"
"\n"
" Renders the desktop wallpaper. You probably don't want\n"
" to be running this directly - it is started by the\n"
" session manager along with the panel.\n", argv[0]);
return 1;
}
wallpaper = malloc(sizeof(sprite_t));
load_sprite(wallpaper, "/usr/share/wallpaper.bmp");
wallpaper->alpha = 0;

View File

@ -833,6 +833,17 @@ static void sig_usr2(int sig) {
}
int main (int argc, char ** argv) {
if (argc < 2 || strcmp(argv[1],"--really")) {
fprintf(stderr,
"%s: Desktop environment panel / dock\n"
"\n"
" Renders the application menu, window list, widgets,\n"
" alt-tab window switcher, clock, etc.\n"
" You probably don't want to run this directly - it is\n"
" started automatically by the session manager.\n", argv[0]);
return 1;
}
/* Connect to window server */
yctx = yutani_init();

View File

@ -7,16 +7,15 @@
#include <sys/wait.h>
int main(int argc, char * argv[]) {
int _background_pid = fork();
if (!_background_pid) {
char * args[] = {"/bin/background", NULL};
char * args[] = {"/bin/background", "--really", NULL};
execvp(args[0], args);
}
int _panel_pid = fork();
if (!_panel_pid) {
char * args[] = {"/bin/panel", NULL};
char * args[] = {"/bin/panel", "--really", NULL};
execvp(args[0], args);
}