aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2019-08-18 15:34:42 +0200
committerSébastien Dailly <sebastien@chimrod.com>2019-08-18 15:34:42 +0200
commit65915ec6c0311ef8a0af24bfe82bd10f338afa86 (patch)
tree7936b7312b3958d99c8cc966e2b2102276ae14a7
parentb426ca8baa820ca7c48fecebdff0833b0103e309 (diff)
Update calendar script
-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}"