summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-08-20 16:34:28 -0500
committerToby Vincent <tobyv13@gmail.com>2022-08-20 16:34:28 -0500
commit1bd2b586d4c7d6381af548944b75f57458f0d337 (patch)
tree9d6a62e4d6f320d56129a67e1915b5a4ed42e2bb
parentf8cb7b756e489de50e87567a1b44188ce1573add (diff)
feat(sh): inherit env from environment.d
-rw-r--r--bash/.bash_profile5
-rw-r--r--sh/.profile26
-rw-r--r--sway/.config/environment.d/20-sway.conf2
-rw-r--r--wayland/.config/environment.d/10-wayland.conf9
-rw-r--r--zsh/.zshenv2
5 files changed, 31 insertions, 13 deletions
diff --git a/bash/.bash_profile b/bash/.bash_profile
index 6c85f86..832b387 100644
--- a/bash/.bash_profile
+++ b/bash/.bash_profile
@@ -1,7 +1,8 @@
#!/bin/bash
-
# shellcheck disable=1090
+
+export BASH_COMPLETION_USER_DIR="$XDG_DATA_HOME/bash-completion/completions"
+
. ~/.profile
-# shellcheck disable=1090
if [[ $- == *i* ]]; then . ~/.bashrc; fi
diff --git a/sh/.profile b/sh/.profile
index f865eb2..1098a70 100644
--- a/sh/.profile
+++ b/sh/.profile
@@ -1,24 +1,29 @@
#!/bin/sh
-# shellcheck disable=2155
+# shellcheck disable=1091,2046
-# https://wiki.archlinux.org/title/XDG_Base_Directory
+# environment.d
+if [ -x /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator ]; then
+ export $(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
+fi
+
+# xdg
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u "$USER")}"
-export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
-export BASH_COMPLETION_USER_DIR="$XDG_DATA_HOME/bash-completion/completions"
-export LESSHISTFILE="$XDG_STATE_HOME/lesshst"
-export WGETRC="$XDG_CONFIG_HOME/wgetrc"
-
-# Misc
-export EDITOR="$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v vi)"
-export BROWSER="$(command -v firefox || command -v chromium 2>/dev/null)"
+# prog
+EDITOR="$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v vi)"
+BROWSER="$(command -v chromium 2>/dev/null || command -v firefox)"
+export EDITOR BROWSER
export TERMINAL="alacritty"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
+
+# opts
export MANROFFOPT="-c"
+export LESSHISTFILE="$XDG_STATE_HOME/lesshst"
+export WGETRC="$XDG_CONFIG_HOME/wgetrc"
export STARSHIP_LOG="error"
export FZF_PREVIEW_COMMAND="bat --style=numbers,changes --wrap never --color always {} || cat {} || exa --tree --icons --git-ignore {} || tree -C {}"
export FZF_DEFAULT_COMMAND="fd --type f || git ls-tree -r --name-only HEAD || rg --files || find ."
@@ -26,6 +31,7 @@ export FZF_DEFAULT_OPTS='--exit-0 --select-1 --bind "ctrl-q:abort,ctrl-y:preview
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS="--min-height 30 --preview-window down:60% --preview-window noborder --preview '($FZF_PREVIEW_COMMAND) 2> /dev/null'"
+# path
export PATH="$PATH:$HOME/.local/bin"
# rust
diff --git a/sway/.config/environment.d/20-sway.conf b/sway/.config/environment.d/20-sway.conf
new file mode 100644
index 0000000..f73a316
--- /dev/null
+++ b/sway/.config/environment.d/20-sway.conf
@@ -0,0 +1,2 @@
+XDG_SESSION_DESKTOP=sway
+XDG_CURRENT_DESKTOP=sway
diff --git a/wayland/.config/environment.d/10-wayland.conf b/wayland/.config/environment.d/10-wayland.conf
new file mode 100644
index 0000000..1c5c347
--- /dev/null
+++ b/wayland/.config/environment.d/10-wayland.conf
@@ -0,0 +1,9 @@
+XDG_SESSION_TYPE=wayland
+MOZ_ENABLE_WAYLAND=1
+CLUTTER_BACKEND=wayland
+QT_QPA_PLATFORM=wayland-egl
+ECORE_EVAS_ENGINE=wayland-egl
+ELM_ENGINE=wayland_egl
+SDL_VIDEODRIVER=wayland
+_JAVA_AWT_WM_NONREPARENTING=1
+NO_AT_BRIDGE=1
diff --git a/zsh/.zshenv b/zsh/.zshenv
index ad32cea..5fad2b0 100644
--- a/zsh/.zshenv
+++ b/zsh/.zshenv
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/zsh
emulate sh -c '. ~/.profile'