Skip to content

Commit

Permalink
fix(pkgs): remove gnugrep from my tmux scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
refnode committed Nov 17, 2024
1 parent 4036052 commit 40dd1ec
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkgs/ref-irc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
writeShellApplication {
name = "ref-irc";

runtimeInputs = [pkgs.tmux pkgs.gnugrep pkgs.weechat-unwrapped];
runtimeInputs = [pkgs.tmux pkgs.weechat-unwrapped];

text = builtins.readFile ./script.sh;
}
4 changes: 2 additions & 2 deletions pkgs/ref-irc/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SESSION_NAME="irc"
SESSION_DIR="$HOME"
SESSION_CMD="weechat"

if ! tmux list-session | grep -q "$SESSION_NAME"; then
tmux new-session -d -s "$SESSION_NAME" -c "$SESSION_DIR" "$SESSION_CMD"
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
tmux new-session -d -s "$SESSION_NAME" -c "$SESSION_DIR" "$SESSION_CMD"
fi

tmux switch-client -t "$SESSION_NAME"
2 changes: 1 addition & 1 deletion pkgs/ref-mail/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
writeShellApplication {
name = "ref-mail";

runtimeInputs = [pkgs.tmux pkgs.gnugrep pkgs.neomutt pkgs.lynx];
runtimeInputs = [pkgs.tmux pkgs.neomutt pkgs.lynx];

text = builtins.readFile ./script.sh;
}
2 changes: 1 addition & 1 deletion pkgs/ref-mail/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SESSION_NAME="mail"
SESSION_DIR="$HOME/.Mail/private"
SESSION_CMD="neomutt"

if ! tmux list-session | grep -q "$SESSION_NAME"; then
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
tmux new-session -d -s "$SESSION_NAME" -c "$SESSION_DIR" "$SESSION_CMD"
fi

Expand Down
2 changes: 1 addition & 1 deletion pkgs/ref-main/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
writeShellApplication {
name = "ref-main";

runtimeInputs = [pkgs.tmux pkgs.gnugrep];
runtimeInputs = [pkgs.tmux];

# excludeShellChecks = [ "SC2148" ];
text = builtins.readFile ./script.sh;
Expand Down
10 changes: 5 additions & 5 deletions pkgs/ref-main/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
SESSION_NAME="main"
SESSION_DIR="$HOME"

if ! tmux server-info > /dev/null 2>&1; then
tmux new-session -s "$SESSION_NAME" -c "$SESSION_DIR"
exit 0
if ! tmux server-info >/dev/null 2>&1; then
tmux new-session -s "$SESSION_NAME" -c "$SESSION_DIR"
exit 0
fi

if ! tmux list-session | grep -q "$SESSION_NAME"; then
tmux new-session -d -s "$SESSION_NAME" -c "$SESSION_DIR"
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
tmux new-session -d -s "$SESSION_NAME" -c "$SESSION_DIR"
fi

tmux switch-client -t "$SESSION_NAME"

0 comments on commit 40dd1ec

Please sign in to comment.