From 91a4eacb0419bd0f67774f6124b6f0b1525eb988 Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Tue, 14 Oct 2025 21:57:25 +0200 Subject: new stuff --- dbdb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 dbdb (limited to 'dbdb') 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 -- cgit v1.2.3