From f6e2d97e72f8bdc1d5f41bd64b760e0f5bb9d5e3 Mon Sep 17 00:00:00 2001 From: Uttarayan Mondal Date: Wed, 22 Mar 2023 11:24:47 +0530 Subject: [PATCH] [fix] Use case-switch for starting tmux --- config/tmux/start-tmux | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/tmux/start-tmux b/config/tmux/start-tmux index ed7cce6b..fa5579b6 100755 --- a/config/tmux/start-tmux +++ b/config/tmux/start-tmux @@ -1,7 +1,14 @@ #!/bin/sh live_sessions=$(tmux list-sessions 2>/dev/null) -all_sessions=$(find ~/.config/tmux/sessions -type f -executable -printf '%f\n'| sort) +if [[ $(uname) == "Darwin" ]]; then + all_sessions=$(gfind ~/.config/tmux/sessions -type f -executable -printf '%f\n'| sort) +elif [[ $(uname) == "Linux" ]]; then + all_sessions=$(find ~/.config/tmux/sessions -type f -executable -printf '%f\n'| sort) +else + echo "Unsupported OS" + exit 1 +fi TMUX_SESSIONS="$HOME/.config/tmux/sessions" # for some reason ~/.config/tmux/session doesn't work if made with quotes # TMUX_SESSIONS=$XDG_CONFIG_HOME/tmux/sessions