Use environment.d to load set env variables
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
6ed415c41a
commit
f14d73dbf4
4 changed files with 32 additions and 67 deletions
|
@ -35,7 +35,6 @@ fi
|
|||
|
||||
# XDG Overrides for unsupported programs
|
||||
export HTTPIE_CONFIG_DIR="${XDG_CONFIG_HOME}/httpie"
|
||||
export WGETRC="${XDG_CONFIG_HOME}/wget/wgetrc"
|
||||
export XAUTHORITY="${HOME}/.Xauthority"
|
||||
export VIMINIT=":source ${XDG_CONFIG_HOME}/vim/vimrc"
|
||||
export CARGO_HOME="${XDG_DATA_HOME}/cargo"
|
||||
|
@ -56,7 +55,6 @@ export WINEPREFIX="${XDG_DATA_HOME}/wine/prefixes/default"
|
|||
export SQLITE_HISTORY="${XDG_DATA_HOME}/sqlite_history"
|
||||
export TASKDATA="${HOME}/tasks"
|
||||
export TASKRC="${XDG_CONFIG_HOME}/task/taskrc"
|
||||
export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
|
||||
export CCACHE_CONFIGPATH="${XDG_CONFIG_HOME}/ccache/config"
|
||||
export CCACHE_DIR="${XDG_CACHE_HOME}/ccache"
|
||||
mkdir -p "${XDG_CONFIG_HOME}/pg"
|
||||
|
@ -80,9 +78,20 @@ export MYSQL_HISTFILE="${XDG_DATA_HOME}/mysql/history"
|
|||
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME}/android"
|
||||
mkdir -p "${XDG_DATA_HOME}/nuget"
|
||||
export NUGET_PACKAGES="${XDG_CACHE_HOME}/nuget/packages"
|
||||
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="${XDG_CONFIG_HOME}/java"
|
||||
export GRADLE_USER_HOME="${XDG_DATA_HOME}/gradle"
|
||||
|
||||
# XDG support for zoom
|
||||
export SSB_HOME="${XDG_DATA_HOME}/zoom"
|
||||
|
||||
# XDG support for parallel
|
||||
export PARALLEL_HOME="${XDG_CONFIG_HOME}/parallel"
|
||||
|
||||
# XDG support for wget
|
||||
export WGETRC="${XDG_CONFIG_HOME}/wget/wgetrc"
|
||||
|
||||
# XDG support for Java and OpenJFX
|
||||
export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java -Djavafx.cachedir=${XDG_CACHE_HOME}/OpenJFX"
|
||||
|
||||
# Python
|
||||
mkdir -p "${XDG_DATA_HOME}/python"
|
||||
export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/startup.py"
|
||||
|
@ -120,71 +129,18 @@ export MANPAGER="${PAGER}"
|
|||
export QT_QPA_PLATFORMTHEME="qt5ct"
|
||||
|
||||
# Ibus
|
||||
export GTK_IM_MODULE=xim
|
||||
export GTK_IM_MODULE=ibus
|
||||
export XMODIFIERS=@im=ibus
|
||||
export QT_IM_MODULE=xim
|
||||
export QT_IM_MODULE=ibus
|
||||
|
||||
export SDL_GAMECONTROLLERCONFIG="050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b8,guide:b10,start:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpdown:b14,dpleft:b15,dpright:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,"
|
||||
# Nintendo Wii Remote Pro Controller
|
||||
SDL_GAMECONTROLLERCONFIG="050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,platform:Linux,a:b0,b:b1,x:b3,y:b2,back:b8,guide:b10,start:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpdown:b14,dpleft:b15,dpright:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,"
|
||||
export SDL_GAMECONTROLLERCONFIG="${SDL_GAMECONTROLLERCONFIG}\n030000004c050000e60c000000016800,PS5 Controller,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"
|
||||
|
||||
# Adding folders to the PATH variable
|
||||
export PATH="${PATH}:${CARGO_HOME}/bin"
|
||||
export PATH="${PATH}:${XDG_DATA_HOME}/npm/bin"
|
||||
export PATH="${PATH}:${GOPATH}/bin"
|
||||
export PATH="${PATH}:${GEM_HOME}/bin"
|
||||
export PATH="${PATH}:${XDG_CONFIG_HOME}/composer/vendor/bin"
|
||||
export PATH="${HOME}/.local/bin:${PATH}"
|
||||
# NVIDIA
|
||||
export __GL_SHADER_DISK_CACHE="1"
|
||||
export __GL_SHADER_DISK_CACHE_SKIP_CLEANUP="1"
|
||||
export __GL_SHADER_DISK_CACHE_PATH="${XDG_CACHE_HOME}/nvidia/shaders"
|
||||
mkdir -p "${__GL_SHADER_DISK_CACHE_PATH}"
|
||||
|
||||
# Load version control information
|
||||
function current_branch() {
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)" > /dev/null 2>&1
|
||||
if [ -z "${branch}" ]
|
||||
then
|
||||
echo ""
|
||||
else
|
||||
echo "[${branch}]"
|
||||
fi
|
||||
}
|
||||
|
||||
function file_count() {
|
||||
count="$(ls -a -1 | wc -l)"
|
||||
echo "[${count} files]"
|
||||
}
|
||||
|
||||
function folder_size() {
|
||||
size="$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')"
|
||||
echo "[${size}B]"
|
||||
}
|
||||
|
||||
function prompt_width() {
|
||||
hostname="$(hostname)"
|
||||
branch="$(current_branch)"
|
||||
pwd="$(print -P %~)"
|
||||
file_count="$(file_count)"
|
||||
folder_size="$(folder_size)"
|
||||
echo "$((COLUMNS - 19 - ${#hostname} - ${#branch} - ${#pwd} - ${#file_count} - ${#folder_size}))"
|
||||
}
|
||||
|
||||
function precmd() {
|
||||
# Print a newline before the prompt, unless it's the
|
||||
# first prompt in the process.
|
||||
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
|
||||
NEW_LINE_BEFORE_PROMPT=1
|
||||
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Custom prompt
|
||||
#NEWLINE=$'\n'
|
||||
#export PS1="┌─"
|
||||
#export PS1="${PS1}%F{red}[%D{%T}]%f"
|
||||
#export PS1="${PS1}%F{blue}[%m]%f"
|
||||
#export PS1="${PS1}%F{yellow}[%~]%f"
|
||||
#export PS1="${PS1}"'${(r:$(prompt_width)::─:)}'
|
||||
#export PS1="${PS1}%F{yellow}"'$(file_count)'"%f"
|
||||
#export PS1="${PS1}%F{blue}"'$(folder_size)'"%f"
|
||||
#export PS1="${PS1}%F{red}"'$(current_branch)'"%f"
|
||||
#export PS1="${PS1}─┐"
|
||||
#export PS1="${PS1}${NEWLINE}└─╼ "
|
||||
#export RPROMPT="╾─┘"
|
||||
eval "$(starship init zsh)"
|
6
system/.config/environment.d/80_path.conf
Normal file
6
system/.config/environment.d/80_path.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
PATH="${PATH}:${CARGO_HOME}/bin"
|
||||
PATH="${PATH}:${XDG_DATA_HOME}/npm/bin"
|
||||
PATH="${PATH}:${GOPATH}/bin"
|
||||
PATH="${PATH}:${GEM_HOME}/bin"
|
||||
PATH="${PATH}:${XDG_CONFIG_HOME}/composer/vendor/bin"
|
||||
PATH="${HOME}/.local/bin:${PATH}"
|
0
system/.config/environment.d/90_prompt.conf
Normal file
0
system/.config/environment.d/90_prompt.conf
Normal file
|
@ -25,6 +25,9 @@ dconf load / < "${XDG_CONFIG_HOME}/dconf/root.conf"
|
|||
# Activate correct crontab file
|
||||
crontab "${XDG_CONFIG_HOME}/cron/crontab"
|
||||
|
||||
# Load env variables
|
||||
export "$(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)"
|
||||
|
||||
# If we are on tty1 we start the x-server
|
||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||
startx "${XDG_CONFIG_HOME}/X11/xinitrc" -- -keeptty > "${XDG_LOG_HOME}/xorg.log" 2>&1 && exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue