Skip to content

Commit

Permalink
added support for alternate
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveEdson committed Feb 18, 2016
1 parent 4bc8e9b commit 41204f7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/SteveEdson/BitBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class BitBarLine {
protected $dropdown;
protected $trim = true;
protected $refresh = false;
protected $alternate = false;

/**
* @param mixed $text
Expand Down Expand Up @@ -120,6 +121,16 @@ public function setRefresh($boolean) {
$this->refresh = (boolean) $boolean;
return $this;
}


/**
* @param $boolean
* @return $this
*/
public function setAlternate($boolean) {
$this->alternate = (boolean) $boolean;
return $this;
}

/**
* @return BitBarLine
Expand Down Expand Up @@ -171,6 +182,15 @@ public function format() {

$string .= ' trim=false';
}

if ($this->alternate === true) {
if (!$this->usedPipe) {
$string .= '|';
$this->usedPipe = true;
}

$string .= ' alternate=true';
}

if ($this->bash) {
if (!$this->usedPipe) {
Expand Down

0 comments on commit 41204f7

Please sign in to comment.