dotfiles/.config/shell/logout.sh

19 lines
496 B
Bash
Raw Normal View History

2022-08-08 23:59:31 +02:00
# This file is sourced by a login shell upon logout
2024-06-06 19:10:46 +02:00
# Clear the screen (if desired) to increase privacy
2022-08-08 23:59:31 +02:00
if [ "$SHLVL" = 1 ]; then
2024-06-06 19:02:07 +02:00
if [ -x /usr/bin/clear ]; then
2024-06-06 19:10:46 +02:00
read -p "Clear screen? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
/usr/bin/clear
fi
2024-06-06 19:02:07 +02:00
elif [ -x /usr/bin/clear_console ]; then
2024-06-06 19:10:46 +02:00
read -p "Clear screen? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
/usr/bin/clear_console -q
fi
2024-06-06 19:02:07 +02:00
fi
2022-08-08 23:59:31 +02:00
fi