Compare commits
No commits in common. "d7056e8f38bba7cca8e9b1b7080800eeb365a740" and "4ab5ad76cf3058e76b31dd17b637befb369f1c04" have entirely different histories.
d7056e8f38
...
4ab5ad76cf
@ -87,7 +87,6 @@
|
|||||||
"share.tbmrs.nl"
|
"share.tbmrs.nl"
|
||||||
"vault.local.tbmrs.nl"
|
"vault.local.tbmrs.nl"
|
||||||
"paperless.local.tbmrs.nl"
|
"paperless.local.tbmrs.nl"
|
||||||
"monitor.local.tbmrs.nl"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,38 +1,9 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.settings.applications.zellij;
|
cfg = config.settings.applications.zellij;
|
||||||
sesh = pkgs.writeScriptBin "sesh" ''
|
|
||||||
#! /usr/bin/env sh
|
|
||||||
|
|
||||||
# Taken from https://github.com/zellij-org/zellij/issues/884#issuecomment-1851136980
|
|
||||||
# select a directory using zoxide
|
|
||||||
ZOXIDE_RESULT=$(${pkgs.zoxide}/bin/zoxide query --interactive)
|
|
||||||
|
|
||||||
# checks whether a directory has been selected
|
|
||||||
if [[ -z "$ZOXIDE_RESULT" ]]; then
|
|
||||||
# if there was no directory, select returns without executing
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
# extracts the directory name from the absolute path
|
|
||||||
SESSION_TITLE=$(echo "$ZOXIDE_RESULT" | sed 's#.*/##')
|
|
||||||
|
|
||||||
# get the list of sessions
|
|
||||||
SESSION_LIST=$(zellij list-sessions -n | awk '{print $1}')
|
|
||||||
|
|
||||||
# checks if SESSION_TITLE is in the session list
|
|
||||||
if echo "$SESSION_LIST" | grep -q "^$SESSION_TITLE$"; then
|
|
||||||
# if so, attach to existing session
|
|
||||||
zellij attach "$SESSION_TITLE"
|
|
||||||
else
|
|
||||||
# if not, create a new session
|
|
||||||
echo "Creating new session $SESSION_TITLE and CD $ZOXIDE_RESULT"
|
|
||||||
cd $ZOXIDE_RESULT
|
|
||||||
zellij attach -c "$SESSION_TITLE"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
settings.applications.zellij.enable = lib.mkOption {
|
settings.applications.zellij.enable = lib.mkOption {
|
||||||
@ -48,15 +19,6 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zoxide = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = [
|
|
||||||
sesh
|
|
||||||
];
|
|
||||||
|
|
||||||
home.file.zellij = {
|
home.file.zellij = {
|
||||||
target = ".config/zellij/config.kdl";
|
target = ".config/zellij/config.kdl";
|
||||||
text = ''
|
text = ''
|
||||||
@ -64,7 +26,6 @@ in {
|
|||||||
keybinds {
|
keybinds {
|
||||||
normal {
|
normal {
|
||||||
bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; }
|
bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; }
|
||||||
bind "Ctrl d" { Detach; }
|
|
||||||
bind "Alt 1" { GoToTab 1; }
|
bind "Alt 1" { GoToTab 1; }
|
||||||
bind "Alt 2" { GoToTab 2; }
|
bind "Alt 2" { GoToTab 2; }
|
||||||
bind "Alt 3" { GoToTab 3; }
|
bind "Alt 3" { GoToTab 3; }
|
||||||
|
@ -22,7 +22,6 @@ in {
|
|||||||
btop
|
btop
|
||||||
git
|
git
|
||||||
yazi
|
yazi
|
||||||
zoxide
|
|
||||||
|
|
||||||
just
|
just
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user