diff options
author | Shubham Saini <ssaini@fispan.com> | 2023-09-26 22:12:26 +0000 |
---|---|---|
committer | Shubham Saini <ssaini@fispan.com> | 2023-09-26 22:12:26 +0000 |
commit | d14bb821b86f560e7da56cce8c686d3e09aa0785 (patch) | |
tree | 7d5e86db81fc532d0b03795f73d26989d2b64c67 /darwin | |
parent | 4eb5c86944a0097dbd5bc3b03c5ed540f4599358 (diff) |
lf: nixified
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/home.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/darwin/home.nix b/darwin/home.nix index 5ae2bd0..626d4b9 100644 --- a/darwin/home.nix +++ b/darwin/home.nix | |||
@@ -77,4 +77,41 @@ | |||
77 | signByDefault = true; | 77 | signByDefault = true; |
78 | }; | 78 | }; |
79 | }; | 79 | }; |
80 | programs.lf = { | ||
81 | enable = true; | ||
82 | settings = { | ||
83 | shell = "sh"; | ||
84 | icons = true; | ||
85 | drawbox = true; | ||
86 | scrolloff = 10; | ||
87 | shellopts = "-eu"; | ||
88 | }; | ||
89 | commands = { | ||
90 | extract = '' | ||
91 | %{{ | ||
92 | set -f | ||
93 | case $f in | ||
94 | *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;; | ||
95 | *.tar.gz|*.tgz) tar xzvf $f;; | ||
96 | *.tar.xz|*.txz) tar xJvf $f;; | ||
97 | *.zip) unzip $f;; | ||
98 | *.rar) unrar x $f;; | ||
99 | *.7z) 7z x $f;; | ||
100 | esac | ||
101 | }} | ||
102 | ''; | ||
103 | open = '' | ||
104 | %{{ | ||
105 | case $(file --mime-type -Lb $f) in | ||
106 | text/*) lf -remote "send $id \$$EDITOR \$fx";; | ||
107 | *) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;; | ||
108 | esac | ||
109 | }} | ||
110 | ''; | ||
111 | }; | ||
112 | keybindings = { | ||
113 | "<enter>" = "shell"; | ||
114 | "." = "set hidden!"; | ||
115 | }; | ||
116 | }; | ||
80 | } | 117 | } |