diff --git a/dot_config/nushell/config.nu.tmpl b/dot_config/nushell/config.nu.tmpl index 4369e46..19f40e0 100644 --- a/dot_config/nushell/config.nu.tmpl +++ b/dot_config/nushell/config.nu.tmpl @@ -5,6 +5,7 @@ source xdg.nu use themes.nu use completions * +use inspect #{{- if eq .age_key "age1htqslfl4d5uv76j8eg49u9njqjx5udj9jmg3ujf2gxjjm06z0vqqwz6tlm" }} overlay use work #{{- end }} diff --git a/dot_config/nushell/lib/inspect/mod.nu b/dot_config/nushell/lib/inspect/mod.nu new file mode 100644 index 0000000..d3f3d44 --- /dev/null +++ b/dot_config/nushell/lib/inspect/mod.nu @@ -0,0 +1 @@ +export use tmux.nu diff --git a/dot_config/nushell/lib/inspect/tmux.nu b/dot_config/nushell/lib/inspect/tmux.nu new file mode 100644 index 0000000..db6c015 --- /dev/null +++ b/dot_config/nushell/lib/inspect/tmux.nu @@ -0,0 +1,15 @@ +# list of tmux sessions +export def sessions []: [ + nothing -> table + >> +] { + tmux list-sessions -F "#{session_name}\t#{session_id}\t#{session_windows}\t#{session_attached}\t#{session_attached_list}" + | from tsv --noheaders + | rename name id windows attached attached_list + | update attached_list { split row , } +}