feat: Added tmux-float to toggle the floating terminal

This commit is contained in:
uttarayan21
2024-12-24 18:37:12 +05:30
parent 29ef167516
commit 328248536e
5 changed files with 143 additions and 10 deletions

View File

@@ -5,7 +5,7 @@
if [ "$(tmux display-message -p -F "#{session_name}")" = "scratch" ];then
tmux detach-client
else
tmux popup -d '#{pane_current_path}' -xC -yC -w$width -h$height -E "tmux new -A -s scratch"
tmux popup -d '#{pane_current_path}' -xC -yC -w$width -h$height -E "tmux new -A -s scratch -d -c ''$(pwd)"
fi
'';
in {
@@ -77,7 +77,7 @@ in {
bind k select-pane -U
bind l select-pane -R
bind-key -n C-\\ run-shell ${scratchpad}
bind-key -n C-\\ run-shell "${pkgs.tmux-float}/bin/tmux-float toggle"
bind o set status
bind C-n next-window

View File

@@ -3,13 +3,9 @@
skhd = {
enable = true;
skhdConfig = ''
alt - return : ${pkgs.lib.getExe pkgs.kitty} --single-instance --directory ~
# alt - return : $\{pkgs.wezterm}/bin/wezterm-gui
alt - return : ${pkgs.lib.getExe pkgs.kitty} --single-instance --directory ~
shift + alt - return: pkill afplay
# open mpv
alt - m : open -na /Applications/mpv.app $(pbpaste)
# close focused window
# alt - w : yabai -m window --close

138
flake.lock generated
View File

@@ -32,6 +32,22 @@
"type": "github"
}
},
"advisory-db_3": {
"flake": false,
"locked": {
"lastModified": 1734961910,
"narHash": "sha256-F4iNNs84rdqN2ZDCKtZrE/PUIfUe6YSZM/O2sckeQr4=",
"owner": "rustsec",
"repo": "advisory-db",
"rev": "b02b7ca7c98eee7fe26ac18277040c3fc814b52d",
"type": "github"
},
"original": {
"owner": "rustsec",
"repo": "advisory-db",
"type": "github"
}
},
"anyrun": {
"inputs": {
"flake-parts": "flake-parts",
@@ -229,6 +245,21 @@
}
},
"crane_5": {
"locked": {
"lastModified": 1734808813,
"narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=",
"owner": "ipetkov",
"repo": "crane",
"rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"crane_6": {
"locked": {
"lastModified": 1732906089,
"narHash": "sha256-NvYSSiKsC0rqn9yY0a9zglLXrFp92EwKhTFZC38voCQ=",
@@ -608,6 +639,24 @@
"type": "github"
}
},
"flake-utils_12": {
"inputs": {
"systems": "systems_14"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
@@ -1492,6 +1541,27 @@
"type": "github"
}
},
"nix-github-actions_2": {
"inputs": {
"nixpkgs": [
"tmux-float",
"nixpkgs"
]
},
"locked": {
"lastModified": 1731952509,
"narHash": "sha256-p4gB3Rhw8R6Ak4eMl8pqjCPOLCZRqaehZxdZ/mbFClM=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "7b5f051df789b6b20d259924d349a9ba3319b226",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": "nixpkgs_3"
@@ -1976,6 +2046,7 @@
"rest-nvim": "rest-nvim",
"rust-overlay": "rust-overlay_6",
"sops-nix": "sops-nix",
"tmux-float": "tmux-float",
"tree-sitter-d2": "tree-sitter-d2",
"tree-sitter-just": "tree-sitter-just",
"tree-sitter-nu": "tree-sitter-nu",
@@ -2113,6 +2184,27 @@
}
},
"rust-overlay_7": {
"inputs": {
"nixpkgs": [
"tmux-float",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735007320,
"narHash": "sha256-NdhUgB9BkLGW9I+Q1GyUUCc3CbDgsg7HLWjG7WZBR5Q=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "fb5fdba697ee9a2391ca9ceea3b853b4e3ce37a5",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_8": {
"inputs": {
"nixpkgs": [
"zjstatus",
@@ -2228,6 +2320,21 @@
"type": "github"
}
},
"systems_14": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
@@ -2348,6 +2455,31 @@
"type": "github"
}
},
"tmux-float": {
"inputs": {
"advisory-db": "advisory-db_3",
"crane": "crane_5",
"flake-utils": "flake-utils_11",
"nix-github-actions": "nix-github-actions_2",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_7"
},
"locked": {
"lastModified": 1735044950,
"narHash": "sha256-8Au07voKXOa70Cq874FIPLi4Cj+4GdLMketKFwwuaas=",
"owner": "uttarayan21",
"repo": "tmux-float",
"rev": "11b2cf83ebe8478135483d9a165e828e33fee038",
"type": "github"
},
"original": {
"owner": "uttarayan21",
"repo": "tmux-float",
"type": "github"
}
},
"tree-sitter-d2": {
"flake": false,
"locked": {
@@ -2515,12 +2647,12 @@
},
"zjstatus": {
"inputs": {
"crane": "crane_5",
"flake-utils": "flake-utils_11",
"crane": "crane_6",
"flake-utils": "flake-utils_12",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_7"
"rust-overlay": "rust-overlay_8"
},
"locked": {
"lastModified": 1733851126,

View File

@@ -130,6 +130,10 @@
url = "github:ray-x/guihua.lua";
flake = false;
};
tmux-float = {
url = "github:uttarayan21/tmux-float";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {

View File

@@ -143,6 +143,7 @@
};
};
};
tmux-float = inputs.tmux-float.packages.${prev.system}.default;
};
catppuccinThemes = final: prev: {
catppuccinThemes = import ./themes/catppuccin.nix {pkgs = final.pkgs;};