diff --git a/doc/manual.html b/doc/manual.html index ab94a81..54c5c30 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -273,7 +273,7 @@ Try to respect as much as possible the order of the options as given below.

<
  • border_content_tint_weight = integer : Mixes the border color with the content color (for tasks, this is the average color of the window icon). Values must be between 0 (no mixing) and 100 (fully replaces the color). (since 16.0)

  • background_content_tint_weight = integer : Mixes the background color with the content color (for tasks, this is the average color of the window icon). Values must be between 0 (no mixing) and 100 (fully replaces the color). (since 16.0)

  • -

    You can define as many backgrounds as you want. For example, the following config defines two backgrounds:

    rounded = 1
    +

    You can define as many backgrounds as you want. For example, the following config defines two backgrounds:

    rounded = 1
     border_width = 0
     background_color = #282828 100
     border_color = #000000 0
    @@ -284,7 +284,7 @@ background_color = #f6b655 90
     border_color = #cccccc 40
     

    tint2 automatically identifies each background with a number starting from 1 (1, 2, ...). -Afterwards, you can apply a background to objects (panel, taskbar, task, clock, systray) using the background id, for example:

    panel_background_id = 1
    +Afterwards, you can apply a background to objects (panel, taskbar, task, clock, systray) using the background id, for example:

    panel_background_id = 1
     taskbar_background_id = 0
     task_background_id = 0
     task_active_background_id = 2
    @@ -300,21 +300,21 @@ the gradient index, starting from 1.

    Gradient types

    The user must specify the start and end colors, and can optionally add extra color stops in between -using the color_stop option, as explained below.

    Vertical gradient, with color varying from the top edge to the bottom edge, two colors
    gradient = vertical
    +using the color_stop option, as explained below.

    Vertical gradient, with color varying from the top edge to the bottom edge, two colors
    gradient = vertical
     start_color = #rrggbb opacity
     end_color = #rrggbb opacity
     
    -
    Horizontal gradient, with color varying from the left edge to the right edge, two colors
    gradient = horizontal
    +
    Horizontal gradient, with color varying from the left edge to the right edge, two colors
    gradient = horizontal
     start_color = #rrggbb opacity
     end_color = #rrggbb opacity
     
    -
    Radial gradient, with color varying from the center to the corner, two colors:
    gradient = radial
    +
    Radial gradient, with color varying from the center to the corner, two colors:
    gradient = radial
     start_color = #rrggbb opacity
     end_color = #rrggbb opacity
     
    -
    Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)
    color_stop = percentage #rrggbb opacity
    +
    Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)
    color_stop = percentage #rrggbb opacity
     
    -

    Gradient examples

    # Gradient 1: thin film effect
    +

    Gradient examples

    # Gradient 1: thin film effect
     gradient = horizontal
     start_color = #111122 30
     end_color = #112211 30
    @@ -389,7 +389,7 @@ Example:
     
  • scale_relative_to_dpi = integer : If set to a non-zero value, HiDPI scaling is enabled. Each panel is visible on a different monitor. Thus each panel has a specific scaling factor. The scaling factor is computed as the ratio between the monitor DPI (obtained from the dimensions in pixels and millimeters from RandR) and a configured reference DPI - this is the DPI for which exising user configs looked normal, for backward compatibility.

  • scale_relative_to_screen_height = integer : Similar to scale_relative_to_dpi, except the scaling factor is computed as the ratio between the monitor height and scale_relative_to_screen_height. The effect is cumulative with scale_relative_to_dpi, i.e. if both options are present, the factors are multiplied.

  • -
    # The panel's width is 94% the size of the monitor, the height is 30 pixels:
    +
    # The panel's width is 94% the size of the monitor, the height is 30 pixels:
     panel_size = 94% 30
     
    @@ -407,8 +407,9 @@ panel_size = 94% 30
  • panel_background_id = integer : Which background to use for the panel.

  • wm_menu = boolean (0 or 1) : Defines if tint2 forwards unhandled mouse events to your window manager. Useful for window managers such as openbox, which display the start menu if you right click on the desktop.

  • panel_dock = boolean (0 or 1) : Defines if tint2 is placed into the window manager's dock. For the openbox window manager it is advised to also use a modifier for the moveButton option, otherwise the mouse click is not forwarded to tint2 (in ~/.config/openbox/rc.xml).

  • +
  • panel_pivot_struts = boolean (0 or 1) : Defines if tint2 lies to the window manager about its orientation (horizontal vs vertical) when requesting reserved space with STRUTs (see strut_policy below). On some window managers, this allows placing a panel in the middle of the virtual screen, e.g. on the bottom edge of the top monitor in a vertical dual-monitor setup.

  • panel_layer = bottom/normal/top : Places tint2 into the bottom/normal/top layer. This is helpful for specifying if the panel can be covered by other windows or not. The default is the bottom layer, but with real transparency normal or top layer may be a nice alternative.

  • -
  • strut_policy = follow_size/minimum/none : STRUTs are used by the window manager to decide the size of maximized windows. Note: on multi-monitor (Xinerama) setups, the panel must be placed at the edge (not in the middle) of the virtual screen for this to work correctly.

    +
  • strut_policy = follow_size/minimum/none : STRUTs are used by the window manager to decide the size of maximized windows. Note: on multi-monitor (Xinerama) setups, the panel generally must be placed at the edge (not in the middle) of the virtual screen for this to work correctly (though on some window managers, setting panel_pivot_struts may work around this limitation).

    • follow_size means that the maximized windows always resize to have a common edge with tint2.
    • minimum means that the maximized windows always expand to have a common edge with the hidden panel. This is useful if the autohide option is enabled.
    • @@ -621,16 +622,16 @@ panel_size = 94% 30
    • execp_uwheel_command = text : Command to execute on wheel scroll up. If not defined, execp_command is executed immediately, unless it is currently running. (since 0.12.4)

    • execp_dwheel_command = text : Command to execute on wheel scroll down. If not defined, execp_command is executed immediately, unless it is currently running. (since 0.12.4)

    -

    Executor samples

    execp = new
    +

    Executor samples

    execp = new
     execp_command = hostname
     execp_interval = 0
     
    -
    execp = new
    -execp_command = df -h | awk '/\/$/ { print $6 ": " $2 " " $5}'
    +
    execp = new
    +execp_command = df -h | awk '/\/$/ { print $6 ": " $2 " " $5}'
     execp_interval = 10
     
    -
    Button with icon and rich text, executes command when clicked
    execp = new
    -execp_command = echo /usr/share/icons/elementary-xfce/emblems/24/emblem-colors-blue.png; echo '<span foreground="#7f7">Click</span> <span foreground="#77f">me</span> <span foreground="#f77">pls</span>'
    +
    Button with icon and rich text, executes command when clicked
    execp = new
    +execp_command = echo /usr/share/icons/elementary-xfce/emblems/24/emblem-colors-blue.png; echo '<span foreground="#7f7">Click</span> <span foreground="#77f">me</span> <span foreground="#f77">pls</span>'
     execp_has_icon = 1
     execp_interval = 0
     execp_centered = 1
    @@ -639,34 +640,34 @@ execp_markup = 1
     execp_font_color = #aaffaa 100
     execp_padding = 2 0
     execp_tooltip = I will tell you a secret...
    -execp_lclick_command = zenity --info "--text=$(uname -sr)"
    +execp_lclick_command = zenity --info "--text=$(uname -sr)"
     execp_background_id = 2
     
    -
    Desktop pager with text
    execp = new
    -execp_command = xprop -root -spy | awk '/^_NET_CURRENT_DESKTOP/ { print "Workspace " ($3 + 1) ; fflush(); }'
    +
    Desktop pager with text
    execp = new
    +execp_command = xprop -root -spy | awk '/^_NET_CURRENT_DESKTOP/ { print "Workspace " ($3 + 1) ; fflush(); }'
     execp_interval = 1
     execp_continuous = 1
     
    -
    Desktop pager with icon
    execp_command = xprop -root -spy | awk -v home="$HOME" '/^_NET_CURRENT_DESKTOP/ { print home "/.config/myPager/" ($3 + 1) ".png\n" ; fflush(); }'
    +
    Desktop pager with icon
    execp_command = xprop -root -spy | awk -v home="$HOME" '/^_NET_CURRENT_DESKTOP/ { print home "/.config/myPager/" ($3 + 1) ".png\n" ; fflush(); }'
     execp_interval = 1
     execp_has_icon = 1
     execp_cache_icon = 1
     execp_continuous = 2
     
    -
    Round-trip time to the gateway, refreshed every second
    execp = new
    -execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
    +
    Round-trip time to the gateway, refreshed every second
    execp = new
    +execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
     execp_continuous = 0
     execp_interval = 1
     execp_markup = 1
     
    -
    Memory usage
    execp = new
    -execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }'
    +
    Memory usage
    execp = new
    +execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }'
     execp_interval = 5
     execp_continuous = 0
     
    -
    Network load
    # Note the use of "stdbuf -oL" to force the program to flush the output line by line.
    +
    Network load
    # Note the use of "stdbuf -oL" to force the program to flush the output line by line.
     execp = new
    -execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
    +execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
     execp_continuous = 1
     execp_interval = 1
     
    diff --git a/doc/readme.html b/doc/readme.html index 11922c8..58ba87c 100644 --- a/doc/readme.html +++ b/doc/readme.html @@ -199,7 +199,7 @@ pre { -

    Latest stable release: 16.6.1

    Changes: https://gitlab.com/o9000/tint2/blob/16.6.1/ChangeLog

    Documentation: manual.html

    Compile it with (after you install the dependencies):

    git clone https://gitlab.com/o9000/tint2.git
    +

    Latest stable release: 16.6.1

    Changes: https://gitlab.com/o9000/tint2/blob/16.6.1/ChangeLog

    Documentation: manual.html

    Compile it with (after you install the dependencies):

    git clone https://gitlab.com/o9000/tint2.git
     cd tint2
     git checkout 16.6.1
     mkdir build
    @@ -207,7 +207,7 @@ cd build
     cmake ..
     make -j4
     
    -

    To install, run (as root):

    make install
    +

    To install, run (as root):

    make install
     update-icon-caches /usr/local/share/icons/hicolor
     update-mime-database /usr/local/share/mime
     
    diff --git a/doc/tint2.1 b/doc/tint2.1 index ad47572..86e3f89 100644 --- a/doc/tint2.1 +++ b/doc/tint2.1 @@ -379,9 +379,11 @@ panel_size = 94% 30 .IP \(bu 2 \fB\fCpanel_dock = boolean (0 or 1)\fR : Defines if tint2 is placed into the window manager's dock. For the openbox window manager it is advised to also use a modifier for the moveButton option, otherwise the mouse click is not forwarded to tint2 (in ~/.config/openbox/rc.xml). .IP \(bu 2 +\fB\fCpanel_pivot_struts = boolean (0 or 1)\fR : Defines if tint2 lies to the window manager about its orientation (horizontal vs vertical) when requesting reserved space with STRUTs (see \fB\fCstrut_policy\fR below). On some window managers, this allows placing a panel in the middle of the virtual screen, e.g. on the bottom edge of the top monitor in a vertical dual\-monitor setup. +.IP \(bu 2 \fB\fCpanel_layer = bottom/normal/top\fR : Places tint2 into the bottom/normal/top layer. This is helpful for specifying if the panel can be covered by other windows or not. The default is the bottom layer, but with real transparency normal or top layer may be a nice alternative. .IP \(bu 2 -\fB\fCstrut_policy = follow_size/minimum/none\fR : STRUTs are used by the window manager to decide the size of maximized windows. Note: on multi\-monitor (Xinerama) setups, the panel must be placed at the edge (not in the middle) of the virtual screen for this to work correctly. +\fB\fCstrut_policy = follow_size/minimum/none\fR : STRUTs are used by the window manager to decide the size of maximized windows. Note: on multi\-monitor (Xinerama) setups, the panel generally must be placed at the edge (not in the middle) of the virtual screen for this to work correctly (though on some window managers, setting \fB\fCpanel_pivot_struts\fR may work around this limitation). .RS .IP \(bu 2 \fB\fCfollow_size\fR means that the maximized windows always resize to have a common edge with tint2. diff --git a/doc/tint2.md b/doc/tint2.md index 682ea43..93c8b9d 100644 --- a/doc/tint2.md +++ b/doc/tint2.md @@ -306,9 +306,11 @@ panel_size = 94% 30 * `panel_dock = boolean (0 or 1)` : Defines if tint2 is placed into the window manager's dock. For the openbox window manager it is advised to also use a modifier for the moveButton option, otherwise the mouse click is not forwarded to tint2 (in ~/.config/openbox/rc.xml). + * `panel_pivot_struts = boolean (0 or 1)` : Defines if tint2 lies to the window manager about its orientation (horizontal vs vertical) when requesting reserved space with STRUTs (see `strut_policy` below). On some window managers, this allows placing a panel in the middle of the virtual screen, e.g. on the bottom edge of the top monitor in a vertical dual-monitor setup. + * `panel_layer = bottom/normal/top` : Places tint2 into the bottom/normal/top layer. This is helpful for specifying if the panel can be covered by other windows or not. The default is the bottom layer, but with real transparency normal or top layer may be a nice alternative. - * `strut_policy = follow_size/minimum/none` : STRUTs are used by the window manager to decide the size of maximized windows. Note: on multi-monitor (Xinerama) setups, the panel must be placed at the edge (not in the middle) of the virtual screen for this to work correctly. + * `strut_policy = follow_size/minimum/none` : STRUTs are used by the window manager to decide the size of maximized windows. Note: on multi-monitor (Xinerama) setups, the panel generally must be placed at the edge (not in the middle) of the virtual screen for this to work correctly (though on some window managers, setting `panel_pivot_struts` may work around this limitation). * `follow_size` means that the maximized windows always resize to have a common edge with tint2. * `minimum` means that the maximized windows always expand to have a common edge with the hidden panel. This is useful if the `autohide` option is enabled. * `none` means that the maximized windows use the full screen size. diff --git a/src/config.c b/src/config.c index 4646535..944d93a 100644 --- a/src/config.c +++ b/src/config.c @@ -508,6 +508,8 @@ void add_entry(char *key, char *value) wm_menu = atoi(value); else if (strcmp(key, "panel_dock") == 0) panel_dock = atoi(value); + else if (strcmp(key, "panel_pivot_struts") == 0) + panel_pivot_struts = atoi(value); else if (strcmp(key, "urgent_nb_of_blink") == 0) max_tick_urgent = atoi(value); else if (strcmp(key, "panel_layer") == 0) { diff --git a/src/panel.c b/src/panel.c index 59bc657..63692b7 100644 --- a/src/panel.c +++ b/src/panel.c @@ -49,6 +49,7 @@ MouseAction mouse_tilt_right; TaskbarMode taskbar_mode; gboolean wm_menu; gboolean panel_dock; +gboolean panel_pivot_struts; Layer panel_layer; PanelPosition panel_position; gboolean panel_horizontal; @@ -103,6 +104,7 @@ void default_panel() panel_shrink = FALSE; panel_strut_policy = STRUT_FOLLOW_SIZE; panel_dock = FALSE; // default not in the dock + panel_pivot_struts = FALSE; panel_layer = BOTTOM_LAYER; // default is bottom layer panel_window_name = strdup("tint2"); wm_menu = FALSE; @@ -625,7 +627,7 @@ void update_strut(Panel *p) XGetGeometry(server.display, server.root_win, &d2, &d3, &d3, &screen_width, &screen_height, &d1, &d1); Monitor monitor = server.monitors[p->monitor]; long struts[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - if (panel_horizontal) { + if (panel_horizontal ^ panel_pivot_struts) { int height = p->area.height + p->marginy; if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && panel_autohide && p->is_hidden)) height = p->hidden_height; diff --git a/src/panel.h b/src/panel.h index eabb21b..cb9bca5 100644 --- a/src/panel.h +++ b/src/panel.h @@ -69,6 +69,7 @@ typedef enum Strut { extern TaskbarMode taskbar_mode; extern gboolean wm_menu; extern gboolean panel_dock; +extern gboolean panel_pivot_struts; extern Layer panel_layer; extern char *panel_window_name; extern PanelPosition panel_position; diff --git a/src/tint2conf/properties.c b/src/tint2conf/properties.c index 508db41..06be623 100644 --- a/src/tint2conf/properties.c +++ b/src/tint2conf/properties.c @@ -25,8 +25,8 @@ GtkWidget *scale_relative_to_dpi, *scale_relative_to_screen_height; GtkWidget *panel_width, *panel_height, *panel_margin_x, *panel_margin_y, *panel_padding_x, *panel_padding_y, *panel_spacing; -GtkWidget *panel_wm_menu, *panel_dock, *panel_autohide, *panel_autohide_show_time, *panel_autohide_hide_time, - *panel_autohide_size; +GtkWidget *panel_wm_menu, *panel_dock, *panel_pivot_struts, *panel_autohide, *panel_autohide_show_time, + *panel_autohide_hide_time, *panel_autohide_size; GtkWidget *panel_combo_strut_policy, *panel_combo_layer, *panel_combo_width_type, *panel_combo_height_type, *panel_combo_monitor; GtkWidget *panel_window_name, *disable_transparency; @@ -1015,6 +1015,27 @@ void create_panel(GtkWidget *parent) "The exact behavior depends on the window manager and its configuration."), NULL); + row++; + col = 2; + label = gtk_label_new(_("Pivot reserved space")); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_widget_show(label); + gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0); + col++; + + panel_pivot_struts = gtk_check_button_new(); + gtk_widget_show(panel_pivot_struts); + gtk_table_attach(GTK_TABLE(table), panel_pivot_struts, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0); + col++; + gtk_tooltips_set_tip(tooltips, + panel_pivot_struts, + _("If enabled, the space reserved for the panel (if \"Maximised windows\" is set to " + "match the panel size or hidden panel size) will be given to the window manager as if " + "the panel were the opposite orientation (horizontal vs vertical) than it actually is. " + "On some window managers this allows placing a panel in the middle of the virtual screen, " + "e.g. on the bottom edge of the top screen in a vertical dual-monitor setup."), + NULL); + row++; col = 2; label = gtk_label_new(_("Panel layer")); diff --git a/src/tint2conf/properties.h b/src/tint2conf/properties.h index 529ff39..4c5dc35 100644 --- a/src/tint2conf/properties.h +++ b/src/tint2conf/properties.h @@ -12,8 +12,8 @@ extern GtkWidget *scale_relative_to_dpi, *scale_relative_to_screen_height; extern GtkWidget *panel_width, *panel_height, *panel_margin_x, *panel_margin_y, *panel_padding_x, *panel_padding_y, *panel_spacing; -extern GtkWidget *panel_wm_menu, *panel_dock, *panel_autohide, *panel_autohide_show_time, *panel_autohide_hide_time, - *panel_autohide_size; +extern GtkWidget *panel_wm_menu, *panel_dock, *panel_pivot_struts, *panel_autohide, *panel_autohide_show_time, + *panel_autohide_hide_time, *panel_autohide_size; extern GtkWidget *panel_combo_strut_policy, *panel_combo_layer, *panel_combo_width_type, *panel_combo_height_type, *panel_combo_monitor; extern GtkWidget *panel_window_name, *disable_transparency; diff --git a/src/tint2conf/properties_rw.c b/src/tint2conf/properties_rw.c index f54e84a..80228f8 100644 --- a/src/tint2conf/properties_rw.c +++ b/src/tint2conf/properties_rw.c @@ -295,6 +295,7 @@ void config_write_panel(FILE *fp) fprintf(fp, "panel_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(panel_background))); fprintf(fp, "wm_menu = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_wm_menu)) ? 1 : 0); fprintf(fp, "panel_dock = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_dock)) ? 1 : 0); + fprintf(fp, "panel_pivot_struts = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_pivot_struts)) ? 1 : 0); fprintf(fp, "panel_position = "); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_BLH]))) { @@ -1384,6 +1385,8 @@ void add_entry(char *key, char *value) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_wm_menu), atoi(value)); } else if (strcmp(key, "panel_dock") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_dock), atoi(value)); + } else if (strcmp(key, "panel_pivot_struts") == 0) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_pivot_struts), atoi(value)); } else if (strcmp(key, "panel_layer") == 0) { if (strcmp(value, "bottom") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 2);