-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4972ed
commit 8eef336
Showing
5 changed files
with
183 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from ..utils import BasicSegment | ||
from datetime import date, datetime | ||
|
||
bashmoji_list =['🐔', '🦴', '💫', '👽', '⭐', '🌮', '🤡', '🦊', '🐧', '🤖', | ||
'👺', '😽', '🐐', '👾', '🍣', '🦙', '🐦', '🦧', '🐫', '☕', '🌞', '⚡', '🐢', '😁', '🦏', '🦆', | ||
'🦄', '🧃', '🌈', '👹', '🦍', '👻', '🦋', '🌟', '🐌', '🌛', '🐗', '🐥', '🌯', '🦌', | ||
'🌜', '🤔', '🐑', '🍕', '💥', '🐴','🐼', '🔥', '🐣', | ||
'🐰', '🐶', '✨', '🥪', '🦅', '🤠', '🐱', '🎃', '🌝', '😺', '💩', '🦇', '🐘', '🦜', '🐞', '🦉', '🍟', '🤑', '🤪', '😄', '🥤', | ||
'🐝', '🐸', '🚀'] | ||
|
||
baremoji_list =['🐟', '💧', '🦈', '🐋', '🐠', '🧊', '🐚', '🦑', '🐡', '🐙', '🌊', '🐳', '💦', '🐬'] | ||
|
||
|
||
|
||
|
||
|
||
def emoji(emoji_list): | ||
now = datetime.now() | ||
start_date = date(now.year, 1, 1) | ||
today = date(now.year, now.month, now.day) | ||
delta = int((today - start_date).days) | ||
while delta > len(emoji_list): | ||
delta -= len(emoji_list) | ||
return emoji_list[delta-1] | ||
|
||
class Segment(BasicSegment): | ||
|
||
def add_to_powerline(self): | ||
|
||
powerline = self.powerline | ||
root_indicators = { | ||
"bash": " " + emoji(bashmoji_list) + " \\$ ", | ||
"tcsh": " %# ", | ||
"zsh": " %# ", | ||
"bare": emoji(baremoji_list) + " $ ", | ||
} | ||
bg = powerline.theme.CMD_PASSED_BG | ||
fg = powerline.theme.CMD_PASSED_FG | ||
if powerline.args.prev_error != 0: | ||
fg = powerline.theme.CMD_FAILED_FG | ||
bg = powerline.theme.CMD_FAILED_BG | ||
powerline.append(root_indicators[powerline.args.shell], fg, bg, sanitize=False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters