mirror of
https://github.com/gaschz/dotfiles.git
synced 2026-01-10 00:14:26 +01:00
fix: unset local variables exported to environment
This commit is contained in:
parent
6e0fe495cf
commit
11bc58a4dd
@ -124,7 +124,7 @@ if ! shopt -oq posix; then
|
|||||||
source_readable /usr/share/bash-completion/bash_completion
|
source_readable /usr/share/bash-completion/bash_completion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset newline ps1_symbol dircolor reset_color usercolor
|
unset newline ps1_symbol dircolor usercolor
|
||||||
## }}}
|
## }}}
|
||||||
## {{{ Plugins
|
## {{{ Plugins
|
||||||
if has zoxide; then
|
if has zoxide; then
|
||||||
|
|||||||
@ -111,7 +111,8 @@ has qubesctl && {
|
|||||||
alias qctlu="qctl --skip-dom0 --targets"
|
alias qctlu="qctl --skip-dom0 --targets"
|
||||||
qctlus(){
|
qctlus(){
|
||||||
test -n "${2-}" || return 1
|
test -n "${2-}" || return 1
|
||||||
qubesctl --skip-dom0 --targets "${1}" state.apply "${@}"
|
# shellcheck disable=SC3058
|
||||||
|
qubesctl --skip-dom0 --targets "${1}" state.apply "${@#"${1}"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
has gpg && alias gpgs="gpg --show-keys"
|
has gpg && alias gpgs="gpg --show-keys"
|
||||||
@ -162,16 +163,19 @@ case "${TERM-}" in
|
|||||||
iterm|*-truecolor)
|
iterm|*-truecolor)
|
||||||
export COLORTERM=truecolor; color_prompt=yes
|
export COLORTERM=truecolor; color_prompt=yes
|
||||||
;;
|
;;
|
||||||
*-color|*-256color|linux*)
|
*-color|*-256color|linux*|vt100*|vt220*)
|
||||||
color_prompt=yes
|
color_prompt=yes
|
||||||
;;
|
;;
|
||||||
""|dumb|vt100*|vt220*)
|
""|dumb)
|
||||||
color_prompt=no
|
color_prompt=no
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
color_prompt=no
|
color_prompt=no
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
if test -n "${NO_COLOR-}"; then
|
||||||
|
color_prompt=no
|
||||||
|
fi
|
||||||
|
|
||||||
## Colorise "ls" output.
|
## Colorise "ls" output.
|
||||||
if test "${color_prompt-}" = "yes"; then
|
if test "${color_prompt-}" = "yes"; then
|
||||||
|
|||||||
@ -99,11 +99,11 @@ _set_title() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "${TERM-}" in
|
case "${TERM-}" in
|
||||||
screen*)
|
screen*|tmux*)
|
||||||
precmd() {
|
precmd() {
|
||||||
_set_title "$@"
|
_set_title "$@"
|
||||||
if [ "${STY:-}" -o "${TMUX:-}" ]; then
|
if [ "${STY:-}" -o "${TMUX:-}" ]; then
|
||||||
# print -Pn "\033]1;\a\033]1;@%m\a"
|
print -Pn '\033]1;\a\033]1;@%m\a'
|
||||||
print -Pn '\033k@\033\\'
|
print -Pn '\033k@\033\\'
|
||||||
else
|
else
|
||||||
print -Pn '\033k@%m\033\\'
|
print -Pn '\033k@%m\033\\'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
## SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
## SPDX-FileCopyrightText: 2024 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||||
##
|
##
|
||||||
## SPDX-License-Identifier: GFDL-1.3-or-later
|
## SPDX-License-Identifier: GFDL-1.3-or-later
|
||||||
##
|
##
|
||||||
@ -46,6 +46,12 @@ if test "${#}" -eq 0; then
|
|||||||
unset term_file_active
|
unset term_file_active
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sc="$(tput sc || printf '%b' '\0337')"
|
||||||
|
rc="$(tput rc || printf '%b' '\0338')"
|
||||||
|
cup="$(tput cup 99999 99999 || printf '%b' '\033[99999;99999H')"
|
||||||
|
csr="$(tput csr || printf '%b' '\033[r')"
|
||||||
|
gc="$(tput u7 || printf '%b' '\033[6n')"
|
||||||
|
|
||||||
## POSIX compliant.
|
## POSIX compliant.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC3045
|
||||||
if ! printf '%s\n' "R" | read -r -t 1 -sd R 2>/dev/null; then
|
if ! printf '%s\n' "R" | read -r -t 1 -sd R 2>/dev/null; then
|
||||||
@ -58,7 +64,7 @@ if ! printf '%s\n' "R" | read -r -t 1 -sd R 2>/dev/null; then
|
|||||||
## Slow due to heavy stty calls.
|
## Slow due to heavy stty calls.
|
||||||
termios="$(stty -g)"
|
termios="$(stty -g)"
|
||||||
stty raw -echo min 0 time 1
|
stty raw -echo min 0 time 1
|
||||||
printf '\0337\033[r\033[99999;99999H\033[6n\0338' >/dev/tty
|
printf '%s' "${sc}${csr}${cup}${gc}${rc}" >/dev/tty
|
||||||
IFS='[;R' read -r _ rows cols _ </dev/tty
|
IFS='[;R' read -r _ rows cols _ </dev/tty
|
||||||
stty "${termios}" cols "${cols}" rows "${rows}"
|
stty "${termios}" cols "${cols}" rows "${rows}"
|
||||||
unset termios
|
unset termios
|
||||||
@ -67,7 +73,7 @@ fi
|
|||||||
|
|
||||||
## Non-POSIX compliant and fast.
|
## Non-POSIX compliant and fast.
|
||||||
stty -echo
|
stty -echo
|
||||||
printf '\0337\033[r\033[99999;99999H\033[6n\0338' >/dev/tty
|
printf '%s' "${sc}${csr}${cup}${gc}${rc}" >/dev/tty
|
||||||
# shellcheck disable=3045,SC2034
|
# shellcheck disable=3045,SC2034
|
||||||
IFS='[;R' read -r -t 1 -s -d R _ rows cols _ </dev/tty || {
|
IFS='[;R' read -r -t 1 -s -d R _ rows cols _ </dev/tty || {
|
||||||
printf '%s\n' "${msg_unsupported}" >&2
|
printf '%s\n' "${msg_unsupported}" >&2
|
||||||
|
|||||||
@ -17,8 +17,7 @@ set-option -g history-limit 10000
|
|||||||
set-option -g repeat-time 2000
|
set-option -g repeat-time 2000
|
||||||
set-option -g escape-time 50
|
set-option -g escape-time 50
|
||||||
set-option -g status-position top
|
set-option -g status-position top
|
||||||
set-option -g default-terminal screen-256color
|
set-option -g default-terminal tmux-256color
|
||||||
# set-option -g default-terminal tmux-256color # on newer ncurses
|
|
||||||
set-option -g display-panes-time 2000
|
set-option -g display-panes-time 2000
|
||||||
set-option -g display-time 2000
|
set-option -g display-time 2000
|
||||||
set-option -g focus-events on
|
set-option -g focus-events on
|
||||||
|
|||||||
@ -48,12 +48,34 @@ desktop_autostart(){
|
|||||||
|
|
||||||
for f in "${autostart_etc}"/*.desktop "${autostart_home}"/*.desktop; do
|
for f in "${autostart_etc}"/*.desktop "${autostart_home}"/*.desktop; do
|
||||||
test -r "${f}" || continue
|
test -r "${f}" || continue
|
||||||
|
## TODO: check other conditions: (Not|Only)ShowIn
|
||||||
# shellcheck disable=SC2091
|
# shellcheck disable=SC2091
|
||||||
|
autostart_hidden="$(awk -F '=' -- '/^Hidden=/{print $2}' "${f}")"
|
||||||
|
if test "${autostart_hidden}" = "true"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
autostart_tryexec="$(awk -F '=' -- '/^TryExec=/{print $2}' "${f}")"
|
||||||
|
if test -n "${autostart_tryexec}"; then
|
||||||
|
case "${autostart_tryexec}" in
|
||||||
|
/*) test -x "${autostart_tryexec}" || continue;;
|
||||||
|
*) command -v "${autostart_tryexec}" >/dev/null || continue;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
autostart_path="$(awk -F '=' -- '/^Path=/{print $2}' "${f}")"
|
||||||
autostart_exec="$(awk -F '=' -- '/^Exec=/{print $2}' "${f}")"
|
autostart_exec="$(awk -F '=' -- '/^Exec=/{print $2}' "${f}")"
|
||||||
command -v "${autostart_exec%% *}" >/dev/null || continue
|
case "${autostart_exec}" in
|
||||||
|
/*) test -x "${autostart_exec}" || continue;;
|
||||||
|
*) command -v "${autostart_exec}" >/dev/null || continue;;
|
||||||
|
esac
|
||||||
|
if test -n "${autostart_path}"; then
|
||||||
|
if ! test -d "${autostart_path}"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
cd "${autostart_path}" || continue
|
||||||
|
fi
|
||||||
${autostart_exec} &
|
${autostart_exec} &
|
||||||
done
|
done
|
||||||
unset f
|
unset f autostart_hidden autostart_tryexec autostart_exec autostart_path
|
||||||
}
|
}
|
||||||
|
|
||||||
## Source Xorg profiles.
|
## Source Xorg profiles.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user