Krolyxon
Commit ba7303e

Branches

Refs →

dotfiles-x11ba7303e

switching from ranger to lf

Author
krolyxon
Date
2022-07-05 14:07 +0530
Parent
a33c7ad
Commit
ba7303e5b852ecd96e6acf35d8fb1427c9be9c62

+406 −406

13 files changed

  1. A .config/lf/cleaner +4 −0
  2. A .config/lf/lfrc +114 −0
  3. A .config/lf/scope +44 −0
  4. D .config/ranger/plugins/__init__.py +0 −0
  5. D .config/ranger/plugins/ranger_devicons/__init__.py +0 −15
  6. D .config/ranger/plugins/ranger_devicons/devicons.py +0 −381
  7. D .config/ranger/rc.conf +0 −8
  8. M .config/shell/aliasrc +1 −1
  9. M .config/shell/profile +162 −0
  10. A .local/bin/dmenuumount +44 −0
  11. A .local/bin/lfub +24 −0
  12. A .local/bin/rotdir +12 −0
  13. M .local/share/applications/file.desktop +1 −1
A .config/lf/cleaner View
@@ -0,0 +1,4 @@
1+#!/bin/sh
2+if [ -n "$FIFO_UEBERZUG" ]; then
3+ printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG"
4+fi
A .config/lf/lfrc View
@@ -0,0 +1,114 @@
1+# Basic vars
2+set shellopts '-eu'
3+set ifs "\n"
4+set scrolloff 10
5+set icons
6+set period 1
7+set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
8+set cleaner '~/.config/lf/cleaner'
9+set previewer '~/.config/lf/scope'
10+
11+# cmds/functions
12+cmd open ${{
13+ case $(file --mime-type "$(readlink -f $f)" -b) in
14+ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
15+ image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
16+ text/*|application/json|inode/x-empty) $EDITOR $fx;;
17+ image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
18+ image/svg+xml) display -- $f ;;
19+ image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" |
20+ setsid -f sxiv -aio 2>/dev/null | while read -r file; do
21+ [ -z "$file" ] && continue
22+ lf -remote "send select \"$file\""
23+ lf -remote "send toggle"
24+ done &
25+ ;;
26+ audio/*) mpv --audio-display=no $f ;;
27+ video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
28+ application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
29+ application/pgp-encrypted) $EDITOR $fx ;;
30+ *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
31+ esac
32+}}
33+
34+cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
35+
36+cmd extract ${{
37+ clear; tput cup $(($(tput lines)/3)); tput bold
38+ set -f
39+ printf "%s\n\t" "$fx"
40+ printf "extract?[y/N]"
41+ read ans
42+ [ $ans = "y" ] && aunpack $fx
43+}}
44+
45+cmd delete ${{
46+ clear; tput cup $(($(tput lines)/3)); tput bold
47+ set -f
48+ printf "%s\n\t" "$fx"
49+ printf "delete?[y/N]"
50+ read ans
51+ [ $ans = "y" ] && rm -rf -- $fx
52+}}
53+
54+cmd moveto ${{
55+ clear; tput cup $(($(tput lines)/3)); tput bold
56+ set -f
57+ clear; echo "Move to where?"
58+ dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
59+ for x in $fx; do
60+ eval mv -iv \"$x\" \"$dest\"
61+ done &&
62+ notify-send "๐Ÿšš File(s) moved." "File(s) moved to $dest."
63+}}
64+
65+cmd copyto ${{
66+ clear; tput cup $(($(tput lines)/3)); tput bold
67+ set -f
68+ clear; echo "Copy to where?"
69+ dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
70+ for x in $fx; do
71+ eval cp -ivr \"$x\" \"$dest\"
72+ done &&
73+ notify-send "๐Ÿ“‹ File(s) copied." "File(s) copies to $dest."
74+}}
75+
76+cmd setbg "$1"
77+cmd bulkrename $vidir
78+
79+# Bindings
80+map <c-f> $lf -remote "send $id select \"$(fzf)\""
81+map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
82+map gh
83+map g top
84+map D delete
85+map E extract
86+map C copyto
87+map M moveto
88+map <c-n> push :mkdir<space>
89+map <c-r> reload
90+map <c-s> set hidden!
91+map <enter> shell
92+map x $$f
93+map X !$f
94+map o &mimeopen $f
95+map O $mimeopen --ask $f
96+
97+map A rename # at the very end
98+map c push A<c-u> # new rename
99+map I push A<c-a> # at the very beginning
100+map i push A<a-b><a-b><a-f> # before extension
101+map a push A<a-b> # after extension
102+map B bulkrename
103+map b $setbg $f
104+
105+map <c-e> down
106+map <c-y> up
107+map V push :!nvim<space>
108+
109+map W $setsid -f $TERMINAL >/dev/null 2>&1
110+
111+map Y $printf "%s" "$fx" | xclip -selection clipboard
112+
113+# Source Bookmarks
114+#source "~/.config/lf/shortcutrc"
A .config/lf/scope View
@@ -0,0 +1,44 @@
1+#!/bin/sh
2+
3+# File preview handler for lf.
4+
5+set -C -f
6+IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}"
7+
8+image() {
9+ if [ -f "$1" ] && [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1; then
10+ printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
11+ else
12+ mediainfo "$6"
13+ fi
14+}
15+
16+ifub() {
17+ [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1
18+}
19+
20+# Note that the cache file name is a function of file information, meaning if
21+# an image appears in multiple places across the machine, it will not have to
22+# be regenerated once seen.
23+
24+case "$(file --dereference --brief --mime-type -- "$1")" in
25+ image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
26+ text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
27+ text/troff) man ./ "$1" | col -b ;;
28+ text/* | */xml | application/json) cat "$1" ;;
29+ application/zip) atool --list -- "$1" ;;
30+ audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;;
31+ video/* )
32+ CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
33+ [ ! -f "$CACHE" ] && ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0
34+ image "$CACHE" "$2" "$3" "$4" "$5" "$1"
35+ ;;
36+ */pdf)
37+ CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
38+ [ ! -f "$CACHE.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"
39+ image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
40+ ;;
41+ *opendocument*) odt2txt "$1" ;;
42+ application/pgp-encrypted) gpg -d -- "$1" ;;
43+esac
44+exit 1
D .config/ranger/plugins/__init__.py View

