power menu
This commit is contained in:
1
echo
Normal file
1
echo
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"text": "\ue312 49\u00b0F", "tooltip": " Overcast 49\u00b0\n<span foreground=\"#585858\" font-weight=\"bold\"> .--. </span>Feels like: 49\u00b0\n<span foreground=\"#585858\" font-weight=\"bold\"> .-( ). </span>Wind: 2mph \u2199\n<span foreground=\"#585858\" font-weight=\"bold\"> (___.__)__) </span>Humidity: 80%\n Moon phase: Waxing Crescent \ud83c\udf12\n\nToday, <b>Mon Nov 24 2025</b>\n\uf2c7 53\u00b0F \uf2ca 38\u00b0F\ue34c 07:23 AM \ue34d 04:36 PM\n03 PM \udb81\udd95 52\u00b0 Partly Cloudy , Overcast 33%, Sunshine 73%\n06 PM \ue313 44\u00b0 Mist, Overcast 83%, Sunshine 8%\n09 PM \ue313 43\u00b0 Fog, Overcast 93%, Sunshine 5%\nTomorrow, <b>Tue Nov 25 2025</b>\n\uf2c7 43\u00b0F \uf2ca 34\u00b0F\ue34c 07:24 AM \ue34d 04:36 PM\n12 AM \ue313 43\u00b0 Fog, Fog 6%, Overcast 81%, Sunshine 19%\n03 AM \ue313 42\u00b0 Fog, Overcast 89%, Sunshine 8%\n06 AM \ue313 41\u00b0 Fog, Fog 6%, Overcast 92%, Sunshine 11%\n09 AM \ue313 40\u00b0 Fog, Fog 6%, Overcast 88%, Sunshine 5%\n12 PM \ue317 39\u00b0 Moderate rain at times, Overcast 90%, Rain 100%\n03 PM \ue308 34\u00b0 Light rain, Overcast 93%, Rain 100%\n06 PM \ue318 31\u00b0 Moderate rain, Overcast 88%, Rain 100%\n09 PM \ue31a 24\u00b0 Moderate snow, Overcast 89%, Rain 100%, Snow 100%\n<b>Wed Nov 26 2025</b>\n\uf2c7 36\u00b0F \uf2ca 25\u00b0F\ue34c 07:26 AM \ue34d 04:35 PM\n12 AM \ue312 21\u00b0 Overcast , Overcast 87%, Sunshine 8%\n03 AM \ue312 14\u00b0 Overcast , Frost 25%, Overcast 94%, Sunshine 13%\n06 AM \ue312 11\u00b0 Overcast , Frost 80%, Overcast 89%, Sunshine 8%\n09 AM \ue312 13\u00b0 Overcast , Frost 79%, Overcast 80%, Sunshine 5%\n12 PM \ue33d 18\u00b0 Cloudy , Frost 77%, Overcast 89%, Sunshine 17%\n03 PM \ue30d 24\u00b0 Sunny, Frost 29%, Sunshine 90%\n06 PM \udb81\udd94 22\u00b0 Clear , Frost 78%, Sunshine 94%\n09 PM \udb83\udf31 15\u00b0 Partly Cloudy , Frost 85%, Overcast 39%, Sunshine 83%\n"}
|
||||||
@@ -122,6 +122,23 @@ let
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-power {
|
||||||
|
color: ${palette.colors.primary};
|
||||||
|
background-color: ${palette.colors.bg};
|
||||||
|
${defaultOpacity}
|
||||||
|
${defaultCenterOptions}
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
menu {
|
||||||
|
border-radius: 15px;
|
||||||
|
background: ${palette.colors.bg};
|
||||||
|
color: ${palette.colors.text};
|
||||||
|
}
|
||||||
|
menuitem {
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
#custom-weather {
|
#custom-weather {
|
||||||
color: ${palette.colors.primary};
|
color: ${palette.colors.primary};
|
||||||
background-color: ${palette.colors.bg};
|
background-color: ${palette.colors.bg};
|
||||||
@@ -130,6 +147,25 @@ let
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-notifications {
|
||||||
|
color: ${palette.colors.primary};
|
||||||
|
background-color: ${palette.colors.bg};
|
||||||
|
${defaultOpacity}
|
||||||
|
${defaultCenterOptions}
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-notifications.notify {
|
||||||
|
color: ${palette.colors.danger};
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-notifications.alert {
|
||||||
|
animation-name: blinker;
|
||||||
|
animation-duration: 3s;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
}
|
||||||
|
|
||||||
#battery {
|
#battery {
|
||||||
color: ${palette.colors.accent};
|
color: ${palette.colors.accent};
|
||||||
background-color: ${palette.colors.bg};
|
background-color: ${palette.colors.bg};
|
||||||
@@ -292,6 +328,7 @@ in
|
|||||||
./options.nix
|
./options.nix
|
||||||
./scripts/audio-control.nix
|
./scripts/audio-control.nix
|
||||||
./scripts/hass.nix
|
./scripts/hass.nix
|
||||||
|
./scripts/notifications.nix
|
||||||
./scripts/weather.nix
|
./scripts/weather.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -299,6 +336,39 @@ in
|
|||||||
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
|
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
|
||||||
# https://www.nerdfonts.com/cheat-sheet
|
# https://www.nerdfonts.com/cheat-sheet
|
||||||
|
|
||||||
|
home.file = {
|
||||||
|
".config/waybar/power_menu.xml".text = ''
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkMenu" id="menu">
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="suspend">
|
||||||
|
<property name="label">Suspend</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="hibernat">
|
||||||
|
<property name="label">Hibernate</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="shutdown">
|
||||||
|
<property name="label">Shutdown</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem" id="delimiter1" />
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="reboot">
|
||||||
|
<property name="label">Reboot</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
@@ -377,15 +447,37 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/notifications" = {
|
||||||
|
interval = 30;
|
||||||
|
format = { };
|
||||||
|
tooltip = true;
|
||||||
|
exec = "waybar-notifications";
|
||||||
|
return-type = "json";
|
||||||
|
on-click-middle = "makoctl restore && makoctl dismiss --all --no-history"; # todo
|
||||||
|
};
|
||||||
|
|
||||||
"custom/left-end" = {
|
"custom/left-end" = {
|
||||||
format = " ";
|
format = "&nbsp";
|
||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
"custom/right-end" = {
|
"custom/right-end" = {
|
||||||
format = " ";
|
format = "&nbsp";
|
||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/power" = {
|
||||||
|
format = "⏻ ";
|
||||||
|
tooltip = false;
|
||||||
|
menu = "on-click";
|
||||||
|
menu-file = "~/.config/waybar/power_menu.xml";
|
||||||
|
menu-actions = {
|
||||||
|
shutdown = "shutdown";
|
||||||
|
reboot = "reboot";
|
||||||
|
suspend = "systemctl suspend";
|
||||||
|
hibernate = "systemctl hibernate";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.features.tray.enable {
|
(mkIf cfg.features.tray.enable {
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ in
|
|||||||
"custom/left-end"
|
"custom/left-end"
|
||||||
"clock"
|
"clock"
|
||||||
"battery"
|
"battery"
|
||||||
|
"custom/notifications"
|
||||||
"custom/weather"
|
"custom/weather"
|
||||||
|
"custom/power"
|
||||||
"custom/right-end"
|
"custom/right-end"
|
||||||
];
|
];
|
||||||
description = "Modules shown on the right.";
|
description = "Modules shown on the right.";
|
||||||
|
|||||||
95
modules/home/programs/waybar/scripts/notifications.nix
Normal file
95
modules/home/programs/waybar/scripts/notifications.nix
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
namespace,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.${namespace}.programs.waybar;
|
||||||
|
|
||||||
|
waybar-notifications = pkgs.writeScriptBin "waybar-notifications" ''
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
import json
|
||||||
|
import codecs
|
||||||
|
import re
|
||||||
|
|
||||||
|
def check_notifications(args = "history"):
|
||||||
|
notifications = []
|
||||||
|
number = None
|
||||||
|
content = None
|
||||||
|
appname = None
|
||||||
|
urgency = None
|
||||||
|
cmd = "makoctl"
|
||||||
|
temp = subprocess.Popen([cmd, args], stdout = subprocess.PIPE)
|
||||||
|
output = str(temp.communicate()).replace("(b\'", "").replace("\', None)", "")
|
||||||
|
lines = output.split("\\n")
|
||||||
|
for line in lines:
|
||||||
|
if "Notification" in line:
|
||||||
|
number = line.split(":")[0].replace("Notification ", "")
|
||||||
|
content = re.sub(r"[\u2066\u2067\u2068\u2069, \u00e2\u0081\u00a8]", "", codecs.decode(line.split(": ")[-1].encode("latin1").decode("utf-8"), "unicode_escape"))
|
||||||
|
content = re.sub(r"[\u00a9]", " ", content)
|
||||||
|
|
||||||
|
if "App name" in line:
|
||||||
|
appname = line.split(": ")[-1]
|
||||||
|
if "Urgency" in line:
|
||||||
|
urgency = line.split(": ")[-1]
|
||||||
|
|
||||||
|
if number is not None and content is not None and appname is not None and urgency is not None:
|
||||||
|
notifications.append((number, content, appname, urgency))
|
||||||
|
number = None
|
||||||
|
content = None
|
||||||
|
appname = None
|
||||||
|
urgency = None
|
||||||
|
|
||||||
|
return notifications
|
||||||
|
|
||||||
|
def get_icon(notifications):
|
||||||
|
status = ""
|
||||||
|
icon = ""
|
||||||
|
|
||||||
|
for number, content, appname, urgency in notifications:
|
||||||
|
status = "notify"
|
||||||
|
if urgency != "normal":
|
||||||
|
status = "alert"
|
||||||
|
break
|
||||||
|
|
||||||
|
if status == "notify":
|
||||||
|
icon = ""
|
||||||
|
if status == "alert":
|
||||||
|
icon = ""
|
||||||
|
|
||||||
|
return icon, status
|
||||||
|
|
||||||
|
def build_tooltip(notifications):
|
||||||
|
tooltip = ""
|
||||||
|
for number, content, appname, urgency in notifications:
|
||||||
|
tooltip += "{0}: {1}\n".format(appname, content)
|
||||||
|
|
||||||
|
return tooltip
|
||||||
|
|
||||||
|
def main():
|
||||||
|
notifications = check_notifications()
|
||||||
|
data = {}
|
||||||
|
|
||||||
|
icon, status = get_icon(notifications)
|
||||||
|
|
||||||
|
data["text"] = icon
|
||||||
|
data["tooltip"] = build_tooltip(notifications)
|
||||||
|
data["class"] = status
|
||||||
|
|
||||||
|
print(json.dumps(data, ensure_ascii=False))
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ../options.nix ];
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [ waybar-notifications ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -189,100 +189,100 @@ let
|
|||||||
' '],
|
' '],
|
||||||
"VeryCloudy": [
|
"VeryCloudy": [
|
||||||
' ',
|
' ',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> .--. </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> .--. </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> .-( ). </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> .-( ). </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> (___.__)__) </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> (___.__)__) </span>',
|
||||||
' '],
|
' '],
|
||||||
"LightShowers": [
|
"LightShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ ‘ ‘ ‘ </span>',
|
'<span foreground=\"#87afff\"> ‘ ‘ ‘ ‘ </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ ‘ ‘ ‘ </span>'],
|
'<span foreground=\"#87afff\"> ‘ ‘ ‘ ‘ </span>'],
|
||||||
"HeavyShowers": [
|
"HeavyShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#585858\"; font-weight: bold;">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#585858\" font-weight="bold">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#585858\"; font-weight: bold;">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#585858\" font-weight="bold">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#585858\"; font-weight: bold;">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#585858\" font-weight="bold">(___(__) </span>',
|
||||||
'<span foreground=\"#0000ff\"; font-weight: bold;"> ‚‘‚‘‚‘‚‘ </span>',
|
'<span foreground=\"#0000ff\" font-weight="bold"> ‚‘‚‘‚‘‚‘ </span>',
|
||||||
'<span foreground=\"#0000ff\"; font-weight: bold;"> ‚’‚’‚’‚’ </span>'],
|
'<span foreground=\"#0000ff\" font-weight="bold"> ‚’‚’‚’‚’ </span>'],
|
||||||
"LightSnowShowers": [
|
"LightSnowShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> * * * </span>',
|
'<span foreground=\"#eeeeee\"> * * * </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> * * * </span>'],
|
'<span foreground=\"#eeeeee\"> * * * </span>'],
|
||||||
"HeavySnowShowers": [
|
"HeavySnowShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#585858\"; font-weight: bold;">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#585858\" font-weight="bold">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#585858\"; font-weight: bold;">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#585858\" font-weight="bold">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#585858\"; font-weight: bold;">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#585858\" font-weight="bold">(___(__) </span>',
|
||||||
'<span foreground=\"#eeeeee\"; font-weight: bold;"> * * * * </span>',
|
'<span foreground=\"#eeeeee\" font-weight="bold"> * * * * </span>',
|
||||||
'<span foreground=\"#eeeeee\"; font-weight: bold;"> * * * * </span>'],
|
'<span foreground=\"#eeeeee\" font-weight="bold"> * * * * </span>'],
|
||||||
"LightSleetShowers": [
|
"LightSleetShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ </span>"<span foreground=\"#eeeeee\";">*</span>"<span foreground=\"#87afff\";"> ‘ </span>"<span foreground=\"#eeeeee\";">* </span>',
|
'<span foreground=\"#87afff\"> ‘ </span>"<span foreground=\"#eeeeee\">*</span>"<span foreground=\"#87afff\"> ‘ </span>"<span foreground=\"#eeeeee\">* </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> *</span>"<span foreground=\"#87afff\";"> ‘ </span>"<span foreground=\"#eeeeee\";">*</span>"<span foreground=\"#87afff\";"> ‘ </span>'],
|
'<span foreground=\"#eeeeee\"> *</span>"<span foreground=\"#87afff\"> ‘ </span>"<span foreground=\"#eeeeee\">*</span>"<span foreground=\"#87afff\"> ‘ </span>'],
|
||||||
"ThunderyShowers": [
|
"ThunderyShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
||||||
'<span foreground=\"#ffff87\";"> ⚡\\</span>"<span foreground=\"#87afff\";">‘ ‘</span>"<span foreground=\"#ffff87\";">⚡\\</span>"<span foreground=\"#87afff\";">‘ ‘ </span>',
|
'<span foreground=\"#ffff87\"> ⚡\\</span>"<span foreground=\"#87afff\">‘ ‘</span>"<span foreground=\"#ffff87\">⚡\\</span>"<span foreground=\"#87afff\">‘ ‘ </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ ‘ ‘ ‘ </span>'],
|
'<span foreground=\"#87afff\"> ‘ ‘ ‘ ‘ </span>'],
|
||||||
"ThunderyHeavyRain": [
|
"ThunderyHeavyRain": [
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> .-. </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> .-. </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> ( ). </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> ( ). </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> (___(__) </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> (___(__) </span>',
|
||||||
'<span foreground=\"#0000ff\"; font-weight: bold;"> ‚‘</span>"<span foreground=\"#ffff87\";">⚡\\</span>"<span foreground=\"#0000ff\";">‘‚</span>"<span foreground=\"#ffff87\";">⚡\\</span>"<span foreground=\"#0000ff\";">‚‘ </span>',
|
'<span foreground=\"#0000ff\" font-weight="bold"> ‚‘</span>"<span foreground=\"#ffff87\">⚡\\</span>"<span foreground=\"#0000ff\">‘‚</span>"<span foreground=\"#ffff87\">⚡\\</span>"<span foreground=\"#0000ff\">‚‘ </span>',
|
||||||
'<span foreground=\"#0000ff\"; font-weight: bold;"> ‚’‚’</span>"<span foreground=\"#ffff87\";">⚡\\</span>"<span foreground=\"#0000ff\";">’‚’ </span>'],
|
'<span foreground=\"#0000ff\" font-weight="bold"> ‚’‚’</span>"<span foreground=\"#ffff87\">⚡\\</span>"<span foreground=\"#0000ff\">’‚’ </span>'],
|
||||||
"ThunderySnowShowers": [
|
"ThunderySnowShowers": [
|
||||||
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
'<span foreground=\"#FFFF00\"> _`/\'\'</span>"<span foreground=\"#BBBBBB\">.-. </span>',
|
||||||
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
'<span foreground=\"#FFFF00\"> ,\\_</span>"<span foreground=\"#BBBBBB\">( ). </span>',
|
||||||
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
'<span foreground=\"#FFFF00\"> /</span>"<span foreground=\"#BBBBBB\">(___(__) </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> *</span>"<span foreground=\"#ffff87\";">⚡\\</span>"<span foreground=\"#eeeeee\";">*</span>"<span foreground=\"#ffff87\";">⚡\\</span>"<span foreground=\"#eeeeee\";">* </span>',
|
'<span foreground=\"#eeeeee\"> *</span>"<span foreground=\"#ffff87\">⚡\\</span>"<span foreground=\"#eeeeee\">*</span>"<span foreground=\"#ffff87\">⚡\\</span>"<span foreground=\"#eeeeee\">* </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> * * * </span>'],
|
'<span foreground=\"#eeeeee\"> * * * </span>'],
|
||||||
"LightRain": [
|
"LightRain": [
|
||||||
'<span foreground=\"#BBBBBB\"> .-. </span>',
|
'<span foreground=\"#BBBBBB\"> .-. </span>',
|
||||||
'<span foreground=\"#BBBBBB\"> ( ). </span>',
|
'<span foreground=\"#BBBBBB\"> ( ). </span>',
|
||||||
'<span foreground=\"#BBBBBB\"> (___(__) </span>',
|
'<span foreground=\"#BBBBBB\"> (___(__) </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ ‘ ‘ ‘ </span>',
|
'<span foreground=\"#87afff\"> ‘ ‘ ‘ ‘ </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ ‘ ‘ ‘ </span>'],
|
'<span foreground=\"#87afff\"> ‘ ‘ ‘ ‘ </span>'],
|
||||||
"HeavyRain": [
|
"HeavyRain": [
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> .-. </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> .-. </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> ( ). </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> ( ). </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> (___(__) </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> (___(__) </span>',
|
||||||
'<span foreground=\"#0000ff\"; font-weight: bold;"> ‚‘‚‘‚‘‚‘ </span>',
|
'<span foreground=\"#0000ff\" font-weight="bold"> ‚‘‚‘‚‘‚‘ </span>',
|
||||||
'<span foreground=\"#0000ff\"; font-weight: bold;"> ‚’‚’‚’‚’ </span>'],
|
'<span foreground=\"#0000ff\" font-weight="bold"> ‚’‚’‚’‚’ </span>'],
|
||||||
"LightSnow": [
|
"LightSnow": [
|
||||||
'<span foreground=\"#BBBBBB\"> .-. </span>',
|
'<span foreground=\"#BBBBBB\"> .-. </span>',
|
||||||
'<span foreground=\"#BBBBBB\"> ( ). </span>',
|
'<span foreground=\"#BBBBBB\"> ( ). </span>',
|
||||||
'<span foreground=\"#BBBBBB\"> (___(__) </span>',
|
'<span foreground=\"#BBBBBB\"> (___(__) </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> * * * </span>',
|
'<span foreground=\"#eeeeee\"> * * * </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> * * * </span>'],
|
'<span foreground=\"#eeeeee\"> * * * </span>'],
|
||||||
"HeavySnow": [
|
"HeavySnow": [
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> .-. </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> .-. </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> ( ). </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> ( ). </span>',
|
||||||
'<span foreground=\"#585858\"; font-weight: bold;"> (___(__) </span>',
|
'<span foreground=\"#585858\" font-weight="bold"> (___(__) </span>',
|
||||||
'<span foreground=\"#eeeeee\"; font-weight: bold;"> * * * * </span>',
|
'<span foreground=\"#eeeeee\" font-weight="bold"> * * * * </span>',
|
||||||
'<span foreground=\"#eeeeee\"; font-weight: bold;"> * * * * </span>'],
|
'<span foreground=\"#eeeeee\" font-weight="bold"> * * * * </span>'],
|
||||||
"LightSleet": [
|
"LightSleet": [
|
||||||
'<span foreground=\"#BBBBBB\"> .-. </span>',
|
'<span foreground=\"#BBBBBB\"> .-. </span>',
|
||||||
'<span foreground=\"#BBBBBB\"> ( ). </span>',
|
'<span foreground=\"#BBBBBB\"> ( ). </span>',
|
||||||
'<span foreground=\"#BBBBBB\"> (___(__) </span>',
|
'<span foreground=\"#BBBBBB\"> (___(__) </span>',
|
||||||
'<span foreground=\"#87afff\";"> ‘ </span>"<span foreground=\"#eeeeee\";">*</span>"<span foreground=\"#87afff\";"> ‘ </span>"<span foreground=\"#eeeeee\";">* </span>',
|
'<span foreground=\"#87afff\"> ‘ </span>"<span foreground=\"#eeeeee\">*</span>"<span foreground=\"#87afff\"> ‘ </span>"<span foreground=\"#eeeeee\">* </span>',
|
||||||
'<span foreground=\"#eeeeee\";"> *</span>"<span foreground=\"#87afff\";"> ‘ </span>"<span foreground=\"#eeeeee\";">*</span>"<span foreground=\"#87afff\";"> ‘ </span>'],
|
'<span foreground=\"#eeeeee\"> *</span>"<span foreground=\"#87afff\"> ‘ </span>"<span foreground=\"#eeeeee\">*</span>"<span foreground=\"#87afff\"> ‘ </span>'],
|
||||||
"Fog": [
|
"Fog": [
|
||||||
' ',
|
' ',
|
||||||
'<span foreground=\"#c0c0c0\";"> _ - _ - _ - </span>',
|
'<span foreground=\"#c0c0c0\"> _ - _ - _ - </span>',
|
||||||
'<span foreground=\"#c0c0c0\";"> _ - _ - _ </span>',
|
'<span foreground=\"#c0c0c0\"> _ - _ - _ </span>',
|
||||||
'<span foreground=\"#c0c0c0\";"> _ - _ - _ - </span>',
|
'<span foreground=\"#c0c0c0\"> _ - _ - _ - </span>',
|
||||||
' '],
|
' '],
|
||||||
}
|
}
|
||||||
|
|
||||||
WEATHER_CODES_WEGO = {key: WEATHER_SYMBOL_WEGO[value] for key, value in WWO_CODE.items()}
|
WEATHER_CODES_WEGO = {key: WEATHER_SYMBOL_WEGO[value] for key, value in WWO_CODE.items()}
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
|
data["text"] = ""
|
||||||
|
|
||||||
def format_time(time):
|
def format_time(time):
|
||||||
"""get the time formatted"""
|
"""get the time formatted"""
|
||||||
|
|||||||
Reference in New Issue
Block a user