repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

shell: add bash and tmux configs

2596fac55b11422329c614b2df51dff8fe31364c

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

bash/bash_profile

Added
new file mode 100644
1 +# Bash login config from dotfiles.
3 +# Preserve local POSIX profile if present.
4 +if [ -r "$HOME/.profile" ]; then
5 + . "$HOME/.profile"
6 +fi
8 +# Shared interactive bash config.
9 +if [ -r "$HOME/.bashrc" ]; then
10 + . "$HOME/.bashrc"
11 +fi

bash/bashrc

Added
new file mode 100644
1 +# Bash interactive config from dotfiles.
3 +case "$-" in
4 + *i*) ;;
5 + *) return ;;
6 +esac
8 +# Linux virtual console colors. No sudo, no effect in terminal emulators.
9 +_nugu_console_theme() {
10 + [ "${TERM:-}" = linux ] || return 0
12 + local mode="${1:-light}"
13 + local theme="$HOME/.config/bash/linux-console/nugu-$mode.sh"
15 + if [ ! -r "$theme" ]; then
16 + printf 'missing theme: %s\n' "$theme" >&2
17 + return 1
18 + fi
20 + . "$theme"
21 + clear
24 +tt() {
25 + case "${1:-toggle}" in
26 + dark|light) _nugu_console_theme "$1" ;;
27 + toggle)
28 + case "${NUGU_CONSOLE_THEME:-light}" in
29 + light) _nugu_console_theme dark ;;
30 + dark) _nugu_console_theme light ;;
31 + *) _nugu_console_theme light ;;
32 + esac
33 + ;;
34 + *)
35 + printf 'usage: tt [dark|light]\n' >&2
36 + return 2
37 + ;;
38 + esac
41 +_nugu_console_theme light

tmux/tmux.conf

Added
new file mode 100644
1 +# Minimal tmux config.
2 +# One thing to remember: Prefix h = help.
3 +# Prefix is default: Ctrl-b.
5 +##### fix Pi warning / modern keyboard input
6 +set -g extended-keys on
7 +set -g extended-keys-format csi-u
9 +##### sane defaults
10 +set -g mouse on
11 +set -g history-limit 50000
12 +set -g renumber-windows on
13 +set -g base-index 1
14 +setw -g pane-base-index 1
15 +setw -g mode-keys vi
16 +set -g status-keys vi
17 +set -g escape-time 10
18 +set -g focus-events on
19 +set -g set-clipboard on
21 +##### color
22 +set -g default-terminal "tmux-256color"
23 +set -as terminal-features ',*:RGB'
25 +##### new panes/windows open where you are
26 +bind c new-window -c "#{pane_current_path}"
27 +unbind %
28 +unbind '"'
29 +bind | split-window -h -c "#{pane_current_path}"
30 +bind - split-window -v -c "#{pane_current_path}"
32 +##### quick reload
33 +bind r source-file ~/.config/tmux/tmux.conf \; display-message "tmux config reloaded"
35 +##### help: the only shortcut to memorize
36 +bind h display-popup -w 82% -h 82% -k 'sh -c "cat <<EOF
37 +TMUX QUICK HELP press any key to close
39 +Prefix: Ctrl-b
40 +Help: Prefix h
42 +Sessions
43 + tmux new -s work start named session
44 + tmux ls list sessions
45 + tmux attach -t work attach session
46 + Prefix d detach
48 +Windows
49 + Prefix c new window
50 + Prefix 1..9 jump window
51 + Prefix , rename window
52 + Prefix & kill window
54 +Panes
55 + Prefix | split right
56 + Prefix - split down
57 + Prefix arrows move between panes
58 + Prefix z zoom pane
59 + Prefix x kill pane
61 +Scroll/copy
62 + Prefix [ copy/scroll mode
63 + q leave copy/scroll mode
64 + / search in copy mode
66 +More help
67 + Prefix ? built-in key list
68 + Prefix : tmux command prompt
69 + man tmux full manual
71 +EOF
72 +sleep 100000"'
74 +##### tiny status bar
75 +set -g status-position top
76 +set -g status-interval 5
77 +set -g status-style "bg=#11111b,fg=#cdd6f4"
78 +set -g status-left-length 40
79 +set -g status-left " #[fg=#a6e3a1,bold]#S #[fg=#6c7086]│ #[fg=#89b4fa]C-b h help "
80 +set -g status-right "#[fg=#6c7086]#(whoami)@#h #[fg=#f5c2e7]%H:%M "
81 +setw -g window-status-format " #[fg=#6c7086]#I:#W "
82 +setw -g window-status-current-format " #[fg=#f9e2af,bold]#I:#W "
83 +setw -g pane-border-style "fg=#313244"
84 +setw -g pane-active-border-style "fg=#89b4fa"