repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

shell: add bash and tmux configs

6f3f05a6ad1b0c83447c64dda756b2927806075e

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

+136 / −0 text lines

Diff layout

bash/bash_profile

Added
new file mode 100644

+11 / −0 text lines

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

bash/bashrc

Added
new file mode 100644

+41 / −0 text lines

1# Bash interactive config from dotfiles.
2
3case "$-" in
4 *i*) ;;
5 *) return ;;
6esac
7
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
22}
24tt() {
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
39}
41_nugu_console_theme light

tmux/tmux.conf

Added
new file mode 100644

+84 / −0 text lines

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