Skip to content

Commit

Permalink
rofi-calendar: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vKnmnn committed Sep 11, 2017
1 parent 98f026e commit bbf7625
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
26 changes: 26 additions & 0 deletions rofi-calendar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# rofi-calendar

Have a minimal calendar pop up when clicking the date blocklet

![](screenshot.png)

![](screenshot2.png)

# Dependencies

* rofi
* cal from util-linux package, supporting --color=always
# Installation

* Copy the script into your directory of choice, e.g. ~/.i3blocks/blocklets
* Give it execution permission (`chmod +x rofi-calendar`)
* Edit rofi launch options to fit your needs
* Add the following blocket to your i3blocks.conf:

```ini
[rofi-calendar]
command=$SCRIPT_DIR/rofi-calendar
label=
interval=3600
```

27 changes: 27 additions & 0 deletions rofi-calendar/rofi-calendar
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/sh

blockdate=$(date '+%a. %d. %b. %Y')

case "$BLOCK_BUTTON" in
1|2|3) date=$(date '+%A, %d. %B')
export TERM=xterm
cal --color=always \
| sed 's/\x1b\[[7;]*m/\<b\>\<u\>/g' \
| sed 's/\x1b\[[27;]*m/\<\/u\>\<\/b\>/g' \
| tail -n +2 \
| rofi \
-dmenu \
-markup-rows \
-no-fullscreen \
-font "Monospace 6" \
-hide-scrollbar \
-bw 2 \
-m -3 \
-theme-str '#window {anchor:southeast; location: northwest;}' \
-eh 1 \
-width -22 \
-no-custom \
-p "$date"
esac
echo $blockdate
date '+%d.%m.%Y'
Binary file added rofi-calendar/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rofi-calendar/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bbf7625

Please sign in to comment.