mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
gnu: xorg: Add SLiM theme based on work by Felipe López.
* gnu/services/xorg.scm (%artwork-repository, %default-slim-theme, %default-slim-theme-name): New variables. (slim-service): Add #:theme and #:theme-name parameters. [slim.cfg]: Honor #:theme-name. Honor #:theme by setting the "SLIM_THEMESDIR" environment variable. * doc/guix.texi (X Window): Adjust 'slim-service' documentation accordingly. Document '%default-slim-theme' and '%default-slim-theme-name'.
This commit is contained in:
parent
91781e0268
commit
0ecc3bf309
2 changed files with 62 additions and 6 deletions
|
@ -3964,7 +3964,9 @@ there is no @code{xorg-service} procedure. Instead, the X server is
|
||||||
started by the @dfn{login manager}, currently SLiM.
|
started by the @dfn{login manager}, currently SLiM.
|
||||||
|
|
||||||
@deffn {Monadic Procedure} slim-service [#:allow-empty-passwords? #f] @
|
@deffn {Monadic Procedure} slim-service [#:allow-empty-passwords? #f] @
|
||||||
[#:auto-login? #f] [#:default-user ""] [#:startx]
|
[#:auto-login? #f] [#:default-user ""] [#:startx] @
|
||||||
|
[#:theme @var{%default-slim-theme}] @
|
||||||
|
[#:theme-name @var{%default-slim-theme-name}]
|
||||||
Return a service that spawns the SLiM graphical login manager, which in
|
Return a service that spawns the SLiM graphical login manager, which in
|
||||||
turn starts the X display server with @var{startx}, a command as returned by
|
turn starts the X display server with @var{startx}, a command as returned by
|
||||||
@code{xorg-start-command}.
|
@code{xorg-start-command}.
|
||||||
|
@ -3972,8 +3974,18 @@ turn starts the X display server with @var{startx}, a command as returned by
|
||||||
When @var{allow-empty-passwords?} is true, allow logins with an empty
|
When @var{allow-empty-passwords?} is true, allow logins with an empty
|
||||||
password. When @var{auto-login?} is true, log in automatically as
|
password. When @var{auto-login?} is true, log in automatically as
|
||||||
@var{default-user}.
|
@var{default-user}.
|
||||||
|
|
||||||
|
If @var{theme} is @code{#f}, the use the default log-in theme; otherwise
|
||||||
|
@var{theme} must be a gexp denoting the name of a directory containing the
|
||||||
|
theme to use. In that case, @var{theme-name} specifies the name of the
|
||||||
|
theme.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@defvr {Scheme Variable} %default-theme
|
||||||
|
@defvrx {Scheme Variable} %default-theme-name
|
||||||
|
The G-Expression denoting the default SLiM theme and its name.
|
||||||
|
@end defvr
|
||||||
|
|
||||||
@deffn {Monadic Procedure} xorg-start-command [#:guile] @
|
@deffn {Monadic Procedure} xorg-start-command [#:guile] @
|
||||||
[#:drivers '()] [#:resolutions '()] [#:xorg-server @var{xorg-server}]
|
[#:drivers '()] [#:resolutions '()] [#:xorg-server @var{xorg-server}]
|
||||||
Return a derivation that builds a @var{guile} script to start the X server
|
Return a derivation that builds a @var{guile} script to start the X server
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (gnu services xorg)
|
(define-module (gnu services xorg)
|
||||||
|
#:use-module (guix packages)
|
||||||
|
#:use-module (guix git-download)
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:use-module (gnu system linux) ; 'pam-service'
|
#:use-module (gnu system linux) ; 'pam-service'
|
||||||
#:use-module ((gnu packages base) #:select (canonical-package))
|
#:use-module ((gnu packages base) #:select (canonical-package))
|
||||||
|
@ -35,6 +37,9 @@ (define-module (gnu services xorg)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (xorg-start-command
|
#:export (xorg-start-command
|
||||||
|
|
||||||
|
%default-slim-theme
|
||||||
|
%default-slim-theme-name
|
||||||
slim-service))
|
slim-service))
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
@ -152,9 +157,35 @@ (define builder
|
||||||
|
|
||||||
(gexp->script "xinitrc" builder))
|
(gexp->script "xinitrc" builder))
|
||||||
|
|
||||||
|
|
||||||
|
;;;
|
||||||
|
;;; SLiM log-in manager.
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(define %artwork-repository
|
||||||
|
(origin
|
||||||
|
(method git-fetch)
|
||||||
|
(uri (git-reference
|
||||||
|
(url "git://git.savannah.gnu.org/guix/guix-artwork.git")
|
||||||
|
(commit "71d77b1")))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"03j0fwh6j5knzbfjj3cs0a30cssy706p18b8x7d1p91p29hlzjif"))))
|
||||||
|
|
||||||
|
(define %default-slim-theme
|
||||||
|
;; Theme based on work by Felipe López.
|
||||||
|
#~(string-append #$%artwork-repository "/slim"))
|
||||||
|
|
||||||
|
(define %default-slim-theme-name
|
||||||
|
;; This must be the name of the sub-directory in %DEFAULT-SLIM-THEME that
|
||||||
|
;; contains the actual theme files.
|
||||||
|
"0.8")
|
||||||
|
|
||||||
(define* (slim-service #:key (slim slim)
|
(define* (slim-service #:key (slim slim)
|
||||||
(allow-empty-passwords? #t) auto-login?
|
(allow-empty-passwords? #t) auto-login?
|
||||||
(default-user "")
|
(default-user "")
|
||||||
|
(theme %default-slim-theme)
|
||||||
|
(theme-name %default-slim-theme-name)
|
||||||
(xauth xauth) (dmd dmd) (bash bash)
|
(xauth xauth) (dmd dmd) (bash bash)
|
||||||
startx)
|
startx)
|
||||||
"Return a service that spawns the SLiM graphical login manager, which in
|
"Return a service that spawns the SLiM graphical login manager, which in
|
||||||
|
@ -163,7 +194,13 @@ (define* (slim-service #:key (slim slim)
|
||||||
|
|
||||||
When @var{allow-empty-passwords?} is true, allow logins with an empty
|
When @var{allow-empty-passwords?} is true, allow logins with an empty
|
||||||
password. When @var{auto-login?} is true, log in automatically as
|
password. When @var{auto-login?} is true, log in automatically as
|
||||||
@var{default-user}."
|
@var{default-user}.
|
||||||
|
|
||||||
|
If @var{theme} is @code{#f}, the use the default log-in theme; otherwise
|
||||||
|
@var{theme} must be a gexp denoting the name of a directory containing the
|
||||||
|
theme to use. In that case, @var{theme-name} specifies the name of the
|
||||||
|
theme."
|
||||||
|
|
||||||
(define (slim.cfg)
|
(define (slim.cfg)
|
||||||
(mlet %store-monad ((startx (or startx (xorg-start-command)))
|
(mlet %store-monad ((startx (or startx (xorg-start-command)))
|
||||||
(xinitrc (xinitrc)))
|
(xinitrc (xinitrc)))
|
||||||
|
@ -181,9 +218,13 @@ (define (slim.cfg)
|
||||||
|
|
||||||
halt_cmd " dmd "/sbin/halt
|
halt_cmd " dmd "/sbin/halt
|
||||||
reboot_cmd " dmd "/sbin/reboot
|
reboot_cmd " dmd "/sbin/reboot
|
||||||
" (if auto-login?
|
"
|
||||||
(string-append "auto_login yes\ndefault_user " default-user)
|
(if auto-login?
|
||||||
""))))
|
(string-append "auto_login yes\ndefault_user " default-user "\n")
|
||||||
|
"")
|
||||||
|
(if theme-name
|
||||||
|
(string-append "current_theme " theme-name "\n")
|
||||||
|
""))))
|
||||||
|
|
||||||
(mlet %store-monad ((slim.cfg (slim.cfg)))
|
(mlet %store-monad ((slim.cfg (slim.cfg)))
|
||||||
(return
|
(return
|
||||||
|
@ -200,7 +241,10 @@ (define (slim.cfg)
|
||||||
(fork+exec-command
|
(fork+exec-command
|
||||||
(list (string-append #$slim "/bin/slim") "-nodaemon")
|
(list (string-append #$slim "/bin/slim") "-nodaemon")
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
(list (string-append "SLIM_CFGFILE=" #$slim.cfg)))))
|
(list (string-append "SLIM_CFGFILE=" #$slim.cfg)
|
||||||
|
#$@(if theme
|
||||||
|
(list #~(string-append "SLIM_THEMESDIR=" #$theme))
|
||||||
|
#~())))))
|
||||||
(stop #~(make-kill-destructor))
|
(stop #~(make-kill-destructor))
|
||||||
(respawn? #t)
|
(respawn? #t)
|
||||||
(pam-services
|
(pam-services
|
||||||
|
|
Loading…
Reference in a new issue