12345678910111213141516171819202122232425262728293031323334 |
- #!/bin/sh
- #
- # date-menu.sh
- #
- # This is in the public domain. Honestly, how can you claim anything to something
- # this simple?
- #
- # Outputs a simple openbox pipe menu to display the date, time, and calendar.
- # You need 'date' and 'cal'. You should have these. Additionally, the calendar
- # only appears properly formated if you use a mono spaced font.
- # Outputs the selected row from the calender output.
- # If you don't use a mono spaced font, you would have to play with spacing here.
- # It would probably involve a very complicated mess. Is there a way to force a
- # different font per menu?
- # function calRow() {
- # cal | gawk -v row=$1 '{ if (NR==row) { print $0 } }'
- # }
- # Build the menu
- cat << EOFMENU
- <openbox_pipe_menu>
- <separator label="`date +%A\ %I\:%M\ %p`" />
- <item label="`date +%B\ %d,\ %Y`" />
- <separator />
- <item label="cal | gawk -v row=2 '{ if (NR==row) { print $0 } }'"/>
- <item label="cal | gawk -v row=3 '{ if (NR==row) { print $0 } }'"/>
- <item label="cal | gawk -v row=4 '{ if (NR==row) { print $0 } }'"/>
- <item label="cal | gawk -v row=5 '{ if (NR==row) { print $0 } }'"/>
- <item label="cal | gawk -v row=6 '{ if (NR==row) { print $0 } }'"/>
- <item label="cal | gawk -v row=7 '{ if (NR==row) { print $0 } }'"/>
- </openbox_pipe_menu>
- EOFMENU
|