Clean up distrobox errors

This commit is contained in:
John Mertz 2022-12-12 22:44:24 -05:00
parent f9031a775d
commit 25de715a12
9 changed files with 12 additions and 8 deletions

View File

@ -49,9 +49,9 @@ alias blc="${HOME}/scripts/thinkpad/blc.pl --notify"
alias mpv="flatpak run io.mpv.Mpv" alias mpv="flatpak run io.mpv.Mpv"
# Detect if I'm in a toolbox # Detect if I'm in a toolbox
alias istoolbox='[ -f "/run/.toolboxenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv' alias isdistrobox='[ -f "/run/.toolboxenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv'
if [ $(istoolbox) ]; then if [ $(isdistrobox) ]; then
source $HOME/.dotfiles/bash/bash_aliases.distrobox source $HOME/.dotfiles/bash/bash_aliases.distrobox
else else
source $HOME/.dotfiles/bash/bash_aliases.host source $HOME/.dotfiles/bash/bash_aliases.host

View File

@ -26,7 +26,7 @@ if [ ! -e ${HOME}/.spool/last_login_gui ]; then
echo "Use 'startsway' or 'starti3' to launch a GUI" echo "Use 'startsway' or 'starti3' to launch a GUI"
fi fi
if [ -f "/run/.containerenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv; then if [ -f "/run/.containerenv" ]; then
source $HOME/.dotfiles/bash/bash_login.distrobox source $HOME/.dotfiles/bash/bash_login.distrobox
else else
source $HOME/.dotfiles/bash/bash_login.host source $HOME/.dotfiles/bash/bash_login.host

View File

@ -1 +0,0 @@
export SWAYSOCK="${HOME}/.spool/sway-ipc.sock"

View File

@ -1,6 +1,6 @@
# vim: ft=sh # vim: ft=sh
if [ -f "/run/.containerenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv; then if [ -f "/run/.containerenv" ]; then
source $HOME/.dotfiles/bash/bash_logout.distrobox source $HOME/.dotfiles/bash/bash_logout.distrobox
else else
source $HOME/.dotfiles/bash/bash_logout.host source $HOME/.dotfiles/bash/bash_logout.host

View File

@ -16,7 +16,7 @@ PERL_LOCAL_LIB_ROOT="${HOME}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}
PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT; PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT; PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT;
if [ -f "/run/.containerenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv; then if [ -f "/run/.containerenv" ]; then
source $HOME/.dotfiles/bash/bash_profile.distrobox source $HOME/.dotfiles/bash/bash_profile.distrobox
else else
source $HOME/.dotfiles/bash/bash_profile.host source $HOME/.dotfiles/bash/bash_profile.host

View File

@ -22,6 +22,7 @@ export EDITOR="flatpak run io.neovim.nvim"
# don't put duplicate lines or lines starting with space in the history. # don't put duplicate lines or lines starting with space in the history.
shopt -s histappend shopt -s histappend
HISTCONTROL=ignoreboth HISTCONTROL=ignoreboth
HISTFILE=${HOME}/.spool/bash_history
# append to the history file, don't overwrite it # append to the history file, don't overwrite it
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
@ -92,7 +93,7 @@ export TERM="xterm"
# Set initial title # Set initial title
echo -e -n "\033]2;Welcome to Bash\007" echo -e -n "\033]2;Welcome to Bash\007"
if [ -f "/run/.containerenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv; then if [ -f "/run/.containerenv" ]; then
source $HOME/.dotfiles/bash/bashrc.distrobox source $HOME/.dotfiles/bash/bashrc.distrobox
else else
source $HOME/.dotfiles/bash/bashrc.host source $HOME/.dotfiles/bash/bashrc.host

View File

@ -0,0 +1,3 @@
export DISTROBOX=`grep -oP "(?<=name=\")[^\";]+" /run/.containerenv`
HISTFILE=${HISTFILE}.$DISTROBOX
neofetch

View File

@ -10,3 +10,4 @@ if [ -z $SSH_AGENT_PID ]; then
fi fi
fi fi
echo "This is the host OS. You probably want to open a Distrobox."

View File

@ -30,7 +30,7 @@ fi
# Perl # Perl
PATH="${HOME}/perl5/bin:$PATH" PATH="${HOME}/perl5/bin:$PATH"
if [ -f "/run/.containerenv" ] && grep -oP "(?<=name=\")[^\";]+" /run/.containerenv; then if [ -f "/run/.containerenv" ]; then
source $HOME/.dotfiles/bash/path.distrobox source $HOME/.dotfiles/bash/path.distrobox
else else
source $HOME/.dotfiles/bash/path.host source $HOME/.dotfiles/bash/path.host