diff mbox series

[bug#39271] Status: Add a guide to the guix cookbook about setting up sway.

Message ID 87o8q2ysmw.fsf@dismail.de
State Accepted
Headers show
Series [bug#39271] Status: Add a guide to the guix cookbook about setting up sway. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

iyzsong--- via Guix-patches via June 2, 2020, 4:54 a.m. UTC
From 81cf42cebd6697f16a6b760618bd1a2265c8844e Mon Sep 17 00:00:00 2001
From: Joshua Branson <jbranso@dismail.de>
Date: Mon, 1 Jun 2020 20:12:15 -0400
Subject: [PATCH] doc: Add a sway configuration example.

* doc/guix-cookbook.texi (Sway): Add a sway configuration example.
---
 doc/guix-cookbook.texi | 94 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)
diff mbox series

Patch

diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 8651bc4429..a2ed25fdfc 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -1617,6 +1617,100 @@  Then you need to add the following code to a StumpWM configuration file
 (set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11))
 @end lisp
 
+@node Sway
+@subsection Sway
+@cindex Sway
+
+Sway is a tiling window manager written for wayland.  Since sway does not
+officially support login managers, some users may need to execute
+"sway" at the virtual console after login.  However, according to Sway's
+developers, the GNOME display manager, usually works to start sway.
+
+To get started using sway, install sway, and the configuration
+file.
+
+@example
+$ guix package -i sway wget
+$ wget https://raw.githubusercontent.com/swaywm/sway/master/config.in
+$ mkdir -p ~/.config/sway/
+$ mv config.in ~/.config/sway/config
+# optionally remove wget
+$ guix package -r wget
+@end example
+
+Sway supports several configuration options including your default
+terminal and keyboard layout.  Read @code{man sway} for details.
+
+You will need to use @code{%desktop-services} to run sway.  Try to login
+into sway with gdm.  If gdm does not work then try to remove
+@code{gdm-service-type} like so.
+
+@lisp
+  (use-modules (gnu) (guix)
+   (srfi srfi-1))
+
+  (use-service-modules desktop xorg)
+
+  (operating-system
+   (host-name "dobby")
+   (timezone "America/Indiana/Indianapolis")
+   (locale "en_US.utf8")
+   ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
+   ;; target hard disk, and "my-root" is the label of the target
+   ;; root file system.
+   (bootloader (bootloader-configuration
+                (bootloader grub-bootloader)
+                (target "/dev/sda")))
+
+   (file-systems
+    (cons* (file-system
+            (mount-point "/")
+            (device "/dev/sda1")
+            (type "btrfs"))
+           %base-file-systems))
+   (users (cons*
+           (user-account
+            (name "username")
+            (comment "user name")
+            (group "users")
+            (home-directory "/home/user")
+            (supplementary-groups
+             '("wheel" "netdev" "audio" "video")))
+           %base-user-accounts))
+
+   ;; Globally-installed packages.
+   (packages (append (map specification->package
+                          '("nss-certs"))
+                     %base-packages))
+
+   (services
+    (cons*
+     (modify-services
+      (remove (lambda (service)
+                (member (service-kind service)
+                        (list
+                         gdm-service-type
+                         )))
+              %desktop-services) ;;end of remove services
+      ))))
+
+@end lisp
+
+You can now login to sway after login to the virtual console by typing
+
+@example
+$ sway
+@end example
+
+You can also set up sway to autostart after you login. Add this to your
+~/.bash_profile
+
+@example
+if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
+  XKB_DEFAULT_LAYOUT=us exec sway
+fi
+@end example
+
 @node Session lock
 @subsection Session lock
 @cindex sessionlock