dot

packages and services management
Log | Files | Refs | README

commit 54b42395055aaec9518d8744f862853190079699
parent 51f277f26f5a2b410b011213f36322122f590c2f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat,  8 Sep 2018 20:31:21 +0200

Merge branch 'master' of git.josuah.net:dotfiles

Diffstat:
Mbin/light | 3++-
Abin/put | 26++++++++++++++++++++++++++
Adot/mkshrc | 8++++++++
Mdot/profile | 15++++++++-------
4 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/bin/light b/bin/light @@ -6,6 +6,7 @@ case $(uname) in wsconsctl display.brightness="${1:-100}" ;; (Linux) - su -c "printf '%d' '${1:-2000}' >/sys/class/backlight/*/brightness" + cd /sys/class/backlight/* + printf %d "${1:-2000}" >brightness ;; esac diff --git a/bin/put b/bin/put @@ -0,0 +1,26 @@ +#!/bin/sh + +awk ' +BEGIN { + if (ARGC == 1) ARGV[++ARGC] = "/dev/stdin" + printf("\033[30;1m────────────────────────────────────────────────────────────────────────────────\033[m\n"); +} + +FNR == 1 && notfirst { + printf("\033[30;1m───────┴────────────────────────────────────────────────────────────────────────\033[m\n"); +} + +FNR == 1 { + printf(" \033[1m%s\033[m\n", FILENAME); + printf("\033[30;1m───────┬────────────────────────────────────────────────────────────────────────\033[m\n"); + notfirst = 1; +} + +{ + printf("\033[30;1m%6d │\033[m %s\n", FNR, $0); +} + +END { + printf("\033[30;1m───────┴────────────────────────────────────────────────────────────────────────\033[m\n"); +} +' "$@" | less -RSX diff --git a/dot/mkshrc b/dot/mkshrc @@ -0,0 +1,8 @@ +. "$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 '$')" +) diff --git a/dot/profile b/dot/profile @@ -1,4 +1,5 @@ -# basic +## basic ## + export TZ=Europe/Paris export EMAIL=mail@josuah.net export EDITOR=ex @@ -6,7 +7,8 @@ export VISUAL=ex export PAGER=less export ENV=$HOME/.profile -# locales +## locales ## + export LANG=en_US.UTF-8 export LC_COLLATE=C export LC_CTYPE=en_US.UTF-8 @@ -15,15 +17,14 @@ export LC_MESSAGES=en_US.UTF-8 export LC_NUMERIC=en_US.UTF-8 export LC_TIME=en_US.UTF-8 -# paths +## paths ## + export PATH=$HOME/dotfiles/bin:/local/bin:$PATH export MANPATH=/usr/man:/usr/share/man:/usr/local/man:/usr/local/share/man export MANPATH=/local/share/man:$MANPATH export DOCPATH=/local/share/doc -# programs +## programs ## + export CVSROOT=anoncvs@anoncvs.fr.openbsd.org:/cvs export SSH_AUTH_SOCK=$HOME/.ssh/agent - -# prompt -export PS1=$(uname -n)$(test "$(whoami)" = root && echo '#' || echo '$')' '