diff options
Diffstat (limited to 'users/wpcarro/dotfiles')
-rw-r--r-- | users/wpcarro/dotfiles/config.fish | 34 | ||||
-rw-r--r-- | users/wpcarro/dotfiles/default.nix | 5 | ||||
-rw-r--r-- | users/wpcarro/dotfiles/dunstrc | 53 | ||||
-rw-r--r-- | users/wpcarro/dotfiles/prompt.fish | 87 |
4 files changed, 179 insertions, 0 deletions
diff --git a/users/wpcarro/dotfiles/config.fish b/users/wpcarro/dotfiles/config.fish new file mode 100644 index 000000000000..9d91b0086f8c --- /dev/null +++ b/users/wpcarro/dotfiles/config.fish @@ -0,0 +1,34 @@ +alias c 'xclip -selection clipboard -i' +alias p 'xclip -selection clipboard -o' +alias cat 'bat --theme="Monokai Extended Light"' +alias rgh 'rg --hidden' +alias fdh 'fd --hidden' +alias tpr 'tput reset' +alias ls 'exa --sort=type' +alias ll 'exa --long --sort=type' +alias la 'exa --long --all --sort=type' +alias gd 'git diff' +alias glp 'git log --pretty --oneline --graph' +alias gpf 'git push --force-with-lease' +alias gsh 'git show HEAD' +alias gst 'git status' +alias edit 'emacsclient -n' +# fs navigation +alias d 'cd /depot' +alias w 'cd /depot/users/wpcarro' +# This allows me to call rebuild-system from any directory. +alias rebuild-system 'sudo /depot/bin/rebuild-system' + +# environment variables +set -gx EDITOR "emacsclient" +set -gx ALTERNATE_EDITOR "emacs -q -nw" +set -gx VISUAL "emacsclient" + +# Use my custom fish prompt +source /depot/users/wpcarro/dotfiles/prompt.fish + +# Configure fuzzy history, file, directory searching +source (fzf-share)/key-bindings.fish && fzf_key_bindings + +# Install direnv +eval (direnv hook fish) diff --git a/users/wpcarro/dotfiles/default.nix b/users/wpcarro/dotfiles/default.nix new file mode 100644 index 000000000000..8150f5370699 --- /dev/null +++ b/users/wpcarro/dotfiles/default.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + dunstrc = ./dunstrc; +} diff --git a/users/wpcarro/dotfiles/dunstrc b/users/wpcarro/dotfiles/dunstrc new file mode 100644 index 000000000000..a17533f07330 --- /dev/null +++ b/users/wpcarro/dotfiles/dunstrc @@ -0,0 +1,53 @@ +[global] +font = JetBrains Mono +origin = top-right +markup = yes +plain_text = no +format = "<b>%s</b>\n%b" +sort = no +indicate_hidden = yes +alignment = center +bounce_freq = 0 +show_age_threshold = -1 +word_wrap = yes +ignore_newline = no +stack_duplicates = yes +hide_duplicate_count = yes +geometry = "300x50-15+49" +shrink = no +transparency = 5 +idle_threshold = 0 +monitor = 0 +follow = keyboard +sticky_history = yes +history_length = 15 +show_indicators = no +line_height = 3 +separator_height = 2 +padding = 6 +horizontal_padding = 6 +separator_color = frame +startup_notification = false +browser = xdg-open +icon_position = off +max_icon_size = 80 +frame_width = 3 +frame_color = "#8EC07C" + +[urgency_low] +frame_color = "#3B7C87" +foreground = "#3B7C87" +background = "#191311" +timeout = 4 + +[urgency_normal] +frame_color = "#5B8234" +foreground = "#5B8234" +background = "#191311" +timeout = 6 + +[urgency_critical] +frame_color = "#B7472A" +foreground = "#B7472A" +background = "#191311" +timeout = 8 \ No newline at end of file diff --git a/users/wpcarro/dotfiles/prompt.fish b/users/wpcarro/dotfiles/prompt.fish new file mode 100644 index 000000000000..58d22dab5efa --- /dev/null +++ b/users/wpcarro/dotfiles/prompt.fish @@ -0,0 +1,87 @@ +# When the Emacs SSH client, Tramp, connects to a remote host that uses Fish, +# it's important to keep the shell prompt simple so that Tramp can parse it. +if test "$TERM" = "dumb" + function fish_prompt + echo "\$ " + end + function fish_right_prompt; end + function fish_greeting; end + function fish_title; end +else + function fish_prompt + # My custom prompt. + # + # Design objectives: + # - max-length <= 80 characters + # - minimal + # - no dependencies (well, you know what I mean) + # + # Components + # - ssh connection + # - user + # - host + # - git repo + # - git branch + # - lambda character as prompt + + # Cache status before we overwrite it. + set -l last_status $status + + # Colors + set -l color_inactive (set_color red --bold) + set -l color_active (set_color green --bold) + set -l color_normal (set_color normal) + + # SSH information + if set -q SSH_CLIENT; or set -q SSH_TTY + echo -en "$color_active \bssh ✓ [$color_normal$USER@"(hostname)"$color_active]$color_normal" + else + echo -en "$color_inactive \bssh ✗ [$color_normal$USER@"(hostname)"$color_inactive]$color_normal" + end + + # Separator + echo -n " " + + # Git information + set -l git_repo (git rev-parse --show-toplevel 2>/dev/null) + set -l git_status $status + + if [ (realpath .) = "/" ] + set -g dir_path (realpath .) + else if [ (realpath ..) = "/" ] + set -g dir_path (realpath .) + else + set -g dir_path (echo (basename (realpath ..))"/"(basename (realpath .))) + end + + if test $git_status -eq 0 + set -l git_repo_name (basename (git rev-parse --show-toplevel)) + set -l git_branch (git branch 2>/dev/null | grep '^\*' | cut -d' ' -f2-) + echo -en "$color_active \bgit ✓ [$color_normal$git_branch$color_active|$color_normal$git_repo_name$color_active|$color_normal$dir_path$color_active]$color_normal" + else + echo -en "$color_inactive \bgit ✗ [$color_normal$dir_path$color_inactive]$color_normal" + end + + # Newline + echo + + # Handle root vs non-root + if [ "$USER" = "root" ] + set -g prompt_sigil "#" + else + set -g prompt_sigil "λ" + end + + set -l time (date +"%T") + if test $last_status -eq 0 + set -l color_prompt (set_color white --bold) + echo -n "$time$color_prompt $prompt_sigil$color_normal " + else + set -l color_prompt (set_color red --bold) + echo -n "$time$color_prompt $prompt_sigil$color_normal " + end + end + function fish_right_prompt; end + function fish_greeting; end + function fish_title; end +end |