Starting certain applications fullscreen in Xfce

6,117

Solution 1

Use gdevilspie to match it, that actually works cross DEs

enter image description here

Solution 2

Emacs does understand X resources, so this is a working solution for X in general, not only in Xfce. (This is however not true for any program; for example, xfce4-terminal cannot be controlled this way.) The X resources can be viewed by xrdb -query.

To achieve what you want, I have put into /etc/X11/Xresources-site (/etc/X11/Xresources is also OK, though can be overwritten by your distro):

Emacs.fullscreen: maximized

This would affect also remote X clients which are Emacs (e.g., emacs started on a remote host via ssh).

/etc/X11/Xresources-site and /etc/X11/Xresources (and probably ~/.Xresources and ~/.Xdefaults) are usually read at the start of your X session; to affect your current X resources immediately, run something like xrdb -merge /etc/X11/Xresources-site.

Actually, in my case, /etc/X11/Xresources-site is being read thanks to a line in /etc/X11/Xresources (which is read by the start scripts):

#include "/etc/X11/Xresources-site"

so /etc/X11/Xresources is read for sure.

There are also some files with the same syntax which are read each time an X program like emacs starts. In my case, they are: ~/.Xdefaults-MY_HOST_NAME, /etc/X11/app-defaults/Emacs (only for emacs-athena, not for emacs-gtk3), /usr/share/X11/app-defaults/Emacs etc. (But I like the idea of loaded X resources more -- shown with xrdb -query; so that remote X clients read the same X resources.)

Other X resources which Emacs understands are described at https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html#Table-of-Resources.

Share:
6,117

Related videos on Youtube

Mirzhan Irkegulov
Author by

Mirzhan Irkegulov

I am a PhD student in University of Leicester, UK. My interests are functional programming, category theory, and game theory. All my contributions on the StackExchange network are placed under public domain to the extent possible by law. If you see my question or answer, and it's not good enough, for any reason, don't hesitate to leave a comment under it. I'll do my best to improve it. My goal is to leave answers that are very readable and require least background knowledge.

Updated on September 18, 2022

Comments

  • Mirzhan Irkegulov
    Mirzhan Irkegulov almost 2 years

    Is it possible to make Xfce window manager to open certain applications fullscreen by default? For example i want Emacs in Xfce to be always run fullscreen on start. I know how to execute specifically Emacs fullscreen, so i want an Xfce solution.

    I tried searching through Xfce wiki, Xfce page on Arch wiki and Unix.SE with AskUbuntu, no solution yet.

  • Mirzhan Irkegulov
    Mirzhan Irkegulov over 11 years
    Your solution is helpful, but if i want to specify this from Xfce side, not from application side? I edited my question in accordance.
  • goldilocks
    goldilocks over 11 years
    @sindikat: From what I know of window managers, Xlib (I've done some programming in this area), and their relationship to applications, the window manager can't fullscreen something except by A) Using means supplied by the application, ie, --fullscreen, B) Doing something with the window geometry, however, that will not be the same as fullscreen mode (it will be window that fills the screen INCLUDING border and window). I'm very confused as to why you do not just want to do this in the normal way, actually; I think you are looking for a sort of illogical phantasm ;)
  • goldilocks
    goldilocks over 11 years
    Basically: it is the application that provides fullscreen mode, not the wm. Notice that not all applications have such a mode. The wm can maximize a window, but it is not intended, eg, for you to say "start emacs in whatever mode, load some files, run this emacs script, etc" except in so far as the application provides invocation mechanisms to do this eg, "emacs --fullscreen --load=/some/file --run=/some/script".
  • Mirzhan Irkegulov
    Mirzhan Irkegulov over 11 years
    can you incorporate that in the answer please?
  • goldilocks
    goldilocks over 11 years
    sindikat: I think you are confused and it is impossible for me to discern what exactly it is you don't understand (and what you want me to add). Basically my point was: the original answer IS the answer, there aren't any others. You use Xfce (or some other software, such as warl0ck suggests) to add the --fullscreen switch to emacs. That's it. That's all. There is no other way. Your distinction between "the Xfce side" and "the application side" is non-sensical. Besides editing an xfce menu entry as suggested, what exactly would count as "the xfce side"?
  • goldilocks
    goldilocks over 11 years
    I'll try and put it as simply as possible: It is NOT the DE or the window manager which enables a fullscreen mode. Fullscreen mode is built into the application. Therefore, you have to tell the application you want to use it. Make sense? The point of editing the menu is to make invocations of emacs --fullscreen by default. Try "emacs --fullscreen" from the command line and maybe you will get it.
  • Mirzhan Irkegulov
    Mirzhan Irkegulov over 11 years
    i understand that, i meant you can include all this into the answer, instead of writing in the comments :)