dbdb.sh - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
dbdb.sh (743B) | |
--- | |
1 #!/bin/sh | |
2 # dmenu-based directory browser | |
3 # to run from terminal: | |
4 # source /path/to/dbdb.sh | |
5 # or bind it to shortcut: | |
6 # echo bind \'\"\\C-o\":\"source /path/to/dbdb.sh\\n\"\' >> ~/.bashrc | |
7 | |
8 chosen="placeholder" | |
9 | |
10 while [ ! -z "$chosen" ]; do | |
11 DIRs=$( ls -a1p | grep -P '^\w[^\$/]+/$' | awk -vRS="\n" -vORS="\t" … | |
12 DOTDs=$( ls -a1p | grep -P '^\.[^\$/]+/$' | awk -vRS="\n" -vORS="\t"… | |
13 FILEs=$( ls -a1p | grep -P '^\w[^\$/]+$' | awk -vRS="\n" -vORS=" \t"… | |
14 DOTFs=$( ls -a1p | grep -P '^\.[^\$/]+$' | awk -vRS="\n" -vORS=" \t"… | |
15 clear && printf "\e[1;7;33m $(pwd) \e[0m\n$FILEs\n\e[0;38;5;238m$DOT… | |
16 chosen=`( ( echo -e "$DIRs$DOTDs" | awk -vRS="\t" -vORS="\n" '1' ) |… | |
17 cd "$chosen" | |
18 done |