aboutsummaryrefslogtreecommitdiffstats
path: root/fbcon.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-03-01 15:16:21 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-01 15:16:21 +0100
commit568029f176168fe9c0718b37767bc69587e92eca (patch)
treedcf5788c42d84e07fd5dac751492d30df9003b1d /fbcon.c
parent40f389d427d46159d6ddd249f73fad59b507780e (diff)
downloadfbida-568029f176168fe9c0718b37767bc69587e92eca.tar.gz
logind support
Diffstat (limited to 'fbcon.c')
-rw-r--r--fbcon.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/fbcon.c b/fbcon.c
index 98ad279..b741e99 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -26,8 +26,8 @@
#include <cairo.h>
#include <libudev.h>
#include <libinput.h>
-#include <xkbcommon/xkbcommon.h>
#include <libtsm.h>
+#include <xkbcommon/xkbcommon.h>
#include "fbtools.h"
#include "drmtools.h"
@@ -36,10 +36,10 @@
/* ---------------------------------------------------------------------- */
-static char *seat_name = "seat0";
+static const char *seat_name = "seat0";
/* config */
-static char *font_name = "monospace";
+static const char *font_name = "monospace";
static int font_size = 16;
static bool verbose;
@@ -362,6 +362,9 @@ static void fbcon_cairo_update(const char *font_name, int font_size)
fbcon_cairo_update_one(&state1, font_name, font_size);
fbcon_cairo_update_one(&state2, font_name, font_size);
cairo_font_extents(state1.context, &extents);
+
+ /* underline quirk */
+ extents.height++;
}
static void fbcon_winsize(struct winsize *win)
@@ -506,6 +509,8 @@ static void fbcon_child_exec_shell(struct winsize *win)
fprintf(stderr, "failed to exec /bin/sh: %s\n", strerror(errno));
}
+/* ---------------------------------------------------------------------- */
+
int main(int argc, char *argv[])
{
struct udev_enumerate *uenum;
@@ -513,12 +518,20 @@ int main(int argc, char *argv[])
struct winsize win;
const char *drm_node = NULL;
const char *fb_node = NULL;
+ const char *string;
int input;
pid_t child;
setlocale(LC_ALL,"");
fbcon_read_config();
+ string = getenv("XDG_SEAT");
+ if (string)
+ seat_name = string;
+
+ if (getenv("XDG_SESSION_ID"))
+ logind_init();
+
/* look for gfx devices */
udev = udev_new();
uenum = udev_enumerate_new(udev);