dot

packages and services management
Log | Files | Refs | README

commit 307cd06b45a2f7a79e65b55f1b446be71bc12fda
parent dfc86eb5c2bbb45e73ba09ca56dc7cafe4746e6a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 15 Sep 2018 16:43:07 +0200

shorter prompt

Diffstat:
Mbin/put | 4+++-
Mbin/s6-rc-load | 10+++++-----
Mbin/xdg-open | 9++++++---
Mdot/bashrc | 2+-
Mdot/mkshrc | 14++++++++------
5 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/bin/put b/bin/put @@ -1,5 +1,6 @@ -#!/usr/bin/awk -f +#!/bin/sh +awk ' BEGIN { if (ARGC == 1) ARGV[++ARGC] = "/dev/stdin" printf("\033[30;1m────────────────────────────────────────────────────────────────────────────────\033[m\n"); @@ -22,3 +23,4 @@ FNR == 1 { END { printf("\033[30;1m───────┴────────────────────────────────────────────────────────────────────────\033[m\n"); } +' "$@" | less -RS diff --git a/bin/s6-rc-load b/bin/s6-rc-load @@ -1,7 +1,7 @@ #!/usr/bin/env execlineb -backtick -n t { s6-clock } -importas t t -if { s6-rc-compile /var/s6/compiled${t} /var/s6/source } -if { s6-rc-update -l /var/s6/live /var/s6/compiled${t} } -if { s6-ln -nsf /var/s6/compiled${t} /var/s6/compiled } +backtick t { s6-clock } importas t t +if { s6-rc-compile "/var/s6/compiled$t" /etc/s6 } +if { s6-rc-update -l /var/s6/live "/var/s6/compiled$t" } +if { s6-ln -nsf "/var/s6/compiled$t" /var/s6/compiled } +if { s6-rc -l /var/s6/live -u change ok-all } diff --git a/bin/xdg-open b/bin/xdg-open @@ -93,11 +93,14 @@ case $1 in (*.[0-9]|*.[0-9]p|*.[0-9].gz) exec mandoc -a -T utf8 "$1" ;; -(*.o|*.a) - exec sh -c "objdump -D '$1' | less" "$1" +(*.o) + exec sh -c "objdump -D '$1' | exec less" "$1" + ;; +(*.a) + exec nm "$1" | exec less "$1" ;; (*.ics) - exec sh -c "ics2txt txt '$1' | less" "$1" + exec sh -c "ics2txt txt '$1' | exec less" "$1" ;; (*.html) exec links "$1" diff --git a/dot/bashrc b/dot/bashrc @@ -1,3 +1,3 @@ . "$HOME/.profile" -PS1='\[\033[1;$(test $? = 0 && echo 32 || echo 31)m\]"\[\033[0;1m\] \t \h\[\033[34m\]\$\[\033[m\] ' +PS1='\[\033[1m\]\h\[\033[$(test $? = 0 && echo 32 || echo 31)m\]\$\[\033[m\] ' diff --git a/dot/mkshrc b/dot/mkshrc @@ -1,8 +1,10 @@ . "$HOME/.profile" -PS1=$(printf '\033[1;%sm%s \033[37m%s\033[34m%s \033[m' \ - '$(test $? = 0 && echo 32 || echo 31)' \ - '$(date +%T)' \ - '$(uname -n)' \ - "$(test $(whoami) = root && echo '#' || echo '$')" -) +PS1='$( + test $? = 0 && color=32 || color=31 + test "$(whoami)" = root && user=# || user="$" + printf "\\033[1m%s\\033[%sm%s\\033[m " \ + "$(uname -n)" \ + "$color" \ + "$user" +)'