entrance: Let user choose WM/DE by his choice and pass it as parameter to the system session command
This commit is contained in:
parent
6f9dd39de7
commit
b51edc9c1c
|
@ -35,7 +35,8 @@ group "Entrance_Config" struct {
|
|||
|
||||
/** Bool to determine if entrance could use the xdg desktop files and
|
||||
* determine the command to use
|
||||
* 1 = desktop_file_cmd, 0 = session_login */
|
||||
* 1 = desktop_file_cmd, 0 = session_login,
|
||||
* 2 = pass window manager choice to session_login command */
|
||||
value "xsessions" uchar: 1;
|
||||
|
||||
/** Bool to determine if entrance must autologin user when X start
|
||||
|
|
|
@ -25,7 +25,7 @@ _defaults_set(Entrance_Config *config)
|
|||
config->command.suspend = eina_stringshare_add("/usr/sbin/suspend");
|
||||
config->daemonize = EINA_TRUE;
|
||||
config->numlock = EINA_FALSE;
|
||||
config->xsessions = EINA_FALSE;
|
||||
config->xsessions = ENTRANCE_SESSION_DESKTOP_NONE;
|
||||
config->autologin = EINA_FALSE;
|
||||
config->custom_conf = EINA_FALSE;
|
||||
config->userlogin = eina_stringshare_add("mylogintouse");
|
||||
|
|
|
@ -5,6 +5,13 @@
|
|||
|
||||
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
|
||||
{
|
||||
const char *session_path;
|
||||
|
@ -30,9 +37,9 @@ struct _Entrance_Config
|
|||
const char *path;
|
||||
const char *group;
|
||||
} bg;
|
||||
unsigned char xsessions;
|
||||
Eina_Bool daemonize;
|
||||
Eina_Bool numlock;
|
||||
Eina_Bool xsessions;
|
||||
Eina_Bool autologin;
|
||||
Eina_Bool custom_conf;
|
||||
Eina_Bool vkbd_enabled;
|
||||
|
|
|
@ -25,7 +25,7 @@ _entrance_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event E
|
|||
eev.type = ENTRANCE_EVENT_ACTIONS;
|
||||
eev.event.actions.actions = entrance_action_get();
|
||||
entrance_event_send(&eev);
|
||||
if (entrance_config->xsessions)
|
||||
if (entrance_config->xsessions != ENTRANCE_SESSION_DESKTOP_NONE)
|
||||
{
|
||||
PT("Sending xsessions\n");
|
||||
eev.type = ENTRANCE_EVENT_XSESSIONS;
|
||||
|
|
|
@ -367,7 +367,11 @@ _entrance_session_find_command(const char *path, const char *session)
|
|||
{
|
||||
if (xsession->command)
|
||||
{
|
||||
return xsession->command;
|
||||
if (entrance_config->xsessions
|
||||
== ENTRANCE_SESSION_DESKTOP_FILE_CMD_ARGS)
|
||||
break;
|
||||
else
|
||||
return xsession->command;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -376,16 +380,28 @@ _entrance_session_find_command(const char *path, const char *session)
|
|||
path, ".xinitrc");
|
||||
if (ecore_file_can_exec(buf))
|
||||
{
|
||||
if (xsession)
|
||||
snprintf(buf, sizeof(buf), "%s/%s %s",
|
||||
path, ".xinitrc", xsession->command);
|
||||
return eina_stringshare_add(buf);
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%s/%s",
|
||||
path, ".Xsession");
|
||||
if (ecore_file_can_exec(buf))
|
||||
{
|
||||
if (xsession)
|
||||
snprintf(buf, sizeof(buf), "%s/%s %s",
|
||||
path, ".Xsession", xsession->command);
|
||||
return eina_stringshare_add(buf);
|
||||
}
|
||||
if (ecore_file_exists("/etc/X11/xinit/xinitrc"))
|
||||
{
|
||||
if (xsession)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "/etc/X11/xinit/xinitrc %s",
|
||||
xsession->command);
|
||||
return eina_stringshare_add(buf);
|
||||
}
|
||||
return eina_stringshare_add("/etc/X11/xinit/xinitrc");
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue