ch11ng / exwm

Emacs X Window Manager
2.85k stars 136 forks source link

Hide modeline for X windows? #636

Open anthrolisp opened 5 years ago

anthrolisp commented 5 years ago

Is it possible to show modeline only for emacs applications and not X windows? Many thanks in advance!

QiangF commented 5 years ago

Why not for all of them. You can try https://github.com/kiennq/emacs-mini-modeline with my settings: https://gist.github.com/QiangF/00a0e1d1625f7a005f5d6aaffd2931b9

QiangF commented 5 years ago

You can try set mode-line-format to nil in the exwm-mode-hook to hide the modeline.

emacksnotes commented 5 years ago

I use the following to hide modeline in firefox

(custom-set-variables
 '(exwm-manage-configurations
   '(((and
       (stringp exwm-class-name)
       (string-match-p "Firefox" exwm-class-name))
      floating-mode-line nil tiling-mode-line nil))))

The problem with taking the exwm-manage-configurations route is that I need to duplicate this setting for each and every X app I will be using. This duplication is necessary because of the way the matcher works on a first-hit basis.

According to exwm-manage-configurations

For each X window managed for the first time, matching criteria (sexps) are evaluated sequentially and the first configuration with a non-nil matching criterion would be applied.

Now, if only exwm combined the actions of all the hits (or steps through each of the matching actions), one could have something like

(custom-set-variables
 '(exwm-manage-configurations
   '((t
      floating-mode-line nil tiling-mode-line nil)
     ((and
       (stringp exwm-class-name)
       (string-match-p "Firefox" exwm-class-name))
      whatever whatever))))

Then, the actions on the first matcher would apply to any exwm mode buffer.

Again, if exwm were to act as I suggested abov,e it would obviate the need for an explicitly declaring a variable like exwm-input-simulation-keys, and instead let the simulation-keys-key of the catch-all t matcher in the exwm-manage-configurations take over its function. There are more such variables could be nuked (I think).

(cf. Actions in exwm-manage-configurations are plists. Org does org-combine-plists to make sure that per-buffer export settings take precedence over the global export settings)

(I could be bike-shedding here. I hope I am not perceived as spamming the issue tracker and be flamed for expressing my 2 cents)

emacksnotes commented 5 years ago

You can try set mode-line-format to nil in the exwm-mode-hook to hide the modeline.

I didn't think of this. I was taking the exwm-manage-configurations route so far. See my comment https://github.com/ch11ng/exwm/issues/636#issuecomment-525992390

emacksnotes commented 5 years ago

Is it possible to show modeline only for emacs applications and not X windows? Many thanks in advance!

I asked the same question a day or two before here https://github.com/ch11ng/exwm/issues/629.

emacksnotes commented 5 years ago

You can try set mode-line-format to nil in the exwm-mode-hook to hide the modeline.

I didn't think of this. I was taking the exwm-manage-configurations route so far. See my comment #636 (comment)

I suggest ...

Promote exwm-mode-hook from being a variable to a user-option. Use :options field of the variable's defcustom to suggest to the user that turninng off mode-line, menu-bar etc could be useful defaults.

ch11ng commented 5 years ago

Please refer to #629 for the solution.

[...] There are more such variables could be nuked (I think).

exwm-manage-configurations is supposed to be used occasionally while most applications share a same configuration. It's easier and clearer to configure each individual option than a plist buried deep inside exwm-manage-configurations. If you find yourself constantly modifying exwm-manage-configurations, perhaps it's time to try thinking the opposite way.

Promote exwm-mode-hook from being a variable to a user-option. Use :options field of the variable's defcustom to suggest to the user that turninng off mode-line, menu-bar etc could be useful defaults.

It's the major-mode hook automatically generated for exwm-mode. Often the time it's too early to do anything here as most stuffs are not ready. It's recommended to use exwm-manage-finish-hook instead.

emacksnotes commented 5 years ago

Promote exwm-mode-hook from being a variable to a user-option. Use :options field of the variable's defcustom to suggest to the user that turninng off mode-line, menu-bar etc could be useful defaults.

It's the major-mode hook automatically generated for exwm-mode. Often the time it's too early to do anything here as most stuffs are not ready. It's recommended to use exwm-manage-finish-hook instead.

Please modify the defcustom of exwm-manage-finish-hook, and add an :options property that shows the most common stuff like disabling of mode line, menu bar etc.

ch11ng commented 5 years ago

Please modify the defcustom of exwm-manage-finish-hook, and add an :options property that shows the most common stuff like disabling of mode line, menu bar etc.

(Continuation of https://github.com/ch11ng/exwm/issues/644#issuecomment-529171917) Perhaps we can simplify these settings even further with such contrib package? Perhaps a GNOME control center-like fronted hiding the underlying Customize options, so users can focus on the functionalities rather than dealing with modules/hooks.