summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-05-19 10:40:37 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-05-19 10:40:37 +0900
commitfc4371bbf8cfee1fccba6ef243711d01d861c57f (patch)
tree6b7ae94638442a8114497035acc4c38011abf8f5
parent1f738fe712239a76b4dc6064b4c6f5543ce475e6 (diff)
modified lf/lfrc, created fedora/.inputrc, created bin/lazysql
-rw-r--r--ar/.config/lf/lfrc79
-rw-r--r--fedora/.inputrc31
-rwxr-xr-xfedora/.local/bin/lazysqlbin0 -> 16863416 bytes
3 files changed, 94 insertions, 16 deletions
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc
index 87b1858..a69d578 100644
--- a/ar/.config/lf/lfrc
+++ b/ar/.config/lf/lfrc
@@ -235,23 +235,70 @@ cmd extract ${{
printf "%s\n\t" "$fx"
printf "extract?[y/N]"
read ans
- [ $ans = "y" ] && {
- case $fx in
- *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjf $fx;;
- *.tar.gz|*.tgz) tar xzf $fx ;;
- *.tar.xz|*.txz) tar xf $fx ;;
- *.bz2) bunzip2 $fx ;;
- *.lzma) unlzma $fx ;;
- *.rar) unrar e $fx ;;
- *.gz) gunzip $fx ;;
- *.tar) tar xf $fx ;;
- *.xz) unxz $fx ;;
- *.zip|*.jar|*.war|*.7z) 7z x $fx ;;
- *.Z) uncompress $fx ;;
- *.exe) cabextract $fx ;;
- *.ace) unace x $fx ;;
+ [ "$ans" != "y" ] && exit
+
+ for archive in $fx; do
+ [ -e "$archive" ] || continue
+ case "$archive" in
+ /*) archive_abs="$archive";;
+ *) archive_abs="$PWD/$archive";;
esac
- }
+ base="${archive##*/}"
+ tar_flag=""
+ type=""
+ name=""
+ case "$base" in
+ *.tar.bz2) name="${base%.tar.bz2}"; type=tar; tar_flag=j;;
+ *.tar.bz) name="${base%.tar.bz}"; type=tar; tar_flag=j;;
+ *.tbz2) name="${base%.tbz2}"; type=tar; tar_flag=j;;
+ *.tbz) name="${base%.tbz}"; type=tar; tar_flag=j;;
+ *.tar.gz) name="${base%.tar.gz}"; type=tar; tar_flag=z;;
+ *.tgz) name="${base%.tgz}"; type=tar; tar_flag=z;;
+ *.tar.xz) name="${base%.tar.xz}"; type=tar; tar_flag=J;;
+ *.txz) name="${base%.txz}"; type=tar; tar_flag=J;;
+ *.tar) name="${base%.tar}"; type=tar;;
+ *.zip|*.jar|*.war|*.7z) name="${base%.*}"; type=7z;;
+ *.rar) name="${base%.rar}"; type=rar;;
+ *.exe) name="${base%.exe}"; type=cab;;
+ *.ace) name="${base%.ace}"; type=ace;;
+ *.bz2) bunzip2 "$archive"; continue;;
+ *.gz) gunzip "$archive"; continue;;
+ *.xz) unxz "$archive"; continue;;
+ *.lzma) unlzma "$archive"; continue;;
+ *.Z) uncompress "$archive"; continue;;
+ *) printf "Unknown archive type: %s\n" "$archive"; continue;;
+ esac
+
+ case "$type" in
+ tar) toplevel=$(tar tf "$archive" 2>/dev/null | awk -F/ 'NF{print $1}' | sort -u);;
+ 7z) toplevel=$(7z l -slt -ba "$archive" 2>/dev/null | awk -F'= ' '/^Path = /{print $2}' | awk -F/ 'NF{print $1}' | sort -u);;
+ rar) toplevel=$(unrar lb "$archive" 2>/dev/null | awk -F/ 'NF{print $1}' | sort -u);;
+ *) toplevel="";;
+ esac
+ if [ -z "$toplevel" ]; then
+ count=0
+ else
+ count=$(printf '%s\n' "$toplevel" | wc -l)
+ fi
+
+ target="."
+ if [ "$count" != "1" ]; then
+ printf "\n'%s' has %s top-level entries.\nExtract into folder '%s'? [Y/n] " "$base" "$count" "$name"
+ read folder_ans
+ if [ "$folder_ans" != "n" ] && [ "$folder_ans" != "N" ]; then
+ mkdir -p -- "$name"
+ target="$name"
+ fi
+ fi
+
+ case "$type" in
+ tar) tar x${tar_flag}f "$archive" -C "$target";;
+ 7z) 7z x "$archive" -o"$target";;
+ rar) (cd "$target" && unrar x "$archive_abs");;
+ cab) (cd "$target" && cabextract "$archive_abs");;
+ ace) (cd "$target" && unace x "$archive_abs");;
+ esac
+ done
}}
# Git
diff --git a/fedora/.inputrc b/fedora/.inputrc
new file mode 100644
index 0000000..81cdf85
--- /dev/null
+++ b/fedora/.inputrc
@@ -0,0 +1,31 @@
+$include /etc/inputrc
+
+set completion-display-width 0
+set completion-query-items 1000
+
+# Prettyfi
+set colored-stats on
+set colored-completion-prefix on
+
+# ^C no longer shows on C-c keypress
+set echo-control-characters off
+
+# Map tab to cycle through all the possible completions.
+TAB: menu-complete
+
+# vi mode
+set editing-mode vi
+
+$if mode=vi
+set show-mode-in-prompt on
+set vi-ins-mode-string \1\e[6 q\2
+set vi-cmd-mode-string \1\e[2 q\2
+set keymap vi-command
+
+# these are for vi-command mode
+Control-l: clear-screen
+
+set keymap vi-insert
+# these are for vi-insert mode
+Control-l: clear-screen
+$endif
diff --git a/fedora/.local/bin/lazysql b/fedora/.local/bin/lazysql
new file mode 100755
index 0000000..1fe6af4
--- /dev/null
+++ b/fedora/.local/bin/lazysql
Binary files differ