dot

packages and services management
Log | Files | Refs | README

commit e351c4a2cd7ec61b2d7be3277112908fffdb1bcd
parent 96562131c7a1402f8632723d660a8c2254104b24
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  4 Nov 2018 20:22:25 +0100

make ssh-agent work

Diffstat:
Abin/menu-ssh | 6++++++
Mbin/service-disable | 5++---
Mbin/service-enable | 4++--
Mbin/service-init | 2+-
Mbin/service-load | 2+-
Mbin/service-shutdown | 2+-
Mbin/service-start | 2+-
Mbin/service-stop | 2+-
Mbin/shortcut | 1+
Mbin/window | 8++++++--
Mprofile.d/prompt.sh | 24++++++++++++------------
Mprofile.d/ssh.sh | 2+-
As6/ssh-agent-josuah-unix/env/USER | 1+
Rs6/ssh-agent-unix/producer-for -> s6/ssh-agent-josuah-unix/producer-for | 0
As6/ssh-agent-josuah-unix/run | 9+++++++++
Rs6/ssh-agent-unix/type -> s6/ssh-agent-josuah-unix/type | 0
Ms6/ssh-agent-log/consumer-for | 3++-
As6/ssh-agent-root-unix/env/USER | 1+
Rs6/ssh-agent-unix/producer-for -> s6/ssh-agent-root-unix/producer-for | 0
As6/ssh-agent-root-unix/run | 9+++++++++
Rs6/ssh-agent-unix/type -> s6/ssh-agent-root-unix/type | 0
Ds6/ssh-agent-unix/run | 9---------
22 files changed, 57 insertions(+), 35 deletions(-)

