From 76684c322a609f7ca31d86c9ffd0f318ef45e3c7 Mon Sep 17 00:00:00 2001 From: Thomas Ulmer Date: Thu, 1 Jan 2026 13:07:53 -0800 Subject: misc: new subdir + move lk --- lk.sh | 28 ---------------------------- misc/lk.sh | 28 ++++++++++++++++++++++++++++ symlinks.csv | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) delete mode 100755 lk.sh create mode 100755 misc/lk.sh diff --git a/lk.sh b/lk.sh deleted file mode 100755 index 967332a..0000000 --- a/lk.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# This is helper that should replace a number of common commands -# -# It is intended to be named `lk`, short for "look" - -longView=${PAGER:-$(which less || which more || echo "cat")} -dirView="ls --color=auto -Alh" - -if [ $# -lt 1 ]; then - # take stdin instead - $dirView $(pwd) -fi - -for a in $@; do - if [ $a == "" ]; then - echo "Empty argument skipped" - elif [ ! -e $a ]; then - echo "$a does not exist" 1>&2 - exit -1 - elif [ -d $a ]; then - $dirView $a - elif [ $(tput lines) -ge $(($(wc -l < $a) - 2)) ]; then - cat $a - else - ${longView} $a - fi -done diff --git a/misc/lk.sh b/misc/lk.sh new file mode 100755 index 0000000..5f760c6 --- /dev/null +++ b/misc/lk.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# This is helper that should replace a number of common commands +# +# It is intended to be named `lk`, short for "look" + +longView=${PAGER:-$(which less || which more || echo "cat")} +dirView="ls --color=always -Alh" + +if [ $# -lt 1 ]; then + # take stdin instead + $dirView $(pwd) | ${longView} +fi + +for a in $@; do + if [ $a == "" ]; then + echo "Empty argument skipped" + elif [ ! -e $a ]; then + echo "$a does not exist" 1>&2 + exit -1 + elif [ -d $a ]; then + $dirView $a + elif [ $(tput lines) -ge $(($(wc -l < $a) - 2)) ]; then + cat $a + else + ${longView} $a + fi +done diff --git a/symlinks.csv b/symlinks.csv index 241c411..84ad337 100644 --- a/symlinks.csv +++ b/symlinks.csv @@ -14,4 +14,4 @@ brightness/brightnessmax,.local/bin/brightnessmax volume/volumeup,.local/bin/volumeup volume/volumedown,.local/bin/volumedown volume/volumemute,.local/bin/volumemute -lk.sh,.local/bin/lk +misc/lk.sh,.local/bin/lk -- cgit v1.2.3