diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2019-08-17 12:40:35 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2019-08-17 12:40:35 +0200 |
commit | 87a9234d3014e58696c8579aa4d86e0a75f48aeb (patch) | |
tree | c00bfffb28e579d2bb54341658eb5dd8b451f471 /polybar | |
parent | 6228b9055d21b750a67c465fe248b7da9d9de66c (diff) |
Update calendar rofi script
Diffstat (limited to 'polybar')
-rwxr-xr-x | polybar/scripts/polybar/cal.sh | 15 |
1 files changed, 11 insertions, 4 deletions
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|_\(.\)|<span background="white" foreground="black">\1</span>|' \ +#!/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|_\(.\)|<span background="white" foreground="red">\1</span>|' \ | sed 's|_\(.\)|<span background="white" foreground="black">\1</span>|' \ | sed 's|\s*$||') -rofi -markup -width -55 -lines 8 -location 3 -e "$cal" +rofi -markup -width -57 -lines 8 -location 3 -e "$cal" |