blob: 0282a9eeaa775ad55fe0f038d942bf20d04bb1ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
# Basic Settings
set previewer ~/scripts/lf/preview
set preview true
set hidden true
#set drawbox true
set icons true
set ignorecase true
# Custom Functions
cmd open ${{
case $(file --mime-type "$f" -bL) in
text/*|application/json) $EDITOR "$f";;
*) xdg-open "$f" ;;
esac
}}
cmd mkdir ${{
printf "Directory Name: "
read ans
mkdir $ans
}}
cmd mkfile ${{
printf "File Name: "
read ans
$EDITOR $ans
}}
cmd chmod ${{
printf "Mode Bits: "
read ans
for file in "$fx"
do
chmod $ans $file
done
lf -remote 'send reload'
}}
cmd sudomkfile ${{
printf "File Name: "
read ans
sudo $EDITOR $ans
}}
cmd setwallpaper %cp "$f" ~/.config/wall.png && xwallpaper --zoom "$f"
cmd fzf_jump ${{
res="$(find . -maxdepth 3 | fzf --reverse --header='Jump to location')"
if [ -f "$res" ]; then
cmd="select"
elif [ -d "$res" ]; then
cmd="cd"
fi
lf -remote "send $id $cmd \"$res\""
}}
cmd broot_jump ${{
f=$(mktemp)
res="$(broot --outcmd $f && cat $f | sed 's/cd //')"
rm -f "$f"
if [ -f "$res" ]; then
cmd="select"
elif [ -d "$res" ]; then
cmd="cd"
fi
lf -remote "send $id $cmd \"$res\""
}}
cmd open_config ${{
$EDITOR $(bookmenu -b ~/.config/bookmenu/configs -f fzf -o)
}}
cmd dragon %dragon-drag-and-drop -a -x $fx
cmd dragon-stay %dragon-drag-and-drop -a $fx
cmd dragon-individual %dragon-drag-and-drop $fx
cmd cpdragon %cpdragon
cmd mvdragon %mvdragon
cmd dlfile %dlfile
# Archive bindings
cmd unarchive ${{
case "$f" in
*.zip) unzip "$f" ;;
*.tar.gz) tar -xzvf "$f" ;;
*.tar.bz2) tar -xjvf "$f" ;;
*.tar) tar -xvf "$f" ;;
*) echo "Unsupported format" ;;
esac
}}
cmd zip %zip -r "$f" "$f"
cmd tar %tar cvf "$f.tar" "$f"
cmd targz %tar cvzf "$f.tar.gz" "$f"
cmd tarbz2 %tar cjvf "$f.tar.bz2" "$f"
# Trash cli bindings
cmd trash ${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
# extract the substring from start of string up to delimiter.
# this is the first "element" of the string.
file=${files%%;*}
trash-put "$(basename "$file")"
# if there's only one element left, set `files` to an empty string.
# this causes us to exit this `while` loop.
# else, we delete the first "element" of the string from files, and move onto the next.
if [ "$files" = "$file" ]; then
files=''
else
files="${files#*;}"
fi
done
}}
cmd clear_trash %trash-empty
cmd restore_trash ${{
trash-restore
}}
cmd stripspace %stripspace "$f"
# Bindings
# Remove some defaults
map m
map o
map n
map "'"
map '"'
map d
map c
map e
map f
# File Openers
map ee $$EDITOR "$f"
map u $view "$f"
# Archive Mappings
map az zip
map at tar
map ag targz
map ab targz
map au unarchive
# Trash Mappings
map dd trash
map tc clear_trash
map tr restore_trash
# Broot Mapping
map f broot_jump
# Dragon Mapping
map dr dragon
map ds dragon-stay
map di dragon-individual
map dm mvdragon
map dc cpdragon
map dl dlfile
map ss stripspace
# Basic Functions
map . set hidden!
map DD delete
map p paste
map x cut
map y copy
map <enter> open
map mf mkfile
map mr sudomkfile
map md mkdir
map ms $mkscript
map ch chmod
map bg setwallpaper
map o open_config
map br $vimv $fx
map r rename
map H top
map L bottom
map R reload
map C clear
map U unselect
# Movement
map gtr cd ~/.local/share/Trash/files
map gus cd /run/media/brodie
map gv. cd ~/videos
map gva cd ~/videos/anime
map gy. cd ~/videos/youtube
map gyt cd ~/videos/youtube/ToUpload
map gyu cd ~/videos/youtube/Uploaded
map gya cd ~/videos/youtube/asset
map go. cd ~/videos/podcast
map got cd ~/videos/podcast/ToUpload
map gou cd ~/videos/podcast/Uploaded
map gp. cd ~/pictures
map gpm cd ~/pictures/mpvscreenshots
map gpa cd ~/pictures/Anime
map gps cd ~/pictures/screenshots
map gw. cd ~/pictures/Wallpapers
map gww cd ~/pictures/Wallpapers/Wallpapers
map gwm cd ~/pictures/Wallpapers/MobileWallpapers
map gt. cd ~/documents/Textbooks
map gt1 cd ~/documents/Textbooks/1stYear
map gt2 cd ~/documents/Textbooks/2ndYear
map gt3 cd ~/documents/Textbooks/3rdYear
map gu3 cd ~/documents/Uni/3rdYear
map gd cd ~/documents
map gD cd ~/downloads
map ge cd ~/desktop
map gs. cd ~/scripts
map gsl cd ~/scripts/lf
map gsa cd ~/scripts/alsa
map gsi cd ~/scripts/i3
map gse cd ~/scripts/lemonbar
map gsp cd ~/scripts/polybar
map gsb cd ~/scripts/bspwm
map gsu cd ~/scripts/pulse
map gdt cd ~/scripts/transmission
map gr. cd ~/repos
map grb cd ~/repos/bookmenu
map grf cd ~/repos/cleanfullscreen
map grm cd ~/repos/dmenu
map grd cd ~/repos/dotfiles
map gri cd ~/repos/init
map grk cd ~/repos/kanban-board
map grl cd ~/repos/lbryurlconvert
map grP cd ~/repos/PerlProjects
map grr cd ~/repos/reading-list
map grs cd ~/repos/st
map grw cd ~/repos/website
map gc cd ~/.config
map gC cd ~/.local/share/cell
map gl cd ~/.local
map gE cd /etc
map gU. cd /usr
map gUs cd /usr/share
map \;j cd ~
|