xonecas.io
56101
Df

dotfiles / commit 1ff89e6

Simplify shell config install

xonecas2026-04-07 1ff89e65ff3bcbfb150df531b944a7260871c303 parent a0865f3

3 files changed

codium/settings.json+1−1
@@ -4,7 +4,7 @@
44 "workbench.layoutControl.enabled": false,
55 "workbench.activityBar.location": "top",
66 "terminal.integrated.initialHint": false,
7- "editor.fontSize": 16,
7+ "editor.fontSize": 17,
88 "editor.fontFamily": "'ZedMono Nerd Font Mono', 'Droid Sans Mono', monospace",
99 "terminal.integrated.fontSize": 16,
1010 "workbench.startupEditor": "none",
shell/install.sh+3−25
@@ -1,29 +1,7 @@
11 #!/usr/bin/env bash
2-# Install shell config by appending a source line to ~/.bashrc (or ~/.zshrc).
3-# The full bashrc is kept here for reference; the installer sources shared.sh
4-# so it works alongside an existing rc file.
52 set -euo pipefail
63
7-repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8-config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/shell"
4+script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
95
10-mkdir -p "$config_dir"
11-
12-# Link shared.sh
13-target="$config_dir/shared.sh"
14-if [ ! -e "$target" ] && [ ! -L "$target" ]; then
15- ln -s "$repo_dir/shared.sh" "$target"
16-fi
17-
18-source_line='[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shared.sh" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shared.sh"'
19-
20-for rc_file in "$HOME/.zshrc" "$HOME/.bashrc"; do
21- if [ -f "$rc_file" ]; then
22- if ! grep -q "shell/shared.sh" "$rc_file"; then
23- printf '\n# Load shared shell config\n%s\n' "$source_line" >> "$rc_file"
24- fi
25- fi
26-done
27-
28-echo "Installed shell config."
29-echo "A full reference bashrc is in: $repo_dir/bashrc"
6+cp "$script_dir/bashrc" "$HOME/.bashrc"
7+echo "Installed $script_dir/bashrc -> $HOME/.bashrc"
shell/shared.sh+0−36
@@ -1,36 +0,0 @@
1-# These are the shared shell configurations, used by zsh on mac and bash on linux.
2-# to install these please include them at the bottom of your shell's config (zshrc or bashrc)
3-
4-# Convenience alias:
5-export EDITOR=nvim
6-
7-alias n=nvim
8-alias oc=opencode
9-
10-alias ll='ls -Fal --color=always'
11-alias ls='ls --color=always'
12-
13-alias g='git'
14-alias gst='git status'
15-alias gc='git commit --verbose'
16-alias gp='git pull origin'
17-alias gpo='git push origin'
18-
19-alias rg='rg --color always'
20-alias les='less -r'
21-
22-# Greetings!
23-function greet() {
24- local cows=(
25- "default" "flaming-sheep" "fox" "llama" "sheep" "skeleton" "three-eyes" "tux" "udder" "www"
26- )
27- local count=${#cows[@]}
28- local idx
29- if [ -n "${ZSH_VERSION:-}" ]; then
30- idx=$((RANDOM % count + 1))
31- else
32- idx=$((RANDOM % count))
33- fi
34- local cow=${cows[$idx]:-"default"}
35- fortune -s | cowsay -f "$cow" -W 80 | lolcat -p 1.0 -F 0.06 -S "$RANDOM"
36-}