Skip to content

Commit 41204f7

Browse files
committed
added support for alternate
1 parent 4bc8e9b commit 41204f7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/SteveEdson/BitBar.php

+20
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class BitBarLine {
2222
protected $dropdown;
2323
protected $trim = true;
2424
protected $refresh = false;
25+
protected $alternate = false;
2526

2627
/**
2728
* @param mixed $text
@@ -120,6 +121,16 @@ public function setRefresh($boolean) {
120121
$this->refresh = (boolean) $boolean;
121122
return $this;
122123
}
124+
125+
126+
/**
127+
* @param $boolean
128+
* @return $this
129+
*/
130+
public function setAlternate($boolean) {
131+
$this->alternate = (boolean) $boolean;
132+
return $this;
133+
}
123134

124135
/**
125136
* @return BitBarLine
@@ -171,6 +182,15 @@ public function format() {
171182

172183
$string .= ' trim=false';
173184
}
185+
186+
if ($this->alternate === true) {
187+
if (!$this->usedPipe) {
188+
$string .= '|';
189+
$this->usedPipe = true;
190+
}
191+
192+
$string .= ' alternate=true';
193+
}
174194

175195
if ($this->bash) {
176196
if (!$this->usedPipe) {

0 commit comments

Comments
 (0)