summaryrefslogtreecommitdiff
path: root/dbdb
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2025-10-14 21:57:25 +0200
committerfilip <“filip.rabiega@gmail.com”>2025-10-14 21:57:25 +0200
commit91a4eacb0419bd0f67774f6124b6f0b1525eb988 (patch)
treede8189790a11437e540f7792fd7559f88212bae7 /dbdb
parent7f6189dcbed755af34e222237b8cfa8b1f903696 (diff)
downloadchadscripts-91a4eacb0419bd0f67774f6124b6f0b1525eb988.tar.gz
chadscripts-91a4eacb0419bd0f67774f6124b6f0b1525eb988.tar.bz2
chadscripts-91a4eacb0419bd0f67774f6124b6f0b1525eb988.zip
new stuff
Diffstat (limited to 'dbdb')
-rwxr-xr-xdbdb18
1 files changed, 18 insertions, 0 deletions
diff --git a/dbdb b/dbdb
new file mode 100755
index 0000000..238c057
--- /dev/null
+++ b/dbdb
@@ -0,0 +1,18 @@
+#!/bin/sh
+# dmenu-based directory browser
+# to run from terminal:
+# source /path/to/dbdb.sh
+# or bind it to shortcut:
+# echo bind \'\"\\C-o\":\"source /path/to/dbdb.sh\\n\"\' >> ~/.bashrc
+
+chosen="placeholder"
+
+while [ ! -z "$chosen" ]; do
+ DIRs=$( ls -a1p | grep -P '^\w[^\$/]+/$' | awk -vRS="\n" -vORS="\t" '1')
+ DOTDs=$( ls -a1p | grep -P '^\.[^\$/]+/$' | awk -vRS="\n" -vORS="\t" '1')
+ FILEs=$( ls -a1p | grep -P '^\w[^\$/]+$' | awk -vRS="\n" -vORS=" \t" '1')
+ DOTFs=$( ls -a1p | grep -P '^\.[^\$/]+$' | awk -vRS="\n" -vORS=" \t" '1')
+ clear && printf "\e[1;7;33m $(pwd) \e[0m\n$FILEs\n\e[0;38;5;238m$DOTFs\e[0m\n"
+ chosen=`( ( echo -e "$DIRs$DOTDs" | awk -vRS="\t" -vORS="\n" '1' ) | dmenu -i )`
+ cd "$chosen"
+done