Re: Run a GTK application without desktop environment



This is quite simple.

You have to send in the geometry to the GTK application so that is self
can decide its geometry. 

You don't need any window manager.

I run a lot of FreeBSD computers this way.

In rc.local you run something like

-------------------------------
#!/usr/local/bin/bash

/usr/sbin/ntpdate -s 0.ubuntu.pool.ntp.org

DISPLAY=:0.0
export DISPLAY

/usr/local/bin/X -ac &

# Let the x-server have time to start
sleep 20

# Connect from any IP
/usr/local/bin/xhost + &

# Remove the cursor from the screen, turn off screensaver
/usr/local/bin/unclutter -root -idle 1 &
/usr/local/bin/xset -dpms &
/usr/local/bin/xset s off &

# set background
# https://en.wikipedia.org/wiki/X11_color_names
/usr/local/bin/xsetroot -solid Grey &

# show local time
TZ=CEST
export TZ

# Startscript for infotable at LEV
DISPLAY=192.168.37.88:0.0 ./draw-text -x 0 -y 0 -X 896 -Y 307 -g logo -L "" -f 100 &
...

----------------------------------------------------

Note that the gtk-widget have to "resize" itself. So you must program it to
read its own "geometry". x , y , X  Y (and some other stuff).

/gh

Den 2016-03-18 kl. 01:30, skrev Anatol Pomozov:
Hi

I am trying to implement a simple Kiosk-like web application. The
application will run fullscreen all the time and show web pages. I my
case it will be project's build status. I want to use a simple
computer like a RaspberryPi. And I want to avoid starting heavy
environments like KDE or Gnome.

Is there any good example/tutorial on this topic?

In fact I already have a simple GTK application that uses WebKit
engine. I can run it both in Gnome and without it by using xinit. I
have a few questions about it:

- gtk_window_fullscreen() works fine with Gnome but with xinit it does
not expand the window. Does it mean that fullscreen is actually a DE
feature? What is the best way to make fullscreen app in XWindow? Right
now I use gdk_screen_get_width/height and then set default size.

- If I run webkit in XWindows it shows pages with horrible fonts. How
to make the browser fonts similar to what I see in my Gnome desktop?
Where to start reading about font handling in the modern Linux
graphical stack?

- It looks like Kodi player at RaspberryPi does not not use xinit at
all. It looks like RaspberryPi has a direct framebuffer feature. Is it
possible to do it with my webkit-centric application? I can't find any
details on this topic.

Did anybody make something similar? I would love to hear the
experience in making DE-less applications.
_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list


-- 
Göran Hasse
Raditex Control AB
http://www.rscada.se
OrgNr: 556611-8773
email: gorhas raditex nu
tel: 019-450105
mob: 070-5530148


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]