Disclaimer: This is not exactly what you want, but I've spent too much time on this not to post it and maybe someone else can use it.
I got as far as Ctrl + F11 is fullscreen everywhere but Chromium where it is Chromium's fullscreen !
- Train of thought
I thought I might be able to trick the window manager if I use xdotool
and send the command directly to the chrome window - to no avail.
Then I thought I might be able to change the keyboard shortcut in google chrome, but that seems hardcoded - another dead end.
- Which leaves us with this
Install xdotool
to simulate keyboard presses
sudo apt-get install xdotool
reconfigure the Ubuntu Keyboard shortcuts to something arbitrary, that we never type but is usable in the script
Settings -> Devices -> Keyboard
Scroll down and edit Toggle fullscreen mode to Ctrl + Alt + 1
and then hit the +
and add a custom keyboard shortcut
and then hit the +
and add a custom keyboard shortcut
edit the script
nano /home/user/fullscreen.sh
#!/bin/bash
export DISPLAY=:0
windowname=$(xdotool getactivewindow getwindowname | cut -d "-" -f 2)
if [[ $windowname != *"Chromium"* ]]
then
xdotool keydown Ctrl keydown Alt key 1 keyup Alt keyup Ctrl
else
xdotool search --onlyvisible --class "Chromium" windowfocus
sleep 0.2
xdotool key F11
fi
make it executeable
chmod +x /home/user/fullscreen.sh
- Conclusion
It seems impossible to trick the windowmanager and smuggle keystroke by, but there are certainly workarounds possible. In this case Google made the fullscreen keyboard shortcut non-configureable, so it falls just short of the mark
Now with Ctrl + F11 the windowmanager controls the fullscreen behavior except in chromium.
Best Answer
ianorlin's answer is on-point, but I had a lot of trouble understanding what they were saying. Not feeling comfortable with Edit-by-Rewrite, I am posting my own answer.
The problem is that Openbox, the Lubuntu window manager, sees you press F11 before Chrome does. Openbox then performs its own fullscreen process and never informs Chrome about it.
The fix, then, is to either change Openbox's fullscreen key or to change Chrome's (to something Openbox isn't using).
The file
~/.config/openbox/lubuntu-rc.xml
contains Openbox's keyboard configuration information. You may wish to make a back-up of it prior to changing things since you don't want to mess it up.Look for the stanza that says:
It may be inline with the rest of the file, like so:
But you can break it out onto its own lines to make it more visible.
Once you've made the changes described below use
to activate/test them.
Now, change the stanza mentioned above to read:
This will make the Windows/Super key into a modifier, so you press Windows+F11. I like this one because (probably) nothing is going to be using that key combo, whereas Shift+F11 and F11 are both used at the application level.
If you did want Shift+F11 to be your fullscreen key, you'd use:
More information about what actions you can perform using this config file is available here.