-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfetch.bashrc
More file actions
61 lines (52 loc) · 2.46 KB
/
fetch.bashrc
File metadata and controls
61 lines (52 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# --- System & History ---
export HISTCONTROL=ignoreboth:erasedups
export HISTSIZE=10000
shopt -s histappend
shopt -s checkwinsize
# --- Greyscale Palette (RGB) ---
C_BG="30;30;46" # Dark Charcoal
C_WHITE="205;214;244" # Soft White
C_SILVER="166;173;200" # Muted Silver
C_GREY="108;112;134" # Medium Grey
C_DARK="17;17;27" # Deep Black
# --- Powerline Prompt Engine ---
__build_prompt() {
local EXIT="$?"
local ICON_USER=""
local ICON_DIR=""
local ICON_GIT=""
# 1. User Segment (White, turns Grey on error)
local SEG1_BG=$C_WHITE
[[ $EXIT -ne 0 ]] && SEG1_BG=$C_GREY
local S1="\[\e[48;2;${SEG1_BG}m\e[38;2;${C_DARK}m\] ${ICON_USER} Neko \[\e[0m\]"
# 2. Transition 1 (User -> Dir)
local T1="\[\e[38;2;${SEG1_BG}m\e[48;2;${C_SILVER}m\]\[\e[0m\]"
# 3. Directory Segment with Contrast Slashes
local RAW_DIR="\w"
# Slashes are now colored with C_GREY for subtle distinction
local COLORED_DIR="${RAW_DIR//\//\\[\e[38;2;${C_GREY}m\\]/\\[\e[38;2;${C_DARK}m\\]}"
local S2="\[\e[48;2;${C_SILVER}m\e[38;2;${C_DARK}m\] ${ICON_DIR} ${COLORED_DIR} \[\e[0m\]"
# 4. Git Integration (Dynamic Label)
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local BRANCH=$(git branch --show-current)
local T2="\[\e[38;2;${C_SILVER}m\e[48;2;${C_GREY}m\]\[\e[0m\]"
local S3="\[\e[48;2;${C_GREY}m\e[38;2;${C_WHITE}m\] ${ICON_GIT} ${BRANCH} \[\e[0m\]"
local TAIL="\[\e[38;2;${C_GREY}m\]\[\e[0m\]"
PS1="${S1}${T1}${S2}${T2}${S3}${TAIL} "
else
local TAIL="\[\e[38;2;${C_SILVER}m\]\[\e[0m\]"
PS1="${S1}${T1}${S2}${TAIL} "
fi
}
PROMPT_COMMAND=__build_prompt
# --- Professional Aliases ---
alias ls='ls --color=auto --group-directories-first --classify'
alias ll='ls -al --classify'
alias grep='grep --color=auto'
alias ..='cd ..'
alias musics='cd ~/MPP && bash nekoplay.sh'
alias bspconf='nano ~/.config/bspwm/bspwmrc'
alias sxhkdconf='nano ~/.config/sxhkd/sxhkdrc'
alias fetch='neofetch --ascii_distro gentoo'
alias livewallon='nice -n 19 xwinwrap -ov -ni -g 1920x1080 -- mpv --wid=%WID --loop --no-audio --hwdec=vaapi --vo=gpu --gpu-api=opengl --profile=fast --vd-lavc-fast --vd-lavc-threads=1 --cache=no --demuxer-readahead-secs=0 --demuxer-max-bytes=1M --vd-lavc-dr=yes --dither=no --correct-downscaling=no --scale=bilinear --hdr-compute-peak=no --video-sync=display-resample --framedrop=vo --terminal=no --ytdl=no --msg-level=all=no "Videos/livewall/1.mp4" &
'