tmux-python / tmuxp

🖥️ Session manager for tmux, build on libtmux.
https://tmuxp.git-pull.com/
MIT License
4.04k stars 231 forks source link

Adds installation instructions for installing with Nix #883

Closed ChristopherHarwell closed 1 year ago

ChristopherHarwell commented 1 year ago

What does this change add?

I updated to README to have a one liner shell script for installing tmuxp with Nix package manager.

What does the one-command do?

The one-liner command using Nix to install tmux and tmuxp while ensuring that tmux is installed before installing tmuxp can be explained as follows:

  1. The command starts with [[ -z $(which tmux) ]] &&.

    • [[ -z $(which tmux) ]] checks if the command which tmux returns an empty string, indicating that tmux is not found.
      • The double brackets [[ ... ]] are used for conditional tests in shell scripts.
      • The -z flag checks if the string is empty [^1].
      • $(...) is command substitution, which executes the command within the parentheses and replaces it with the output of that command [^1].
  2. If tmux is not found, the command executes the following block: echo "tmux not found, please install tmux first".

    • This block displays a message indicating that tmux needs to be installed before proceeding with tmuxp installation.
  3. If tmux is found, the command executes the following block: (nix-env -i tmux && nix-env -i tmuxp)[^2].

    • (command1 && command2) executes command1 and then command2 if command1 succeeds.
    • nix-env -i tmux installs tmux using the nix-env command.
    • nix-env -i tmuxp installs tmuxp using the nix-env command.
  4. If tmux is already installed, the command executes the following block: nix-env -i tmuxp.

    • This block directly installs tmuxp using the nix-env command.

In summary, the one-liner command checks if tmux is installed, and if not, it displays a message to install tmux first. Otherwise, it installs tmux and then installs tmuxp.

References:

[^1]: github.com - tmux wiki [^2]: github.com - installing tmux + tmuxp with Nix

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

tony commented 1 year ago

@ChristopherHarwell A very detailed PR description. Well done!

Are you up to signing the CLA before I merge?

codecov[bot] commented 1 year ago

Codecov Report

Merging #883 (70a9a31) into master (f794f31) will not change coverage. Report is 63 commits behind head on master. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #883   +/-   ##
=======================================
  Coverage   71.29%   71.29%           
=======================================
  Files          25       25           
  Lines        1850     1850           
  Branches      410      410           
=======================================
  Hits         1319     1319           
  Misses        411      411           
  Partials      120      120           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

tony commented 1 year ago

@ChristopherHarwell Hi, thanks again for the contribution.

Can you sign the CLA?

tony commented 1 year ago

@ChristopherHarwell Hi! Can you take a look at this?

ChristopherHarwell commented 1 year ago

Yes. I just signed it.

tony commented 1 year ago

@ChristopherHarwell Thank you!

tony commented 1 year ago

@ChristopherHarwell Live in 1.30.1 (PyPI, highlight, current README, highlight)

tony commented 1 year ago

Thank you once again for the contribution!