Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
4.8 KiB

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