From 59ac7de79ca21c495d7388f80412f8bfd6e892e3 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 9 Jun 2022 11:39:41 -0700 Subject: ref(zsh): ensure home-manager variables are set before starting sway Change-Id: I820a636bcdeb6abf7ff8a25ec409c08916e94c42 Reviewed-on: https://cl.fcuny.net/c/world/+/303 Reviewed-by: Franck Cuny --- home/zsh/default.nix | 13 +++++++------ home/zsh/sway.zsh | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 home/zsh/sway.zsh (limited to 'home/zsh') diff --git a/home/zsh/default.nix b/home/zsh/default.nix index fad7b2e..086c17e 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -38,13 +38,14 @@ in { defaultKeymap = "emacs"; - initExtraFirst = '' - if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then - exec sway - fi - ''; - + # the order matters for sway.zsh: I want to load it first + # to start the session if I log on a machine where it's + # available. + # it can't be loaded with `initExtraFirst` because the session + # variables from home-manager are not set yet otherwise (and I + # need them for things like firefox or emacs). initExtra = lib.concatMapStrings builtins.readFile [ + ./sway.zsh ./completion-style.zsh ./gerrit.zsh ./options.zsh diff --git a/home/zsh/sway.zsh b/home/zsh/sway.zsh new file mode 100644 index 0000000..69d5103 --- /dev/null +++ b/home/zsh/sway.zsh @@ -0,0 +1,3 @@ +if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + exec sway +fi -- cgit 1.4.1