-
Notifications
You must be signed in to change notification settings - Fork 0
/
i3_ssh.sh
executable file
·46 lines (38 loc) · 903 Bytes
/
i3_ssh.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
# path: /home/klassiker/.local/share/repos/i3/i3_ssh.sh
# author: klassiker [mrdotx]
# github: https://github.com/mrdotx/i3
# date: 2024-08-22T07:09:38+0200
# i3 helper
. i3_helper.sh
title="ssh"
table_width=26
message="
$(i3_table "$table_width" "header" "server")
$(i3_table "$table_width" "m" "" "m625q")
$(i3_table "$table_width" "header" "client")
$(i3_table "$table_width" "n" "" "mi")
$(i3_table "$table_width" "b" "" "macbook")
[<b>q</b>]uit, [<b>escape</b>], [<b>return</b>]"
connect () {
host="${1##*--}"
i3_net_check "$host" \
&& i3_tmux.sh -o "$2" "$host" "ssh $host"
}
case "$1" in
--m625q)
connect "$1" 23
;;
--mi)
connect "$1" 24
;;
--macbook)
connect "$1" 25
;;
--kill)
i3_notify 1 "$title"
;;
*)
i3_notify 0 "$title" "$message"
;;
esac