summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorCole Mickens <cole.mickens@gmail.com>2018-11-15 15:00:01 -0800
committerCole Mickens <cole.mickens@gmail.com>2018-11-17 02:11:35 -0800
commit57370790c7afa85bd06c73607ccfeda9329c1234 (patch)
treeed2a78d963e2a46e1f7e89f925541f16f707d0dc /docs
parenta0fca3ba8deb54c75a523c4ef9356b70182e4b2d (diff)
docs: fixup sway-on-ubuntu docs
Signed-off-by: Cole Mickens <cole.mickens@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/sway-on-ubuntu/README.md52
-rwxr-xr-xdocs/sway-on-ubuntu/execute.sh40
2 files changed, 52 insertions, 40 deletions
diff --git a/docs/sway-on-ubuntu/README.md b/docs/sway-on-ubuntu/README.md
index 68ed463..9121d0c 100644
--- a/docs/sway-on-ubuntu/README.md
+++ b/docs/sway-on-ubuntu/README.md
@@ -1,13 +1,8 @@
-# "sway-on-ubuntu"
-
-"sway-on-ubuntu" is a bad name, but so is "sway-on-ubuntu-via-nixpkgs".
-
-**!!**: *Please do not file bugs against Sway when using these packages.*
+# Sway on non-NixOS Distributions
## Walkthrough - NixGL + Sway on Ubuntu
-This guide will walk you through running `sway` on Ubuntu via `nix` and `nixpkgs`.
-In theory, this should work with a number of Ubuntu versions, but was tested with 18.10 under KVM.
+This guide will walk you through running `sway` on Ubuntu 18.10 via `nix` and `nixpkgs`.
At a high-level:
1. Install `nix`
@@ -19,10 +14,19 @@ At a high-level:
### Quick Version
-If you'd like the quick version, you can run `./execute` (aka `/docs/sway-on-ubuntu/execute.sh`)
-and then skip to the last step ("Run Sway").
+If you'd like the quick version, you can use the quickshot `execute.sh` script in this directory:
+```
+cd /tmp
+wget https://raw.githubusercontent.com/colemickens/nixpkgs-wayland/master/docs/sway-on-ubuntu/execute.sh
+chmod +x execute.sh
+./execute.sh
+```
+
+[![Quick Steps Video on YouTube](https://img.youtube.com/vi/Sri_24TJtFI/0.jpg)](https://www.youtube.com/watch?v=Sri_24TJtFI)
+
+You can then skip to the end.
-### Full Version
+### Detailed Version
#### Install Nix
@@ -70,7 +74,8 @@ assuming enough RAM, CPU, etc.
```bash
mkdir -p $HOME/.config/nixpkgs/overlays
-git clone https://github.com/colemickens/nixpkgs-wayland.git $HOME/.config/nixpkgs/overlays/nixpkgs-wayland
+git clone https://github.com/colemickens/nixpkgs-wayland.git \
+ $HOME/.config/nixpkgs/overlays/nixpkgs-wayland
```
#### Install NixGL and Sway
@@ -83,25 +88,25 @@ the use of a wrapper. I've added some summary details to the NixOS Wiki:
(Change the attribute to be installed per your GL vendor.)
```bash
-nix-env -iE '(import (builtins.fetchurl { url = "https://raw.githubusercontent.com/guibou/nixGL/master/default.nix"; })).nixGLIntel
+curl -L --fail https://raw.githubusercontent.com/guibou/nixGL/master/default.nix > /tmp/nixgl.nix
```
-
-**Install Sway and a config file**
-
-Install the default sway config:
+**Install Sway and related tools**
```bash
-nix-env -iA nixpkgs.sway-beta nixpkgs.dmenu
+nix-env -iA nixGLIntel -f /tmp/nixgl.nix
+nix-env -iA nixpkgs.sway-beta nixpkgs.dmenu nixpkgs.mako nixpkgs.slurp nixpkgs.grim
```
-This will install `sway-beta` from `nixpkgs` (the channel that Nix is configured to follow out
-of the box). In this case, `sway-beta` is actually a newer version coming from this overlay.
+This will install `sway-beta` the default configured channel for the Nix install you
+performed at the beginning, which is named `nixpkgs`. In our case though, `sway-beta`
+is overriden to a newer version by use of this overlay.
+**Install a demo Sway config**
+Install the default sway config:
```bash
-mkdir -p $HOME/.config/sway/config
+mkdir -p $HOME/.config/sway
wget 'https://raw.githubusercontent.com/swaywm/sway/master/config.in' \
-O $HOME/.config/sway/config
-# accomodate nested sway, remove missing BG, set $term
sed -i 's|Mod4|Mod1|g' ~/.config/sway/config
sed -i '/Sway_Wallpaper_Blue_1920x1080.png/d' ~/.config/sway/config
sed -i 's|urxvt|gnome-terminal|g' ~/.config/sway/config
@@ -112,9 +117,12 @@ sed -i 's|urxvt|gnome-terminal|g' ~/.config/sway/config
Let's drop to a TTY and try sway. **Note, this will stop GDM and your current session!**
```bash
-# from GNOME
+# stop the graphical session
sudo systemctl isolate multi-user.target
+# switch to another TTY
+# ctrl+alt+f3
+
# on TTY
nixGLIntel sway
```
diff --git a/docs/sway-on-ubuntu/execute.sh b/docs/sway-on-ubuntu/execute.sh
index ae6bd8e..092acba 100755
--- a/docs/sway-on-ubuntu/execute.sh
+++ b/docs/sway-on-ubuntu/execute.sh
@@ -1,37 +1,41 @@
#!/usr/bin/env bash
-
+set +x
echo "---------------------------------------------"
echo "install nix"
-sudo apt update -qqy; sudo apt install -qqy curl git
-sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
-curl https://nixos.org/nix/install | sh
-source .nix-profile/etc/profile.d/nix.sh
+sudo apt-get update -qqy &>/dev/null; sudo apt-get install -qqy curl git &>/dev/null
+[[ -f "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]] && source ${HOME}/.nix-profile/etc/profile.d/nix.sh
+if ! which nix-env ; then
+ sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
+ curl --silent --fail https://nixos.org/nix/install | sh
+fi
+. "${HOME}/.nix-profile/etc/profile.d/nix.sh"
+set -euo pipefail
echo "---------------------------------------------"
echo "install cachix"
-nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/889c72032f8595fcd7542c6032c208f6b8033db6
+nix-env -iA cachix -f "https://github.com/NixOS/nixpkgs/tarball/889c72032f8595fcd7542c6032c208f6b8033db6"
echo "---------------------------------------------"
echo "use nixpkgs-wayland binary cache"
-cachix use nixpkgs-wayland
+cachix use "nixpkgs-wayland"
echo "---------------------------------------------"
-echo "activate `nixpkgs-wayland` overlay"
-mkdir -p $HOME/.config/nixpkgs/overlays
+echo "activate \"nixpkgs-wayland\" overlay"
+mkdir -p "$HOME/.config/nixpkgs/overlays"
if [[ ! -d "${HOME}/.config/nixpkgs/overlays/nixpkgs-wayland" ]]; then
- git clone https://github.com/colemickens/nixpkgs-wayland.git \
- $HOME/.config/nixpkgs/overlays/nixpkgs-wayland
+ git clone "https://github.com/colemickens/nixpkgs-wayland.git" \
+ "$HOME/.config/nixpkgs/overlays/nixpkgs-wayland"
fi
echo "---------------------------------------------"
-echo "install NixGL, sway, dmenu"
-nix-env -iE '(import (builtins.fetchurl { url = "https://raw.githubusercontent.com/guibou/nixGL/master/default.nix"; })).nixGLIntel'
-
-nix-env -iA nixpkgs.sway-beta nixpkgs.dmenu
+echo "install NixGL, sway, and sway tools"
+curl -L --fail https://raw.githubusercontent.com/guibou/nixGL/master/default.nix > /tmp/nixgl.nix
+nix-env -iA nixGLIntel -f /tmp/nixgl.nix
+nix-env -iA nixpkgs.sway-beta nixpkgs.dmenu nixpkgs.mako nixpkgs.slurp nixpkgs.grim
echo "---------------------------------------------"
echo "configuring sway"
-mkdir -p $HOME/.config/sway/config
+mkdir -p $HOME/.config/sway
wget 'https://raw.githubusercontent.com/swaywm/sway/master/config.in' \
-O $HOME/.config/sway/config
@@ -46,8 +50,8 @@ echo "now run:"
echo " - sudo systemctl isolate multi-user.target (this will stop your GDM session)"
echo " - nixGLIntel sway"
echo "when in sway:"
-echo " - `alt+d` starts `dmenu`"
-echo " - `alt+enter` starts `gnome-terminal`"
+echo " - 'alt+d' starts 'dmenu'"
+echo " - 'alt+enter' starts 'gnome-terminal'"
echo "---------------------------------------------"
echo