diff --git a/bin/menu-ssh b/bin/menu-ssh @@ -0,0 +1,6 @@ +#!/bin/sh -e + +t=$(sed 's/[, ].*//' "$HOME/.ssh/known_hosts" | menu) +t=${t:-localhost} + +exec ssh "$t" diff --git a/bin/service-disable b/bin/service-disable @@ -2,9 +2,8 @@ importas 1 1 if { mkdir -p /etc/s6rc/ok-all } -if { touch /etc/s6rc/ok-all/content } +if { touch /etc/s6rc/ok-all/contents } if { pipeline { grep -Fv $1 /etc/s6rc/ok } - sort -u -o /etc/s6rc/ok-all/content - + sort -u -o /etc/s6rc/ok-all/contents - } - diff --git a/bin/service-enable b/bin/service-enable @@ -3,6 +3,6 @@ importas 1 1 cd /etc/s6/ if { - pipeline { ls -d $1 } - sort -u -o /etc/s6/ok-all/content /etc/s6/ok-all/content - + pipeline { echo $1 } + sort -u -o /etc/s6/ok-all/contents /etc/s6/ok-all/contents - } diff --git a/bin/service-init b/bin/service-init @@ -16,7 +16,7 @@ background { if { s6-rc-compile /var/s6/compiled${t} /etc/s6 } if { s6-rc-init -c /var/s6/compiled${t} -l /var/s6/live /run/s6 } if { s6-ln -nsf /var/s6/compiled${t} /var/s6/compiled } - if { s6-rc -l /var/s6/live change -u ok-all } + if { s6-rc -l /var/s6/live -u change ok-all } if { echo ok } } diff --git a/bin/service-load b/bin/service-load @@ -4,4 +4,4 @@ backtick t { s6-clock } importas -n 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 change -u ok-all } +if { s6-rc -l /var/s6/live -u change ok-all } diff --git a/bin/service-shutdown b/bin/service-shutdown @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -s6-rc -l /var/s6/live change -d -a +s6-rc -l /var/s6/live -d -a change diff --git a/bin/service-start b/bin/service-start @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb importas 1 1 -s6-rc -l /var/s6/live change -u $1 +s6-rc -l /var/s6/live -u change $1 diff --git a/bin/service-stop b/bin/service-stop @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb importas 1 1 -s6-rc -l /var/s6/live change -d $1 +s6-rc -l /var/s6/live -d change $1 diff --git a/bin/shortcut b/bin/shortcut @@ -5,4 +5,5 @@ case "$1" in (s) exec menu-session ;; (m) exec menu-mblaze ;; (o) exec menu-open ;; +(t) exec menu-ssh ;; esac diff --git a/bin/window b/bin/window @@ -1,3 +1,7 @@ -#!/bin/sh -ex +#!/bin/sh -e -test "$DISPLAY" && exec st -e "$@" || exec "$@" +if [ "$DISPLAY" ]; then + exec st -f terminus:pixelsize=16 -e "$@" +else + exec "$@" +fi diff --git a/profile.d/prompt.sh b/profile.d/prompt.sh @@ -1,21 +1,21 @@ case "$0" in (*zsh) - export vt_red='${red}' - export vt_green='${green}' - export vt_bold='${bold}' - export vt_norm='${norm}' + vt_red='${red}' + vt_green='${green}' + vt_bold='${bold}' + vt_norm='${norm}' ;; (*bash) - export vt_red=$(printf '\\[\033[31m\\]') - export vt_green=$(printf '\\[\033[32m\\]') - export vt_bold=$(printf '\\[\033[1m\\]') - export vt_norm=$(printf '\\[\033[m\\]') + vt_red=$(printf '\\[\033[31m\\]') + vt_green=$(printf '\\[\033[32m\\]') + vt_bold=$(printf '\\[\033[1m\\]') + vt_norm=$(printf '\\[\033[m\\]') ;; (*) - export vt_red=$(printf '\033[31m') - export vt_green=$(printf '\033[32m') - export vt_bold=$(printf '\033[1m') - export vt_norm=$(printf '\033[m') + vt_red=$(printf '\033[31m') + vt_green=$(printf '\033[32m') + vt_bold=$(printf '\033[1m') + vt_norm=$(printf '\033[m') ;; esac diff --git a/profile.d/ssh.sh b/profile.d/ssh.sh @@ -1 +1 @@ -export SSH_AUTH_SOCK=$HOME/.ssh/agent +export SSH_AUTH_SOCK=$HOME/.ssh/sock diff --git a/s6/ssh-agent-josuah-unix/env/USER b/s6/ssh-agent-josuah-unix/env/USER @@ -0,0 +1 @@ +josuah diff --git a/s6/ssh-agent-unix/producer-for b/s6/ssh-agent-josuah-unix/producer-for diff --git a/s6/ssh-agent-josuah-unix/run b/s6/ssh-agent-josuah-unix/run @@ -0,0 +1,9 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 +s6-envdir env multisubstitute { + importas USER USER +} + +backtick -n home { homeof $USER } importas home home + +ssh-agent -d -a ${home}/.ssh/sock diff --git a/s6/ssh-agent-unix/type b/s6/ssh-agent-josuah-unix/type diff --git a/s6/ssh-agent-log/consumer-for b/s6/ssh-agent-log/consumer-for @@ -1 +1,2 @@ -ssh-agent-unix +ssh-agent-root-unix +ssh-agent-josuah-unix diff --git a/s6/ssh-agent-root-unix/env/USER b/s6/ssh-agent-root-unix/env/USER @@ -0,0 +1 @@ +root diff --git a/s6/ssh-agent-unix/producer-for b/s6/ssh-agent-root-unix/producer-for diff --git a/s6/ssh-agent-root-unix/run b/s6/ssh-agent-root-unix/run @@ -0,0 +1,9 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 +s6-envdir env multisubstitute { + importas USER USER +} + +backtick -n home { homeof $USER } importas home home + +ssh-agent -d -a ${home}/.ssh/sock diff --git a/s6/ssh-agent-unix/type b/s6/ssh-agent-root-unix/type diff --git a/s6/ssh-agent-unix/run b/s6/ssh-agent-unix/run @@ -1,9 +0,0 @@ -#!/usr/bin/env execlineb -fdmove -c 2 1 -s6-envdir env multisubstitute { - importas USER USER -} - -backtick home { homeof $USER - -ssh-agent -d -a $home/.ssh/sock