diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-14 19:57:03 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-14 19:57:03 +0200 |
| commit | 9ef9c789d8e919c161de14883ecf492693662343 (patch) | |
| tree | 07548acb0708f4ce6fa538ad8b6fcddad50a7291 /shenanigans.sh | |
| parent | b3ab10161ce1ebc25c6cc1f62dca703935a4fe53 (diff) | |
| download | dotfiles-9ef9c789d8e919c161de14883ecf492693662343.tar.gz | |
Cleanup
Diffstat (limited to 'shenanigans.sh')
| -rwxr-xr-x | shenanigans.sh | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/shenanigans.sh b/shenanigans.sh index ea2dc97..29dbf0a 100755 --- a/shenanigans.sh +++ b/shenanigans.sh | |||
| @@ -1,15 +1,12 @@ | |||
| 1 | # Software list. | 1 | # Software list. |
| 2 | # cifs-utils tree hstr s3cmd xclip mc gnupg ripgrep jq xmlstarlet htop nvtop newsboat tmux ctags vim picom scrot | 2 | # cifs-utils tree hstr s3cmd xclip mc gnupg ripgrep jq xmlstarlet htop nvtop tmux vim ctags picom scrot |
| 3 | 3 | ||
| 4 | # Magical environment variables. | 4 | # Magical environment variables. |
| 5 | |||
| 6 | NIX_SHELL_PRESERVE_PROMPT=1 | 5 | NIX_SHELL_PRESERVE_PROMPT=1 |
| 7 | TERM=xterm-256color | 6 | TERM=xterm-256color |
| 8 | VISUAL=vim | 7 | VISUAL=vim |
| 9 | EDITOR=vim | 8 | EDITOR=vim |
| 10 | 9 | ||
| 11 | # Better prompt. | ||
| 12 | |||
| 13 | parse_git_branch() { | 10 | parse_git_branch() { |
| 14 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | 11 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' |
| 15 | } | 12 | } |
| @@ -21,10 +18,10 @@ is_inside_nix_shell() { | |||
| 21 | fi | 18 | fi |
| 22 | } | 19 | } |
| 23 | 20 | ||
| 21 | # Better prompt. | ||
| 24 | export PS1="[\033[38;5;166m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \w\[$(tput sgr0)\] \n$ " | 22 | export PS1="[\033[38;5;166m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33m\]\$(parse_git_branch)\[\033[00m\] \w\[$(tput sgr0)\] \n$ " |
| 25 | 23 | ||
| 26 | # General aliases. | 24 | # General aliases. |
| 27 | |||
| 28 | alias ls='ls --color=none' | 25 | alias ls='ls --color=none' |
| 29 | alias l='ls -lh --color=none' | 26 | alias l='ls -lh --color=none' |
| 30 | alias ll='ls -lha --color=none' | 27 | alias ll='ls -lha --color=none' |
| @@ -38,19 +35,16 @@ alias newsraft='newsraft -f ~/.dotfiles/rssfeeds' | |||
| 38 | alias server='python3 -m http.server 6969' | 35 | alias server='python3 -m http.server 6969' |
| 39 | 36 | ||
| 40 | # Custom folder jump commands. | 37 | # Custom folder jump commands. |
| 41 | |||
| 42 | alias p='cd ~/Vault/projects' | 38 | alias p='cd ~/Vault/projects' |
| 43 | alias j='cd ~/Junk/current' | 39 | alias j='cd ~/Junk/current' |
| 44 | alias d='cd ~/Downloads' | 40 | alias d='cd ~/Downloads' |
| 45 | 41 | ||
| 46 | # Additional path settings. | 42 | # Additional path settings. |
| 47 | |||
| 48 | export PATH=$HOME/Applications:$PATH | 43 | export PATH=$HOME/Applications:$PATH |
| 49 | export PATH=$HOME/go/bin:$PATH | 44 | export PATH=$HOME/go/bin:$PATH |
| 50 | export PATH=/usr/local/go/bin:$PATH | 45 | export PATH=/usr/local/go/bin:$PATH |
| 51 | 46 | ||
| 52 | # History and search. Stolen from J. | 47 | # History and search. Stolen from J. |
| 53 | |||
| 54 | HISTCONTROL=ignoreboth | 48 | HISTCONTROL=ignoreboth |
| 55 | shopt -s histappend | 49 | shopt -s histappend |
| 56 | export HISTSIZE= | 50 | export HISTSIZE= |
| @@ -62,8 +56,7 @@ bind '"\e[B": history-search-forward' | |||
| 62 | export HSTR_CONFIG=hicolor | 56 | export HSTR_CONFIG=hicolor |
| 63 | if [[ $- =~ .i. ]]; then bind '"\C-h": "\C-a hstr -- \C-j"'; fi | 57 | if [[ $- =~ .i. ]]; then bind '"\C-h": "\C-a hstr -- \C-j"'; fi |
| 64 | 58 | ||
| 65 | # Useful function. Much wow! | 59 | # Backup to NAS function. Much wow! |
| 66 | |||
| 67 | backup() { | 60 | backup() { |
| 68 | CWD=$(pwd) | 61 | CWD=$(pwd) |
| 69 | VHOME=/home/$USER/Vault | 62 | VHOME=/home/$USER/Vault |
| @@ -72,12 +65,10 @@ backup() { | |||
| 72 | mkdir -p $VHOME/dotfiles | 65 | mkdir -p $VHOME/dotfiles |
| 73 | cd $VHOME/dotfiles | 66 | cd $VHOME/dotfiles |
| 74 | 67 | ||
| 75 | # Make a copy of dotfiles. | 68 | # Make a copy of certain files. |
| 76 | cp /home/$USER/.shenanigans.sh shenanigans.sh | 69 | cp /home/$USER/.shenanigans.sh shenanigans.sh |
| 77 | cp /home/$USER/.bash_history_infinite bash_history_infinite | 70 | cp /home/$USER/.bash_history_infinite bash_history_infinite |
| 78 | cp /home/$USER/.gitconfig gitconfig | 71 | cp /home/$USER/.gitconfig gitconfig |
| 79 | cp /home/$USER/.newsboat/urls urls | ||
| 80 | cp /home/$USER/.newsboat/cache.db cache.db | ||
| 81 | 72 | ||
| 82 | cp -Rf /home/$USER/.ssh/ ./ | 73 | cp -Rf /home/$USER/.ssh/ ./ |
| 83 | cp -Rf /home/$USER/.aws/ ./ | 74 | cp -Rf /home/$USER/.aws/ ./ |
