From c909f3c00829545b0bea5418e921ac55cce56c5d Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Mon, 23 May 2022 03:30:26 +0200 Subject: [PATCH] Fix Minecraft servere status --- profiles/xsession/polybar.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/profiles/xsession/polybar.nix b/profiles/xsession/polybar.nix index 17af9c5..489c3d4 100644 --- a/profiles/xsession/polybar.nix +++ b/profiles/xsession/polybar.nix @@ -188,6 +188,10 @@ in try: pvv_status = pvv.status() + except: + pass + + try: dods_status = dods.status() except: pass @@ -196,10 +200,15 @@ in try: if pvv_status.players.online > 0: result += ("P" + str(pvv_status.players.online)) - if dods_status > 0: - result += ("D" + str(pvv_status.players.online)) except: pass + + try: + if dods_status.players.online > 0: + result += ("D" + str(dods_status.players.online)) + except: + pass + print(result) ''; click-left = "" + pkgs.writers.writePython3 "minecraft_status" { libraries = with pkgs.python3.pkgs; [ mcstatus notify2 ]; flakeIgnore = [ "E722" ]; } '' @@ -214,6 +223,10 @@ in try: pvv_status = pvv.status() + except: + pass + + try: dods_status = dods.status() except: pass