aboutsummaryrefslogtreecommitdiff
path: root/scripts/default.nix
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-03 07:06:10 +0100
committerAkshay <[email protected]>2021-10-03 07:06:10 +0100
commit072e34034a99a8aac7dc0f3b651a3f1243d06f90 (patch)
tree94789741a98dcf49f200805b9d21553f0cc2e66d /scripts/default.nix
parent94d534975ab228b27d4713f7dec41bfa3900fdfb (diff)
migrate scripts into nix
Diffstat (limited to 'scripts/default.nix')
-rw-r--r--scripts/default.nix26
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
39in 63in
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]