Skip to content

# anyRemote

# Set(...) / ExecAndSet(...) commands

This command used to control and customize GUI of Java client. It is possible to change:

- caption of screen
- title and status fields
- arrange icons from predefined icon set
- change background and foreground color
- change font size
- show album cover image
- change icon layouts (skins)
- use internal vibrator of the phone
- toggle fullscreen mode
- show lists and texts data
- show MC-like file manager
- show images

Set(...) command is used to set various parameters of GUI of Java client with impicit data specification.

ExecAndSet(..) do the same thing, but it uses the results of executed command as a part of command which will be sent to Java client.

For details see examples below.

There are a plenty of ways to use this command:

### Set(icons, ...)

Format: Set(icons,caption,1,name1[,2,name2...,*,name11,#,name12])

where nameX specifies desired action. This command sets the caption of Java client window and reports to Java client to dynamically change shown icons.

    1=Exec(xmmsctrl play);Set(icons,XmmsPlaying,5,stop,1,kill);
    1=ExecAndSet(icons,echo "XmmsPlaying,5,stop,1,kill");

if You do not want to change the caption of Java client window then it is possible to write:

    1=Exec(xmmsctrl play);Set(icons,SAME,5,stop,1,kill);

### Set(title, ...)

Format: Set(title, new_title)

This command sets the title field of Java client.

    Set(title,XMMS);
    ExecAndSet(title,whoami);

It is possible to add line break characters to the text. It could be done with "\n".

### Set(status, ...)

Format: Set(status, new_status)

This command sets the status field of Java client.

    3=Exec(xmmsctrl play);Set(status, Playing)
    3=ExecAndSet(status,sh -c "if xmmsctrl playing;\
           then echo Stopped; else echo Playing; fi")

### Set(bg ...)

Format: Set(bg,R,G,B)

Where R, G, B values should be beetween 0 and 255. This command sets the background color of control (main) screen of java client. For example to set background to blue:

    3=Set(bg,0,0,255);
    3=ExecAndSet(bg,echo "0,0,255");

The simplest way to determine appropriare RGB value is to run KolourPaint program and then open Select Color dialog.

### Set(fg ...)

Format: Set(fg,R,G,B)

Where R, G, B values should be beetween 0 and 255. This command sets the foreground color of control (main) screen of java client. For example to set foreground to blue:

    3=Set(fg,0,0,255);
    4=ExecAndSet(fg,echo "0,0,255");

### Set(font ...)

Format: Set(font [,small | medium | large] [,bold] [,italic] [,underlined] [,system | monospace | proportional])

This command sets font parameters for the title and status fields of control (main) screen of java client. Java realization in the phone could support only some subset of fonts which can be specified by this command.

For example, the following commands sets small underlined bold proportinal font:

    3=Set(font,small,underlined,bold,proportinal);
    4=ExecAndSet(font,echo "small,underlined,bold,proportinal");

### Set(volume ...)

Format: Set(volume,X)

Where X should be between 0 and 100. This command sets value of volume bar of Java client (it needs to issue Set(skin,....volume) command before to make volume bar visible):

    3=Set(volume,50);
    4=ExecAndSet(volume,xmmsctrl getvol);

### Set(cover ...)

Format: Set(cover,/path/to/image/file)

    3=Set(cover,/tmp/album_cover.png);

It is user responsibility to shrink image to the appropriate size on server side. Use Get(cover_size) command to retrieve cover size. This command works only if skin previously set to bottomline with ticker parameter:

    4=Set(skin,bottomline,ticker);

### Set(vibrate)

Format: Set(vibrate)

This command switches on internal vibrator of the phone (if exists) for 1/2 sec.

    5=Set(vibrate);

### Set(text, ...)

Format: Set(text,add|replace|show|clear|close|fg|bg|font, _data_)

This command shows help test on the screen of cell phone. See detailed description here.

    #=Exec(xmmsctrl quit);\
      Set(text,replace,Help,To run Xmms press 1)
    #=ExecAndSet(text,replace,Date,date)

### Set(list ...)

and

### Set(iconlist ...)

Format:

Set(list,add|replace|clear|show|close|fg|bg|font, _data_) or

Set(iconlist,add|replace|clear|show|close|menu|fg|bg|font, _data_)

This command used to create and manage lists. It could be useful to manage player playlists or to browse directory structure. See detailed description here. The iconlist can contain icons in front of each list item.

    3=Set(list,replace,Shell commands,reboot,shutdown,uptime,dmesg);
    3=ExecAndSet(list,replace,Example,more some_file.txt);
    3=Set(iconlist,replace,Shell commands,\
          launch:reboot,exit:shutdown,question:uptime,question:dmesg);

### Set(menu ...)

Format: Set(menu,add|replace|clear[,_data_])

This command used to manage menues. Custom made menu could be added to each screen of Java Client. See detailed description here.

    4=Set(menu,add,Random,Repeat,Shuffle);
    4=ExecAndSet(menu,add,echo "Random,Repeat,Shuffle");

### Set(skin ...)

Format:

Set(skin,default|bottomline [,keypad_only|joystick_only] [,ticker|noticker] [,volume] [,size16|size32|size64] [,split] [,choose,_button_] [,up,_button_] [,down,_button_])

    4=Set(skin,default,ticker,size32);
    4=ExecAndSet(skin,echo "bottomline,joystick_only,\
                 volume,up,VolUp,down,VolDown");

This command used to choose icon layout ("skin") to show. There are 3 icon layouts defined: default and bottomline.

If keypad_only parameter specified, then it will be possible to send commands only by pressing numeric keys.

If joystick_only parameter is specified, then it will be possible to send commands only by pressing joystick central button.

If choose,_button_ parameter is specified then initial selection will be set to button with appropriate number. (0-9, *, # are the valid values for the button).

If ticker parameter is specified then ticker (running text) will be used to show title field instead of static text.

If noticker parameter is specified then title field will be shown as static text.

If volume parameter is specified then volume bar will be shown.

In bottomline icon layout if there will be not enough space on phone screen to show all icons, then some of them will be omitted.

If the screen heigth is less than 250pt. then 16x16 icons will be used by default, overwise 32x32 icons will be used by default.

It is possible to force using 16x16, 32x32 or 64x64 icons by specifying size16, size32 or size64 parameter.

(Note: to make this command work it needs to use java client which supports specified icon set).

If split parameter is specified then icons will be drawn with a distance from each other. This distance is equal to icon size. Applied only in case of default icon layout.

In bottomline icon layout it is possible to specify action to JoystickUp and JoystickDown with help of "up,_button_up_" and "down,_button_down_". If user pushes JoystickUp/JoystickDown then _button_up_/_button_down_ events will be sent.

### Set(filemanager ...)

Format: Set(filemanager, add|replace|select, left|right, [_data_])

This command used to show file manager window. It looks like MC and allows to do basic file operations. See detailed description here.

    3=Set(filemanager,add,left,.,..);
    4=ExecAndSet(filemanager,add,left,ls -1);

### Set(fullscreen ...)

Format: Set(fullscreen,on|off|toggle)

Set fullscreen mode on or off.

    3=Set(fullscreen,toggle);
    4=ExecAndSet(fullscreen,echo on);

### Set(editfield ...)

Format: Set(editfield,caption_value,label_value,init_value)

Shows edit field on phones screen. When used press Ok then reply Ok(0,_entered_value_) will be sent to server.

    3=Set(editfield,Enter parameters,\
        Parameters,Enter your data here);
    4=ExecAndSet(editfield,
        echo "Enter parameters,Parameters,Enter your data here");

For example, if user enters, say - new_line - and presses Ok, then reply Ok(0,new_line) will be sent.

### Set(disconnect)

Format: Set(disconnect)

Force java client to disconnect from PC.

    0=Set(disconnect);

### Set(parameter, ...)

Format: Set(parameter,[_parameter_name_,_parameter_value_]+)

This command used to tune Java client in some aspects (which could be hardware-dependent). See detailed description here.

### Set(repaint)

Format: Set(repaint)

This command force java client to repaint the screen. Useful if parameter "lazy_repaint" is set to on.

    3=Set(repaint);

### Set(image ...)

Format:

Set(image,window,_image_file_name_) or

Set(image,icon,_icon_name_,_image_file_name_) or

Set(image,show|close|cursor|nocursor|remove_all)

This command used to show images on screen of cell phone or upload icons which could be used in Set(icons,...) command. See cfg-example/Server-mode/winManager.cfg and cfg-example/Server-mode/iconUpload.cfg for details. See detailed description of Set(image ...) here.

    3=Set(image,window,/tmp/image.png);

## Data caching

To mimimize traffic between PC and Java Client results of the following commands will be cached:

- Set | ExecAndSet(bg,...);
- Set | ExecAndSet(cover,...);
- Set | ExecAndSet(fg,...);
- Set | ExecAndSet(font,...);
- Set | ExecAndSet(icons,...);
- Set | ExecAndSet(skin,...);
- Set | ExecAndSet(status,...);
- Set | ExecAndSet(title,...);
- Set | ExecAndSet(volume,...);

Then one of these command will be executed next time, it will be send to Java Client only if command data are changed.

Maintained by anyRemote. Website by m.lettner.