diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/default.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/default.nix b/scripts/default.nix index a6e5936..35ed43e 100644 --- a/scripts/default.nix +++ b/scripts/default.nix | |||
@@ -36,11 +36,37 @@ let | |||
36 | # battery script | 36 | # battery script |
37 | battery = import ./battery.nix pkgs; | 37 | battery = import ./battery.nix pkgs; |
38 | 38 | ||
39 | # fzf script to switch between tmux sessions | ||
40 | tmux-fzf = pkgs.writeScriptBin "tmux-fzf" '' | ||
41 | tbin() { | ||
42 | ${pkgs.tmux}/bin/tmux "$@" | ||
43 | } | ||
44 | fbin() { | ||
45 | ${pkgs.fzf}/bin/fzf "$@" | ||
46 | } | ||
47 | |||
48 | __fzf() { | ||
49 | fbin --cycle --height 7 --reverse | ||
50 | } | ||
51 | |||
52 | __list_to_fzf() { | ||
53 | fbin ls -F "#{session_name}" | fzf | ||
54 | } | ||
55 | |||
56 | if [ -n "$TMUX" ]; then | ||
57 | tbin switch-client -t "$(__list_to_fzf)" | ||
58 | else | ||
59 | tbin a -t "$(tbin ls -F "#{session_name}" | fbin)" | ||
60 | fi | ||
61 | ''; | ||
62 | |||
39 | in | 63 | in |
40 | [ | 64 | [ |
41 | webcam | 65 | webcam |
42 | git-set-desc | 66 | git-set-desc |
67 | git-new-repo | ||
43 | record | 68 | record |
44 | uploader | 69 | uploader |
45 | battery | 70 | battery |
71 | tmux-fzf | ||
46 | ] | 72 | ] |