Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-16-2012, 09:54 PM   #1
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Lightbulb programatically set xwindows titles : SOLVED

Hi, I know it is possibly to set the titles of X apps that honor the -name and -title parameters, however I would like to change the title of apps programmatically.


EDIT: Solved:

[root@kindle root]# xprop -name LBreakout2 -f WM_NAME 8s -set WM_NAME bob



Quote:
#! /bin/sh
exec xprop -notype \
-f WM_NAME 8s ':\n title =\? $0\n' \
-f WM_CLASS 8s ':\n appName =\? $0\n className =\? $1\n' \
-f WM_WINDOW_ROLE 8s ':\n stringProperty "WM_WINDOW_ROLE" =\? $0\n' \
WM_NAME WM_CLASS WM_WINDOW_ROLE \
${1+"$@"}
is a handyish shell to adapt to do stuff

however it seems that setting the title after it has been stuck on the background is not enough. nor is toggling the WM_STATE 0 to 1 or vice versa.

Quote:
[root@kindle us]# xprop -name xeyes
Quote:
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_CLIENT_LEADER(WINDOW): window id # 0x1400007
WM_LOCALE_NAME(STRING) = "C"
WM_CLASS(STRING) = "xeyes", "XEyes"
WM_HINTS(WM_HINTS):
Client accepts input or input focus: False
Initial state is Normal State.
bitmap id # to use for icon: 0x1400001
bitmap id # of mask for icon: 0x1400003
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified size: 150 by 100
window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "kindle"
WM_COMMAND(STRING) = { "xeyes" }
WM_ICON_NAME(STRING) = "xeyes"
WM_NAME(STRING) = "xeyes"
[root@kindle us]#
Thoughts on that gratefully accepted. Lipc? Lua?

Spoiler:


I checked out K5 X apps run on native touch Xorg. also

Thanks.


Perhaps reparenting is the way forward?

http://standards.freedesktop.org/xem...-spec-0.5.html

http://menehune.opt.wfu.edu/Kokua/Ir...html/ch16.html

Last edited by twobob; 10-16-2012 at 11:43 PM. Reason: https://www.mobileread.com/forums/showthread.php?t=162022
twobob is offline   Reply With Quote
Old 10-16-2012, 10:39 PM   #2
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
[root@kindle root]# xprop -name LBreakout2
WM_NAME(STRING) = "LBreakout2"
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 592 by 480
program specified maximum size: 592 by 480
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW
WM_CLIENT_MACHINE(STRING) = "kindle"
_NET_WM_PID(CARDINAL) = 13003
WM_CLASS(STRING) = "lbreakout2", "lbreakout2"
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
bitmap id # to use for icon: 0x1400012
bitmap id # of mask for icon: 0x1400010
[root@kindle root]# xprop -name LBreakout2 -set WM_NAME "L:A_N:application_ID:breakout"
cannot convert WM_NAME argument to STRING or COMPOUND_TEXT.
[root@kindle root]# xprop -name LBreakout2 -set WM_NAME L:A_N:application_ID:breakout
cannot convert WM_NAME argument to STRING or COMPOUND_TEXT.
[root@kindle root]# xprop -name LBreakout2 -set WM_NAME 'L:A_N:application_ID:breakout'
cannot convert WM_NAME argument to STRING or COMPOUND_TEXT.

hmm... *reads more*

and further refs: http://tronche.com/gui/x/icccm/sec-4.html#WM_NAME

http://oreilly.com/catalog/motifref2...html/ch16.html

Last edited by twobob; 10-16-2012 at 11:16 PM.
twobob is offline   Reply With Quote
Advert
Old 10-16-2012, 10:54 PM   #3
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
simple one liner:

[root@kindle root]# xprop -name LBreakout2 -f WM_NAME 8s -set WM_NAME "bob"


done.

Here's some handy code for more serious code level work.

Spoiler:
Quote:
#include <string.h>

#include <xcb/xcb.h>
#include <xcb/xcb_atom.h>

int
main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
xcb_window_t win;
char *title = "Hello World !";
char *title_icon = "Hello World ! (iconified)";



/* Open the connection to the X server */
c = xcb_connect (NULL, NULL);

/* Get the first screen */
screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;

