From 87a9234d3014e58696c8579aa4d86e0a75f48aeb Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sat, 17 Aug 2019 12:40:35 +0200 Subject: Update calendar rofi script --- polybar/scripts/polybar/cal.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'polybar') diff --git a/polybar/scripts/polybar/cal.sh b/polybar/scripts/polybar/cal.sh index 96374f0..33f5f68 100755 --- a/polybar/scripts/polybar/cal.sh +++ b/polybar/scripts/polybar/cal.sh @@ -1,6 +1,13 @@ -#!/bin/sh -cal=$(ncal -3 \ - | sed 's|_\(.\)|\1|' \ +#!/bin/bash + +# Add a fake tty to get the day highlight +# https://stackoverflow.com/a/32981392 +faketty () { + script -qfec "$(printf "%q " "$@")" +} + +cal=$(faketty ncal -3 \ + | sed 's|_\(.\)|\1|' \ | sed 's|_\(.\)|\1|' \ | sed 's|\s*$||') -rofi -markup -width -55 -lines 8 -location 3 -e "$cal" +rofi -markup -width -57 -lines 8 -location 3 -e "$cal" -- cgit v1.2.3