entrance: use Xsession script to launch the session
This commit is contained in:
parent
74ebe7265c
commit
6d93384f12
|
@ -12,8 +12,10 @@ group "Entrance_Config" struct {
|
||||||
value "xauth_file" string: "/var/run/entrance.auth";
|
value "xauth_file" string: "/var/run/entrance.auth";
|
||||||
|
|
||||||
|
|
||||||
/* Commands executed when starting a session */
|
/* Commands executed before starting a session */
|
||||||
value "session_start" string: "/usr/bin/sessreg -a -l :0.0";
|
value "session_start" string: "/usr/bin/sessreg -a -l :0.0";
|
||||||
|
/* Commands executed to launch a session */
|
||||||
|
value "session_start" string: "/etc/entrance/Xsession";
|
||||||
/* Commands executed when exiting a session */
|
/* Commands executed when exiting a session */
|
||||||
value "session_stop" string: "/usr/bin/sessreg -d -l :0.0";
|
value "session_stop" string: "/usr/bin/sessreg -d -l :0.0";
|
||||||
|
|
||||||
|
@ -35,8 +37,7 @@ group "Entrance_Config" struct {
|
||||||
|
|
||||||
/** Bool to determine if entrance could use the xdg desktop files and
|
/** Bool to determine if entrance could use the xdg desktop files and
|
||||||
* determine the command to use
|
* determine the command to use
|
||||||
* 1 = desktop_file_cmd, 0 = session_login,
|
* 1 = use system and xdg desktop files, 0 = only system command */
|
||||||
* 2 = pass window manager choice to system command */
|
|
||||||
value "xsessions" uchar: 1;
|
value "xsessions" uchar: 1;
|
||||||
|
|
||||||
/** Bool to determine if entrance must autologin user when X start
|
/** Bool to determine if entrance must autologin user when X start
|
||||||
|
|
|
@ -19,13 +19,14 @@ _defaults_set(Entrance_Config *config)
|
||||||
config->command.xauth_path = eina_stringshare_add("/usr/bin/xauth");
|
config->command.xauth_path = eina_stringshare_add("/usr/bin/xauth");
|
||||||
config->command.xauth_file = eina_stringshare_add("/var/run/entrance.auth");
|
config->command.xauth_file = eina_stringshare_add("/var/run/entrance.auth");
|
||||||
config->command.session_start = eina_stringshare_add("/usr/bin/sessreg -a -l :0.0" );
|
config->command.session_start = eina_stringshare_add("/usr/bin/sessreg -a -l :0.0" );
|
||||||
|
config->command.session_login = eina_stringshare_add(SYSTEM_CONFIG_DIR"/entrance/Xsession");
|
||||||
config->command.session_stop = eina_stringshare_add("/usr/bin/sessreg -d -l :0.0");
|
config->command.session_stop = eina_stringshare_add("/usr/bin/sessreg -d -l :0.0");
|
||||||
config->command.shutdown = eina_stringshare_add("/usr/bin/shutdown -h now");
|
config->command.shutdown = eina_stringshare_add("/usr/bin/shutdown -h now");
|
||||||
config->command.reboot = eina_stringshare_add("/usr/bin/shutdown -r now");
|
config->command.reboot = eina_stringshare_add("/usr/bin/shutdown -r now");
|
||||||
config->command.suspend = eina_stringshare_add("/usr/sbin/suspend");
|
config->command.suspend = eina_stringshare_add("/usr/sbin/suspend");
|
||||||
config->daemonize = EINA_TRUE;
|
config->daemonize = EINA_TRUE;
|
||||||
config->numlock = EINA_FALSE;
|
config->numlock = EINA_FALSE;
|
||||||
config->xsessions = ENTRANCE_SESSION_DESKTOP_NONE;
|
config->xsessions = EINA_TRUE;
|
||||||
config->autologin = EINA_FALSE;
|
config->autologin = EINA_FALSE;
|
||||||
config->custom_conf = EINA_FALSE;
|
config->custom_conf = EINA_FALSE;
|
||||||
config->userlogin = eina_stringshare_add("mylogintouse");
|
config->userlogin = eina_stringshare_add("mylogintouse");
|
||||||
|
@ -123,6 +124,7 @@ _config_free(Entrance_Config *config)
|
||||||
eina_stringshare_del(config->command.xauth_path);
|
eina_stringshare_del(config->command.xauth_path);
|
||||||
eina_stringshare_del(config->command.xauth_file);
|
eina_stringshare_del(config->command.xauth_file);
|
||||||
eina_stringshare_del(config->command.session_start);
|
eina_stringshare_del(config->command.session_start);
|
||||||
|
eina_stringshare_del(config->command.session_login);
|
||||||
eina_stringshare_del(config->command.session_stop);
|
eina_stringshare_del(config->command.session_stop);
|
||||||
eina_stringshare_del(config->command.shutdown);
|
eina_stringshare_del(config->command.shutdown);
|
||||||
eina_stringshare_del(config->command.reboot);
|
eina_stringshare_del(config->command.reboot);
|
||||||
|
@ -151,6 +153,7 @@ entrance_config_init()
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "xauth_path", command.xauth_path, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "xauth_path", command.xauth_path, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "xauth_file", command.xauth_file, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "xauth_file", command.xauth_file, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "session_start", command.session_start, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "session_start", command.session_start, EET_T_STRING);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "session_login", command.session_login, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "session_stop", command.session_stop, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "session_stop", command.session_stop, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "shutdown", command.shutdown, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "shutdown", command.shutdown, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "reboot", command.reboot, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "reboot", command.reboot, EET_T_STRING);
|
||||||
|
|
|
@ -5,13 +5,6 @@
|
||||||
|
|
||||||
typedef struct _Entrance_Config Entrance_Config;
|
typedef struct _Entrance_Config Entrance_Config;
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
ENTRANCE_SESSION_DESKTOP_NONE = 0,
|
|
||||||
ENTRANCE_SESSION_DESKTOP_FILE_CMD = 1,
|
|
||||||
ENTRANCE_SESSION_DESKTOP_FILE_CMD_ARGS = 2
|
|
||||||
} Entrance_Session_Type;
|
|
||||||
|
|
||||||
struct _Entrance_Config
|
struct _Entrance_Config
|
||||||
{
|
{
|
||||||
const char *session_path;
|
const char *session_path;
|
||||||
|
@ -22,6 +15,7 @@ struct _Entrance_Config
|
||||||
const char *xauth_path;
|
const char *xauth_path;
|
||||||
const char *xauth_file;
|
const char *xauth_file;
|
||||||
const char *session_start;
|
const char *session_start;
|
||||||
|
const char *session_login;
|
||||||
const char *session_stop;
|
const char *session_stop;
|
||||||
const char *shutdown;
|
const char *shutdown;
|
||||||
const char *reboot;
|
const char *reboot;
|
||||||
|
@ -37,7 +31,7 @@ struct _Entrance_Config
|
||||||
const char *path;
|
const char *path;
|
||||||
const char *group;
|
const char *group;
|
||||||
} bg;
|
} bg;
|
||||||
unsigned char xsessions;
|
Eina_Bool xsessions;
|
||||||
Eina_Bool daemonize;
|
Eina_Bool daemonize;
|
||||||
Eina_Bool numlock;
|
Eina_Bool numlock;
|
||||||
Eina_Bool autologin;
|
Eina_Bool autologin;
|
||||||
|
|
|
@ -26,7 +26,7 @@ _entrance_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event E
|
||||||
eev.type = ENTRANCE_EVENT_ACTIONS;
|
eev.type = ENTRANCE_EVENT_ACTIONS;
|
||||||
eev.event.actions.actions = entrance_action_get();
|
eev.event.actions.actions = entrance_action_get();
|
||||||
entrance_event_send(&eev);
|
entrance_event_send(&eev);
|
||||||
if (entrance_config->xsessions != ENTRANCE_SESSION_DESKTOP_NONE)
|
if (entrance_config->xsessions)
|
||||||
{
|
{
|
||||||
PT("Sending xsessions\n");
|
PT("Sending xsessions\n");
|
||||||
eev.type = ENTRANCE_EVENT_XSESSIONS;
|
eev.type = ENTRANCE_EVENT_XSESSIONS;
|
||||||
|
|
|
@ -181,8 +181,8 @@ _entrance_session_run(struct passwd *pwd, const char *cmd, const char *cookie)
|
||||||
snprintf(buf, sizeof(buf), PACKAGE_BIN_DIR"/entrance_ck_launch %s > %s/.entrance_session.log 2>&1",
|
snprintf(buf, sizeof(buf), PACKAGE_BIN_DIR"/entrance_ck_launch %s > %s/.entrance_session.log 2>&1",
|
||||||
cmd, pwd->pw_dir);
|
cmd, pwd->pw_dir);
|
||||||
#else
|
#else
|
||||||
snprintf(buf, sizeof(buf), "%s > %s/.entrance_session.log 2>&1",
|
snprintf(buf, sizeof(buf), "%s %s > %s/.entrance_session.log 2>&1",
|
||||||
cmd, pwd->pw_dir);
|
entrance_config->command.session_login, cmd, pwd->pw_dir);
|
||||||
#endif
|
#endif
|
||||||
PT("Executing: %s --login -c %s \n", pwd->pw_shell, buf);
|
PT("Executing: %s --login -c %s \n", pwd->pw_shell, buf);
|
||||||
execle(pwd->pw_shell, pwd->pw_shell, "--login", "-c", buf, NULL, env);
|
execle(pwd->pw_shell, pwd->pw_shell, "--login", "-c", buf, NULL, env);
|
||||||
|
@ -374,13 +374,7 @@ _entrance_session_find_command(const char *path, const char *session)
|
||||||
if (!strcmp(xsession->name, session))
|
if (!strcmp(xsession->name, session))
|
||||||
{
|
{
|
||||||
if (xsession->command)
|
if (xsession->command)
|
||||||
{
|
return xsession->command;
|
||||||
if (entrance_config->xsessions
|
|
||||||
== ENTRANCE_SESSION_DESKTOP_FILE_CMD_ARGS)
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
return xsession->command;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue