File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 3
3
### master
4
4
- README updates
5
5
- update readme to reflect github organization changes
6
+ - linux can't display default offline icon - update it
6
7
7
8
### v0.0.2, 2014-06-02
8
9
- bugfix: offline status icon wasn't displaying properly
Original file line number Diff line number Diff line change @@ -5,11 +5,33 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5
5
online_option_string=" @online_icon"
6
6
offline_option_string=" @offline_icon"
7
7
8
- online_icon_default=" ✔ "
9
- offline_icon_default=" ❌ "
8
+ online_icon_osx=" ✅ "
9
+ online_icon=" ✔ "
10
+ offline_icon_osx=" ⛔️ "
11
+ offline_icon=" ❌ "
10
12
11
13
source $CURRENT_DIR /shared.sh
12
14
15
+ is_osx () {
16
+ [ $( uname) == " Darwin" ]
17
+ }
18
+
19
+ online_icon_default () {
20
+ if is_osx; then
21
+ echo " $online_icon_osx "
22
+ else
23
+ echo " $online_icon "
24
+ fi
25
+ }
26
+
27
+ offline_icon_default () {
28
+ if is_osx; then
29
+ echo " $offline_icon_osx "
30
+ else
31
+ echo " $offline_icon "
32
+ fi
33
+ }
34
+
13
35
online_status () {
14
36
ping -c 3 www.google.com > /dev/null 2>&1
15
37
}
@@ -18,9 +40,9 @@ print_icon() {
18
40
# spacer fixes weird emoji spacing
19
41
local spacer=" "
20
42
if $( online_status) ; then
21
- printf " $( get_tmux_option " $online_option_string " " $online_icon_default " ) $spacer "
43
+ printf " $( get_tmux_option " $online_option_string " " $( online_icon_default) " ) $spacer "
22
44
else
23
- printf " $( get_tmux_option " $offline_option_string " " $offline_icon_default " ) $spacer "
45
+ printf " $( get_tmux_option " $offline_option_string " " $( offline_icon_default) " ) $spacer "
24
46
fi
25
47
}
26
48
You can’t perform that action at this time.
0 commit comments