summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD47
-rw-r--r--sl9
3 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f11aa0229dba
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,12 @@
+pkgbase = sl-alt
+ pkgdesc = Mirror the output of ls
+ pkgver = 0.1
+ pkgrel = 1
+ url = https://gir.st/blog/sl-alt.htm
+ arch = any
+ license = GPL3
+ depends = bash
+ conflicts = sl
+
+pkgname = sl-alt
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..22afd3d05e85
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: bobpaul <aurpackage [at] bobpaul 'period' org>
+pkgname=sl-alt
+pkgver=0.1
+pkgrel=1
+epoch=
+pkgdesc="Mirror the output of ls"
+arch=('any')
+url="https://gir.st/blog/sl-alt.htm"
+license=('GPL3')
+groups=()
+depends=('bash')
+makedepends=()
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=('sl')
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+source=()
+noextract=()
+sha512sums=()
+validpgpkeys=()
+
+#prepare() {
+# cd "$pkgname-$pkgver"
+# patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
+#}
+
+#build() {
+# cd "$pkgname-$pkgver"
+# ./configure --prefix=/usr
+# make
+#}
+
+#check() {
+# cd "$pkgname-$pkgver"
+# make -k check
+#}
+
+package() {
+# cd "$pkgname-$pkgver"
+ install -dm755 "$pkgdir"/usr/bin/
+ install -m755 "$startdir"/sl "$pkgdir"/usr/bin
+}
diff --git a/sl b/sl
new file mode 100644
index 000000000000..31bd530d7979
--- /dev/null
+++ b/sl
@@ -0,0 +1,9 @@
+#!/bin/bash
+# sl - prints a mirror image of ls. (C) 2017 Tobias Girstmair, https://gir.st/, GPLv3
+
+LEN=$(ls "$@" |wc -L) # get the length of the longest line
+
+ls "$@" | rev | while read -r line
+do
+ printf "%${LEN}.${LEN}s\\n" "$line" | sed 's/^\(\s\+\)\(\S\+\)/\2\1/'
+done