dot

packages and services management
Log | Files | Refs | README

commit c47d85ea68b35d1e55d63520c3c3c2702a74bcca
parent 19c39dd9844f0eb2abfa7d2b1e99dc2249d71d81
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 21 Mar 2018 19:56:03 +0100

very few code, a lot of features

Diffstat:
Mbin/proto | 16++++++++++++----
Mbin/wifi | 5+----
Mbin/xdg-abduco | 2+-
Mbin/xdg-open | 2+-
4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/bin/proto b/bin/proto @@ -8,6 +8,11 @@ function print_tabs(len) printf("\t"); } +ARGC > 1 && FNR == 1 { + sub(".*/", "", FILENAME); + printf("\n/* %s */\n", FILENAME); +} + /^[a-z0-9_]*\(/ { if (match(type, "static") || match($0, ";$")) next; @@ -18,14 +23,17 @@ function print_tabs(len) else ptr = " "; - printf("%s", type); - print_tabs(length(type)); - printf("%s", ptr); - symbol = $0; sub("\\(.*", "", symbol); sub("[a-z0-9_]*\\(", "("); + if (symbol == "main") + next; + + printf("%s", type); + print_tabs(length(type)); + printf("%s", ptr); + printf("%s", symbol); print_tabs((length(symbol) + length(ptr))); diff --git a/bin/wifi b/bin/wifi @@ -4,10 +4,7 @@ case "$(uname)" in (*BSD) - doas ifconfig iwm0 nwid "$1" wpa wpakey "0x$2" - ;; -(Linux) - echo 'unsupported system' + doas ifconfig iwm0 nwid "$1" wpa wpakey "$2" ;; (*) echo 'unsupported system' diff --git a/bin/xdg-abduco b/bin/xdg-abduco @@ -11,7 +11,7 @@ touch "$dir/names" # only keep existing session names grep -e "^$(abduco | sed -rn 's/.* ([0-9]+)$/\1/p') " "$dir/names" | - sort -uo "$dir/names" + sort -k2 -uo "$dir/names" # get the reas path name ! [ -h "$1" ] || set -- "$(readlink -f "$1")" diff --git a/bin/xdg-open b/bin/xdg-open @@ -272,7 +272,7 @@ case "$1" in ;; (*) [ -f "$1" ] && exec $EDITOR "$1" - [ -d "$1" ] && exec xdg-open "$(io-find "$1")" + [ -d "$1" ] && cd "$1" && exec "$SHELL" ;; esac