BBKEYSRC(5)

πŸ“¦ version 0.9.0, in fedora 43, fedora 44

πŸ’– BBKEYSRC(5) πŸ’–

okay bestie, sit down, hydrate, because today we're doing a full deep-dive on BBKEYSRC(5) β€” the manual page for the bbkeys configuration file β€” and honestly? it's giving "small file, big main character energy". no cap. πŸŽ€βœ¨


🌸 NAME 🌸

bbkeysrc β€” bbkeys configuration file 🫢


✨ SYNOPSIS ✨

$HOME/.bbkeysrc

πŸ’… DESCRIPTION πŸ’…

so here's the tea: bbkeys picks up its configuration settings from $HOME/.bbkeysrc, unless that gets overridden on the command line, in which case, well, it doesn't. and listen β€” there are several avenues open to you if you want to set up any key-grabs your heart desires:

🧚 Using bbconf:

this one is a Qt-based application and it lives at http://bbconf.sourceforge.net/. iconic. go look. ✨

πŸ¦‹ Manually editing $HOME/.bbkeysrc:

okay so the format here is very easy, like genuinely, and it follows the same format as blackbox's menu files. rules of the game, bestie:

  • it must begin with a [begin] tag. mandatory. no skipping.
  • it may contain a [config] tag, which holds a configuration section, and that section ends with a [end] tag.
  • in fact, all opening section tags must end with an [end] tag. every. single. one. πŸ’…
  • it should also contain a [keybindings] section.

and for more information? go read the man page for blackbox's menu. iykyk. 😌


πŸ‘‘ LIST OF CONFIG OPTIONS πŸ‘‘

  • stylefile β€” filename of blackbox style to use (string) πŸŽ€
  • honorModifiers β€” whether or not to break if NumLock or ScrollLock is pressed. (hint: for bbkeys to ignore your keybindings if NumLock or ScrollLock are pressed, set this to true) (true or false)
  • raiseWhileCycling β€” should bbkeys raise the windows you're cycling through while cycling through them? (true or false)
  • showCycleMenu β€” show the window-cycling menu, or cycle without it? (true or false)
  • cycleMenuTitle β€” show the given string as the title of the window-cycling menu. if an empty string is passed as the parameter to this config option ({}), then the title will not be drawn. (string value)
  • menuTextJustify β€” how should the window-cycling menu be justified? (left, center, right)
  • menuTitleJustify β€” how should the window-cycling title be justified? (left, center, right)
  • autoConfig β€” should bbkeys watch for changes to its config file? (true or false) Note: if you decide to not do this (though it should be VERY light on system resources), you can always force bbkeys to reconfigure itself by sending it a SIGHUP (killall -HUP bbkeys). ⚑
  • autoConfigCheckTimeout β€” how often should bbkeys check for changes made to its config file? (numeric number of seconds)
  • workspaceColumns β€” number of columns that you have your workspaces laid out in your pager (numeric)
  • workspaceRows β€” number of rows that you have your workspaces/desktops laid out in (numeric). as way of an example, if you have your pager laid out in a 4x2 grid (4 wide, 2 high), then you would set workspaceColumns to 4 and workspaceRows to 2.
  • cycleMenuX β€” horizontal position that you want the window cycling menu to show up at. (numeric)
  • cycleMenuY β€” vertical position that you want the window cycling menu to show up at. (numeric)
NOTE. the cycleMenuX and cycleMenuY config options allow you to place your window-cycling window exactly where you want to put it on screen. we at the Bbkeys Foundation For Better Software (TM) call this a feature, though some crazy nuts might call it a bug caused by the fact that blackbox's Menu class doesn't have anything in it to center it on-screen, etc. it also doesn't have any methods available to figure out how big the menu will be on-screen. this can be worked around by bbkeys, but I've not the time to do it now. patch anyone? or, you can just consider it a really neat feature that you can place the popup window-cycling window anywhere you want. =:D πŸ’œ

🌈 KEYBINDINGS 🌈

the format of this section is similar to the config section, and blackbox's menu structure. every single line is gonna look like this:

[command] (keys) {parameters}

πŸŽ€ Parameters:

not all directives need to have parameters provided, okay? and within the [keybindings] section, the only sub-group allowed (a group that will have an [end] tag) is the [chain] tag.

the chain tag is special β€” it lets the user give emacs-style keybindings, where a certain keystroke is given, released, and then another keystroke is given to complete the action. a good example would be the following:

[chain] (Control-Mod1-W)
  [sendToWorkspace] (1) {1}
  [sendToWorkspace] (2) {2}
  [sendToWorkspace] (3) {3}
  [sendToWorkspace] (4) {4}
[end]

