Adds powerline stuff.
This commit is contained in:
@@ -210,3 +210,71 @@ alias wget-rip-lite='wget --page-requisites --convert-links --adjust-extension -
|
||||
alias mount-nas='mkdir -p ~/nas/tom && sshfs deepthought:/mnt/Data/Private/Homes/tom ~/nas/tom'
|
||||
alias installlocalbin='function f() { sudo install -m 755 -o root -g root "$1" /usr/local/bin ; unset -f f; } f'
|
||||
alias installuserbin='function f() { mkdir -p ~/bin ; cp "$1" ~/bin/ ; unset -f f; } f'
|
||||
|
||||
packdir() {
|
||||
# Check if an argument was provided
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Error: Missing folder name." >&2
|
||||
echo "Usage: packdir <folder_name>" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Strip any trailing slashes to prevent name formatting issues
|
||||
local target="${1%/}"
|
||||
|
||||
# Verify that the target exists and is a directory
|
||||
if [[ ! -d "$target" ]]; then
|
||||
echo "Error: Directory '$target' does not exist." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Prevent accidental destruction of root or parent references
|
||||
if [[ "$target" == "." || "$target" == ".." || "$target" == "/" ]]; then
|
||||
echo "Error: Refusing to compress critical path '$target'." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local archive="${target}.tar.bz2"
|
||||
|
||||
# Verify the archive file doesn't already exist to avoid accidental overwrite
|
||||
if [[ -e "$archive" ]]; then
|
||||
echo "Error: Archive '$archive' already exists." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Create archive and only remove the original folder if tar succeeds
|
||||
tar -jcvf "$archive" "$target" && rm -rf "$target"
|
||||
}
|
||||
|
||||
clone() {
|
||||
if [ -z "$1" -o "$1" = " " -o -z "$2" -o "$2" = " " ]; then
|
||||
echo "Clones the repo into \$PROJECT_ROOT/<projectName>"
|
||||
echo "usage: clone <repositoryUrl> <projectName>"
|
||||
return
|
||||
fi
|
||||
|
||||
git clone "$1" "$2"
|
||||
}
|
||||
|
||||
# Use like this
|
||||
# some-command && sleep 1 ; alert-me -s -t -f --success-message --success-title --failure-message --failure-title --title
|
||||
# osascript -e 'display notification "The command worked" with title "Success"'
|
||||
# osascript -e 'display notification "The command failed" with title "Failed"'
|
||||
alert-me(){
|
||||
local SUCCESS_MESSAGE="The command worked"
|
||||
local SUCCESS_TITLE="Success"
|
||||
local FAILURE_MESSAGE="The command failed"
|
||||
local FAILURE_TITLE="Failed"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
osascript -e "display notification \"$SUCCESS_MESSAGE\" with title \"$SUCCESS_TITLE\""
|
||||
else
|
||||
|
||||
osascript -e "display notification \"$FAILURE_MESSAGE\" with title \"$FAILURE_TITLE\""
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
alias hermes-kanban="hermes dashboard --port 9229 --skip-build --host 127.0.0.1"
|
||||
|
||||
|
||||
4
.rc.d/cargo.sh
Executable file
4
.rc.d/cargo.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
if [ -f "$HOME/.cargo/env" ]; then
|
||||
# For sh/bash/zsh/ash/dash/pdksh
|
||||
source "$HOME/.cargo/env"
|
||||
fi
|
||||
@@ -194,5 +194,6 @@ These values are the same for foreground and background. The bright colors are o
|
||||
| Setgid (g+s) | Bright Yellow | Bright Red | DB |
|
||||
| SOW (+t,o+w) | Bright Red | Green | Bc |
|
||||
| Sticky (+t) | Bright Red | Yellow | Bd |
|
||||
| Cloud Only |
|
||||
|
||||
`export LSCOLORS=FxGxedGdCxxExFHBDBBcBd`
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
export LS_COLORS="rs=0:di=95:ln=36:mh=00:pi=96;43:so=34;43:do=34;43:bd=104:cd=105:or=5;96;40:mi=5;30;46:su=97;101:sg=93;101:ca=00:tw=91;42:ow=91;43:st=42:ex=92:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:"
|
||||
elif [ -n "$ZSH_VERSION" ]; then
|
||||
export LSCOLORS=FxGxedGdCxxExFHBDBbcbd
|
||||
export LSCOLORS=FxGxedGdCxxExFHBDBbcbdxx
|
||||
fi
|
||||
|
||||
0
.rc.d/noop.bash
Normal file
0
.rc.d/noop.bash
Normal file
0
.rc.d/noop.zsh
Normal file
0
.rc.d/noop.zsh
Normal file
64
.rc.d/starship.sh
Normal file
64
.rc.d/starship.sh
Normal file
@@ -0,0 +1,64 @@
|
||||
# Setup starship shell integration (bash, zsh, and fallback paths)
|
||||
_setup_starship() {
|
||||
# Ensure starship binary is accessible if installed in common locations
|
||||
if ! command -v starship >/dev/null 2>&1; then
|
||||
for _starship_bin_dir in \
|
||||
"/opt/homebrew/bin" \
|
||||
"/usr/local/bin" \
|
||||
"$HOME/.starship/bin" \
|
||||
"$HOME/.local/bin"
|
||||
do
|
||||
if [ -x "$_starship_bin_dir/starship" ]; then
|
||||
case ":$PATH:" in
|
||||
*":$_starship_bin_dir:"*) ;;
|
||||
*) PATH="$_starship_bin_dir:$PATH"; export PATH ;;
|
||||
esac
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
command -v starship >/dev/null 2>&1 || return 0
|
||||
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
if starship init bash >/dev/null 2>&1; then
|
||||
eval "$(starship init bash)"
|
||||
else
|
||||
# Fallback for older starship versions
|
||||
for _dir in \
|
||||
"/opt/homebrew/opt/starship/shell" \
|
||||
"/usr/local/opt/starship/shell" \
|
||||
"$HOME/.starship/shell" \
|
||||
"/usr/share/doc/starship/examples" \
|
||||
"/usr/share/starship"
|
||||
do
|
||||
if [ -d "$_dir" ]; then
|
||||
[ -r "$_dir/completion.bash" ] && \. "$_dir/completion.bash"
|
||||
[ -r "$_dir/key-bindings.bash" ] && \. "$_dir/key-bindings.bash"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
elif [ -n "$ZSH_VERSION" ]; then
|
||||
if starship init zsh >/dev/null 2>&1; then
|
||||
eval "$(starship init zsh)"
|
||||
else
|
||||
# Fallback for older starship versions
|
||||
for _dir in \
|
||||
"/opt/homebrew/opt/starship/shell" \
|
||||
"/usr/local/opt/starship/shell" \
|
||||
"$HOME/.starship/shell" \
|
||||
"/usr/share/doc/starship/examples" \
|
||||
"/usr/share/starship"
|
||||
do
|
||||
if [ -d "$_dir" ]; then
|
||||
[ -r "$_dir/completion.zsh" ] && \. "$_dir/completion.zsh"
|
||||
[ -r "$_dir/key-bindings.zsh" ] && \. "$_dir/key-bindings.zsh"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
_setup_starship
|
||||
unset -f _setup_starship
|
||||
Reference in New Issue
Block a user