From cb9bc04f252f0fbdcbbcf6e2857406c85739c1e1 Mon Sep 17 00:00:00 2001 From: M1dgard Date: Mon, 20 Aug 2018 03:07:18 +0200 Subject: [PATCH] [clock.py] Add actions to open khal and tty-clock --- polybar/clock.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/polybar/clock.py b/polybar/clock.py index 27b4762..cc9214f 100755 --- a/polybar/clock.py +++ b/polybar/clock.py @@ -50,24 +50,30 @@ try: localcolor = color_for(localnow) + khal_link = lambda x: "%{A1:i3-sensible-terminal -e khal interactive &:}" + x + "%{A}" + clock_link = lambda x, args: "%{A1:i3-sensible-terminal -e tty-clock -cC3 " + args + " &:}" + x + "%{A}" + print( - localcolor + - localnow.strftime("%A") + - "%{F} " + + khal_link( + localcolor + + localnow.strftime("%A") + + "%{F} " + ) + # face_for(leftnow) + - " %{T4}" + localcolor + localnow.strftime("%H") + "%{F}" + clock_link(" %{T4}" + localcolor + localnow.strftime("%H") + "%{F}", "") + "%{O2}%{T8}" + face_for(localnow) + - "%{O2}%{T4}" + localcolor + localnow.strftime("%M") + "%{T-}%{F}" + - " " + + clock_link("%{O2}%{T4}" + localcolor + localnow.strftime("%M") + "%{T-}%{F} ", "-s") + # face_for(rightnow) + " " + - " " + - localcolor + - localnow.strftime("%d %b") + - "%{F}", + khal_link( + " " + + localcolor + + localnow.strftime("%d %b") + + "%{F}" + ), flush = True )