note that both the beginning [chain] and the ending [end] tags must be provided. in this example, the chain is begun by the user pressing (and holding) the Control modifier, the Mod1 (Alt) modifier, and the "W" key on his keyboard. the user then releases these keys and bbkeys enters the chain. bbkeys will then wait for the user to press one of the keybindings from within that chain to execute the next action. in this case, if bbkeys sees either the 1, 2, 3 or 4 key pressed on the keyboard, it will execute the given action for that key. again, in this case, bbkeys will send the currently-focused window to the workspace specified in the {}-enclosed parameter (workspace 1, 2, 3, or 4 as the case may be here).

so, the parameters provided in a keybinding directive can be seen as additional information to provide to the "command". in some cases, it will be a number (what workspace to send a window to, how many pixels to move the window, how many pixels to resize a window, etc.). in other cases, it will be a string ("xterm -fn nexus", for example, as an argument to the Execute command). and for many directives, it is not needed at all.

πŸ’œ Keys:

the format for the keybindings uses 0 or more modifiers, separated with the - character, finally followed by the key name as known to X. the "left" key, for example, is known to X as Left. the "j" key is known as J. you get the idea. the modifiers are typically Shift, Control, and Mod1. an example would be Mod1-Control-K. this would be listed as the second element in a keybinding directive.

πŸ”₯ Commands:

the following commands are understood by bbkeys. bbkeys is not case-sensitive with regards to its commands, so the case may be mixed accidentally or on purpose. =:) 🌸

  • execute β€” executes a command. a string argument/parameter is expected for this directive that lists the command to be executed.
  • iconify
  • raise
  • lower
  • close
  • toggleShade
  • toggleOmnipresent β€” sets a window to be "sticky" β€” on all workspaces.
  • toggleDecorations β€” either strips a window of all decorations or causes it to be decorated regularly.
  • moveWindowUp β€” a numeric parameter may be provided which tells bbkeys how many pixels in the given direction to move the currently-selected window.
  • moveWindowDown β€” a numeric parameter may be provided which tells bbkeys how many pixels in the given direction to move the currently-selected window.
  • moveWindowLeft β€” a numeric parameter may be provided which tells bbkeys how many pixels in the given direction to move the currently-selected window.
  • moveWindowRight β€” a numeric parameter may be provided which tells bbkeys how many pixels in the given direction to move the currently-selected window.
  • resizeWindowWidth β€” a numeric parameter may be provided which tells bbkeys how many pixels in the given direction to resize the currently-selected window. this may be a positive or negative number, allowing bbkeys to grow or shrink the window.
  • resizeWindowHeight β€” a numeric parameter may be provided which tells bbkeys how many pixels in the given direction to resize the currently-selected window. this may be a positive or negative number, allowing bbkeys to grow or shrink the window.
  • toggleMaximizeFull
  • toggleMaximizeVertical
  • toggleMaximizeHorizontal
  • sendToWorkspace β€” a numeric parameter must be provided which tells bbkeys which workspace (1-based index) to send the current window to.
  • nextWindow β€” used for window cycling (alt-tabbing, most often). selects the next window according to the window stack.
  • prevWindow β€” used for window cycling (alt-tabbing, most often). selects the previous window according to the window stack.
  • nextWindowOnAllWorkspaces
  • prevWindowOnAllWorkspaces
  • nextWindowOnAllScreens
  • prevWindowOnAllScreens
  • nextWindowOfClass
  • prevWindowOfClass
  • nextWindowOfClassOnAllWorkspaces
  • prevWindowOfClassOnAllWorkspaces
  • changeWorkspace β€” a numeric parameter must be given to tell bbkeys which 1-based workspace to switch to.
  • nextWorkspace
  • prevWorkspace
  • upWorkspace
  • downWorkspace
  • leftWorkspace
  • rightWorkspace
  • nextScreen
  • prevScreen
  • chain β€” no parameter is needed for this directive.

and bestie… there's more. keep scrolling, we're not done here. 🫢

✨ EXAMPLE ✨

Okay bestie, here's the moment you've been waiting for: an actual config file, in the wild, living its best life. Behold πŸ‘‡

