Show the date and time in Pekwm’s menu | urukrama's weblog
Written by Laurent Marechal - 31 march 2015
Classified in : Unix, Links - Tags : UI, Unix
Site d'origine : https://urukrama.wordpress.com/2008/01/02/show-the-date-and-time-in-pekwms-menu/
Show the date and time in Pekwm’s menu
January 2, 2008
One of the nice features of Pekwm is that it allows you to use dynamic menus, menus and entries that display the output of a script that is run each time the menu is accessed. Here is how you can display the time and date in your root menu (or window menu, if you’d like that). I’ve adapted what follows from here.
Create a new file in a place that is convenient for you. (I keep such dynamic menus in a subdirectory called “menu” in the ~/.pekwm directory.) Add the following to that file:
#!/bin/bash echo "Dynamic {" echo " Entry = \"`date +'%a, %e %B - %H:%M'`\" { Actions = \"Exec osmo & \" } " echo " }"
Make the script executable (chmod +x /path/to/script), and add the following to your menu file (in ~/.pekwm):
Entry = "" { Actions = "Dynamic /path/to/the/script"}
If you reload Pekwm, you will have a menu item that displays the time and date. If you click on the time and date, Osmo, a nice light calendar, todo list and contact management application, will launch. Replace it in the above command with any other application you like (Orage, dzen with a calendar script, etc.). If you prefer not to have any application linked to the entry, use the following line in the above script (instead of line 3):
echo " Entry = \" `date +'%d.%m.%y - %H:%M'`\" { Actions = \"Exec source /dev/null & \" } "
If you want the date and time to display in its owm submenu, add the following to your menu file:
Submenu = "Date and Time" { Entry = "" { Actions = "Dynamic /path/to/the/script"} }
You can also easily change the date and time format to your liking. Below are two screenshots; the first shows the date and time on the main menu with the command `date +’%d.%m.%y – %H:%M’`, the second shows it in a submenu with the command `date +’%a, %e %B – %H:%M’`.
Comments are closed.