Rename t to tmux-sessionizer
This matches ThePrimeagen's script that mine is based on and that I'll probably switch to in the future. I've added to the Nix store as custom-tmux-sessionizer so it doesn't conflict with the tmux-sessionzer packages that's already in the store.
This commit is contained in:
parent
5a9353ad17
commit
930473a896
|
@ -2,6 +2,7 @@
|
||||||
features = {
|
features = {
|
||||||
cli = {
|
cli = {
|
||||||
direnv.enable = true;
|
direnv.enable = true;
|
||||||
|
tmux-sessionizer.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
desktop = {
|
desktop = {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
cli = {
|
cli = {
|
||||||
bluetuith.enable = true;
|
bluetuith.enable = true;
|
||||||
direnv.enable = true;
|
direnv.enable = true;
|
||||||
|
tmux-sessionizer.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
desktop = {
|
desktop = {
|
||||||
|
|
|
@ -17,7 +17,6 @@ let
|
||||||
import ./scripts/export-video-list.nix { inherit pkgs username; }
|
import ./scripts/export-video-list.nix { inherit pkgs username; }
|
||||||
);
|
);
|
||||||
run = writeShellApplication (import ./scripts/run.nix { inherit pkgs; });
|
run = writeShellApplication (import ./scripts/run.nix { inherit pkgs; });
|
||||||
t = writeShellApplication (import ./scripts/t.nix { inherit pkgs; });
|
|
||||||
timer = writeShellApplication (import ./scripts/timer.nix);
|
timer = writeShellApplication (import ./scripts/timer.nix);
|
||||||
in
|
in
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
@ -69,7 +68,6 @@ with pkgs;
|
||||||
# Scripts.
|
# Scripts.
|
||||||
deliver
|
deliver
|
||||||
run
|
run
|
||||||
t
|
|
||||||
]
|
]
|
||||||
++ pkgs.lib.optionals desktop [
|
++ pkgs.lib.optionals desktop [
|
||||||
# Scripts.
|
# Scripts.
|
||||||
|
|
|
@ -19,6 +19,15 @@
|
||||||
;
|
;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(import ./tmux-sessionizer.nix {
|
||||||
|
inherit
|
||||||
|
config
|
||||||
|
lib
|
||||||
|
pkgs
|
||||||
|
self
|
||||||
|
;
|
||||||
|
})
|
||||||
|
|
||||||
./bat.nix
|
./bat.nix
|
||||||
./bin.nix
|
./bin.nix
|
||||||
./bluetuith.nix
|
./bluetuith.nix
|
||||||
|
|
32
nix/modules/home-manager/features/cli/tmux-sessionizer.nix
Normal file
32
nix/modules/home-manager/features/cli/tmux-sessionizer.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.features.cli.tmux-sessionizer.enable = lib.mkEnableOption "Enable tmux-sessionizer";
|
||||||
|
|
||||||
|
config = lib.mkIf config.features.cli.tmux-sessionizer.enable {
|
||||||
|
home.packages = with pkgs; [ custom-tmux-sessionizer ];
|
||||||
|
|
||||||
|
home.file.".tmux-sessionizer".source = "${
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = ".tmux-sessionizer";
|
||||||
|
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
tmux
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
set +o nounset
|
||||||
|
|
||||||
|
tmux new-window -d -n scratch
|
||||||
|
nvim
|
||||||
|
clear
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
}/bin/.tmux-sessionizer";
|
||||||
|
};
|
||||||
|
}
|
|
@ -72,8 +72,7 @@ in
|
||||||
set-option -g pane-active-border-style "fg=#1f2335"
|
set-option -g pane-active-border-style "fg=#1f2335"
|
||||||
set-option -g pane-border-style "fg=#1f2335"
|
set-option -g pane-border-style "fg=#1f2335"
|
||||||
|
|
||||||
bind-key -r f run-shell "tmux new-window t"
|
bind-key -r f run-shell "tmux new-window custom-tmux-sessionizer"
|
||||||
|
|
||||||
|
|
||||||
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
|
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
zstyle ":completion:*" matcher-list "" "m:{a-zA-Z}={A-Za-z}" "r:|=*" "l:|=* r:|=*"
|
zstyle ":completion:*" matcher-list "" "m:{a-zA-Z}={A-Za-z}" "r:|=*" "l:|=* r:|=*"
|
||||||
autoload -Uz compinit && compinit
|
autoload -Uz compinit && compinit
|
||||||
|
|
||||||
bindkey -s ^f "t\n"
|
bindkey -s ^f "custom-tmux-sessionizer\n"
|
||||||
bindkey -s ^v "nvim\n"
|
bindkey -s ^v "nvim\n"
|
||||||
|
|
||||||
clear-ls-all() {
|
clear-ls-all() {
|
||||||
|
|
|
@ -5,6 +5,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
build-glove80 = callPackage ./build-glove80.nix { };
|
build-glove80 = callPackage ./build-glove80.nix { };
|
||||||
|
custom-tmux-sessionizer = callPackage ./tmux-sessionizer.nix { };
|
||||||
notify-battery = callPackage ./notify-battery.nix { };
|
notify-battery = callPackage ./notify-battery.nix { };
|
||||||
|
|
||||||
vimPlugins = prev.vimPlugins // {
|
vimPlugins = prev.vimPlugins // {
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
{
|
pkgs.writeShellApplication {
|
||||||
name = "t";
|
name = "custom-tmux-sessionizer";
|
||||||
|
|
||||||
runtimeInputs = with pkgs; [ tmux ];
|
runtimeInputs = with pkgs; [ tmux ];
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
# https://github.com/ThePrimeagen/tmux-sessionizer.
|
set +o nounset
|
||||||
|
|
||||||
|
# Based on https://github.com/ThePrimeagen/tmux-sessionizer.
|
||||||
|
|
||||||
switch_to() {
|
switch_to() {
|
||||||
if [[ -z $TMUX ]]; then
|
if [[ -z $TMUX ]]; then
|
Loading…
Reference in a new issue