From 36ad01f7fa3c94647860f3b0ed73879c608fcf12 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 29 Jan 2022 13:21:01 +0000 Subject: darwin/env.sh: Run script in a login shell We need a login shell to have the right PATH set. Also, we need not to call stty when TERM is empty, which it will be when that script runs. --- dotfiles-darwin/launchd/Makefile | 1 + dotfiles-darwin/launchd/org.awhk.env.plist | 8 ++++++-- zsh/profile | 12 +++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dotfiles-darwin/launchd/Makefile b/dotfiles-darwin/launchd/Makefile index 54d7b2a..83d0c81 100644 --- a/dotfiles-darwin/launchd/Makefile +++ b/dotfiles-darwin/launchd/Makefile @@ -1,3 +1,4 @@ +export ZSH := $(shell which zsh) export ENV_SH := $(realpath ../bin/env.sh) all: $(foreach plist, $(wildcard *.plist), ~/Library/LaunchAgents/${plist}) diff --git a/dotfiles-darwin/launchd/org.awhk.env.plist b/dotfiles-darwin/launchd/org.awhk.env.plist index 49b42d8..f598479 100644 --- a/dotfiles-darwin/launchd/org.awhk.env.plist +++ b/dotfiles-darwin/launchd/org.awhk.env.plist @@ -5,8 +5,12 @@ Label org.awhk.env - Program - ${ENV_SH} + ProgramArguments + + ${ZSH} + -l + ${ENV_SH} + StandardOutPath ${HOME}/Library/Logs/org.awhk.env.log diff --git a/zsh/profile b/zsh/profile index 97f766c..536502d 100644 --- a/zsh/profile +++ b/zsh/profile @@ -7,11 +7,13 @@ done } -# Make C-q and C-s work in zsh. -# -# See https://en.wikipedia.org/wiki/Software_flow_control for gory -# details. -stty -ixon +if [[ -n ${TERM} ]]; then + # Make C-q and C-s work in zsh. + # + # See https://en.wikipedia.org/wiki/Software_flow_control for gory + # details. + stty -ixon +fi source_if_exists dotfiles-${UNAME}/zsh/profile source_if_exists dotfiles-${DOMAIN}/zsh/profile -- cgit v1.2.3-70-g09d2