mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-16 18:02:23 +00:00
zellij tweaks and session switching
This commit is contained in:
parent
870ab6894d
commit
b901b9abd9
72
flake.lock
generated
72
flake.lock
generated
@ -334,6 +334,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1728538411,
|
||||||
|
"narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
@ -372,9 +388,28 @@
|
|||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"wsl": "wsl",
|
"wsl": "wsl",
|
||||||
|
"zellij-switch": "zellij-switch",
|
||||||
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1736476219,
|
||||||
|
"narHash": "sha256-+qyv3QqdZCdZ3cSO/cbpEY6tntyYjfe1bB12mdpNFaY=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "de30cc5963da22e9742bbbbb9a3344570ed237b9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689347925,
|
"lastModified": 1689347925,
|
||||||
@ -405,6 +440,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -447,6 +497,28 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"zellij-switch": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": "rust-overlay",
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1737011317,
|
||||||
|
"narHash": "sha256-A8VGuw/jIw+NCo5aCYy8MFrWpKzZLf77RApGGMzHxCY=",
|
||||||
|
"owner": "mostafaqanbaryan",
|
||||||
|
"repo": "zellij-switch",
|
||||||
|
"rev": "15b02834c8be735fca0d9fb41f48709f97cc9afc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mostafaqanbaryan",
|
||||||
|
"repo": "zellij-switch",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"zenyd-mpv-scripts": {
|
"zenyd-mpv-scripts": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -64,6 +64,12 @@
|
|||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Zellij Switcher
|
||||||
|
zellij-switch = {
|
||||||
|
url = "github:mostafaqanbaryan/zellij-switch";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# Nextcloud Apps
|
# Nextcloud Apps
|
||||||
nextcloud-news = {
|
nextcloud-news = {
|
||||||
# https://github.com/nextcloud/news/releases
|
# https://github.com/nextcloud/news/releases
|
||||||
|
@ -66,6 +66,7 @@ lib
|
|||||||
overlays = [
|
overlays = [
|
||||||
inputs.nur.overlays.default
|
inputs.nur.overlays.default
|
||||||
inputs.nix2vim.overlay
|
inputs.nix2vim.overlay
|
||||||
|
inputs.zellij-switch.overlays.default
|
||||||
] ++ (importOverlays ../overlays);
|
] ++ (importOverlays ../overlays);
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
|
@ -30,6 +30,13 @@ in
|
|||||||
window-decoration = false;
|
window-decoration = false;
|
||||||
macos-non-native-fullscreen = true;
|
macos-non-native-fullscreen = true;
|
||||||
fullscreen = true;
|
fullscreen = true;
|
||||||
|
keybind = [
|
||||||
|
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
|
||||||
|
"super+shift+]=unbind"
|
||||||
|
"super+shift+[=unbind"
|
||||||
|
"ctrl+tab=unbind"
|
||||||
|
"ctrl+shift+tab=unbind"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
themes."gruvbox" = {
|
themes."gruvbox" = {
|
||||||
background = config.theme.colors.base00;
|
background = config.theme.colors.base00;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@ -14,6 +15,43 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = [ pkgs.zellij-switch ];
|
||||||
|
|
||||||
|
programs.fish = {
|
||||||
|
functions = {
|
||||||
|
zellij-session = {
|
||||||
|
# description = "Open a session in Zellij";
|
||||||
|
body = # fish
|
||||||
|
''
|
||||||
|
zoxide query --interactive | xargs -I {} sh -c 'zellij pipe --plugin file:$(which zellij-switch.wasm) -- "--cwd {} --layout default --session $(basename {})"' \\;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."zellij/layouts/compact-top.kdl".text = # kdl
|
||||||
|
''
|
||||||
|
layout {
|
||||||
|
pane size=1 borderless=true {
|
||||||
|
plugin location="compact-bar"
|
||||||
|
}
|
||||||
|
pane
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
xdg.configFile."zellij/layouts/default.kdl".text = # kdl
|
||||||
|
''
|
||||||
|
layout {
|
||||||
|
pane size=1 borderless=true {
|
||||||
|
plugin location="tab-bar"
|
||||||
|
}
|
||||||
|
pane
|
||||||
|
pane size=1 borderless=true {
|
||||||
|
plugin location="status-bar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
|
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -22,8 +60,11 @@ in
|
|||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
# default_layout = "compact-top";
|
||||||
# Remove border
|
# Remove border
|
||||||
pane_frames = false;
|
pane_frames = false;
|
||||||
|
# Scrollback
|
||||||
|
scrollback_editor = config.home.sessionVariables.EDITOR;
|
||||||
keybinds = {
|
keybinds = {
|
||||||
# _props = {
|
# _props = {
|
||||||
# clear-defaults = true;
|
# clear-defaults = true;
|
||||||
@ -37,6 +78,7 @@ in
|
|||||||
"Ctrl p"
|
"Ctrl p"
|
||||||
"Ctrl q"
|
"Ctrl q"
|
||||||
"Ctrl s"
|
"Ctrl s"
|
||||||
|
"Alt i"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
normal = {
|
normal = {
|
||||||
@ -67,7 +109,7 @@ in
|
|||||||
};
|
};
|
||||||
"bind \"Alt k\"" = {
|
"bind \"Alt k\"" = {
|
||||||
SwitchToMode = {
|
SwitchToMode = {
|
||||||
_args = [ "search" ];
|
_args = [ "scroll" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"bind \"Alt o\"" = {
|
"bind \"Alt o\"" = {
|
||||||
@ -78,6 +120,41 @@ in
|
|||||||
"bind \"Alt q\"" = {
|
"bind \"Alt q\"" = {
|
||||||
"Quit" = { };
|
"Quit" = { };
|
||||||
};
|
};
|
||||||
|
"bind \"Alt Shift p\"" = {
|
||||||
|
"Run" = {
|
||||||
|
_args = [
|
||||||
|
"${pkgs.fish}/bin/fish"
|
||||||
|
"-c"
|
||||||
|
"zellij-session"
|
||||||
|
];
|
||||||
|
close_on_exit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Super t\"" = {
|
||||||
|
"NewTab" = { };
|
||||||
|
};
|
||||||
|
"bind \"Super Shift ]\"" = {
|
||||||
|
"GoToPreviousTab" = { };
|
||||||
|
};
|
||||||
|
"bind \"Super Shift [\"" = {
|
||||||
|
"GoToNextTab" = { };
|
||||||
|
};
|
||||||
|
"bind \"Ctrl Tab\"" = {
|
||||||
|
"GoToNextTab" = { };
|
||||||
|
};
|
||||||
|
"bind \"Ctrl Shift Tab\"" = {
|
||||||
|
"GoToPreviousTab" = { };
|
||||||
|
};
|
||||||
|
"bind \"Alt Shift i\"" = {
|
||||||
|
"MoveTab" = {
|
||||||
|
_args = [ "Left" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Alt Shift o\"" = {
|
||||||
|
"MoveTab" = {
|
||||||
|
_args = [ "Right" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
locked = {
|
locked = {
|
||||||
"bind \"Alt l\"" = {
|
"bind \"Alt l\"" = {
|
||||||
@ -86,6 +163,11 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
session = {
|
||||||
|
unbind = {
|
||||||
|
_args = [ "Alt o" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
theme = "custom";
|
theme = "custom";
|
||||||
|
@ -31,6 +31,8 @@ in
|
|||||||
# Used for aerc
|
# Used for aerc
|
||||||
xdg.enable = lib.mkDefault pkgs.stdenv.isDarwin;
|
xdg.enable = lib.mkDefault pkgs.stdenv.isDarwin;
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs.t = "trash";
|
||||||
|
|
||||||
# Add homebrew paths to CLI path
|
# Add homebrew paths to CLI path
|
||||||
home.sessionPath = [
|
home.sessionPath = [
|
||||||
"/opt/homebrew/bin/"
|
"/opt/homebrew/bin/"
|
||||||
|
@ -31,6 +31,8 @@ in
|
|||||||
pkgs.charm # Manage account and filesystem
|
pkgs.charm # Manage account and filesystem
|
||||||
pkgs.pop # Send emails from a TUI
|
pkgs.pop # Send emails from a TUI
|
||||||
|
|
||||||
|
pkgs.yazi # TUI file explorer
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.gh-dash.enable = lib.mkDefault true;
|
programs.gh-dash.enable = lib.mkDefault true;
|
||||||
|
@ -15,25 +15,26 @@ in
|
|||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.age # Encryption
|
pkgs.age # Encryption
|
||||||
pkgs.bc # Calculator
|
pkgs.bc # Calculator
|
||||||
|
pkgs.bottom # System monitor (top)
|
||||||
pkgs.delta # Fancy diffs
|
pkgs.delta # Fancy diffs
|
||||||
pkgs.difftastic # Other fancy diffs
|
pkgs.difftastic # Other fancy diffs
|
||||||
|
pkgs.doggo # DNS client (dig)
|
||||||
|
pkgs.du-dust # Disk usage tree (ncdu)
|
||||||
|
pkgs.dua # File sizes (du)
|
||||||
|
pkgs.duf # Basic disk information (df)
|
||||||
pkgs.jless # JSON viewer
|
pkgs.jless # JSON viewer
|
||||||
pkgs.jo # JSON output
|
pkgs.jo # JSON output
|
||||||
|
pkgs.mpd # TUI slideshows
|
||||||
|
pkgs.nmasur.jqr # FZF fq JSON tool
|
||||||
pkgs.nmasur.osc # Clipboard over SSH
|
pkgs.nmasur.osc # Clipboard over SSH
|
||||||
pkgs.qrencode # Generate qr codes
|
|
||||||
pkgs.nmasur.ren-find # Rename files
|
pkgs.nmasur.ren-find # Rename files
|
||||||
pkgs.nmasur.rep-grep # Replace text in files
|
pkgs.nmasur.rep-grep # Replace text in files
|
||||||
|
pkgs.pandoc # Convert text documents
|
||||||
|
pkgs.qrencode # Generate qr codes
|
||||||
pkgs.spacer # Output lines in terminal
|
pkgs.spacer # Output lines in terminal
|
||||||
pkgs.tealdeer # Cheatsheets
|
pkgs.tealdeer # Cheatsheets
|
||||||
|
pkgs.tree # Print tree in terminal
|
||||||
pkgs.vimv-rs # Batch rename files
|
pkgs.vimv-rs # Batch rename files
|
||||||
pkgs.dua # File sizes (du)
|
|
||||||
pkgs.du-dust # Disk usage tree (ncdu)
|
|
||||||
pkgs.duf # Basic disk information (df)
|
|
||||||
pkgs.pandoc # Convert text documents
|
|
||||||
pkgs.mpd # TUI slideshows
|
|
||||||
pkgs.doggo # DNS client (dig)
|
|
||||||
pkgs.bottom # System monitor (top)
|
|
||||||
pkgs.nmasur.jqr # FZF fq JSON tool
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.fish.shellAliases = {
|
programs.fish.shellAliases = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user