[begin] (bbkeys configuration file)

  [config]
    [option] (stylefile)
{~/local/blackbox-CVS/share/blackbox/styles/Cthulhain}
    [option] (honorModifiers) {false}
    [option] (raiseWhileCycling) {false}
    [option] (showCycleMenu)  {true}
    [option] (menuTextJustify) {right}
    [option] (autoConfig)   {true}
    [option] (autoConfigCheckTimeout) {2}
    [option] (workspaceColumns) {4}
    [option] (workspaceRows) {2}
    [option] (cycleMenuX) {20}
    [option] (cycleMenuY) {20}
  [end]

  [keybindings] (begin keybindings)
    [chain] (Control-Mod1-W)
      [sendToWorkspace] (1) {1}
      [sendToWorkspace] (2) {2}
      [sendToWorkspace] (3) {3}
      [sendToWorkspace] (4) {4}
      [sendToWorkspace] (5) {5}
      [sendToWorkspace] (6) {6}
      [sendToWorkspace] (7) {7}
      [sendToWorkspace] (8) {8}
    [end]
    [chain] (Mod1-Y)
      [execute] (1) {xmms}
      [execute] (2) {aumix -v +5}
      [execute] (3) {aumix -v -5}
    [end]
    [Lower]  (Mod1-Down)
    [Raise]  (Mod1-Up)
    [toggleShade]  (Mod1-F9)
    [Close]  (Mod1-F4)
    [Iconify]  (Mod1-m)
    [toggleMaximizeFull]  (Mod1-F12)
    [toggleMaximizeHorizontal]  (Mod1-F11)
    [toggleMaximizeVertical]  (Mod1-F10)
    [toggleOmnipresent]  (Mod1-Control-S)
    [resizeWindowWidth]  (Mod1-Control-Shift-Left) {-5}
    [resizeWindowWidth]  (Mod1-Control-Shift-Right) {5}
    [resizeWindowHeight]  (Mod1-Control-Shift-Up) {-5}
    [resizeWindowHeight]  (Mod1-Control-Shift-Down) {5}
    [moveWindowUp]  (Mod1-Control-Up) {1}
    [moveWindowDown]  (Mod1-Control-Down) {1}
    [moveWindowLeft]  (Mod1-Control-Left) {1}
    [moveWindowRight]  (Mod1-Control-Right) {1}
    [NextWindow]  (Mod1-Tab)
    [NextWindowOnAllWorkspaces]  (Mod1-Control-Tab)
    [PrevWindow]  (Mod1-Shift-Tab)
    [changeWorkspace]  (Mod1-1) {1}
    [changeWorkspace]  (Mod1-2) {2}
    [changeWorkspace]  (Mod1-3) {3}
    [changeWorkspace]  (Mod1-4) {4}
    [changeWorkspace]  (Mod1-5) {5}
    [changeWorkspace]  (Mod1-6) {6}
    [changeWorkspace]  (Mod1-7) {7}
    [changeWorkspace]  (Mod1-8) {8}

    [upWorkspace] (Mod1-Control-K)
    [downWorkspace] (Mod1-Control-J)
    [leftWorkspace] (Mod1-Control-H)
    [rightWorkspace] (Mod1-Control-L)

    [showRootMenu] (Mod1-Control-Escape)

    [Execute]  (Mod1-F5) {xrefresh}
    [Execute]  (Mod1-F1) {gnome-terminal}
    #[Execute]  (Mod4-E) {kfmclient openProfile filemanagement}
    #[Execute]  (F20) {kfmclient openProfile filemanagement}
    [Execute]  (Mod4-E) {nautilus /home/gideon}
    [Execute]  (F20) {nautilus /home/gideon}
  [end] (end keybindings) [end] (end bbkeys configuration)

A few things you're gonna notice and I need you to not panic about πŸ’–

  • The stylefile value {~/local/blackbox-CVS/share/blackbox/styles/Cthulhain} sits on its own line in this example, hanging out at the far left like it owns the place. That's just how it's written here, bestie. Copy the vibe, not necessarily the whitespace.
  • The two lines starting with # (#[Execute] (Mod4-E) {kfmclient openProfile filemanagement} and #[Execute] (F20) {kfmclient openProfile filemanagement}) are commented out, so those two kfmclient openProfile filemanagement bindings are just sitting there, unbothered, not doing anything.
  • Notice the doubled spaces in stuff like [option] (showCycleMenu) {true} and [Lower] (Mod1-Down) β€” yes, they're really there, and yes, I preserved them, because facts are facts. πŸ”₯
  • The [chain] blocks each get their own [end], and the whole thing closes with [end] (end keybindings) [end] (end bbkeys configuration) β€” nesting all the way down, we love a tidy structure. πŸŽ€

πŸ‘€ SEE ALSO πŸ‘€

Go read the whole family, no cap:


πŸ’œ AUTHOR πŸ’œ

Give it up for the icons who made this happen 🫢

  • Jason 'vanRijn' Kasper <vR@movingparts.net> β€” bbkeys
  • Jan Schaumann <jschauma@netmeister.org> β€” this man page

And that's a wrap, bestie! ✨ This little masterpiece is brought to you by vanRijn and is dated August 27, 2004, and it's the BBKEYSRC(5) page itself. Go forth and bind some keys. You got this. πŸ’…πŸŒˆ

πŸ“¦ where this page comes from