1

I use org-mode with org-pomodoro.

Status bar at the bottom get's pretty long. Like:

-:**- leo.org   Top L50 (org Ind Helm drag Abbrev) [6:08 (bug 459487 - [Gtk] Replace deprecated ......)] [Pomodoro-19:42] 

and it's only fully visable if there is only a single window(/frame).

Is it possible to display the status bar in the title bar of emacs instead? (I am using the GUI version of emacs.)

Or alt. Can I shorten it somehow myself via hacks? E.g only show the first xyz chars, and only show the last xyz chars and trim out the middle if it doesn't all fit?

Leo Ufimtsev
  • 4,488
  • 3
  • 22
  • 45
  • check out diminish, better yet, write your own mode line format to get rid of unnecessary information. – Jordon Biondo Feb 12 '15 at 20:37
  • The 'status-bar' is called `mode-line` in emacs jargon. You can search for that term in this stackexchange. Here's a question that [asks how to control what minor modes show in the mode line](http://emacs.stackexchange.com/q/3925/115). To learn more about mode-line: [EmacsWiki](http://www.emacswiki.org/emacs/ModeLine), [Emacs manual](https://www.gnu.org/software/emacs/manual/html_node/emacs/Mode-Line.html) – Kaushal Modi Feb 12 '15 at 20:41

2 Answers2

7

You can set frame-title-format to control the template used for frame titles.

If you really want the frame title to match the mode-line, try this:

(setq frame-title-format mode-line-format)

This approach differs from using set-frame-parameter in a couple ways:

  • The title format is used to set the title on all frames, rather than on a single frame.
  • The title format gets re-evaluated automatically. If you set the title parameter directly you will need some way to update it manually when something changes.

Since your specific example is about org-pomodoro, you could consider adding the current pomodoro timer to the frame title rather than copying the whole mode line up there. For example:

(setq frame-title-format '("" invocation-name "@" system-name " " org-pomodoro-mode-line))

With this approach you should not need any timers or anything else.

glucas
  • 20,175
  • 1
  • 51
  • 83
  • I would need to hack into org-pomodoro to do that. What if the file get's updated, wouldn't I have to add the code back in again? I did ask the author to add a hook for this function thou. – Leo Ufimtsev Feb 12 '15 at 21:40
  • I was suggesting you use advice. If you aren't familiar with this approach, try `M-x describe-function advice-add`. This would not require changes when org-pomodoro is updated, unless the authoer removed that `org-pomodoro-update-mode-line` function altogether. – glucas Feb 12 '15 at 21:45
  • The frame title is automatically updated regularly from the `frame-title-format`. If you use this approach I don't think you need to worry about advice or explicitly updating the title at all. Just set the format to include the info you want. See http://www.gnu.org/software/emacs/manual/html_node/elisp/Frame-Titles.html#Frame-Titles for more. – glucas Feb 12 '15 at 21:54
3

It's certainly possible to get the mode line into the frame's title.

(set-frame-parameter
        nil 'title (format-mode-line mode-line-format))

You'll have to figure out when and how to update it.

politza
  • 3,316
  • 14
  • 16