LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Software to Display a Large Menu for Remote Control? (https://www.linuxquestions.org/questions/linux-software-2/software-to-display-a-large-menu-for-remote-control-626741/)

bt101 03-09-2008 04:41 AM

Software to Display a Large Menu for Remote Control?
 
Hi - Does anybody know of software that will display a large graphical menu where you can scroll around and make selections?

I just got a remote control working with my linux box. I can grab the keys sent by the remote and do various things, and it works well. I would like to both expand and simplify this system by just displaying a large menu where I can make selections. I'm hoping I don't have to write it from scratch. I'm looking for something that will display a large menu of either text or icons. I would prefer something inside a window rather than a full screen menu. I would imagine that you would edit a config file where you specify the text to be displayed and the corresponding command to run. You would use arrow keys to scroll around.

If anybody has any thought, please let me know.

Thanks

jiml8 03-09-2008 09:41 AM

the easiest/quickest way to go about that is to write a web interface for your remote in PHP or perl.

When I do such things, I usually have a C program that actually handles my device interface, and I invoke that C program from PHP to obtain its output and to provide it with necessary inputs. Then I just build an HTML page and pass the information back and forth.

The downside to this is that it is heavy. You need to have apache running and your GUI is a webpage. The upside is that it is quick and easy - a lot quicker than writing a gtk interface, for sure. It is also automatically a remote control; you can call that interface up from any computer that can talk to your apache server.

Wim Sturkenboom 03-09-2008 12:25 PM

It's my understanding that bt101 prefers an available solution (which I don't know).

My personal favorite for this type of work is Tcl/Tk.

Code:

#! /usr/bin/wish

# procedure to read IR data from a file and send it over an interface
proc send_cmd cmd {
    tk_messageBox -title "send command" -message $cmd

# todo:
# 1) open,read and close commandfile containing IR data
# 2) open device and write command
# 3) close device
}

# keys
# a list of available keys
# format:
#  category keyname value2display IRdatafile

set keys[list\[list "num" "K1" "1" "cmd_1.dta"] \[list "num" "K2" "2" "cmd_2.dta"] \[list "num" "K3" "3" "cmd_3.dta"] \[list "num" "K4" "4" "cmd_4.dta"] \[list "num" "K5" "5" "cmd_5.dta"] \[list "num" "K6" "6" "cmd_6.dta"] \[list "num" "K7" "7" "cmd_7.dta"] \[list "num" "K8" "8" "cmd_8.dta"] \[list "num" "K9" "9" "cmd_9.dta"] \[list "num" "K0" "0" "cmd_0.dta"] \[list "prog" "Pplus" "P+" "cmd_pplus.dta"] \[list "prog" "Pminus" "P-" "cmd_pminus.dta"] \[list "vol" "Vplus" "V+" "cmd_vplus.dta"] \[list "vol" "Vminus" "V-" "cmd_vminus.dta"] \
]

# main code to draw buttons
# all keys
foreach key $keys {
    if { [winfo exists .f_[lindex $key 0]] == 0 } {
        frame .f_[lindex $key 0] -relief sunken
        pack .f_[lindex $key 0] -in . -fill x -side top
    }
    button .b_[lindex $key 1] -text [lindex $key 2] -command "send_cmd [lindex $key 3]"
    pack .b_[lindex $key 1] -in .f_[lindex $key 0] -side left
}

The above assumes that for each key a datafile is available that defines the data to be transmitted to the IR device for a specific button.
It's reasonable easy to read the list of keys from a file rather then hardcode them.
It's also reasonable easy to read the command file and send the data to a device (the TODO part)


PS I see that in my browser the list of keys is one long line; the code tags don't seem to prevent <backslash><enter> from being removed. Sorry for that. You can quote my message and next copy the code.

bt101 03-09-2008 02:12 PM

Thanks for the replies.
Yes, I was considering a web page, but as was mentioned, you need to run a web server etc. I may have to do it if I can't ind another solution.

I hope I didn't complicate the issue when I mentioned that I am using a remote control. I only mentioned that part to give some background to what I'm doing. My remote control generates normal keys as if they came from the keyboard, so you can take the remote completely out of the picture.

The question could be rephrased as.. how can you display a big menu and scroll around it with the arrow keys on the keyboard.

I currently do have a cript which grabs the keys and runs things, but it is all in the background. I would like to display a menu instead.

Thanks

bt101 03-09-2008 03:03 PM

I found an example of what I am seeking, but this runs under Windows. This page has some screenshots of menus about half way down the page:

http://forums.sage.tv/forums/showthread.php?t=10715

I don't really need it to be fancy. I would even settle for something that ran in a bash shell if the type was big enough.


All times are GMT -5. The time now is 11:04 AM.