4

This is an Awesome WM question and not a tmux question. I have the awful.hotkeys_popup in use in my configuration, however, for as long as I've used it it has always shown hotkeys and hotkey groups for tmux (i.e. tmux:session, tmux:panes). The issue is that I have never installed tmux on my system; I don't use it and don't plan to. I've always ignored these entries in the dialog, but I want to finally fix this.

I've read online in the docs that there is a rule for tmux sessions that "If no rules are provided then tmux hotkeys will be shown always!". Is this why tmux shows up all the time?

I'd like to know how to remove the tmux hotkeys from the hotkey_popup widget. Unfortunately, I don't really understand how to do this from reading the docs. If someone could explain to me how to do this I would be very grateful.

3 Answers3

3

I'm not quite sure what the proper way to get rid of that would be, but the improper way would be mkdir -p ~/.config/awesome/awful/hotkeys_popup/keys && touch ~/.config/awesome/awful/hotkeys_popup/keys/tmux.lua. Just replace the awful.hotkeys_popup.keys.tmux module with an empty file that does nothing.

Also, you could add awful.hotkeys_popup.keys.tmux.add_rules_for_terminal({ rule = { name = "no window ever has a name like this }}). That's equally hacky, I guess.

Uli Schlachter
  • 9,337
  • 1
  • 23
  • 39
  • Sorry for the extremely late response, but adding the empty tmux.lua file did the trick :) I am a happy camper. Thank you! – sunflower_fields_forever Dec 04 '20 at 01:33
  • 4
    And now I have come up with a new hack: Add `package.loaded["awful.hotkeys_popup.keys.tmux"] = {}` to the beginning of your `rc.lua`. That has basically the same effect as the empty file, but might be a bit clearer since it is in `rc.lua` and not somewhere else. – Uli Schlachter Dec 05 '20 at 06:08
  • Thanks! I do like that a bit more. Now I'm wondering how to make custom hotkeys_popup lua files for specific applications so I can pull up a list of app keybinds that I often forget. – sunflower_fields_forever Dec 08 '20 at 00:27
  • 1
    Sounds like a new SO question. ;-) Answer is: Just look at what the existing files do: https://github.com/awesomeWM/awesome/tree/master/lib/awful/hotkeys_popup/keys Looks like that magic is `awful.hotkeys_popup.widget.add_hotkeys()` with the right argument. – Uli Schlachter Dec 08 '20 at 14:45
2

The more proper way to do this is to comment out the following from your rc.lua

-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")

Its close to the top of the file

chibi-dev
  • 21
  • 1
0

A little late but the one of the answers above is correct but 'ugly' and the other answers a different question and could cause confusion, as it gets rid of all program-specific helpers.

The correct way is to do $ mkdir -p ~/.config/awesome/awful/hotkeys_popup/keys/ && cp /usr/share/awesome/lib/awful/hotkeys_popup/keys/init.lua -d ~/.config/awesome/awful/hotkeys_popup/keys/.

After that you can edit the ~/.config/awesome/awful/hotkeys_popup/keys/init.lua file and remove the line that calls tmux.lua .

That way you have also created a ~/.config/awesome/awful/hotkeys_popup/keys folder where you can place different key binding helpers if you wish. You can use one of the existing .lua files as a template.

I have tested all of the above if you are wondering and it works as expected.

One further note: If you make a mistake in one of the files in your ~/.config/awesome/awful/ folder you will completely crash awesome (not like when you make a mistake in your rc.lua or theme.lua. You will possibly get a black screen.) If that happens don't panic, just Ctl+Alt+F3 and either open the last file you edited and fix the error or move you whole awful folder to a different location and reboot and fix it when you log back in normally, before moving it back to ~/.config/awesome.