unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#39271] Add a guide to the guix cookbook about setting up sway.
@ 2020-01-24 17:03 jbranso--- via Guix-patches via
  2020-03-15 19:54 ` Leo Famulari
  2020-06-02  0:38 ` [bug#39271] Status: " Joshua Branson via Guix-patches via
  0 siblings, 2 replies; 4+ messages in thread
From: jbranso--- via Guix-patches via @ 2020-01-24 17:03 UTC (permalink / raw)
  To: 39271


[-- Attachment #1.1: Type: text/plain, Size: 444 bytes --]

Hello,

I've created a brief and simple guide for users to set up sway. It
would probably be better for someone to create a sway-service-type
instead, but until that happens users need to configure sway manually.

In the guide, I include a code snippet of a minimal operating
configuration for sway. I tested the code last night with guix system
vm, and it did produce a run-able vm.

I hope this helps someone!

Thanks,

Joshua

[-- Attachment #1.2: Type: text/html, Size: 737 bytes --]

[-- Attachment #2: 0001-doc-Add-sway-to-the-cookbook.patch --]
[-- Type: application/octet-stream, Size: 4418 bytes --]

From 43916e36c49bbcfac720a88b04ab0bee33f550f5 Mon Sep 17 00:00:00 2001
From: Joshua Branson <jbranso@dismail.de>
Date: Thu, 23 Jan 2020 18:09:39 -0500
Subject: [PATCH] doc: Add sway to the cookbook

* doc/guix-cookbook.texi: Add a guide to install and configure sway.
---
 doc/guix-cookbook.texi | 103 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 101 insertions(+), 2 deletions(-)

diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 477b7e3dff..2b0e4209c5 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -77,8 +77,8 @@ Packaging
 
 System Configuration
 
-* Customizing the Kernel::      Creating and using a custom Linux kernel
-
+* Customizing the Kernel::     Creating and using a custom Linux kernel on Guix System.
+* Setting up Sway::            Using the sway tiling window manager
 
 @end detailmenu
 @end menu
@@ -1320,6 +1320,7 @@ reference.
 
 @menu
 * Customizing the Kernel::     Creating and using a custom Linux kernel on Guix System.
+* Setting up Sway::            Using the sway tiling window manager
 @end menu
 
 @node Customizing the Kernel
@@ -1561,6 +1562,104 @@ Left undiscussed however, is Guix's initrd and its customization.  It is
 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.
+@c ********************************************************************
+
+@menu
+* Setting up Sway::     Using the sway tiling window manager
+@end menu
+
+@node Setting up Sway
+@section Setting up 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.ini ~/.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
 
 @c *********************************************************************
 @node Advanced package management
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#39271] Add a guide to the guix cookbook about setting up sway.
  2020-01-24 17:03 [bug#39271] Add a guide to the guix cookbook about setting up sway jbranso--- via Guix-patches via
@ 2020-03-15 19:54 ` Leo Famulari
  2020-06-02  0:38 ` [bug#39271] Status: " Joshua Branson via Guix-patches via
  1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2020-03-15 19:54 UTC (permalink / raw)
  To: 39271

On Fri, Jan 24, 2020 at 05:03:27PM +0000, jbranso--- via Guix-patches via wrote:
> Hello,
> 
> I've created a brief and simple guide for users to set up sway. It
> would probably be better for someone to create a sway-service-type
> instead, but until that happens users need to configure sway manually.
> 
> In the guide, I include a code snippet of a minimal operating
> configuration for sway. I tested the code last night with guix system
> vm, and it did produce a run-able vm.

Thanks for this!

I wonder, are you using sway on Guix with GDM? I think we should
establish whether or not GDM works with sway in Guix, and then base the
recipe on that.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#39271] Status: Add a guide to the guix cookbook about setting up sway.
  2020-01-24 17:03 [bug#39271] Add a guide to the guix cookbook about setting up sway jbranso--- via Guix-patches via
  2020-03-15 19:54 ` Leo Famulari
@ 2020-06-02  0:38 ` Joshua Branson via Guix-patches via
  2020-06-02  4:54   ` Joshua Branson via Guix-patches via
  1 sibling, 1 reply; 4+ messages in thread
From: Joshua Branson via Guix-patches via @ 2020-06-02  0:38 UTC (permalink / raw)
  To: bug#39271


I created an updated patch.

According to this email thread, GDM does not work with sway.

https://lists.gnu.org/archive/html/help-guix/2019-10/msg00205.html

Most users use SSDM.  I do not know how to get SSDM to work with sway.
Essentially I use the dvorak keyboard layout, and I do not know how to
get SSDM to use the dvorak layout to login.  BUT I should probably send
an updated patch to show one how to use sway with SSDM, because most
users use qwerty anyway...until then...

For now,  here is just an updated patch that moves the guix cookbook bit
to the proper spot: "Customizing a Window Manager".

Thanks,



--
Joshua Branson
Sent from Emacs and Gnus




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#39271] Status: Add a guide to the guix cookbook about setting up sway.
  2020-06-02  0:38 ` [bug#39271] Status: " Joshua Branson via Guix-patches via
@ 2020-06-02  4:54   ` Joshua Branson via Guix-patches via
  0 siblings, 0 replies; 4+ messages in thread
From: Joshua Branson via Guix-patches via @ 2020-06-02  4:54 UTC (permalink / raw)
  To: bug#39271


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 --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
-- 
2.26.0





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-02  4:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 17:03 [bug#39271] Add a guide to the guix cookbook about setting up sway jbranso--- via Guix-patches via
2020-03-15 19:54 ` Leo Famulari
2020-06-02  0:38 ` [bug#39271] Status: " Joshua Branson via Guix-patches via
2020-06-02  4:54   ` Joshua Branson via Guix-patches via

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).