From 2493206ff97ea3d6477fcbc7f38c32bd6e6cc56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 21 Aug 2022 01:01:08 +0200 Subject: [PATCH] feat(i3status-rust): use fontawesome --- configs/fonts.nix | 1 + configs/i3.nix | 2 +- lib/i3status-rust.nix | 59 ++----------------------------------------- 3 files changed, 4 insertions(+), 58 deletions(-) diff --git a/configs/fonts.nix b/configs/fonts.nix index 2711915..7f2f66e 100644 --- a/configs/fonts.nix +++ b/configs/fonts.nix @@ -12,6 +12,7 @@ corefonts crimson eb-garamond + font-awesome_6 etBook ezra-sil fira diff --git a/configs/i3.nix b/configs/i3.nix index c78284a..d323414 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -152,7 +152,7 @@ in { { workspaceButtons = false; fonts = { - names = ["Monospace"]; + names = ["Monospace" "Font Awesome 6 Free"]; size = 8.0; }; mode = "hide"; # "dock" diff --git a/lib/i3status-rust.nix b/lib/i3status-rust.nix index 1891a8b..6357bfc 100644 --- a/lib/i3status-rust.nix +++ b/lib/i3status-rust.nix @@ -42,50 +42,7 @@ in { separator_fg = colours.black.bright; }; }; - icons = { - name = "none"; - overrides = { - bat = "🔋"; - bat_charging = "🔌"; - bat_discharging = "🔋"; - bat_empty = " "; - bat_full = " "; - bat_half = " "; - bat_quarter = " "; - bat_three_quarters = " "; - cogs = "🚦 "; - cpu = "🖥 "; - disk_drive = "💽"; - mail = "📧 "; - memory_mem = "🧠 "; - music = "🎵"; - music_next = "⏭"; - music_pause = ""; - music_play = "▶"; - music_prev = "⏮"; - net_down = "❎"; - net_up = "🌐"; - net_vpn = "🛡 "; - net_wired = "🌐"; - net_wireless = "📶"; - pomodoro = "🍅 "; - tasks = "✅"; - time = "📅 "; - toggle_off = "👎"; - toggle_on = "👍"; - update = "🆕"; - volume_empty = "🔈 "; - volume_full = "🔊 "; - volume_half = "🔉 "; - volume_muted = "🔇"; - weather_clouds = "🌥"; - weather_default = "🌡"; - weather_rain = "🌧"; - weather_snow = "🌨"; - weather_sun = "🌣"; - weather_thunder = "🌩"; - }; - }; + icons.name = "awesome6"; block = [ { block = "weather"; @@ -113,24 +70,12 @@ in { import astral.moon import astral.sun - moon_phases = { - 0: "🌑", - 3.5: "🌒", - 7: "🌓", - 10.5: "🌔", - 14: "🌕", - 17.5: "🌖", - 21: "🌗", - 24.5: "🌘", - 28: "🌑", - } current_phase = astral.moon.phase() - closest_phase = min(moon_phases.keys(), key=lambda x: abs(current_phase - x)) city = astral.LocationInfo("Berlin", "Germany", "${spacetime.time.timeZone}", ${toString spacetime.location.latitude}, ${toString spacetime.location.longitude}) sun = astral.sun.sun(city.observer, date=astral.today(), tzinfo=city.timezone) - print("🌅 {} 🌇 {} {} {}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), moon_phases[closest_phase], round(current_phase, 1))) + print("↑{} ↓{} {}{}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), "☽" if current_phase < 14 else "☾", round(current_phase, 1))) ''; } {