mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
session: improve info() message
This commit is contained in:
parent
7dc5643bd6
commit
4d1acf645c
1 changed files with 7 additions and 3 deletions
|
|
@ -40,7 +40,6 @@ process_line(char *line)
|
||||||
if (string_empty(key) || string_empty(value)) {
|
if (string_empty(key) || string_empty(value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
info("setenv %s %s", key, value);
|
|
||||||
setenv(key, value, 1);
|
setenv(key, value, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,6 +52,7 @@ read_environment_file(const char *filename)
|
||||||
if (!stream) {
|
if (!stream) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
info("read environment file (%s)", filename);
|
||||||
while (getline(&line, &len, stream) != -1) {
|
while (getline(&line, &len, stream) != -1) {
|
||||||
char *p = strrchr(line, '\n');
|
char *p = strrchr(line, '\n');
|
||||||
if (p) {
|
if (p) {
|
||||||
|
|
@ -83,8 +83,9 @@ void
|
||||||
session_environment_init(void)
|
session_environment_init(void)
|
||||||
{
|
{
|
||||||
const char *environment = config_dir_append("environment");
|
const char *environment = config_dir_append("environment");
|
||||||
if (!environment)
|
if (!environment) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
read_environment_file(environment);
|
read_environment_file(environment);
|
||||||
free((void*)environment);
|
free((void*)environment);
|
||||||
}
|
}
|
||||||
|
|
@ -93,16 +94,19 @@ void
|
||||||
session_autostart_init(void)
|
session_autostart_init(void)
|
||||||
{
|
{
|
||||||
const char *autostart = config_dir_append("autostart");
|
const char *autostart = config_dir_append("autostart");
|
||||||
if (!autostart)
|
if (!autostart) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (!isfile(autostart)) {
|
if (!isfile(autostart)) {
|
||||||
warn("no autostart file");
|
warn("no autostart file");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
info("sh autostart file (%s)", autostart);
|
||||||
int len = strlen(autostart) + 4;
|
int len = strlen(autostart) + 4;
|
||||||
char *cmd = calloc(len, 1);
|
char *cmd = calloc(len, 1);
|
||||||
strcat(cmd, "sh ");
|
strcat(cmd, "sh ");
|
||||||
strcat(cmd, autostart);
|
strcat(cmd, autostart);
|
||||||
spawn_async_no_shell(cmd);
|
spawn_async_no_shell(cmd);
|
||||||
|
free(cmd);
|
||||||
free((void*)autostart);
|
free((void*)autostart);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue