labwc/docs/labnag.1.scd

144 lines
3.4 KiB
Text
Raw Permalink Normal View History

Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
labnag(1)
# NAME
labnag - Show dialog with message and buttons
# SYNOPSIS
_labnag_ [options...]
# OPTIONS
*-B, --button* <text> [<action>]
Create a button with the text _text_ that optionally executes _action_
when pressed. Multiple buttons can be defined by providing the flag
multiple times. Buttons will appear in the order they are provided from
2025-08-21 20:03:33 +10:00
left to right.
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
*-Z, --button-dismiss* <text> [<action>]
Create a button with the text _text_ that optionally executes _action_
when pressed, and dismisses labnag. Multiple buttons can be defined by
providing the flag multiple times. Buttons will appear in the order
2025-08-21 20:03:33 +10:00
they are provided from left to right.
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
*-d, --debug*
Enable debugging.
*-e, --edge* top|bottom
Set the edge to use.
*-y, --layer* overlay|top|bottom|background
Set the layer to use.
*-k, --keyboard-focus none|exclusive|on-demand*
Set the policy for keyboard focus.
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
*-f, --font* <font>
Set the font to use.
*-h, --help*
Show help message and quit.
*-l, --detailed-message*
Read a detailed message from stdin. A button to toggle details will be
added. Details are shown in a scrollable multi-line text area.
*-L, --detailed-button* <text>
Set the text for the button that toggles details. This has no effect if
there is not a detailed message. The default is _Toggle details_.
*-m, --message* <msg>
Set the message text.
*-o, --output* <output>
Set the output to use. This should be the name of a _xdg\_output_.
*-t, --timeout*
Set duration to close dialog. Default is 5 seconds.
*-x, --exclusive-zone*
Use exclusive zone. Default is false.
*-v, --version*
Show the version number and quit.
# APPEARANCE OPTIONS
2025-10-01 15:22:54 +09:00
*--background-color* <RRGGBB[AA]>
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
Set the color of the background.
2025-10-01 15:22:54 +09:00
*--button-border-color* <RRGGBB[AA]>
Set the color of the button border.
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
2025-10-01 15:22:54 +09:00
*--border-bottom-color* <RRGGBB[AA]>
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
Set the color of the bottom border.
2025-10-01 15:22:54 +09:00
*--button-background-color* <RRGGBB[AA]>
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
Set the color for the background for buttons.
2025-10-01 15:22:54 +09:00
*--text-color* <RRGGBB[AA]>
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
Set the text color.
2025-10-01 15:22:54 +09:00
*--button-text-color* <RRGGBB[AA]>
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
Set the button text color.
*--border-bottom-size* <size>
Set the thickness of the bottom border.
*--message-padding* <padding>
Set the padding for the message.
2025-10-01 15:22:54 +09:00
*--details-background-color* <RRGGBB[AA]>
Add labnag Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag) Copied at commit: https://github.com/swaywm/sway/commit/03483ff3707a358d935e451d39748e58c205ce8a Contains the following modifiations: - Some functional changes including: - Disable exclusive-zone by default (Written-by: @Consolatis) and add command line option -x|--exclusive-zone - Add close timeout (Written-by: @Consolatis) and -t|--timeout option - Use index of button (from right-to-left) for exit code - Disable reading from config file and remove associated --type option - Refactoring including: - Use wlr_log() instead of the log.{c,h} functions - Use wl_list instead of sway's list.c implementation - In the pango wrapper functions, use glib's g_strdup_vprintf() rather than the original stringop.c functions - Align with labwc coding style to pass checkpatch.pl - Re-licenced from MIT to GPL-2.0, and add Copyright notices for original authors v2 - Remove option -s|--dismiss-button and the default "X" button. To get such a button, "-Z X :" - Remove options -b and -z because there is no requirement to run in a terminal. - Remove *-no-terminal from options --button and --button-dismiss because commands are now always run directly without a terminal. v3 - Allow -B/-Z options without action-argument - Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z` results in three buttons with "x" furthest to the left, and "z" on the right (rather than the other way around). - Use signalfd() to prevent race conditions on SIGTERM v4 - Limit number of stdin lines to 200 to avoid hogging CPU Co-Authored-by: tokyo4j
2025-04-28 20:38:19 +01:00
Set the color for the background for details.
*--details-border-size* <size>
Set the thickness for the details border.
*--button-border-size* <size>
Set the thickness for the button border.
*--button-gap* <gap>
Set the size of the gap between buttons.
*--button-dismiss-gap* <gap>
Set the size of the gap between the dismiss button and another button.
*--button-margin-right* <margin>
Set the margin from the right of the dismiss button to edge.
*--button-padding* <padding>
Set the padding for the button text.
# EXAMPLE
This is a simple example of a _labnag_ logout GUI.
```
#!/bin/sh
# logout with labnag
labnag \\
-f "Hack Regular 10"\\
-m "Choose your logout option"\\
2025-08-30 21:51:14 +10:00
-Z " Lock " "gtklock -d"\\
-Z " Logout " "labwc -e"\\
-Z "Shutdown " "systemctl poweroff"\\
-Z " Reboot " "systemctl reboot"\\
-Z "Hibernate" "systemctl hibernate"\\
-Z " Suspend " "systemctl suspend"\\
-Z " Cancel "\\
2025-10-01 15:22:54 +09:00
--background-color 00ffff\\
--button-background-color 00ffff\\
--button-border-color 00ccccaa\\
--text-color 000000\\
--button-text-color 000000\\
--button-gap 8\\
--button-margin-right 0\\
--button-padding 5\\
--button-border-size 2\\
-t 60
```