From 7afc8f50df582c37fd785817c584ef2d0f717332 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 11 Jun 2023 21:46:00 +0200 Subject: [PATCH] fixup! Add display server. --- display/Makefile | 3 + display/display.1 | 146 ++++++++++++++++++++++++++++++++++ share/man/man5/session.5 | 2 +- share/man/man7/installation.7 | 1 + share/man/man7/user-guide.7 | 42 ++++++---- 5 files changed, 176 insertions(+), 18 deletions(-) create mode 100644 display/display.1 diff --git a/display/Makefile b/display/Makefile index 9f8f1e3d..001f087b 100644 --- a/display/Makefile +++ b/display/Makefile @@ -9,6 +9,7 @@ CFLAGS?=$(OPTLEVEL) CFLAGS:=$(CFLAGS) -Wall -Wextra PROGRAM=display +MANPAGES1 = display.1 OBJS=\ connection.o \ @@ -29,6 +30,8 @@ install: all mkdir -p $(DESTDIR)$(SYSCONFDIR)/default printf '#!sh\nexec terminal\n' > $(DESTDIR)$(SYSCONFDIR)/default/displayrc chmod +x $(DESTDIR)$(SYSCONFDIR)/default/displayrc + mkdir -p $(DESTDIR)$(MANDIR)/man1 + install $(MANPAGES1) $(DESTDIR)$(MANDIR)/man1 $(PROGRAM): $(OBJS) $(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $(OBJS) -o $@ $(LIBS) diff --git a/display/display.1 b/display/display.1 new file mode 100644 index 00000000..48775af2 --- /dev/null +++ b/display/display.1 @@ -0,0 +1,146 @@ +.Dd June 11, 2023 +.Dt DISPLAY 8 +.Os +.Sh NAME +.Nm display +.Nd desktop environment +.Sh SYNOPSIS +.Nm +.Op Ar session ... +.Sh DESCRIPTION +.Nm +is a desktop environment and windowing system compositor. +Applications talk to the +.Nm +server process to receive user input and show their graphical user interfaces +in windows. +.Pp +The user's preferred startup applications are launched on startup by launching +the +.Xr session +program (if set) or otherwise the +.Xr displayrc 5 +script in the background. +.Pp +.Nm +exits when Control + Alt + Delete is pressed. +.Pp +The keyboard shortcuts are as follows: +.Bl -tag -width "Control + Alt + Delete" +.It Alt + F4 +Quit the current window. +.It Alt + F10 +Maximize (or restore) the current window. +.It Alt + Tab +Switch to the next window. +.It Alt + Click + Drag +Drag the current window. +.It Control + Alt + Delete +Exit the desktop environment. +.It Control + Alt + T +Launch the +.Xr terminal 1 +application. +.It Super + Left +Tile the current window leftwards. +.It Super + Right +Tile the current window rightwards. +.It Super + Up +Tile the current window upwards. +.It Super + Down +Tile the current window downwards. +.It F11 +Grab input for the current window. +.It F12 +Release the input grab on the current window. +.El +.Pp +Windows can be resized by dragging their edges. +Windows can be tiled by dragging them to the left, right, top, and bottom edges. +.Pp +The keyboard layout can be changed with the +.Xr chkblayout 1 +program. +The display resolution can be changed with the +.Xr chvideomode 1 +program. +.Sh ENVIRONMENT +.Bl -tag -width "HISTFILE" +.It Ev DISPLAY_SOCKET +.Nm +sets +.Ev DISPLAY_SOCKET +to the path of the +.Xr unix 4 +socket where it listens for connections from applications. +Applications use +.Ev DISPLAY_SOCKET +to connect to +.Nm +or +.Pa /run/display +by default. +.El +.Sh FILES +.Bl -tag -width 12345678 -compact +.It Pa ~/.displayrc , /etc/displayrc , /etc/default/displayrc +.Xr displayrc 5 +script that spawns the user's preferred startup applications. +.It Pa /run/display +.Xr unix 4 +socket where +.Nm +listens for connections from applications, as advertised in the +.Ev DISPLAY_SOCKET +environment variable. +.El +.Sh ASYNCHRONOUS EVENTS +.Bl -tag -width "SIGTERM" +.It Dv SIGTERM +Request daemon termination. +.El +.Sh EXIT STATUS +.Nm +runs as a +.Xr daemon 7 +until stopped by +.Dv SIGTERM , +the user explicitly exits the desktop environment, or an application asks +it to exit. +.Nm +signals readiness on the +.Ev READYFD +file descriptor when the display server is ready to receive connections from +applications. +.Nm +will exit non-zero on any fatal startup error. +.Sh EXAMPLES +.Nm +can be selected as the user's graphical user interface with this executable +.Pa ~/.session +script: +.Bd -literal -offset indent +#!/bin/sh +exec display +.Ed +.Pp +.Xr chkblayout 1 , +.Xr chvideomode 1 , +.Xr display 1 +will run the +.Xr displayrc 5 +script on startup, which can be used to start applications. +.Sh SEE ALSO +.Xr terminal 1 , +.Xr displayrc 5 , +.Xr session 5 +.Sh BUGS +The following features are not yet implemented: +.Bl -bullet -compact +.It +Windows cannot be minimized. +.It +Applications cannot receive mouse events. +.It +The wallpaper is random and cannot be controlled. +.El diff --git a/share/man/man5/session.5 b/share/man/man5/session.5 index 6f53b8d2..3488f662 100644 --- a/share/man/man5/session.5 +++ b/share/man/man5/session.5 @@ -50,7 +50,7 @@ exec display .Xr display 1 will run the .Xr displayrc 5 -script on startup, which can be used to start programs. +script on startup, which can be used to start applications. .Ss Trianglix .Xr trianglix 1 can be selected as the user's triangle environment with this executable diff --git a/share/man/man7/installation.7 b/share/man/man7/installation.7 index 33a7aed1..eeb06042 100644 --- a/share/man/man7/installation.7 +++ b/share/man/man7/installation.7 @@ -527,6 +527,7 @@ fragment instead. .Sh SEE ALSO .Xr chkblayout 1 , .Xr chvideomode 1 , +.Xr display 1 , .Xr man 1 , .Xr fstab 5 , .Xr group 5 , diff --git a/share/man/man7/user-guide.7 b/share/man/man7/user-guide.7 index 484d9cbb..b33e9488 100644 --- a/share/man/man7/user-guide.7 +++ b/share/man/man7/user-guide.7 @@ -14,26 +14,34 @@ The installation process is covered in Bootable cdrom releases will offer the options of running a live environment, installing the operating system, or upgrading an existing installation. .Pp -You will be presented a with standard Unix command line environment upon login or -booting the live environment. -.Ss Shutdown -.Xr init 8 -spawns a session after boot. -This is -.Xr login 8 -if the system is booted in multi-user mode. -This is a root shell if booted in single-user mode. +You will be presented with a graphical Unix-like command line environment upon +login or booting the live environment. +.Ss Desktop Environment +The +.Xr display 1 +desktop environment is automatically started when booting the live environment +or after logging into an installation. .Pp -To power off the computer login as user -.Sy poweroff -or run +The desktop environment can be exited by pressing Control + Alt + Delete, +which will return to the login screen (in installations) or power off the +computer (in the live environment). +.Pp +A new +.Xr terminal 1 +can be launched by pressing Control + Alt + F1. +.Pp +See +.Xr display 1 +for all the available keyboard shortcuts. +.Ss Shutdown +To power off the computer, run .Xr poweroff 8 -after logging in. -To reboot the computer login as user -.Sy reboot -or run +or login as +.Sy poweroff . +To reboot the computter, run .Xr reboot 8 -after logging in. +or login as +.Sy reboot . .Ss Keyboard Layout The kernel has a default US keyboard layout compiled into it. .Pp