Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pkgs): remove gnugrep from my tmux scripts #11

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"