diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 21dd169..1f142af 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -4,12 +4,6 @@ if [ -d "$TURNSTILE_ENV_DIR" ]; then echo "$DISPLAY" >"$TURNSTILE_ENV_DIR/DISPLAY" echo "$WAYLAND_DISPLAY" >"$TURNSTILE_ENV_DIR/WAYLAND_DISPLAY" - echo "ADDING KEYCHAIN TO ENV" - keychain --eval --quiet --agents ssh,gpg C414FF88A557F29AFEF76C7E73BA40D5AFAF49C9 - echo "$SSH_AUTH_SOCK">"$TURNSTILE_ENV_DIR/SSH_AUTH_SOCK" - echo "$SSH_AGENT_PID">"$TURNSTILE_ENV_DIR/SSH_AGENT_PID" - echo "$GPG_AGENT_INFO">"$TURNSTILE_ENV_DIR/GPG_AGENT_INFO" - echo "DONE ADDING KEYCHAIN TO ENV" fi mod="Mod4" diff --git a/services/sv/loadenv/log/run b/services/sv/loadenv/log/run new file mode 100755 index 0000000..e9f8c5c --- /dev/null +++ b/services/sv/loadenv/log/run @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +exec vlogger -t loadenv -p daemon diff --git a/services/sv/loadenv/run b/services/sv/loadenv/run new file mode 100755 index 0000000..4e45759 --- /dev/null +++ b/services/sv/loadenv/run @@ -0,0 +1,29 @@ +#!/bin/sh +# Loadenv service ensures turstile environment gets populated with all +# profile-loaded environment variables. +# +# To use this service with other turnstile user services, ensure it gets +# started before anything else is started by putting it into `turnstile-ready` +# service conf as a core service. +# +# Will also load the profile file from a custom XDG-compliant +# ~/.config/sh/profile directory before falling back to the home directory +# ~/.profile file. +# This location can be manually overriden by putting the following into the +# service conf file: +# XDG_PROFILE=/my/location/somewhere/profile + +[ -r ./conf ] && . ./conf + +if [ -e "$HOME/.config/sh/profile" ]; then + XDG_PROFILE="${XDG_PROFILE:-HOME/.config/sh/profile}" +fi + +ENV=${XDG_PROFILE:-$HOME/.profile} sh -i -c env | while IFS= read -r line; do + value=${line#*=} + name=${line%%=*} + echo "$value" > "$TURNSTILE_ENV_DIR/$name" +done + +exec 2>&1 +exec pause diff --git a/services/sv/river/run b/services/sv/river/run index 0bc4d0b..cb6ab26 100755 --- a/services/sv/river/run +++ b/services/sv/river/run @@ -2,9 +2,5 @@ [ -r ./conf ] && . ./conf -if [ -d "$TURNSTILE_ENV_DIR" ]; then - echo "$HOME/.local/bin:$PATH" > "$TURNSTILE_ENV_DIR/PATH" -fi - exec 2>&1 exec chpst -e "$TURNSTILE_ENV_DIR" river -log-level warning diff --git a/services/sv/turnstile-ready/conf b/services/sv/turnstile-ready/conf index 68063d2..97b5c92 100644 --- a/services/sv/turnstile-ready/conf +++ b/services/sv/turnstile-ready/conf @@ -1 +1 @@ -core_services="dbus" +core_services="loadenv dbus" diff --git a/terminal/.config/nushell/config.nu b/terminal/.config/nushell/config.nu index 72e382c..ccb2053 100644 --- a/terminal/.config/nushell/config.nu +++ b/terminal/.config/nushell/config.nu @@ -63,7 +63,9 @@ alias l = ls alias cl = clear alias md = mkdir -def --env mcd [path: one_of(string glob)] { +def --env mcd [path: path] { mkdir $path cd $path } + +alias v = nvim