diff options
author | filip <“filip.rabiega@gmail.com”> | 2025-10-14 21:57:25 +0200 |
---|---|---|
committer | filip <“filip.rabiega@gmail.com”> | 2025-10-14 21:57:25 +0200 |
commit | 91a4eacb0419bd0f67774f6124b6f0b1525eb988 (patch) | |
tree | de8189790a11437e540f7792fd7559f88212bae7 /dbdb | |
parent | 7f6189dcbed755af34e222237b8cfa8b1f903696 (diff) | |
download | chadscripts-91a4eacb0419bd0f67774f6124b6f0b1525eb988.tar.gz chadscripts-91a4eacb0419bd0f67774f6124b6f0b1525eb988.tar.bz2 chadscripts-91a4eacb0419bd0f67774f6124b6f0b1525eb988.zip |
new stuff
Diffstat (limited to 'dbdb')
-rwxr-xr-x | dbdb | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 |