mirror of
https://codeberg.org/tmayoff/.dotfiles.git
synced 2025-12-06 08:48:34 -05:00
commit
bbd211508f
5 changed files with 79 additions and 23 deletions
76
dot_config/flake/home/helide/default.nix
Normal file
76
dot_config/flake/home/helide/default.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{...}: {
|
||||
xdg.configFile."helide/yazi.toml" = {
|
||||
text = ''
|
||||
[manager]
|
||||
ratio = [0, 4, 0]
|
||||
|
||||
[opener]
|
||||
edit = [
|
||||
{ run = '~/.config/helide/,yazi_opener.sh "$1"', desc = "Open File in helix" }
|
||||
]
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."helide/,yazi_opener.sh" = {
|
||||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Move focus to the next pane
|
||||
zellij action focus-next-pane
|
||||
|
||||
# Get the running command in the current pane
|
||||
RUNNING_COMMAND=$(zellij action list-clients | awk 'NR==2 {print $3}')
|
||||
|
||||
# Check if the command running in the current pane is helix (hx)
|
||||
if echo "$RUNNING_COMMAND" | grep -q "hx$"; then
|
||||
# The current pane is running helix, use zellij actions to open the file
|
||||
zellij action write 27
|
||||
zellij action write-chars ":open $1"
|
||||
zellij action write 13
|
||||
else
|
||||
# The current pane is not running helix, so open helix in a new pane
|
||||
zellij action new-pane
|
||||
sleep 0.3
|
||||
zellij action write-chars "hx $1"
|
||||
zellij action write 13
|
||||
|
||||
# warning from before I got it working
|
||||
# zellij action new-pane --name "WARNING" -- "echo" "please open helix in a pane right next to the sidebar (to the right of it) using 'hx path_to_file'"
|
||||
fi
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
|
||||
xdg.configFile."helide/zellij_layout" = {
|
||||
text = ''
|
||||
layout {
|
||||
default_tab_template {
|
||||
pane size=1 borderless=true {
|
||||
plugin location="zellij:tab-bar"
|
||||
}
|
||||
children
|
||||
pane size=2 borderless=true {
|
||||
plugin location="zellij:status-bar"
|
||||
}
|
||||
}
|
||||
|
||||
tab name="IDE" {
|
||||
pane split_direction="vertical" {
|
||||
pane name="sidebar" {
|
||||
command "env"
|
||||
args "YAZI_CONFIG_HOME=~/.config/helide" "yazi"
|
||||
size "20%"
|
||||
}
|
||||
pane command="hx"
|
||||
}
|
||||
}
|
||||
|
||||
tab name="shell"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
home.shellAliases ={
|
||||
helide = "zellij -l ~/.config/helide/zellij_layout";
|
||||
};
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
# Nix options
|
||||
nix.optimise.automatic = true;
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
nix.trustedUsers = ["tyler" "@wheel"];
|
||||
nix.settings.trusted-users = ["tyler" "@wheel"];
|
||||
|
||||
networking.hostName = "wash"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
../../home/home-backup.nix
|
||||
../../home/gui.nix
|
||||
|
||||
../../home/helide
|
||||
];
|
||||
|
||||
home = {
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
[manager]
|
||||
ratio = [0, 4, 0]
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
layout {
|
||||
default_tab_template {
|
||||
pane size=1 borderless=true {
|
||||
plugin location="zellij:tab-bar"
|
||||
}
|
||||
children
|
||||
pane size=2 borderless=true {
|
||||
plugin location="zellij:status-bar"
|
||||
}
|
||||
}
|
||||
|
||||
tab name="IDE" {
|
||||
pane split_direction="vertical" {
|
||||
pane command="yazi" size="20%"
|
||||
pane command="hx"
|
||||
}
|
||||
}
|
||||
|
||||
tab name="shell"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue