unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: 33753@debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust@gmail.com>
Subject: [bug#33753] [PATCH 3/3] gnu: Add sbcl-stumpwm-ttf-fonts.
Date: Mon, 23 Mar 2020 10:24:42 +0300	[thread overview]
Message-ID: <20200323072442.25966-3-go.wigust@gmail.com> (raw)
In-Reply-To: <20200323072442.25966-1-go.wigust@gmail.com>

* gnu/packages/wm.scm (sbcl-stumpwm-ttf-fonts): New variable.
* doc/guix-cookbook.texi (Customizing a Window Manager): Document
SBCL-STUMPWM-TTF-FONTS installation and configuration.
---
 doc/guix-cookbook.texi | 41 ++++++++++++++++++++++++++++++++++++++++-
 gnu/packages/wm.scm    | 33 ++++++++++++++++++++++++++++++++-
 2 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 477b7e3dff..84a9bb38a4 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -11,6 +11,7 @@
 Copyright @copyright{} 2019 Ricardo Wurmus@*
 Copyright @copyright{} 2019 Efraim Flashner@*
 Copyright @copyright{} 2019 Pierre Neidhardt@*
+Copyright @copyright{} 2020 Oleg Pykhalov@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -1319,7 +1320,8 @@ chapter is to demonstrate some advanced configuration concepts.
 reference.
 
 @menu
-* Customizing the Kernel::     Creating and using a custom Linux kernel on Guix System.
+* Customizing the Kernel::       Creating and using a custom Linux kernel on Guix System.
+* Customizing a Window Manager:: Handle customization of a Window manager on Guix System.
 @end menu
 
 @node Customizing the Kernel
@@ -1562,6 +1564,43 @@ likely that you'll need to modify the initrd on a machine using a custom
 kernel, since certain modules which are expected to be built may not be
 available for inclusion into the initrd.
 
+@node Customizing a Window Manager
+@section Customizing a Window Manager
+@cindex wm
+
+@node StumpWM
+@subsection StumpWM
+@cindex stumpwm
+
+You could install StumpWM with a Guix system by adding
+@code{stumpwm-checkout} and optionally @code{`(,stumpwm-checkout "lib")}
+packages to a system configuration file, e.g. @file{/etc/config.scm}.
+
+An example configuration can look like this:
+
+@lisp
+(operating-system
+  ;; …
+  (packages (append (list sbcl stumpwm-checkout `(,stumpwm-checkout "lib"))
+                    %base-packages)))
+@end lisp
+
+@cindex stumpwm fonts
+By default StumpWM uses X11 fonts, which could be small or pixelated on
+your system.  You could fix this by installing StumpWM contrib Lisp
+module @code{sbcl-stumpwm-ttf-fonts}, adding it to Guix system packages.
+
+Then you need to add the following code to a StumpWM configuration file
+@file{~/.stumpwm.d/init.lisp}:
+
+@lisp
+(require :ttf-fonts)
+(setf xft:*font-dirs* '("/run/current-system/profile/share/fonts/"))
+(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
+(xft:cache-fonts)
+(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11))
+@end lisp
+
 @c *********************************************************************
 @node Advanced package management
 @chapter Advanced package management
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 25ec278e2c..7217d985f2 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -14,7 +14,7 @@
 ;;; Copyright © 2016 Ivan Vilata i Balaguer <ivan@selidor.net>
 ;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
 ;;; Copyright © 2017, 2019 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
 ;;; Copyright © 2018, 2019 Meiyo Peng <meiyo@riseup.net>
@@ -1660,6 +1660,37 @@ productive, customizable lisp based systems.")
 (define-public sbcl-stumpwm+slynk
   (deprecated-package "sbcl-stumpwm-with-slynk" stumpwm+slynk))
 
+(define-public sbcl-stumpwm-ttf-fonts
+  (let ((commit "dd5b037923ec7d3cc27c55806bcec5a1b8cf4e91")
+        (revision "1"))
+    (package
+      (name "sbcl-ttf-fonts")
+      (version (git-version "0.0.1" revision commit)) ;no upstream release
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/stumpwm/stumpwm-contrib.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0ahxdj9f884afpzxczx6mx7l4nwg4kw6afqaq7lwhf7lxcwylldn"))))
+      (inputs
+       `(("stumpwm" ,stumpwm "lib")
+         ("clx-truetype" ,sbcl-clx-truetype)))
+      (build-system asdf-build-system/sbcl)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'chdir
+             (lambda _
+               (chdir "util/ttf-fonts"))))))
+      (home-page "https://github.com/stumpwm/stumpwm-contrib")
+      (synopsis "Implementation of TTF font rendering for Lisp")
+      (description "This package provides a Lisp implementation of TTF font
+rendering.")
+      (license (list license:gpl2+ license:gpl3+ license:bsd-2)))))
+
 (define-public lemonbar
   (let ((commit "35183ab81d2128dbb7b6d8e119cc57846bcefdb4")
         (revision "1"))
-- 
2.25.1

  parent reply	other threads:[~2020-03-23  7:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15  2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
2018-12-15  2:09 ` [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu Nam Nguyen
2018-12-15  2:09   ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
2018-12-15  2:50 ` [bug#33753] stumpwm-contrib Nam Nguyen
2018-12-21 17:06   ` Ludovic Courtès
2018-12-21 18:18     ` Pierre Neidhardt
     [not found]       ` <875zvlv8r1.fsf@dustycloud.org>
2018-12-24 10:01         ` Nam Nguyen
2018-12-24 10:14           ` Pierre Neidhardt
2018-12-24 10:20             ` Efraim Flashner
2018-12-25  9:01             ` Nam Nguyen
2018-12-26  7:13               ` Nam Nguyen
2018-12-27 10:51               ` Pierre Neidhardt
2018-12-24  9:21 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
2018-12-24  9:21   ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
2018-12-24  9:21   ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
2018-12-25  8:19 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
2018-12-25  8:19   ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
2020-03-23  7:16 ` [bug#33753] [PATCH 0/3] ttf-fonts module in StumpWM Oleg Pykhalov
2020-03-23  7:24   ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Oleg Pykhalov
2020-03-23  7:24     ` [bug#33753] [PATCH 2/3] gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037 Oleg Pykhalov
2020-03-23  7:24     ` Oleg Pykhalov [this message]
2020-03-23  9:06     ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Guillaume Le Vaillant
2020-03-30 20:24       ` bug#33753: " Oleg Pykhalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200323072442.25966-3-go.wigust@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=33753@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).