summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-09-07 21:04:59 +0530
committersinanmohd <sinan@sinanmohd.com>2025-09-07 21:33:22 +0530
commit57df1763fba019574ca4d9ed9aba24c005abe84b (patch)
tree4ab2a8359e301c86e35eeea1df7d0c660c165901 /home
parent1895ad075c98ab01627d033c985fc4954a525dad (diff)
chore(home): nnn -> yaziHEADmaster
Diffstat (limited to 'home')
-rw-r--r--home/common/home.nix2
-rw-r--r--home/common/modules/mimeapps.nix2
-rw-r--r--home/common/modules/nnn.nix7
-rw-r--r--home/common/modules/tmux.nix3
-rw-r--r--home/common/modules/yazi.nix18
-rw-r--r--home/wayland/modules/sway/home.nix56
-rw-r--r--home/wayland/modules/ttyasrt.nix10
7 files changed, 82 insertions, 16 deletions
diff --git a/home/common/home.nix b/home/common/home.nix
index 51e10b3..299fcb1 100644
--- a/home/common/home.nix
+++ b/home/common/home.nix
@@ -13,7 +13,7 @@ in
./modules/ssh.nix
./modules/dev.nix
./modules/neovim
- ./modules/nnn.nix
+ ./modules/yazi.nix
../../global/common
];
diff --git a/home/common/modules/mimeapps.nix b/home/common/modules/mimeapps.nix
index 8c128cf..fe32319 100644
--- a/home/common/modules/mimeapps.nix
+++ b/home/common/modules/mimeapps.nix
@@ -27,7 +27,7 @@
"text/x-python" = "nvim.desktop";
# misc
- "inode/directory" = "nnn.desktop";
+ "inode/directory" = "yazi.desktop";
};
};
}
diff --git a/home/common/modules/nnn.nix b/home/common/modules/nnn.nix
deleted file mode 100644
index fd2046f..0000000
--- a/home/common/modules/nnn.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ pkgs, ... }:
-{
- programs.nnn = {
- enable = true;
- package = pkgs.nnn.override { withNerdIcons = true; };
- };
-}
diff --git a/home/common/modules/tmux.nix b/home/common/modules/tmux.nix
index db7b5d5..9febca8 100644
--- a/home/common/modules/tmux.nix
+++ b/home/common/modules/tmux.nix
@@ -19,6 +19,9 @@
setw -g pane-base-index 1
set -g history-limit 10000
+ # kill the current pane
+ bind -n C-x kill-pane
+
# vim
set -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
diff --git a/home/common/modules/yazi.nix b/home/common/modules/yazi.nix
new file mode 100644
index 0000000..2dd84d5
--- /dev/null
+++ b/home/common/modules/yazi.nix
@@ -0,0 +1,18 @@
+{ pkgs, ... }:
+{
+ home.packages = [ pkgs.p7zip ];
+
+ programs.yazi = {
+ enable = true;
+ enableBashIntegration = true;
+
+ settings.mgr = {
+ ratio = [
+ 0
+ 1
+ 1
+ ];
+ linemode = "size";
+ };
+ };
+}
diff --git a/home/wayland/modules/sway/home.nix b/home/wayland/modules/sway/home.nix
index 8326965..4049886 100644
--- a/home/wayland/modules/sway/home.nix
+++ b/home/wayland/modules/sway/home.nix
@@ -21,7 +21,58 @@ let
i3status = lib.getExe config.programs.i3status.package;
swaylock = lib.getExe config.programs.swaylock.package;
- nnn = lib.getExe (config.programs.nnn.package);
+ termux_sway_yazi = pkgs.writeShellApplication {
+ name = "termux_sway_yazi";
+
+ runtimeInputs = with pkgs; [
+ tmux
+ coreutils
+ jq
+ sway
+ inotify-tools
+ ];
+
+ text = ''
+ session_name="_root_session_managed_by_home_manager"
+ tmux_sock_path="$XDG_RUNTIME_DIR/tmux-$UID/default"
+
+ is_foot_running() {
+ while read -r window_name; do
+ if [ "$window_name" == "foot" ]; then
+ return 0
+ fi
+ echo "$window_name"
+ done < <(swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.pid) | {name} + .rect | "\(.name)"')
+
+ return 1
+ }
+
+ is_tmux_running() {
+ ss -lx | grep -q "$tmux_sock_path"
+ }
+
+ tmux_wait() {
+ while inotifywait -re create "$XDG_RUNTIME_DIR"; do
+ if is_tmux_running; then
+ break
+ fi
+ done
+ }
+
+ if ! is_foot_running; then
+ setsid foot &
+ fi
+ if ! is_tmux_running; then
+ tmux_wait
+ else
+ tmux new-window -t "$session_name"
+ fi
+
+ tmux send-keys -t "$session_name" '${config.programs.yazi.shellWrapperName} && echo -en "\033[2A\033[0J"' Enter
+ '';
+ };
+ yazi = lib.getExe termux_sway_yazi;
+
wpctl = "${pkgs.wireplumber}/bin/wpctl";
brightnessctl = lib.getExe pkgs.brightnessctl;
freezshot = "${wayland-scripts}/bin/freezshot";
@@ -56,6 +107,7 @@ in
pkgs.swayidle
pkgs.brightnessctl
wayland-scripts
+ termux_sway_yazi
];
sessionVariables = {
@@ -158,7 +210,7 @@ in
"${mod}+return" = "exec ${foot}";
"${mod}+o" = "exec ${bemenu}";
"${mod}+w" = "exec ${firefox}";
- "${mod}+n" = "exec ${foot} -- ${nnn} -dec";
+ "${mod}+backslash" = "exec ${yazi}";
XF86MonBrightnessDown = "exec ${brightnessctl} set 1%-";
XF86MonBrightnessUp = "exec ${brightnessctl} set 1%+";
diff --git a/home/wayland/modules/ttyasrt.nix b/home/wayland/modules/ttyasrt.nix
index 399770b..1032498 100644
--- a/home/wayland/modules/ttyasrt.nix
+++ b/home/wayland/modules/ttyasrt.nix
@@ -7,13 +7,13 @@ in
home.packages = [ wayland-scripts ];
xdg.desktopEntries = {
- "nnn".settings = {
+ "yazi".settings = {
Type = "Application";
- Name = "nnn";
+ Name = "yazi";
Comment = "Terminal file manager";
- TryExec = "nnn";
- Exec = "${ttyasrt} nnn -decC";
- Icon = "nnn";
+ TryExec = "yazi";
+ Exec = "${ttyasrt} yazi";
+ Icon = "yazi";
MimeType = "inode/directory";
Categories = "System;FileTools;FileManager";
Keywords = "File;Manager;Management;Explorer;Launcher";