My personal configuration files and scripts.
1# shellcheck shell=bash
2
3# If not running interactively, don't do anything.
4[[ $- != *i* ]] && return
5
6# Set the Linux console colour scheme to Catpuccin Mocha.
7if [[ "$TERM" = "linux" ]]; then
8 printf %b "\e]P01E1E2E" # background color to "Base"
9 printf %b "\e]P8585B70" # bright black to "Surface2"
10
11 printf %b "\e]P7BAC2DE" # text color to "Text"
12 printf %b "\e]PFA6ADC8" # bright white to "Subtext0"
13
14 printf %b "\e]P1F38BA8" # red to "Red"
15 printf %b "\e]P9F38BA8" # bright red to "Red"
16
17 printf %b "\e]P2A6E3A1" # green to "Green"
18 printf %b "\e]PAA6E3A1" # bright green to "Green"
19
20 printf %b "\e]P3F9E2AF" # yellow to "Yellow"
21 printf %b "\e]PBF9E2AF" # bright yellow to "Yellow"
22
23 printf %b "\e]P489B4FA" # blue to "Blue"
24 printf %b "\e]PC89B4FA" # bright blue to "Blue"
25
26 printf %b "\e]P5F5C2E7" # magenta to "Pink"
27 printf %b "\e]PDF5C2E7" # bright magenta to "Pink"
28
29 printf %b "\e]P694E2D5" # cyan to "Teal"
30 printf %b "\e]PE94E2D5" # bright cyan to "Teal"
31
32 clear
33fi
34
35# Only switch to Fish if:
36# + Fish is present in $PATH.
37# + Fish is not the parent process.
38# + We are not executing a string of Bash code (eg. `bash -c 'echo test'`).
39# + We are not already in an interactive Bash shell.
40if command -v fish &> /dev/null && [[
41 "$(ps --no-header --pid=$PPID --format=cmd)" != "fish" &&
42 -z $BASH_EXECUTION_STRING &&
43 $SHLVL == 1
44]]
45then
46 shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=''
47 exec fish $LOGIN_OPTION
48fi
49
50if [[ ! -d "$XDG_DATA_HOME/bash" ]]; then
51 mkdir "$XDG_DATA_HOME/bash"
52fi
53HISTFILE="$XDG_DATA_HOME/bash/history"
54
55PS1="[\u@\h \W]\$ "
56
57if command -v exa &> /dev/null; then
58 cmd="eza --color=auto --hyperlink --classify --group-directories-first"
59 alias ls="$cmd"
60 alias ll="$cmd --long --header --group --git"
61 alias la="ll --all"
62 alias tree="$cmd --git-ignore --tree"
63else
64 alias ls="ls --color=auto"
65fi
66
67# vim: ft=bash