Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to create a custom session by creating a custom.desktop file in /usr/share/xesessions folder. Remember this is not a gnome or some other session. I have created my own application for this session, which are simple.

Case 1

Chrome Browser

Contents of custom.desktop file

[Desktop Entry]
Name=Internet Kiosk
Comment=This is an internet kiosk
Exec=google-chrome --kiosk
TryExec=
Icon=
Type=Application

Issue

Chrome browser starts in kiosk mode but does not capture complete screen area. Some area is left at the bottom and right side of the screen.


Case 2

Custom pyGTK app (Quickly)

Contents of custom.desktop file

[Desktop Entry]
Name=Custom Kiosk
Comment=This is a custom kiosk
Exec=~/MyCustomPyGTKApp
TryExec=
Icon=
Type=Application

Issue

My custom pyGTK app has window.fullScreen() in the code. That means it should open in full screen without the window chrome (and it does under the normal session). But that too, leaves lots of space around it.

Need Help

Can anyone tell me whats going on here. I think its some issue with borders as pointed out at http://www.instructables.com/id/Setting-Up-Ubuntu-as-a-Kiosk-Web-Appliance/?ALLSTEPS in Step 8

If by chance, Google Chromium is not stretched to the edges with the --kiosk switch enabled there is a simple fix. To stretch Chromium simply log in as your regular user and edit chromeKiosk.sh to not have the --kiosk switch. Then log in as the restricted user, click the wrench and choose options. Then on the Personal Stuff tab select Hide system title bar and use compact borders. Close the options screen and stretch Chromium to fit the monitor. Then go back into the options window and set it to Use system title bar and borders. After this is done, log out of your restricted user (might need to just reboot) and log into your regular user. Edit chromeKiosk.sh back to include the --kiosk switch again and Chromium should be full screen next time you log into the restricted user.

If I were to use a custom pyGTK or a gtkmm app, how should I get around this issue. window.fullScreen() should occupy the complete screen area. This has to be done programmatically or in some other way that can scale. I have to deploy this on large number of machines located at different geographical areas. Doing it manually on every machine is not possible.

share|improve this question

3 Answers 3

Case 1 in my case this helped me out:

sudo nano sudo ~/.config/chrium/Default/Preferences

I changed the values according my screen resolution

"window_placement": { "bottom": 1024, "left": 0, "maximized": true, "right": 1280, "top": 0, "work_area_bottom": 1024, "work_area_left": 0, "work_area_right": 1280, "work_area_top": 0 }

share|improve this answer
    
I cannot change it manually. –  Juzer Ali Jan 29 '13 at 19:22

case1

You need to tell chromium what your screen resolution is by rewriting its preferences file (bottom and right values). The link you posted includes that part.

#!/bin/bash

prefs=~/.config/chromium/Default/Preferences

cat $prefs |\
perl -pe "s/\"bottom.*/\"bottom\": $(xrandr | grep \* | cut -d' ' -f4 | cut -d'x' -f2),/" \
> $prefs

cat $prefs |\
perl -pe "s/\"right.*/\"right\": $(xrandr | grep \* | cut -d' ' -f4 | cut -d'x' -f1),/" \
> $prefs

chromium-browser

(tested in Ubuntu 12.04)

case2

I would say you have to somehow tell your pyGTK app what the bottom and right values are, respectively what the screen resolution is. Then the fullscreen command should make your app cover all of the screen i.e. not leave any borders.

Edit: it looks like the window.fullscreen() method should in general make it really fullscreen. So no need to define the resolution first. More info here, but I'm sure you already know this: http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--fullscreen

share|improve this answer
    
+1 A very clever idea! –  hexafraction Sep 29 '12 at 0:25

This is a tricky one, I had a similar problem, when trying to have only a ncurses based interface on a time tracker pc, the problem for me was that when no window manager is present, normal X Window applications behave oddly. Here's my proposal:

  1. Install ratpoison window manager
    sudo apt-get install ratpoison
    
  2. Unbind keyboards that shows a menu or allows you to execute terminals or commands, putting this in $HOME/.ratpoisonrc the home being the user that will run the kiosk mode
    unbind c
    unbind C-c
    unbind exclam
    unbind C-exclam
    unbind period
    
  3. Instead of calling directly to google-chrome, put a script like instructables' link you mentioned
[Desktop Entry]
Encoding=UTF-8
Name=Kiosk Mode
Comment=Chromium Kiosk Mode
Exec=/usr/share/xsessions/chromeKiosk.sh
Type=Application
  1. On the script put this (remember to make it executable)
#!/bin/bash
ratpoison &
xscreensaver -nosplash &
while true; do chromium-browser --kiosk http://google.com; sleep 5s; done

Worked for me, with Ubuntu 12.04 and chromium.

share|improve this answer
    
You also have a very good idea. +1 –  hexafraction Sep 29 '12 at 0:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.