Thursday, July 6, 2017

14.04 - "unexitable" GUI program



Is it possible to create a GUI application, where user can interact with it, but cannot switch to any other program (terminal, desktop, etc). Example of such applications would be something running on a public kiosk, where you will like the user to be able to use your application, but not mess around with the computer in any other way.



If this is not entirely possible, how much "harder" it can be made for the user to switch the application, and cause any potential damage to the system ?




PS: I am ok with running the program under a separate user account, chroot, etc if need be.



You could start the X server without a window manager (or a specially configured lightweight one) running nothing but your application. This example will use xterm, replace it with your application.



To do this, create the file ~/.xinitrc and add something like this:



exec xterm



Now log in via TTY and enter the following comamnd:



startx


This should launch an X server with only xterm running.



You can also disable switching to TTY by adding the following to your xorg.conf:



Section "ServerFlags"

Option "DontVTSwitch" "true"
EndSection


Playing along these lines will land you where you want to be.






If you need a window manager, OpenBox might be a good choice since it is extremely configurable (you can remove all standard keyboard shortcuts, such as ALT+F4, etc.)




To use OpenBox, install it with sudo apt-get install openbox and put exec openbox-session in your ~/.xinitrc, then add your application to ~/.config/openbox/autostart.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...