From 524c3394c9b965ebb49654f6774a198ff6128ab6 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Mon, 21 Feb 2022 01:26:28 +0100 Subject: [PATCH] Improve status bar --- home-manager/roles/gnome.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/home-manager/roles/gnome.nix b/home-manager/roles/gnome.nix index eee41fdf..6d8322d5 100644 --- a/home-manager/roles/gnome.nix +++ b/home-manager/roles/gnome.nix @@ -25,7 +25,7 @@ let tryCmd x = ignoreFailure x |> captureTrim main = do - playing <- Text.intercalate " " . fmap decodeUtf8 . filter (/= "") <$> mapM tryCmd [playerctl "status", playerctl "metadata" "title", playerctl "metadata" "artist"] + playing <- Text.intercalate " - " . fmap decodeUtf8 . filter (/= "") <$> mapM tryCmd [playerctl "status", playerctl "metadata" "title", playerctl "metadata" "artist"] appointments <- Text.intercalate "; ". lines . decodeUtf8 <$> (tryCmd $ khal ["list", "-a", "Standard", "-a", "Planung", "-a", "Uni", "-a", "Maltaire", "now", "2h", "-df", ""]) mode <- getMode unread <- notmuch "count" "folder:hera/Inbox" "tag:unread" |> captureTrim @@ -34,13 +34,13 @@ let dirs <- listDirectory "/home/maralorn/git" dirty <- fmap toText <$> filterM (isDirty . ("/home/maralorn/git/"<>)) dirs unpushed <- fmap toText <$> filterM (isUnpushed . ("/home/maralorn/git/"<>)) dirs - say . Text.intercalate " | " $ - [appointments,playing, show mode] ++ - memptyIfFalse ((unread /= "0") && mode >= Orga) (one [i|Unread: #{unread}|]) ++ - memptyIfFalse ((inbox /= "0") && mode == Leisure) (one [i|Inbox: #{inbox}|]) ++ - memptyIfFalse ((codeMails /= "0") && mode == Code) (one [i|Code: #{codeMails}|]) ++ - memptyIfFalse (length unpushed /= 0) (one [i|Unpushed: #{Text.intercalate " " unpushed}|]) ++ - memptyIfFalse (length dirty /= 0) (one [i|Dirty: #{Text.intercalate " " dirty}|]) + say . Text.unwords $ + ["", [i|#{appointments}|],playing, [i|#{show mode}|]] ++ + memptyIfFalse ((unread /= "0") && mode >= Orga) (one [i|Unread: #{unread}|]) ++ + memptyIfFalse ((inbox /= "0") && mode == Leisure) (one [i|Inbox: #{inbox}|]) ++ + memptyIfFalse ((codeMails /= "0") && mode == Code) (one [i|Code: #{codeMails}|]) ++ + memptyIfFalse (length unpushed /= 0) (one [i|Unpushed: #{Text.intercalate " " unpushed}|]) ++ + memptyIfFalse (length dirty /= 0) (one [i|Dirty: #{Text.intercalate " " dirty}|]) ++ [""] ''; in {