You are not logged in.

#1 2006-05-17 22:24:55

Greycloack
Member
Registered: 2004-03-05
Posts: 166

Openbox menu and a clock

Hi, does anyone knows how to make the current time appear in the openbox root menu... it's just a little feature I would like to have instead running gkrellm or any other program to use as a clock

Thank you,
Grey

Offline

#2 2006-05-18 06:23:12

postlogic
Member
Registered: 2005-02-24
Posts: 410
Website

Re: Openbox menu and a clock

From the manual

Pipe menus
Openbox allows for dynamic menus, built on-the-fly from scripts. These are referred to as "Pipe menus" since the script's output is piped back to Openbox and used for the menu.

A Pipe menu can be created by placing the following into a menu file:

<menu  id="ID" label="TITLE" execute="COMMAND" />

The generated Pipe menu can be referenced just like any other menu.

COMMAND is a command which is executed. The output from this command is parsed and turned into the menu. The output from the script should be a menu, something like:

<openbox_pipe_menu>
  <item label="LABEL">
    ACTIONS
  </item>
</openbox_pipe_menu>

Which means you should be able to do

<menu id="time" label="postlogic kicks ass" execute="your_time_command" />

I have never attempted anything like this, and I'm at work, so I can't actually try it.

Just experiment a bit, and be sure to post your results!

Offline

#3 2006-05-18 07:54:49

Greycloack
Member
Registered: 2004-03-05
Posts: 166

Re: Openbox menu and a clock

Got it working

you need to create a menu entery like above calling for "mytime.py"

the script :
http://shabi.homelinux.org/mytime.py

Grey

Offline

#4 2006-05-18 12:48:34

postlogic
Member
Registered: 2005-02-24
Posts: 410
Website

Re: Openbox menu and a clock

Great. I'll try it myself when I get home.

Offline

Board footer

Powered by FluxBB