mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-30 18:08:00 +02:00
fix: neccessary code changes for nix
This commit is contained in:
4
Makefile
4
Makefile
@@ -10,7 +10,9 @@ PREFIX=/usr
|
|||||||
|
|
||||||
CC?=gcc
|
CC?=gcc
|
||||||
CFLAGS?=-O3 -Wall
|
CFLAGS?=-O3 -Wall
|
||||||
ALLFLAGS=$(CFLAGS) -I$(IDIR)
|
# C PreProcessor flags, not C Plus Plus
|
||||||
|
CPPFLAGS?=
|
||||||
|
ALLFLAGS=$(CFLAGS) $(CPPFLAGS) -I$(IDIR)
|
||||||
|
|
||||||
LIBS=-lpam
|
LIBS=-lpam
|
||||||
|
|
||||||
|
11
src/config.c
11
src/config.c
@@ -240,12 +240,11 @@ struct status config_line_handler(void* _config, char* table, char* k,
|
|||||||
int parse_config(struct config* NNULLABLE config, char* NNULLABLE path) {
|
int parse_config(struct config* NNULLABLE config, char* NNULLABLE path) {
|
||||||
FILE* fd = fopen(path, "r");
|
FILE* fd = fopen(path, "r");
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
perror("fopen");
|
log_perror("fopen");
|
||||||
(void)fputs(
|
log_printf(
|
||||||
"Please place a config file at /etc/lidm.ini or set the LIDM_CONF "
|
" [I] No config, place one at /etc/lidm.ini or set the LIDM_CONF "
|
||||||
"env variable",
|
"env variable");
|
||||||
stderr);
|
return 0; // Its fine now anyways
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = read_desktop(fd, config, config_line_handler);
|
bool ret = read_desktop(fd, config, config_line_handler);
|
||||||
|
@@ -72,6 +72,7 @@ int main(int argc, char* argv[]) {
|
|||||||
chvt_str(argv[1]);
|
chvt_str(argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy
|
||||||
struct config config = DEFAULT_CONFIG;
|
struct config config = DEFAULT_CONFIG;
|
||||||
char* conf_override = getenv("LIDM_CONF");
|
char* conf_override = getenv("LIDM_CONF");
|
||||||
char* conf_path = conf_override ? conf_override : "/etc/lidm.ini";
|
char* conf_path = conf_override ? conf_override : "/etc/lidm.ini";
|
||||||
|
@@ -16,9 +16,16 @@ struct source_dir {
|
|||||||
enum session_type type;
|
enum session_type type;
|
||||||
char* dir;
|
char* dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef SESSIONS_XSESSIONS
|
||||||
|
#define SESSIONS_XSESSIONS "/usr/share/xsessions"
|
||||||
|
#endif
|
||||||
|
#ifndef SESSIONS_WAYLAND
|
||||||
|
#define SESSIONS_WAYLAND "/usr/share/wayland-sessions"
|
||||||
|
#endif
|
||||||
static const struct source_dir SOURCES[] = {
|
static const struct source_dir SOURCES[] = {
|
||||||
{XORG, "/usr/share/xsessions"},
|
{XORG, SESSIONS_XSESSIONS},
|
||||||
{WAYLAND, "/usr/share/wayland-sessions"},
|
{WAYLAND, SESSIONS_WAYLAND},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct Vector* cb_sessions = NULL;
|
static struct Vector* cb_sessions = NULL;
|
||||||
|
Reference in New Issue
Block a user