Tweaks and tweaks

This commit is contained in:
Geoffrey Frogeye 2016-12-11 08:12:15 +01:00
parent 9a9ee8858d
commit 150301d166
3 changed files with 14 additions and 2 deletions

View file

@ -39,6 +39,7 @@ bindsym Mod1+F2 exec --no-startup-id ~/.config/i3/dmenu_run
bindsym $mod+c exec --no-startup-id ~/.config/i3/passmenu
bindsym $mod+asterisk exec --no-startup-id ~/.config/i3/sshmenu
bindsym $mod+dollar exec --no-startup-id ~/.config/i3/sshmenu root
# start program launcher
bindsym $mod+d exec --no-startup-id ~/.config/i3/dmenu_run

View file

@ -1,2 +1,6 @@
#!/bin/sh
xterm -e "ssh $(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p 'SSH to ')"
if [ "$1" == 'root' ]; then
a=" (root)"
b="sudo "
fi
xterm -e "ssh $(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p "SSH$a to ") -t '${b}bash --login'"

View file

@ -130,7 +130,7 @@ function _machines-getAkey { # network
}
function _machines-updateAkey {
KEY_FILE=$(mktemp machines.XXXXXXXXXX.authorized_keys)
KEY_FILE=$(mktemp)
network=$(cat $MACHINES_CONFIG/this | grep '^network=' | cut -d '=' -f 2)
_machines-getAkey $network > $KEY_FILE
if [ $? == 0 ]; then
@ -254,6 +254,13 @@ function machines-deleteNetwork { # network
_machines-deleteElement $1 network
}
function machines-updateAll {
machines-list | while read machine; do
echo "Updating $machine..."
ssh $machine 'machines-update' &
done
}
# USER FUNCTIONS
function machines-update {