mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 02:39:40 +00:00
Define TMOUT in .zshrc
This commit is contained in:
parent
6d5bf3ac97
commit
ddfe420cb0
|
@ -59,6 +59,10 @@ zstyle ':completion:::::' completer _expand _complete _ignored _approximate #ena
|
||||||
# Load prompt
|
# Load prompt
|
||||||
[ -f ~/.config/shell/prompt ] && source ~/.config/shell/prompt
|
[ -f ~/.config/shell/prompt ] && source ~/.config/shell/prompt
|
||||||
|
|
||||||
|
# Define TMOUT timeout for TTY and root
|
||||||
|
[ -z "$DISPLAY" ] && export TMOUT=800
|
||||||
|
[ $UID -eq 0 ] && export TMOUT=600
|
||||||
|
|
||||||
# Load extensions (should be last)
|
# Load extensions (should be last)
|
||||||
. /usr/share/zsh/site-functions/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
|
. /usr/share/zsh/site-functions/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
|
||||||
. /usr/share/zsh/site-functions/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
|
. /usr/share/zsh/site-functions/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Set automatic timeout for shell
|
|
||||||
# which will automatically log out the user after certain amount of time
|
|
||||||
|
|
||||||
# This will only be applied for non-graphical sessions,
|
|
||||||
# or whenever root account is logged in
|
|
||||||
|
|
||||||
# If TMOUT was already set, unset it
|
|
||||||
unset TMOUT
|
|
||||||
|
|
||||||
# Define the timeout delay (seconds)
|
|
||||||
TIMEOUT=600
|
|
||||||
|
|
||||||
# Set TMOUT when display is not set
|
|
||||||
[ -z "$DISPLAY" ] && export TMOUT=$TIMEOUT;
|
|
||||||
|
|
||||||
# Set TMOUT when in TTY
|
|
||||||
case $(/usr/bin/tty) in
|
|
||||||
/dev/tty[0-9]*) export TMOUT=$TIMEOUT;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Set TMOUT when user is root
|
|
||||||
[ $UID -eq 0 ] && export TMOUT=$TIMEOUT;
|
|
||||||
|
|
Loading…
Reference in a new issue