aboutsummaryrefslogtreecommitdiff
path: root/polybar
diff options
context:
space:
mode:
Diffstat (limited to 'polybar')
-rwxr-xr-xpolybar/scripts/polybar/cal.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/polybar/scripts/polybar/cal.sh b/polybar/scripts/polybar/cal.sh
index 33f5f68..a69d088 100755
--- a/polybar/scripts/polybar/cal.sh
+++ b/polybar/scripts/polybar/cal.sh
@@ -6,8 +6,10 @@ faketty () {
script -qfec "$(printf "%q " "$@")"
}
+# Get the max line width
+width=$(ncal -3 | wc -L)
+
cal=$(faketty ncal -3 \
- | sed 's|_\(.\)|<span background="white" foreground="red">\1</span>|' \
- | sed 's|_\(.\)|<span background="white" foreground="black">\1</span>|' \
+ | sed 's|_\(.\)|<span background="white" foreground="black">\1</span>|g' \
| sed 's|\s*$||')
-rofi -markup -width -57 -lines 8 -location 3 -e "$cal"
+rofi -font "mono 9" -markup -width -"${width}" -lines 8 -location 3 -e "${cal}"