Open Applications in Fullscreen on Ubuntu
One of my pet peeves with Ubuntu Linux is that several of the applications I'm using are not opened in fullscreen, even if I maximized them in the previous session. Not sure if that's a bug or a feature, but it is not the behavior I want.
There are different approaches to ensure applications open in fullscreen mode. Some have a corresponding setting, others have a command-line flag, and some applications offer neither of these options.
For applications that have a command-line flag, you can modify the corresponding .desktop
file to open them in fullscreen.
Using Desktop Files
Desktop files (.desktop
files) are configuration files that define how applications appear in your system's menu and how they behave when launched. Located typically in /usr/share/applications/
, these files can be customized on a per-user basis by creating copies in ~/.local/share/applications/
.
Let's walk through the process using Evince as an example:
1. Check the online help to see whether there is an option:
evince --help
...
-f, --fullscreen Run evince in fullscreen mode
...
2. Create a local copy of the Evince desktop file:
mkdir -p ~/.local/share/applications
cp /usr/share/applications/org.gnome.Evince.desktop ~/.local/share/applications/
3. Edit the local copy and modify the Exec=
line to include the --fullscreen
option:
vim ~/.local/share/applications/org.gnome.Evince.desktop
...
Exec=evince --fullscreen %U
...
4. Update the desktop database:
update-desktop-database ~/.local/share/applications
Now, Evince will launch in fullscreen mode by default when you open a PDF or other supported documents.
Limitations
While this method works fine for Evince, it's not a universal solution. Some applications require different approaches:
Visual Studio Code
For VS Code, the desktop file modification approach doesn't work. Instead, you'll need to adjust the application's settings:
- Open VS Code
- Go to Settings (Ctrl+,)
- Search for
window.titleBarStyle
- Set the value to
custom
This setting ensures that VS Code windows open maximized across all new windows.
KeePassX
Similarly, KeePassX lacks a command-line option to start in fullscreen and has no corresponding setting that I'm aware of either. For these cases, I use the keyboard shortcut Super (Windows or Command key) + Up Arrow
or double-click the title bar to manually maximize the window.
Best Practices
- Always create a local copy of the desktop file before modifying.
- Preserve the original file's structure, the local file must be a complete, standalone desktop file.
- Run the
update-desktop-database
command to ensure changes take effect. - Remember that not all applications support fullscreen launch via desktop files.
Conclusion
Modifying desktop files offers a flexible way to customize application launch behaviors. While not a one-size-fits-all solution, it provides a powerful technique for personalizing your Linux desktop experience.
Next time you find an application launching in a less-than-ideal window size, remember: a simple desktop file modification might be the solution you're looking for!
This post was written by Ramiro Gómez (@yaph) and published on . Subscribe to the Geeksta RSS feed to be informed about new posts.
Tags: howto linux sysadmin ubuntu
Disclosure: External links on this website may contain affiliate IDs, which means that I earn a commission if you make a purchase using these links. This allows me to offer hopefully valuable content for free while keeping this website sustainable. For more information, please see the disclosure section on the about page.
Share post: Facebook LinkedIn Reddit Twitter