doc: Finish legacy action migration table

This commit is contained in:
patrick96 2020-10-23 01:19:42 +02:00 committed by Patrick Ziegler
parent 1d9365e74f
commit d45ae7954a
3 changed files with 107 additions and 37 deletions

0
doc/_static/.gitignore vendored Normal file
View File

View File

@ -10,7 +10,7 @@ Welcome to the official polybar documentation.
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
:caption: Contents: :caption: Content:
user/actions user/actions

View File

@ -8,6 +8,11 @@ For example, when you click on your volume module (pulseaudio or alsa), polybar
internally sends an action to that module that tells it to mute/unmute the internally sends an action to that module that tells it to mute/unmute the
audio. audio.
These actions are not only used internally, but users can also send these
actions to polybar through `Inter Process Communication
<https://github.com/polybar/polybar/wiki/Inter-process-messaging>`_ (IPC) to
trigger certain behavior in polybar modules.
Action String Format Action String Format
-------------------- --------------------
@ -89,9 +94,9 @@ just as we would regular commands:
%{A1:firefox:}%{A3:#mydate.toggle:}Opens firefox on left-click and toggles the %{A1:firefox:}%{A3:#mydate.toggle:}Opens firefox on left-click and toggles the
date on right-click %{A}%{A} date on right-click %{A}%{A}
Finally, polybar's Finally, polybar's `Inter Process Communication
`Inter Process Messaging <https://github.com/polybar/polybar/wiki/Inter-process-messaging>`_ <https://github.com/polybar/polybar/wiki/Inter-process-messaging>`_ (IPC) can
(IPC) can also be used to trigger actions: also be used to trigger actions:
.. code-block:: bash .. code-block:: bash
@ -99,52 +104,117 @@ Finally, polybar's
.. note:: .. note::
The quotes around the action string are necessary, otherwise your shell will The quotes around the action string are necessary, otherwise your shell may
interpret the ``#`` as the beginning of the comment and ignore the rest of the interpret the ``#`` as the beginning of the comment and ignore the rest of the
line. line.
Supported Actions Supported Actions
----------------- -----------------
.. TODO
Legacy Action Names Legacy Action Names
------------------- -------------------
Before actions included the name of the module it should be sent to, action In earlier versions (< 3.5.0) action strings only included information about the
strings only included information about the module type. module type.
This meant for bars that contained multiple different modules of the same type, This meant in bars that contained multiple different modules of the same type,
actions for these modules were sometimes processed by the wrong module with the actions for these modules were sometimes processed by the wrong module with the
same type. same type.
Since version 3.5.0, this no longer happens. However, this also means we had to
change what actions are recognized by polybar modules.
If you explicitly use any polybar action names in your config or any of your
scripts, you are advised to change them, as they may stop working at some point.
For now polybar still supports the old action names, will convert them to the
appropriate new action name, and will print a warning to help you find old
action names in your config.
If you use the `menu module
<https://github.com/polybar/polybar/wiki/Module:-menu>`_, you most likely use
old action names to open and close the menu (for example ``menu-open-1`` or
``menu-close``).
The ``i3wm-wsnext``, ``i3wm-wsprev``, ``bspwm-desknext``, and ``bspwm-deskprev``
actions, to switch workspaces in i3 and bspwm, may also appear in your config.
Migration to New Action Strings Migration to New Action Strings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|Module Type |Legacy Action Name |New Action Name| |Module Type |Legacy Action Name |New Action Name|
+=========================+==================+===============+ +=========================+=======================+===============+
|``internal/date`` |``datetoggle`` |``toggle`` | |``internal/date`` |``datetoggle`` |``toggle`` |
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|``internal/alsa`` |``volup`` |``inc`` | |``internal/alsa`` |``volup`` |``inc`` |
| +------------------+---------------+ | +-----------------------+---------------+
| |``voldown`` |``dec`` | | |``voldown`` |``dec`` |
| +------------------+---------------+ | +-----------------------+---------------+
| |``volmute`` |``toggle`` | | |``volmute`` |``toggle`` |
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|``internal/pulseaudio`` | | | |``internal/pulseaudio`` |``pa_volup`` |``inc`` |
+-------------------------+------------------+---------------+ | +-----------------------+---------------+
|``internal/xbacklight`` | | | | |``pa_voldown`` |``dec`` |
+-------------------------+------------------+---------------+ | +-----------------------+---------------+
|``internal/backlight`` | | | | |``pa_volmute`` |``toggle`` |
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|``internal/xkeyboard`` | | | |``internal/xbacklight`` |``xbacklight+`` |``inc`` |
+-------------------------+------------------+---------------+ | +-----------------------+---------------+
|``internal/mpd`` | | | | |``xbacklight-`` |``dec`` |
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|``internal/xworkspaces`` | | | |``internal/backlight`` |``backlight+`` |``inc`` |
+-------------------------+------------------+---------------+ | +-----------------------+---------------+
|``internal/bspwm`` | | | | |``backlight-`` |``dec`` |
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|``internal/i3`` | | | |``internal/xkeyboard`` |``xkeyboard/switch`` |``switch`` |
+-------------------------+------------------+---------------+ +-------------------------+-----------------------+---------------+
|``custom/menu`` | | | |``internal/mpd`` |``mpdplay`` |``play`` |
+-------------------------+------------------+---------------+ | +-----------------------+---------------+
| |``mpdpause`` |``pause`` |
| +-----------------------+---------------+
| |``mpdstop`` |``stop`` |
| +-----------------------+---------------+
| |``mpdprev`` |``prev`` |
| +-----------------------+---------------+
| |``mpdnext`` |``next`` |
| +-----------------------+---------------+
| |``mpdrepeat`` |``repeat`` |
| +-----------------------+---------------+
| |``mpdsingle`` |``single`` |
| +-----------------------+---------------+
| |``mpdrandom`` |``random`` |
| +-----------------------+---------------+
| |``mpdconsume`` |``consume`` |
| +-----------------------+---------------+
| |``mpdseekN`` |``seek.N`` |
+-------------------------+-----------------------+---------------+
|``internal/xworkspaces`` |``xworkspaces-focus=N``|``focus.N`` |
| +-----------------------+---------------+
| |``xworkspaces-next`` |``next`` |
| +-----------------------+---------------+
| |``xworkspaces-prev`` |``prev`` |
+-------------------------+-----------------------+---------------+
|``internal/bspwm`` |``bspwm-deskfocusN`` |``focus.N`` |
| +-----------------------+---------------+
| |``bspwm-desknext`` |``next`` |
| +-----------------------+---------------+
| |``bspwm-deskprev`` |``prev`` |
+-------------------------+-----------------------+---------------+
|``internal/i3`` |``i3wm-wsfocus-N`` |``focus.N`` |
| +-----------------------+---------------+
| |``i3-wsnext`` |``next`` |
| +-----------------------+---------------+
| |``i3-wsprev`` |``prev`` |
+-------------------------+-----------------------+---------------+
|``custom/menu`` |``menu-open-N`` |``open.N`` |
| +-----------------------+---------------+
| |``menu-close`` |``close`` |
+-------------------------+-----------------------+---------------+
.. note::
Some legacy action names are suffixed with ``N``, this means that action has
some additional data (represented by that ``N``), in the new action names,
this data will appear in exactly the same way, after a period.
.. TODO show how to migrate