me
/
guix
Archived
1
0
Fork 0

services: xorg: Add startx-command-service-type.

* gnu/services/xorg.scm (startx-command-profile-service,
startx-command-service-type): New variables.
* doc/guix.texi (X Window): Document startx-command-service-type.

Change-Id: Ia2a7c3b2d5ebf6bcfff40cb2640b17d3baf6eba0
Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
master
Tomas Volf 2024-05-30 20:29:53 +02:00 committed by Arun Isaac
parent 8db1d51b0f
commit e51a930c5c
No known key found for this signature in database
GPG Key ID: 2E25EE8B61802BB3
2 changed files with 46 additions and 3 deletions

View File

@ -23627,9 +23627,11 @@ Usually the X server is started by a login manager.
Return a @code{startx} script in which the modules, fonts, Return a @code{startx} script in which the modules, fonts,
etc. specified in @var{config} are available. The result should be used etc. specified in @var{config} are available. The result should be used
in place of @code{startx} and should be invoked by the user from a tty in place of @code{startx} and should be invoked by the user from a tty
after login. Unlike @code{xorg-start-command}, this script calls after login. Unlike @code{xorg-start-command}, this script calls xinit.
xinit. Therefore it works well when executed from a tty. If you are Therefore it works well when executed from a tty. This script can be
using a desktop environment, you are unlikely to need this procedure. set up as @code{startx} using @code{startx-command-service-type}. If
you are using a desktop environment, you are unlikely to need this
procedure.
@end deffn @end deffn
@ -23691,6 +23693,14 @@ Whether to setup program as setuid binary.
@end deftp @end deftp
@defvar startx-command-service-type
Add @command{startx} to the system profile putting it onto @env{PATH}.
The value for this service is a @code{<xorg-configuration>} object which
is passed to the @code{xorg-start-command-xinit} procedure producing the
@command{startx} used. Default value is @code{(xorg-configuration)}.
@end defvar
@node Printing Services @node Printing Services
@subsection Printing Services @subsection Printing Services

View File

@ -92,6 +92,7 @@
xorg-start-command-xinit xorg-start-command-xinit
xinitrc xinitrc
xorg-server-service-type xorg-server-service-type
startx-command-service-type
%default-slim-theme %default-slim-theme
%default-slim-theme-name %default-slim-theme-name
@ -496,6 +497,38 @@ therefore it works well when executed from tty."
(program-file "startx" exp)) (program-file "startx" exp))
(define (startx-command-profile-service config)
;; XXX: profile-service-type only accepts <package> objects.
(package
(name "startx-profile-package")
(version "0")
(source (xorg-start-command-xinit config))
(build-system trivial-build-system)
(arguments
(list
#:modules '((guix build utils))
#:builder
#~(begin
(use-modules (guix build utils))
(let ((bin (string-append #$output "/bin")))
(mkdir-p bin)
(symlink #$source (string-append bin "/startx"))))))
(home-page #f)
(synopsis #f)
(description #f)
(license #f)))
(define startx-command-service-type
(service-type
(name 'startx-command)
(extensions
(list (service-extension profile-service-type
(compose list startx-command-profile-service))))
(default-value (xorg-configuration))
(description "Add @command{startx} to the system profile.")))
(define* (xinitrc #:key fallback-session) (define* (xinitrc #:key fallback-session)
"Return a system-wide xinitrc script that starts the specified X session, "Return a system-wide xinitrc script that starts the specified X session,
which should be passed to this script as the first argument. If not, the which should be passed to this script as the first argument. If not, the