-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathirc
More file actions
executable file
·51 lines (42 loc) · 737 Bytes
/
irc
File metadata and controls
executable file
·51 lines (42 loc) · 737 Bytes
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
47
48
49
50
51
#!/bin/bash
# marbu's irc wrapper
TUI_CLIENT="irssi"
GUI_CLIENT="xchat"
show_help() {
echo "Usage: irc <command>"
echo """Commands:
shell run $TUI_CLIENT
screen run $TUI_CLIENT inside screen
x run $GUI_CLIENT
help this message"""
}
run_tui() {
exec $TUI_CLIENT
}
run_screen() {
screen -S irc_wrapper -x || \
screen -S irc_wrapper -c ~/.screen/$TUI_CLIENT
}
run_gui() {
nohup $GUI_CLIENT 2>&1 >/dev/null &
exit
}
make_guess() {
if [[ $DISPLAY ]]; then
run_gui
else
run_tui
fi
}
# main
export LANG=C
if [[ $# = 0 ]]; then
make_guess
fi
case $1 in
s|shell|tui) run_tui;;
x|X|gui) run_gui;;
sc|screen) run_screen;;
help) show_help;;
*) show_help;;
esac