Openbox:Pipemenus:Date Menu
From Openbox
(Difference between revisions)
(New page: Simply save this code into a new file somewhere in your home directory and make a link to it as a dynamic menu. I designed it as a standalone menu so you can hit some key combination and ...) |
|||
(3 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Image:date_menu.jpg|right]] | ||
Simply save this code into a new file somewhere in your home directory and make a link to it as a dynamic menu. I designed it as a standalone menu so you can hit some key combination and it appears. | Simply save this code into a new file somewhere in your home directory and make a link to it as a dynamic menu. I designed it as a standalone menu so you can hit some key combination and it appears. | ||
Line 5: | Line 6: | ||
# date-menu.sh | # date-menu.sh | ||
# | # | ||
− | # Outputs a simple openbox pipe menu to display the date, time, and | + | # This is in the public domain. Honestly, how can you claim anything to something |
− | # You need 'date' and 'cal'. You should have these. Additionally, the | + | # 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. | # only appears properly formated if you use a mono spaced font. | ||
Latest revision as of 14:14, 23 November 2008
Simply save this code into a new file somewhere in your home directory and make a link to it as a dynamic menu. I designed it as a standalone menu so you can hit some key combination and it appears.
#!/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="`calRow 2`" /> <item label="`calRow 3`" /> <item label="`calRow 4`" /> <item label="`calRow 5`" /> <item label="`calRow 6`" /> <item label="`calRow 7`" /> <item label="`calRow 8`" /> </openbox_pipe_menu> EOFMENU