diff --git a/dot_config/flake/home/helide/default.nix b/dot_config/flake/home/helide/default.nix new file mode 100644 index 0000000..a9aa23d --- /dev/null +++ b/dot_config/flake/home/helide/default.nix @@ -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"; + }; +} diff --git a/dot_config/flake/machines/wash/configuration.nix b/dot_config/flake/machines/wash/configuration.nix index a2c7c57..fdc25ae 100644 --- a/dot_config/flake/machines/wash/configuration.nix +++ b/dot_config/flake/machines/wash/configuration.nix @@ -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. diff --git a/dot_config/flake/machines/wash/home.nix b/dot_config/flake/machines/wash/home.nix index 7636f0b..f84f4e7 100644 --- a/dot_config/flake/machines/wash/home.nix +++ b/dot_config/flake/machines/wash/home.nix @@ -10,6 +10,8 @@ ../../home/home-backup.nix ../../home/gui.nix + + ../../home/helide ]; home = { diff --git a/dot_config/yazi/empty_yazi.toml b/dot_config/yazi/empty_yazi.toml deleted file mode 100644 index 01e4961..0000000 --- a/dot_config/yazi/empty_yazi.toml +++ /dev/null @@ -1,2 +0,0 @@ -[manager] -ratio = [0, 4, 0] diff --git a/dot_config/zellij/layouts/default.kdl b/dot_config/zellij/layouts/default.kdl deleted file mode 100644 index 048d126..0000000 --- a/dot_config/zellij/layouts/default.kdl +++ /dev/null @@ -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" -}