0

Is there a way to override system/user keybindings for Lubuntu 16.04 when a particular application opens?

I have created an entry in ~/.config/openbox/lubuntu-rc.xml to force the specific application to open in fullscreen by default. The thing is, I do not want my users to have access to anything else while using said application. It is a google-chrome app for testing k-12 students' progress. Various keybindings allow the students to break the validity of the test by Alt+Tab to a browser to look up the answer, or opening the run command to bring up Galculator to find the answer, etc.

I can disable keybindings altogether for that user account. This is not my preferred method as some of those keybindings are useful for average use, just not while this test is being proctored.

Anybody out there have any suggestions as to maybe further editing the particular entry to use a custom keybinding list? Or maybe disallow all keybindings with the exception of Ctrl+Q to quit the program?

0

I have an answer, although still not quite what I was looking for. To keep kids from roaming away from their test when it is open, I have appended the entry in ~/.config/openbox/lubuntu-rc.xml

Again, not the answer I was looking for, but it works for now. If anyone else is looking for this kind of function, I have written out an example below.

Example:

 <applications>
    <application class="class-name" name="name-of-app" title="app-title" 
     type="app-type" role="app-role">
       <fullscreen>yes</fullscreen>
       <layer>above</above>
    </application>
 </applications>

What this does is to open the application in fullscreen every time it opens and layers it above all other windows. At least in the testing that I have done so far. The problem is that the keybindings do still work and other windows can be opened behind (or below rather) the desired application. The application itself does stay on top, even when Alt+Tab is invoked to switch the window.

This work around was inspired by a post on an Arch Linux blog discussing customization to openbox. (https://bbs.archlinux.org/viewtopic.php?id=93126)

I am still looking for a way to create a keybinding profile based on what applications are open.

  • Just found a break in this method... If you happen to have other windows open, attempt to focus to them (Alt+Tab), then fullscreen them (F11), they move to the front over the app that I am trying to keep above all others... Still looking for a way to make a profile for keybindings based on application. – timmoseus Jun 20 '17 at 21:57
0

I think you actually need a different, more simple windows manager or even no window manager at all. I'm not even sure if LXDE allows overriding its own keyboard shortcuts. Alternatively you can look for a "kiosk mode" that jails the user to a specific application that they can't quit (or that is immediately restarted upon termination).

My idea is that you start the "jailed" environment with the required application during evaluations and use a regular window manager otherwise. Disabling shortcuts is a terrible idea because it's so easy to circumvent if you forget but one or if a user manages to close or minimise an application window with a glitch.

There's no need to run complex command sequences during each session type switch because all this could be set up as just another session type to choose during log-in (like the choice between different desktop environments). Switching the session type would be as easy as logging out, selecting a different session type, and logging back in. This should work with guest sessions too. (I have not tried any of this but according to my experience with the configuration of different desktop sessions this should be possible.)

See for instance:

  • The problem with those ideas is that the build has a lot of different programs on it. We are not limiting the end user to just a browser, or a single program. I have added many including, but not limited to: scratch, MAP testing, Pearson testnav, etc. Any suggestions for an alternative window manger that allows keybinding profiles based on application? Thanks for the ideas though. Particularly the library internet kiosk one. That gave me even more ideas for other projects. – timmoseus Jun 20 '17 at 19:47
  • That is not a bad idea, I just worry about non-Linux savvy proctors trying to figure out how to switch between the "student" restricted user account (customized Guest login) with all of the other programs and another "testing" account that is jailed into just the one program. I will read up more on your suggestions to see if I can find a somewhat "idiot-proof" method to alleviate everyone's concerns. A colleague of mine suggested using autokey. I've been reading up on that this morning. – timmoseus Jun 21 '17 at 16:40
  • I had not thought about that. I am closing up shop for the day and going to my other job, full time father. I will try this in the morning. Thank you. – timmoseus Jun 21 '17 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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