[No content changes]

D .config/ranger/plugins/ranger_devicons/__init__.py View
@@ -1,15 +0,0 @@
1โˆ’import os
2โˆ’import ranger.api
3โˆ’from ranger.core.linemode import LinemodeBase
4โˆ’from .devicons import *
5โˆ’
6โˆ’SEPARATOR = os.getenv('RANGER_DEVICONS_SEPARATOR', ' ')
7โˆ’
8โˆ’@ranger.api.register_linemode
9โˆ’class DevIconsLinemode(LinemodeBase):
10โˆ’ name = "devicons"
11โˆ’
12โˆ’ uses_metadata = False
13โˆ’
14โˆ’ def filetitle(self, file, metadata):
15โˆ’ return devicon(file) + SEPARATOR + file.relative_path
D .config/ranger/plugins/ranger_devicons/devicons.py View
@@ -1,381 +0,0 @@
1โˆ’#!/usr/bin/python
2โˆ’# coding=UTF-8
3โˆ’# These glyphs, and the mapping of file extensions to glyphs
4โˆ’# has been copied from the vimscript code that is present in
5โˆ’# https://github.com/ryanoasis/vim-devicons
6โˆ’import re;
7โˆ’import os;
8โˆ’
9โˆ’# Get the XDG_USER_DIRS directory names from enviromental variables
10โˆ’
11โˆ’xdgs_dirs = {path.split('/')[-2]: icon for key, icon in [
12โˆ’ ('XDG_DOCUMENTS_DIR' , '๏'),
13โˆ’ ('XDG_DOWNLOAD_DIR' , '๏’˜'),
14โˆ’ ('XDG_CONFIG_DIR' , '๎œ‡'),
15โˆ’ ('XDG_MUSIC_DIR' , '๏€ฅ'),
16โˆ’ ('XDG_PICTURES_DIR' , '๎‰„'),
17โˆ’ ('XDG_PUBLICSHARE_DIR', '๏ซ'),
18โˆ’ ('XDG_TEMPLATES_DIR' , '๏ƒ…'),
19โˆ’ ('XDG_VIDEOS_DIR' , '๏‘‡'),
20โˆ’] if (path := os.getenv(key))}
21โˆ’
22โˆ’
23โˆ’# all those glyphs will show as weird squares if you don't have the correct patched font
24โˆ’# My advice is to use NerdFonts which can be found here:
25โˆ’# https://github.com/ryanoasis/nerd-fonts
26โˆ’file_node_extensions = {
27โˆ’ '7z' : '๏†‡',
28โˆ’ 'a' : '๎˜ค',
29โˆ’ 'ai' : '๎žด',
30โˆ’ 'apk' : '๏†‡',
31โˆ’ 'asm' : '๎˜”',
32โˆ’ 'asp' : '๎ž•',
33โˆ’ 'aup' : '๏€',
34โˆ’ 'avi' : '๏€ˆ',
35โˆ’ 'awk' : '๎ž•',
36โˆ’ 'bash' : '๎ž•',
37โˆ’ 'bat' : '๎˜•',
38โˆ’ 'bmp' : '๎˜',
39โˆ’ 'bz2' : '๏†‡',
40โˆ’ 'c' : '๎˜ž',
41โˆ’ 'c++' : '๎˜',
42โˆ’ 'cab' : '๏†‡',
43โˆ’ 'cbr' : '๏ต',
44โˆ’ 'cbz' : '๏ต',
45โˆ’ 'cc' : '๎˜',
46โˆ’ 'class' : '๎œธ',
47โˆ’ 'clj' : '๎จ',
48โˆ’ 'cljc' : '๎จ',
49โˆ’ 'cljs' : '๎ช',
50โˆ’ 'cmake' : '๎˜ค',
51โˆ’ 'coffee' : '๎˜›',
52โˆ’ 'conf' : '๎˜•',
53โˆ’ 'cp' : '๎˜',
54โˆ’ 'cpio' : '๏†‡',
55โˆ’ 'cpp' : '๎˜',
56โˆ’ 'cs' : '๏ š',
57โˆ’ 'csh' : '๎ž•',
58โˆ’ 'css' : '๎˜”',
59โˆ’ 'cue' : '๏€',
60โˆ’ 'cvs' : '๎˜•',
61โˆ’ 'cxx' : '๎˜',
62โˆ’ 'd' : '๎žฏ',
63โˆ’ 'dart' : '๎ž˜',
64โˆ’ 'db' : '๎œ†',
65โˆ’ 'deb' : '๏†‡',
66โˆ’ 'diff' : '๎œจ',
67โˆ’ 'dll' : '๎œ',
68โˆ’ 'doc' : '๏€ญ',
69โˆ’ 'docx' : '๏€ญ',
70โˆ’ 'dump' : '๎œ†',
71โˆ’ 'edn' : '๎ช',
72โˆ’ 'eex' : '๎˜ญ',
73โˆ’ 'efi' : '๎ž•',
74โˆ’ 'ejs' : '๎˜Ž',
75โˆ’ 'elf' : '๎ž•',
76โˆ’ 'elm' : '๎˜ฌ',
77โˆ’ 'epub' : '๏€ญ',
78โˆ’ 'erl' : '๎žฑ',
79โˆ’ 'ex' : '๎˜ญ',
80โˆ’ 'exe' : '๎œ',
81โˆ’ 'exs' : '๎˜ญ',
82โˆ’ 'f#' : '๎žง',
83โˆ’ 'fifo' : '๏ณฃ',
84โˆ’ 'fish' : '๎ž•',
85โˆ’ 'flac' : '๏€',
86โˆ’ 'flv' : '๏€ˆ',
87โˆ’ 'fs' : '๎žง',
88โˆ’ 'fsi' : '๎žง',
89โˆ’ 'fsscript' : '๎žง',
90โˆ’ 'fsx' : '๎žง',
91โˆ’ 'gem' : '๏†‡',
92โˆ’ 'gemspec' : '๎ž‘',
93โˆ’ 'gif' : '๎˜',
94โˆ’ 'go' : '๎˜ง',
95โˆ’ 'gz' : '๏†‡',
96โˆ’ 'gzip' : '๏†‡',
97โˆ’ 'h' : '๎˜ž',
98โˆ’ 'haml' : '๎˜Ž',
99โˆ’ 'hbs' : '๎˜',
100โˆ’ 'hh' : '๏ƒฝ',
101โˆ’ 'hpp' : '๎˜',
102โˆ’ 'hrl' : '๎žฑ',
103โˆ’ 'hs' : '๎˜Ÿ',
104โˆ’ 'htaccess' : '๎˜•',
105โˆ’ 'htm' : '๎˜Ž',
106โˆ’ 'html' : '๎˜Ž',
107โˆ’ 'htpasswd' : '๎˜•',
108โˆ’ 'hxx' : '๏ƒฝ',
109โˆ’ 'ico' : '๎˜',
110โˆ’ 'img' : '๎œ†',
111โˆ’ 'ini' : '๎˜•',
112โˆ’ 'iso' : '๎œ†',
113โˆ’ 'jar' : '๎œธ',
114โˆ’ 'java' : '๎œธ',
115โˆ’ 'jl' : '๎˜ค',
116โˆ’ 'jpeg' : '๎˜',
117โˆ’ 'jpg' : '๎˜',
118โˆ’ 'js' : '๎˜Œ',
119โˆ’ 'json' : '๎˜‹',
120โˆ’ 'jsx' : '๎žบ',
121โˆ’ 'key' : '๎˜Š',
122โˆ’ 'ksh' : '๎ž•',
123โˆ’ 'leex' : '๎˜ญ',
124โˆ’ 'less' : '๎˜”',
125โˆ’ 'lha' : '๏†‡',
126โˆ’ 'lhs' : '๎˜Ÿ',
127โˆ’ 'log' : '๏‡ช',
128โˆ’ 'lua' : '๎˜ ',
129โˆ’ 'lzh' : '๏†‡',
130โˆ’ 'lzma' : '๏†‡',
131โˆ’ 'm4a' : '๏€',
132โˆ’ 'm4v' : '๏€ˆ',
133โˆ’ 'markdown' : '๎˜‰',
134โˆ’ 'md' : '๎˜‰',
135โˆ’ 'mdx' : '๎˜‰',
136โˆ’ 'mjs' : '๎˜Œ',
137โˆ’ 'mkv' : '๏€ˆ',
138โˆ’ 'ml' : 'ฮป',
139โˆ’ 'mli' : 'ฮป',
140โˆ’ 'mov' : '๏€ˆ',
141โˆ’ 'mp3' : '๏€',
142โˆ’ 'mp4' : '๏€ˆ',
143โˆ’ 'mpeg' : '๏€ˆ',
144โˆ’ 'mpg' : '๏€ˆ',
145โˆ’ 'msi' : '๎œ',
146โˆ’ 'mustache' : '๎˜',
147โˆ’ 'nix' : '๏Œ“',
148โˆ’ 'o' : '๎˜ค',
149โˆ’ 'ogg' : '๏€',
150โˆ’ 'part' : '๎Ž„',
151โˆ’ 'pdf' : '๏œค',
152โˆ’ 'php' : '๎˜ˆ',
153โˆ’ 'pl' : '๎ฉ',
154โˆ’ 'pm' : '๎ฉ',
155โˆ’ 'png' : '๎˜',
156โˆ’ 'pp' : '๏’™',
157โˆ’ 'ppt' : '๏œฆ',
158โˆ’ 'pptx' : '๏œฆ',
159โˆ’ 'ps1' : '๎ž•',
160โˆ’ 'psb' : '๎žธ',
161โˆ’ 'psd' : '๎žธ',
162โˆ’ 'pub' : '๎˜Š',
163โˆ’ 'py' : '๎˜†',
164โˆ’ 'pyc' : '๎˜†',
165โˆ’ 'pyd' : '๎˜†',
166โˆ’ 'pyo' : '๎˜†',
167โˆ’ 'r' : '๏ณ’',
168โˆ’ 'rake' : '๎ž‘',
169โˆ’ 'rar' : '๏†‡',
170โˆ’ 'rb' : '๎ž‘',
171โˆ’ 'rc' : '๎˜•',
172โˆ’ 'rlib' : '๎žจ',
173โˆ’ 'rmd' : '๎˜‰',
174โˆ’ 'rom' : '๎ž•',
175โˆ’ 'rpm' : '๏†‡',
176โˆ’ 'rproj' : '๏ซ…',
177โˆ’ 'rs' : '๎žจ',
178โˆ’ 'rss' : '๎˜™',
179โˆ’ 'rtf' : '๏€ญ',
180โˆ’ 's' : '๎˜”',
181โˆ’ 'sass' : '๎˜ƒ',
182โˆ’ 'scala' : '๎œท',
183โˆ’ 'scss' : '๎˜ƒ',
184โˆ’ 'sh' : '๎ž•',
185โˆ’ 'slim' : '๎˜Ž',
186โˆ’ 'sln' : '๎œŒ',
187โˆ’ 'so' : '๎˜ค',
188โˆ’ 'sql' : '๎œ†',
189โˆ’ 'styl' : '๎˜€',
190โˆ’ 'suo' : '๎œŒ',
191โˆ’ 'swift' : '๎•',
192โˆ’ 't' : '๎ฉ',
193โˆ’ 'tar' : '๏†‡',
194โˆ’ 'tex' : '๏ญจ',
195โˆ’ 'tgz' : '๏†‡',
196โˆ’ 'toml' : '๎˜•',
197โˆ’ 'torrent' : '๎ฑ',
198โˆ’ 'ts' : '๎˜จ',
199โˆ’ 'tsx' : '๎žบ',
200โˆ’ 'twig' : '๎˜œ',
201โˆ’ 'vim' : '๎Ÿ…',
202โˆ’ 'vimrc' : '๎Ÿ…',
203โˆ’ 'vue' : '๏ต‚',
204โˆ’ 'wav' : '๏€',
205โˆ’ 'webm' : '๏€ˆ',
206โˆ’ 'webmanifest' : '๎˜‹',
207โˆ’ 'webp' : '๎˜',
208โˆ’ 'xbps' : '๏†‡',
209โˆ’ 'xcplayground' : '๎•',
210โˆ’ 'xhtml' : '๎˜Ž',
211โˆ’ 'xls' : '๏œš',
212โˆ’ 'xlsx' : '๏œš',
213โˆ’ 'xml' : '๎˜Ž',
214โˆ’ 'xul' : '๎…',
215โˆ’ 'xz' : '๏†‡',
216โˆ’ 'yaml' : '๎˜•',
217โˆ’ 'yml' : '๎˜•',
218โˆ’ 'zip' : '๏†‡',
219โˆ’ 'zsh' : '๎ž•',
220โˆ’}
221โˆ’
222โˆ’dir_node_exact_matches = {
223โˆ’# English
224โˆ’ '.git' : '๎—ป',
225โˆ’ 'Desktop' : '๏„ˆ',
226โˆ’ 'Documents' : '๏',
227โˆ’ 'Downloads' : '๏’˜',
228โˆ’ 'Dotfiles' : '๎œ‡',
229โˆ’ 'Dropbox' : '๎œ‡',
230โˆ’ 'Music' : '๏€ฅ',
231โˆ’ 'Pictures' : '๎‰„',
232โˆ’ 'Public' : '๏ซ',
233โˆ’ 'Templates' : '๏ƒ…',
234โˆ’ 'Videos' : '๏‘‡',
235โˆ’# Spanish
236โˆ’ 'Escritorio' : '๏„ˆ',
237โˆ’ 'Documentos' : '๏',
238โˆ’ 'Descargas' : '๏’˜',
239โˆ’ 'Mรบsica' : '๏€ฅ',
240โˆ’ 'Imรกgenes' : '๎‰„',
241โˆ’ 'Pรบblico' : '๏ซ',
242โˆ’ 'Plantillas' : '๏ƒ…',
243โˆ’ 'Vรญdeos' : '๏‘‡',
244โˆ’# French
245โˆ’ 'Bureau' : '๏„ˆ',
246โˆ’ 'Documents' : '๏',
247โˆ’ 'Images' : '๎‰„',
248โˆ’ 'Musique' : '๏€ฅ',
249โˆ’ 'Publique' : '๏ซ',
250โˆ’ 'Tรฉlรฉchargements' : '๏’˜',
251โˆ’ 'Vidรฉos' : '๏‘‡',
252โˆ’# Portuguese
253โˆ’ 'Documentos' : '๏',
254โˆ’ 'Imagens' : '๎‰„',
255โˆ’ 'Modelos' : '๏ƒ…',
256โˆ’ 'Mรบsica' : '๏€ฅ',
257โˆ’ 'Pรบblico' : '๏ซ',
258โˆ’ 'Vรญdeos' : '๏‘‡',
259โˆ’ 'รrea de trabalho' : '๏„ˆ',
260โˆ’# Italian
261โˆ’ 'Documenti' : '๏',
262โˆ’ 'Immagini' : '๎‰„',
263โˆ’ 'Modelli' : '๏ƒ…',
264โˆ’ 'Musica' : '๏€ฅ',
265โˆ’ 'Pubblici' : '๏ซ',
266โˆ’ 'Scaricati' : '๏’˜',
267โˆ’ 'Scrivania' : '๏„ˆ',
268โˆ’ 'Video' : '๏‘‡',
269โˆ’# German
270โˆ’ 'Bilder' : '๎‰„',
271โˆ’ 'Dokumente' : '๏',
272โˆ’ 'Musik' : '๏€ฅ',
273โˆ’ 'Schreibtisch' : '๏„ˆ',
274โˆ’ 'Vorlagen' : '๏ƒ…',
275โˆ’ 'ร–ffentlich' : '๏ซ',
276โˆ’# Hungarian
277โˆ’ 'Dokumentumok' : '๏',
278โˆ’ 'Kรฉpek' : '๎‰„',
279โˆ’ 'Modelli' : '๏ƒ…',
280โˆ’ 'Zene' : '๏€ฅ',
281โˆ’ 'Letรถltรฉsek' : '๏’˜',
282โˆ’ 'Szรกmรญtรณgรฉp' : '๏„ˆ',
283โˆ’ 'Videรณk' : '๏‘‡',
284โˆ’# XDG_USER_DIRS
285โˆ’ **xdgs_dirs
286โˆ’}
287โˆ’
288โˆ’file_node_exact_matches = {
289โˆ’ '.bash_aliases' : '๎˜•',
290โˆ’ '.bash_history' : '๎˜•',
291โˆ’ '.bash_logout' : '๎˜•',
292โˆ’ '.bash_profile' : '๎˜•',
293โˆ’ '.bashprofile' : '๎˜•',
294โˆ’ '.bashrc' : '๎˜•',
295โˆ’ '.dmrc' : '๎˜•',
296โˆ’ '.DS_Store' : '๎˜•',
297โˆ’ '.fasd' : '๎˜•',
298โˆ’ '.fehbg' : '๎‰„',
299โˆ’ '.gitattributes' : '๎˜•',
300โˆ’ '.gitconfig' : '๎˜•',
301โˆ’ '.gitignore' : '๎˜•',
302โˆ’ '.gitlab-ci.yml' : '๏Š–',
303โˆ’ '.gvimrc' : '๎˜ซ',
304โˆ’ '.inputrc' : '๎˜•',
305โˆ’ '.jack-settings' : '๎˜•',
306โˆ’ '.mime.types' : '๎˜•',
307โˆ’ '.ncmpcpp' : '๏€',
308โˆ’ '.nvidia-settings-rc' : '๎˜•',
309โˆ’ '.pam_environment' : '๎˜•',
310โˆ’ '.profile' : '๎˜•',
311โˆ’ '.recently-used' : '๎˜•',
312โˆ’ '.selected_editor' : '๎˜•',
313โˆ’ '.vim' : '๎Ÿ…',
314โˆ’ '.viminfo' : '๎Ÿ…',
315โˆ’ '.vimrc' : '๎Ÿ…',
316โˆ’ '.Xauthority' : '๎˜•',
317โˆ’ '.Xdefaults' : '๎˜•',
318โˆ’ '.xinitrc' : '๎˜•',
319โˆ’ '.xinputrc' : '๎˜•',
320โˆ’ '.Xresources' : '๎˜•',
321โˆ’ '.zshrc' : '๎˜•',
322โˆ’ '_gvimrc' : '๎˜ซ',
323โˆ’ '_vimrc' : '๎˜ซ',
324โˆ’ 'a.out' : '๎ž•',
325โˆ’ 'authorized_keys' : '๎˜Š',
326โˆ’ 'bspwmrc' : '๎˜•',
327โˆ’ 'cmakelists.txt' : '๎˜•',
328โˆ’ 'config' : '๎˜•',
329โˆ’ 'config.ac' : '๎˜ค',
330โˆ’ 'config.m4' : '๎˜ค',
331โˆ’ 'config.mk' : '๎˜ค',
332โˆ’ 'config.ru' : '๎ž‘',
333โˆ’ 'configure' : '๎ž•',
334โˆ’ 'docker-compose.yml' : '๏Œˆ',
335โˆ’ 'dockerfile' : '๎žฐ',
336โˆ’ 'Dockerfile' : '๏Œˆ',
337โˆ’ 'dropbox' : '๎œ‡',
338โˆ’ 'exact-match-case-sensitive-1.txt' : 'X1',
339โˆ’ 'exact-match-case-sensitive-2' : 'X2',
340โˆ’ 'favicon.ico' : '๎˜ฃ',
341โˆ’ 'gemfile' : '๎ž‘',
342โˆ’ 'gruntfile.coffee' : '๎˜‘',
343โˆ’ 'gruntfile.js' : '๎˜‘',
344โˆ’ 'gruntfile.ls' : '๎˜‘',
345โˆ’ 'gulpfile.coffee' : '๎˜',
346โˆ’ 'gulpfile.js' : '๎˜',
347โˆ’ 'gulpfile.ls' : '๎˜',
348โˆ’ 'ini' : '๎˜•',
349โˆ’ 'known_hosts' : '๎˜Š',
350โˆ’ 'ledger' : '๏…•',
351โˆ’ 'license' : '๎˜Š',
352โˆ’ 'LICENSE' : '๎˜Š',
353โˆ’ 'LICENSE.md' : '๎˜Š',
354โˆ’ 'LICENSE.txt' : '๎˜Š',
355โˆ’ 'Makefile' : '๎˜•',
356โˆ’ 'makefile' : '๎˜•',
357โˆ’ 'Makefile.ac' : '๎˜•',
358โˆ’ 'Makefile.in' : '๎˜•',
359โˆ’ 'mimeapps.list' : '๎˜•',
360โˆ’ 'mix.lock' : '๎˜ญ',
361โˆ’ 'node_modules' : '๎œ˜',
362โˆ’ 'package-lock.json' : '๎œ˜',
363โˆ’ 'package.json' : '๎œ˜',
364โˆ’ 'playlists' : '๏€',
365โˆ’ 'procfile' : '๎˜‡',
366โˆ’ 'Rakefile' : '๎ž‘',
367โˆ’ 'rakefile' : '๎ž‘',
368โˆ’ 'react.jsx' : '๎˜ฅ',
369โˆ’ 'README' : '๎˜‰',
370โˆ’ 'README.markdown' : '๎˜‰',
371โˆ’ 'README.md' : '๎˜‰',
372โˆ’ 'README.rst' : '๎˜‰',
373โˆ’ 'README.txt' : '๎˜‰',
374โˆ’ 'sxhkdrc' : '๎˜•',
375โˆ’ 'user-dirs.dirs' : '๎˜•',
376โˆ’ 'webpack.config.js' : '๎œ˜',
377โˆ’}
378โˆ’
379โˆ’def devicon(file):
380โˆ’ if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '๎—ฟ')
381โˆ’ return file_node_exact_matches.get(os.path.basename(file.relative_path), file_node_extensions.get(file.extension, '๎˜’'))
D .config/ranger/rc.conf View
@@ -1,8 +0,0 @@
1โˆ’# How many columns are there, and what are their relative widths?
2โˆ’set column_ratios 1,3,5
3โˆ’
4โˆ’set show_hidden true
5โˆ’set draw_borders both
6โˆ’set preview_images true
7โˆ’set preview_images_method ueberzug
8โˆ’default_linemode devicons
M .config/shell/aliasrc View
@@ -12,7 +12,7 @@ alias \
1212 ytdlm='yt-dlp -f "(mp3)"' \
1313 cl='clear' \
1414 dots='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' \
15โˆ’ fm='ranger' \
15+ lf="lfub" \
1616 hst='history 1 -1 | cut -c 8- | sort | uniq | fzf | tr -d '\n' | xclip -sel c'
1717
1818 # Verbosity and settings that you pretty much just always are going to want.
M .config/shell/profile View
@@ -36,6 +36,168 @@ export MPD_PORT="6600"
3636 # Mpd daemon start
3737 [ ! -s ~/.config/mpd/pid ] && mpd
3838
39+export LF_ICONS="\
40+di=๏“:\
41+fi=๏Ž:\
42+ln=๏’:\
43+or=๏’:\
44+ex=๏ง:\
45+*.vimrc=๎˜ซ:\
46+*.viminfo=๎˜ซ:\
47+*.gitignore=๏žก:\
48+*.c=๎˜ž:\
49+*.cc=๎˜:\
50+*.clj=๎จ:\
51+*.coffee=๎‘:\
52+*.cpp=๎˜:\
53+*.css=๎˜”:\
54+*.d=๎žฏ:\
55+*.dart=๎ž˜:\
56+*.erl=๎žฑ:\
57+*.exs=๎˜ญ:\
58+*.fs=๎žง:\
59+*.go=๎˜ง:\
60+*.h=๎˜ž:\
61+*.hh=๎˜:\
62+*.hpp=๎˜:\
63+*.hs=๎ท:\
64+*.html=๎˜Ž:\
65+*.java=๎œธ:\
66+*.jl=๎˜ค:\
67+*.js=๎Ž:\
68+*.json=๎˜‹:\
69+*.lua=๎˜ :\
70+*.md=๎˜‰:\
71+*.php=๎˜ˆ:\
72+*.pl=๎ฉ:\
73+*.pro=๎žก:\
74+*.py=๎œผ:\
75+*.rb=๎œน:\
76+*.rs=๎žจ:\
77+*.scala=๎œท:\
78+*.ts=๎˜จ:\
79+*.vim=๎˜ซ:\
80+*.cmd=๏:\
81+*.ps1=๏:\
82+*.sh=๏:\
83+*.bash=๏:\
84+*.zsh=๏:\
85+*.fish=๏:\
86+*.tar=๏:\
87+*.tgz=๏:\
88+*.arc=๏:\
89+*.arj=๏:\
90+*.taz=๏:\
91+*.lha=๏:\
92+*.lz4=๏:\
93+*.lzh=๏:\
94+*.lzma=๏:\
95+*.tlz=๏:\
96+*.txz=๏:\
97+*.tzo=๏:\
98+*.t7z=๏:\
99+*.zip=๏:\
100+*.z=๏:\
101+*.dz=๏:\
102+*.gz=๏:\
103+*.lrz=๏:\
104+*.lz=๏:\
105+*.lzo=๏:\
106+*.xz=๏:\
107+*.zst=๏:\
108+*.tzst=๏:\
109+*.bz2=๏:\
110+*.bz=๏:\
111+*.tbz=๏:\
112+*.tbz2=๏:\
113+*.tz=๏:\
114+*.deb=๏:\
115+*.rpm=๏:\
116+*.jar=๏:\
117+*.war=๏:\
118+*.ear=๏:\
119+*.sar=๏:\
120+*.rar=๏:\
121+*.alz=๏:\
122+*.ace=๏:\
123+*.zoo=๏:\
124+*.cpio=๏:\
125+*.7z=๏:\
126+*.rz=๏:\
127+*.cab=๏:\
128+*.wim=๏:\
129+*.swm=๏:\
130+*.dwm=๏:\
131+*.esd=๏:\
132+*.jpg=๏:\
133+*.jpeg=๏:\
134+*.mjpg=๏:\
135+*.mjpeg=๏:\
136+*.gif=๏:\
137+*.bmp=๏:\
138+*.pbm=๏:\
139+*.pgm=๏:\
140+*.ppm=๏:\
141+*.tga=๏:\
142+*.xbm=๏:\
143+*.xpm=๏:\
144+*.tif=๏:\
145+*.tiff=๏:\
146+*.png=๏:\
147+*.svg=๏:\
148+*.svgz=๏:\
149+*.mng=๏:\
150+*.pcx=๏:\
151+*.mov=๏:\
152+*.mpg=๏:\
153+*.mpeg=๏:\
154+*.m2v=๏:\
155+*.mkv=๏:\
156+*.webm=๏:\
157+*.ogm=๏:\
158+*.mp4=๏:\
159+*.m4v=๏:\
160+*.mp4v=๏:\
161+*.vob=๏:\
162+*.qt=๏:\
163+*.nuv=๏:\
164+*.wmv=๏:\
165+*.asf=๏:\
166+*.rm=๏:\
167+*.rmvb=๏:\
168+*.flc=๏:\
169+*.avi=๏:\
170+*.fli=๏:\
171+*.flv=๏:\
172+*.gl=๏:\
173+*.dl=๏:\
174+*.xcf=๏:\
175+*.xwd=๏:\
176+*.yuv=๏:\
177+*.cgm=๏:\
178+*.emf=๏:\
179+*.ogv=๏:\
180+*.ogx=๏:\
181+*.aac=๏:\
182+*.au=๏:\
183+*.flac=๏:\
184+*.m4a=๏:\
185+*.mid=๏:\
186+*.midi=๏:\
187+*.mka=๏:\
188+*.mp3=๏:\
189+*.mpc=๏:\
190+*.ogg=๏:\
191+*.ra=๏:\
192+*.wav=๏:\
193+*.oga=๏:\
194+*.opus=๏:\
195+*.spx=๏:\
196+*.xspf=๏:\
197+*.pdf=๏‘:\
198+*.nix=๏Œ“:\
199+"
200+
39201 # Starting X
40202 if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
41203 exec startx
A .local/bin/dmenuumount View
@@ -0,0 +1,44 @@
1+#!/bin/sh
2+
3+# A dmenu prompt to unmount drives.
4+# Provides you with mounted partitions, select one to unmount.
5+# Drives mounted at /, /boot and /home will not be options to unmount.
6+
7+unmountusb() {
8+ [ -z "$drives" ] && exit
9+ chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
10+ chosen="$(echo "$chosen" | awk '{print $1}')"
11+ [ -z "$chosen" ] && exit
12+ sudo -A umount "$chosen" && notify-send "๐Ÿ’ป USB unmounting" "$chosen unmounted."
13+ }
14+
15+unmountandroid() { \
16+ chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1
17+ [ -z "$chosen" ] && exit
18+ sudo -A umount -l "$chosen" && notify-send "๐Ÿค– Android unmounting" "$chosen unmounted."
19+ }
20+
21+asktype() { \
22+ choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1
23+ case "$choice" in
24+ USB) unmountusb ;;
25+ Android) unmountandroid ;;
26+ esac
27+ }
28+
29+drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}')
30+
31+if ! grep simple-mtpfs /etc/mtab; then
32+ [ -z "$drives" ] && echo "No drives to unmount." && exit
33+ echo "Unmountable USB drive detected."
34+ unmountusb
35+else
36+ if [ -z "$drives" ]
37+ then
38+ echo "Unmountable Android device detected."
39+ unmountandroid
40+ else
41+ echo "Unmountable USB drive(s) and Android device(s) detected."
42+ asktype
43+ fi
44+fi
A .local/bin/lfub View
@@ -0,0 +1,24 @@
1+#!/bin/sh
2+
3+# This is a wrapper script for lb that allows it to create image previews with
4+# ueberzug. This works in concert with the lf configuration file and the
5+# lf-cleaner script.
6+
7+set -e
8+
9+cleanup() {
10+ exec 3>&-
11+ rm "$FIFO_UEBERZUG"
12+}
13+
14+if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
15+ lf "$@"
16+else
17+ [ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf"
18+ export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$"
19+ mkfifo "$FIFO_UEBERZUG"
20+ ueberzug layer -s <"$FIFO_UEBERZUG" -p json &
21+ exec 3>"$FIFO_UEBERZUG"
22+ trap cleanup HUP INT QUIT TERM PWR EXIT
23+ lf "$@" 3>&-
24+fi
A .local/bin/rotdir View
@@ -0,0 +1,12 @@
1+#!/bin/sh
2+
3+# When I open an image from the file manager in sxiv (the image viewer), I want
4+# to be able to press the next/previous keys to key through the rest of the
5+# images in the same directory. This script "rotates" the content of a
6+# directory based on the first chosen file, so that if I open the 15th image,
7+# if I press next, it will go to the 16th etc. Autistic, I know, but this is
8+# one of the reasons that sxiv is great for being able to read standard input.
9+
10+[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
11+base="$(basename "$1")"
12+ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'
M .local/share/applications/file.desktop View
@@ -1,4 +1,4 @@
11 [Desktop Entry]
22 Type=Application
33 Name=File Manager
4โˆ’Exec=/usr/local/bin/st -e fm %u
4+Exec=/usr/local/bin/st -e lfub %u