/* Ask for our window's Id */
win = xcb_generate_id (c);

/* Create the window */
xcb_create_window (c, /* Connection */
0, /* depth */
win, /* window Id */
screen->root, /* parent window */
0, 0, /* x, y */
250, 150, /* width, height */
10, /* border_width */
XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
screen->root_visual, /* visual */
0, NULL); /* masks, not used */

/* Set the title of the window */
xcb_change_property (c, XCB_PROP_MODE_REPLACE, win,
WM_NAME, STRING, 8,
strlen (title), title);

/* Set the title of the window icon */
xcb_change_property (c, XCB_PROP_MODE_REPLACE, win,
WM_ICON_NAME, STRING, 8,
strlen(title_icon), title_icon);

/* Map the window on the screen */
xcb_map_window (c, win);

xcb_flush (c);

while (1) {}

return 0;
}
I suppose that could be refactored to do the job

Last edited by twobob; 10-16-2012 at 11:08 PM.
twobob is offline   Reply With Quote
Old 10-17-2012, 07:57 AM   #4
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Got xdotool running now on the kindle. maybe that can do that job...

Quote:
[root@kindle root]# xdotool help
Available commands:
getactivewindow
getwindowfocus
getwindowname
getwindowpid
getwindowgeometry
getdisplaygeometry
search
selectwindow
help
version
behave
behave_screen_edge
click
getmouselocation
key
keydown
keyup
mousedown
mousemove
mousemove_relative
mouseup
set_window
type
windowactivate
windowfocus
windowkill
windowmap
windowminimize
windowmove
windowraise
windowreparent
windowsize
windowunmap
set_num_desktops
get_num_desktops
set_desktop
get_desktop
set_desktop_for_window
get_desktop_for_window
get_desktop_viewport
set_desktop_viewport
exec
sleep
twobob is offline   Reply With Quote
Old 10-17-2012, 09:07 AM   #5
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
xdotool windowreparent 0x1000003 0x51

looks to work okay.
twobob is offline   Reply With Quote
Advert
Old 10-17-2012, 10:35 AM   #6
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
okay. so after much debating. I think simply minimising the three windows is the best option

Home, Searchbar, Blank background.

(searchbar)
[root@kindle root]# xdotool windowminimize 0xe00033

(titlebar)
[root@kindle /dev]# xdotool windowminimize 0xe0004a

(home)
[root@kindle /dev]# xdotool windowminimize 0x1000024

(blank background)
[root@kindle /dev]# xdotool windowminimize 0xe00003

and then restore them again

[root@kindle root]# xdotool windowactivate 0xe00033
etc..

simple.

That way all the nice TSLIB events get piped to the "topmost app" - which is ours

I am currently playing breakout on my kindle 5 : ) YAY with a working TS interface Joy
Attached Thumbnails
Click image for larger version

Name:	Selection_168.png
Views:	304
Size:	26.3 KB
ID:	94274   Click image for larger version

Name:	Selection_169.png
Views:	304
Size:	15.0 KB
ID:	94275   Click image for larger version

Name:	kindle:0.0 - GVncViewer_170.png
Views:	299
Size:	27.2 KB
ID:	94276   Click image for larger version

Name:	kindle:0.0 - GVncViewer_171.png
Views:	308
Size:	29.4 KB
ID:	94277   Click image for larger version

Name:	kindle:0.0 - GVncViewer_172.png
Views:	285
Size:	28.2 KB
ID:	94278  

Last edited by twobob; 10-17-2012 at 11:23 AM. Reason: more ids
twobob is offline   Reply With Quote
Reply

Tags
k5 tools, kindle 5, xorg


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
set up ? IGraham Library Management 4 04-05-2012 02:32 PM
I Love Titles. Do you Love Titles? What's your Favorite Title? kennyc General Discussions 106 01-19-2012 11:32 AM
Titles, subtitles & alternative "display" titles jigme ePub 2 08-31-2011 05:19 PM
Getting book's id number programatically GreyNomad Development 3 03-18-2011 04:16 AM
iLiad ARM (+Xwindows) resources arivero iRex Developer's Corner 0 10-22-2006 10:19 AM


All times are GMT -4. The time now is 06:00 PM.


MobileRead.com is a privately owned, operated and funded community.