switches to tmuxinator instead of cobbled together script
This commit is contained in:
parent
80d3dd69af
commit
6a7193ab14
16 changed files with 135 additions and 17 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
../modules/fish
|
../modules/fish
|
||||||
../modules/ghostty
|
../modules/ghostty
|
||||||
../modules/tmux
|
../modules/tmux
|
||||||
|
../modules/tmuxinator/work.nix
|
||||||
../modules/nvim
|
../modules/nvim
|
||||||
../modules/lazygit
|
../modules/lazygit
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
../modules/fish
|
../modules/fish
|
||||||
../modules/nvim
|
../modules/nvim
|
||||||
../modules/tmux
|
../modules/tmux
|
||||||
|
../modules/tmuxinator/personal.nix
|
||||||
../modules/ghostty
|
../modules/ghostty
|
||||||
../modules/lazygit
|
../modules/lazygit
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -60,25 +60,13 @@
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
sessionizer = /* fish */ ''
|
sessionizer = /* fish */ ''
|
||||||
set -l selected (dev_projects | fzf --prompt "sessionize >> ")
|
set -l selected (tmuxinator ls | fzf --prompt "switch to >> ")
|
||||||
|
|
||||||
if test -z "$selected"
|
if test -z "$selected"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l session_name (basename $selected)
|
tmuxinator start "$selected"
|
||||||
set -l tmux_running (pgrep tmux)
|
|
||||||
|
|
||||||
if test -z $TMUX && test -z $tmux_running
|
|
||||||
tmux new-session -s $session_name -c $selected
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
if not tmux has-session -t=$session_name 2> /dev/null
|
|
||||||
tmux new-session -ds $session_name -c $selected
|
|
||||||
end
|
|
||||||
|
|
||||||
tmux switch-client -t $session_name
|
|
||||||
'';
|
'';
|
||||||
tmux_sessionizer = /* fish */ ''
|
tmux_sessionizer = /* fish */ ''
|
||||||
tmux display-popup -h 50% -w 80% -E sessionizer
|
tmux display-popup -h 50% -w 80% -E sessionizer
|
||||||
|
|
|
||||||
|
|
@ -39,11 +39,13 @@
|
||||||
set -g status-style bg=#1d202f,fg=white
|
set -g status-style bg=#1d202f,fg=white
|
||||||
set -g status-left ""
|
set -g status-left ""
|
||||||
set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H "
|
set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H "
|
||||||
set -g window-status-current-style bg=default,fg=magenta,bold
|
set-window-option -g window-status-style 'fg=magenta,bg=black'
|
||||||
set-window-option -g window-status-format "[#I] #W#F "
|
set-window-option -g window-status-format ' #I #[fg=white]#W #[fg=cyan]#F '
|
||||||
set-window-option -g window-status-current-format "[#I] #W#F "
|
set-window-option -g window-status-current-style "fg=black,bg=magenta"
|
||||||
|
set-window-option -g window-status-current-format " #I #W #F "
|
||||||
set -g pane-border-style fg=#807c9f
|
set -g pane-border-style fg=#807c9f
|
||||||
set -g pane-active-border-style fg=magenta
|
set -g pane-active-border-style fg=magenta
|
||||||
|
set -g message-style "fg=black,bg=red,bold"
|
||||||
|
|
||||||
unbind %
|
unbind %
|
||||||
bind "|" split-window -h
|
bind "|" split-window -h
|
||||||
|
|
|
||||||
7
modules/tmuxinator/personal-layouts/main.yml
Normal file
7
modules/tmuxinator/personal-layouts/main.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
name: main
|
||||||
|
root: ~/
|
||||||
|
windows:
|
||||||
|
- default:
|
||||||
|
layout: main-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
11
modules/tmuxinator/personal-layouts/nix-config.yml
Normal file
11
modules/tmuxinator/personal-layouts/nix-config.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: nix-config
|
||||||
|
root: ~/dev/nix-config/
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
11
modules/tmuxinator/personal-layouts/notes.yml
Normal file
11
modules/tmuxinator/personal-layouts/notes.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: notes
|
||||||
|
root: ~/dev/notes
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
8
modules/tmuxinator/personal.nix
Normal file
8
modules/tmuxinator/personal.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
xdg.configFile."tmuxinator" = {
|
||||||
|
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/tmuxinator/personal-layouts";
|
||||||
|
};
|
||||||
|
}
|
||||||
11
modules/tmuxinator/work-layouts/devtools.yml
Normal file
11
modules/tmuxinator/work-layouts/devtools.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: devtools
|
||||||
|
root: ~/dev/devtools/
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
11
modules/tmuxinator/work-layouts/k8s-admin-certification.yml
Normal file
11
modules/tmuxinator/work-layouts/k8s-admin-certification.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: k8s-admin-certification
|
||||||
|
root: ~/dev/kubernetes-admin-certification
|
||||||
|
windows:
|
||||||
|
- notes:
|
||||||
|
layout: main-vertical
|
||||||
|
panes:
|
||||||
|
- cd notes && nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- experiments:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- cd experiments && clear
|
||||||
7
modules/tmuxinator/work-layouts/main.yml
Normal file
7
modules/tmuxinator/work-layouts/main.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
name: main
|
||||||
|
root: ~/
|
||||||
|
windows:
|
||||||
|
- default:
|
||||||
|
layout: main-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
11
modules/tmuxinator/work-layouts/nix-config.yml
Normal file
11
modules/tmuxinator/work-layouts/nix-config.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: nix-config
|
||||||
|
root: ~/dev/nix-config/
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
11
modules/tmuxinator/work-layouts/notes.yml
Normal file
11
modules/tmuxinator/work-layouts/notes.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: notes
|
||||||
|
root: ~/dev/notes
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
11
modules/tmuxinator/work-layouts/ride-charts.yml
Normal file
11
modules/tmuxinator/work-layouts/ride-charts.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: ride-charts
|
||||||
|
root: ~/dev/ride-charts
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
19
modules/tmuxinator/work-layouts/ride.yml
Normal file
19
modules/tmuxinator/work-layouts/ride.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
name: ride
|
||||||
|
root: ~/dev/ride
|
||||||
|
windows:
|
||||||
|
- code:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- nvim +"lua Snacks.picker.files({ hidden = true })"
|
||||||
|
- run:
|
||||||
|
layout: even-vertical
|
||||||
|
panes:
|
||||||
|
- clear
|
||||||
|
- db_staging:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- dbui_stg
|
||||||
|
- db_production:
|
||||||
|
layout: main-horizontal
|
||||||
|
panes:
|
||||||
|
- dbui_prod
|
||||||
8
modules/tmuxinator/work.nix
Normal file
8
modules/tmuxinator/work.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
xdg.configFile."tmuxinator" = {
|
||||||
|
# mkOutOfStoreSymlink needs an absolute path, otherwise it does not work: https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/tmuxinator/work-layouts";
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue