From 1cd971f5826db473b5028edbedb92c967078202a Mon Sep 17 00:00:00 2001 From: euri10 Date: Mon, 24 Dec 2018 05:08:04 +0100 Subject: [PATCH] Added unicode icons to moon crescents (#649) --- i3pystatus/moon.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/i3pystatus/moon.py b/i3pystatus/moon.py index 8743aa2..fcdb3a3 100644 --- a/i3pystatus/moon.py +++ b/i3pystatus/moon.py @@ -32,9 +32,10 @@ class MoonPhase(IntervalModule): ("status", "Current moon phase"), ("illum", "Percentage that is illuminated"), ("color", "Set color"), + ("moonicon", 'Set icon') ) - format = "{illum} {status}" + format = "{illum} {status} {moonicon}" interval = 60 * 60 * 2 # every 2 hours @@ -60,6 +61,17 @@ class MoonPhase(IntervalModule): "Waning Crescent": "#FF341F", } + moonicon = { + "New Moon": b'\xf0\x9f\x8c\x91'.decode(), + "Waxing Crescent": b'\xf0\x9f\x8c\x92'.decode(), + "First Quarter": b'\xf0\x9f\x8c\x93'.decode(), + "Waxing Gibbous": b'\xf0\x9f\x8c\x94'.decode(), + "Full Moon": b'\xf0\x9f\x8c\x95'.decode(), + "Waning Gibbous": b'\xf0\x9f\x8c\x96'.decode(), + "Last Quarter": b'\xf0\x9f\x8c\x97'.decode(), + "Waning Crescent": b'\xf0\x9f\x8c\x98'.decode() + } + def pos(now=None): days_in_second = 86400 @@ -104,6 +116,7 @@ class MoonPhase(IntervalModule): fdict = { "status": self.status[self.current_phase()], "illum": self.illum(), + "moonicon": self.moonicon[self.current_phase()] } self.data = fdict self.output = {