all repos — tint2 @ 86dcaa7a831c176226b5e291ec7a6d4467a08891

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Merge branch 'master' into 'master'

Allow pivoting STRUTs for panels in the middle of virtual screens on some WMs

See merge request o9000/tint2!31
Chris chrlee@protonmail.com
commit

86dcaa7a831c176226b5e291ec7a6d4467a08891

parent

4dafea185f10b84911926c17668ea05362c1327f

M doc/manual.htmldoc/manual.html

@@ -273,7 +273,7 @@ </ul></li>

<li><p><code>border_content_tint_weight = integer</code> : 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). <em>(since 16.0)</em></p></li> <li><p><code>background_content_tint_weight = integer</code> : 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). <em>(since 16.0)</em></p></li> </ul> -<p>You can define as many backgrounds as you want. For example, the following config defines two backgrounds:</p><pre class="highlight plaintext"><code>rounded = 1 +<p>You can define as many backgrounds as you want. For example, the following config defines two backgrounds:</p><pre><code>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 </code></pre> <p>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:</p><pre class="highlight plaintext"><code>panel_background_id = 1 +Afterwards, you can apply a background to objects (panel, taskbar, task, clock, systray) using the background id, for example:</p><pre><code>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.</p><h4 id="gradient-types">Gradient types<a name="gradient-types" href="#gradient-types" class="md2man-permalink" title="permalink"></a></h4><p>Gradients vary the color between fixed control points:

* vertical gradients: top-to-bottom; * horizontal gradients: left-to-right; * radial gradients: center-to-corners.</p><p>The user must specify the start and end colors, and can optionally add extra color stops in between -using the <code>color_stop</code> option, as explained below.</p><h5 id="vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors">Vertical gradient, with color varying from the top edge to the bottom edge, two colors<a name="vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors" href="#vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>gradient = vertical +using the <code>color_stop</code> option, as explained below.</p><h5 id="vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors">Vertical gradient, with color varying from the top edge to the bottom edge, two colors<a name="vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors" href="#vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre><code>gradient = vertical start_color = #rrggbb opacity end_color = #rrggbb opacity </code></pre> -<h5 id="horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors">Horizontal gradient, with color varying from the left edge to the right edge, two colors<a name="horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors" href="#horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>gradient = horizontal +<h5 id="horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors">Horizontal gradient, with color varying from the left edge to the right edge, two colors<a name="horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors" href="#horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre><code>gradient = horizontal start_color = #rrggbb opacity end_color = #rrggbb opacity </code></pre> -<h5 id="radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors">Radial gradient, with color varying from the center to the corner, two colors:<a name="radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors" href="#radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>gradient = radial +<h5 id="radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors">Radial gradient, with color varying from the center to the corner, two colors:<a name="radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors" href="#radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre><code>gradient = radial start_color = #rrggbb opacity end_color = #rrggbb opacity </code></pre> -<h5 id="adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points">Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)<a name="adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points" href="#adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>color_stop = percentage #rrggbb opacity +<h5 id="adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points">Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)<a name="adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points" href="#adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points" class="md2man-permalink" title="permalink"></a></h5><pre><code>color_stop = percentage #rrggbb opacity </code></pre> -<h4 id="gradient-examples">Gradient examples<a name="gradient-examples" href="#gradient-examples" class="md2man-permalink" title="permalink"></a></h4><pre class="highlight plaintext"><code># Gradient 1: thin film effect +<h4 id="gradient-examples">Gradient examples<a name="gradient-examples" href="#gradient-examples" class="md2man-permalink" title="permalink"></a></h4><pre><code># Gradient 1: thin film effect gradient = horizontal start_color = #111122 30 end_color = #112211 30

@@ -389,7 +389,7 @@ </ul></li>

<li><p><code>scale_relative_to_dpi = integer</code> : 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.</p></li> <li><p><code>scale_relative_to_screen_height = integer</code> : Similar to <code>scale_relative_to_dpi</code>, except the scaling factor is computed as the ratio between the monitor height and <code>scale_relative_to_screen_height</code>. The effect is cumulative with <code>scale_relative_to_dpi</code>, i.e. if both options are present, the factors are multiplied.</p></li> </ul> -<pre class="highlight plaintext"><code># The panel's width is 94% the size of the monitor, the height is 30 pixels: +<pre><code># The panel&#39;s width is 94% the size of the monitor, the height is 30 pixels: panel_size = 94% 30 </code></pre>

@@ -407,8 +407,9 @@ <li><p><code>font_shadow = boolean (0 or 1)</code></p></li>

<li><p><code>panel_background_id = integer</code> : Which background to use for the panel.</p></li> <li><p><code>wm_menu = boolean (0 or 1)</code> : 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.</p></li> <li><p><code>panel_dock = boolean (0 or 1)</code> : Defines if tint2 is placed into the window manager&#39;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).</p></li> +<li><p><code>panel_pivot_struts = boolean (0 or 1)</code> : Defines if tint2 lies to the window manager about its orientation (horizontal vs vertical) when requesting reserved space with STRUTs (see <code>strut_policy</code> 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. </p></li> <li><p><code>panel_layer = bottom/normal/top</code> : 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.</p></li> -<li><p><code>strut_policy = follow_size/minimum/none</code> : 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.</p> +<li><p><code>strut_policy = follow_size/minimum/none</code> : 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 <code>panel_pivot_struts</code> may work around this limitation). </p> <ul> <li><code>follow_size</code> means that the maximized windows always resize to have a common edge with tint2.</li> <li><code>minimum</code> means that the maximized windows always expand to have a common edge with the hidden panel. This is useful if the <code>autohide</code> option is enabled.</li>

@@ -621,16 +622,16 @@ <li><p><code>execp_rclick_command = text</code> : Command to execute on middle click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>

<li><p><code>execp_uwheel_command = text</code> : Command to execute on wheel scroll up. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li> <li><p><code>execp_dwheel_command = text</code> : Command to execute on wheel scroll down. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li> </ul> -<h4 id="executor-samples">Executor samples<a name="executor-samples" href="#executor-samples" class="md2man-permalink" title="permalink"></a></h4><h5 id="print-the-hostname">Print the hostname<a name="print-the-hostname" href="#print-the-hostname" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new +<h4 id="executor-samples">Executor samples<a name="executor-samples" href="#executor-samples" class="md2man-permalink" title="permalink"></a></h4><h5 id="print-the-hostname">Print the hostname<a name="print-the-hostname" href="#print-the-hostname" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp = new execp_command = hostname execp_interval = 0 </code></pre> -<h5 id="print-disk-usage-for-the-root-partition-every-10-seconds">Print disk usage for the root partition every 10 seconds<a name="print-disk-usage-for-the-root-partition-every-10-seconds" href="#print-disk-usage-for-the-root-partition-every-10-seconds" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new -execp_command = df -h | awk '/\/$/ { print $6 ": " $2 " " $5}' +<h5 id="print-disk-usage-for-the-root-partition-every-10-seconds">Print disk usage for the root partition every 10 seconds<a name="print-disk-usage-for-the-root-partition-every-10-seconds" href="#print-disk-usage-for-the-root-partition-every-10-seconds" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp = new +execp_command = df -h | awk &#39;/\/$/ { print $6 &quot;: &quot; $2 &quot; &quot; $5}&#39; execp_interval = 10 </code></pre> -<h5 id="button-with-icon-and-rich-text-executes-command-when-clicked">Button with icon and rich text, executes command when clicked<a name="button-with-icon-and-rich-text-executes-command-when-clicked" href="#button-with-icon-and-rich-text-executes-command-when-clicked" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new -execp_command = echo /usr/share/icons/elementary-xfce/emblems/24/emblem-colors-blue.png; echo '&lt;span foreground="#7f7"&gt;Click&lt;/span&gt; &lt;span foreground="#77f"&gt;me&lt;/span&gt; &lt;span foreground="#f77"&gt;pls&lt;/span&gt;' +<h5 id="button-with-icon-and-rich-text-executes-command-when-clicked">Button with icon and rich text, executes command when clicked<a name="button-with-icon-and-rich-text-executes-command-when-clicked" href="#button-with-icon-and-rich-text-executes-command-when-clicked" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp = new +execp_command = echo /usr/share/icons/elementary-xfce/emblems/24/emblem-colors-blue.png; echo &#39;&lt;span foreground=&quot;#7f7&quot;&gt;Click&lt;/span&gt; &lt;span foreground=&quot;#77f&quot;&gt;me&lt;/span&gt; &lt;span foreground=&quot;#f77&quot;&gt;pls&lt;/span&gt;&#39; 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 &quot;--text=$(uname -sr)&quot; execp_background_id = 2 </code></pre> -<h5 id="desktop-pager-with-text">Desktop pager with text<a name="desktop-pager-with-text" href="#desktop-pager-with-text" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new -execp_command = xprop -root -spy | awk '/^_NET_CURRENT_DESKTOP/ { print "Workspace " ($3 + 1) ; fflush(); }' +<h5 id="desktop-pager-with-text">Desktop pager with text<a name="desktop-pager-with-text" href="#desktop-pager-with-text" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp = new +execp_command = xprop -root -spy | awk &#39;/^_NET_CURRENT_DESKTOP/ { print &quot;Workspace &quot; ($3 + 1) ; fflush(); }&#39; execp_interval = 1 execp_continuous = 1 </code></pre> -<h5 id="desktop-pager-with-icon">Desktop pager with icon<a name="desktop-pager-with-icon" href="#desktop-pager-with-icon" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp_command = xprop -root -spy | awk -v home="$HOME" '/^_NET_CURRENT_DESKTOP/ { print home "/.config/myPager/" ($3 + 1) ".png\n" ; fflush(); }' +<h5 id="desktop-pager-with-icon">Desktop pager with icon<a name="desktop-pager-with-icon" href="#desktop-pager-with-icon" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp_command = xprop -root -spy | awk -v home=&quot;$HOME&quot; &#39;/^_NET_CURRENT_DESKTOP/ { print home &quot;/.config/myPager/&quot; ($3 + 1) &quot;.png\n&quot; ; fflush(); }&#39; execp_interval = 1 execp_has_icon = 1 execp_cache_icon = 1 execp_continuous = 2 </code></pre> -<h5 id="round-trip-time-to-the-gateway-refreshed-every-second">Round-trip time to the gateway, refreshed every second<a name="round-trip-time-to-the-gateway-refreshed-every-second" href="#round-trip-time-to-the-gateway-refreshed-every-second" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>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 "&lt;span foreground=\"#faa\"&gt;timeout&lt;/span&gt;"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "&lt;span foreground=\"#7af\"&gt;%3.0f %s&lt;/span&gt;\n", $8, $9; fflush(); } ' +<h5 id="round-trip-time-to-the-gateway-refreshed-every-second">Round-trip time to the gateway, refreshed every second<a name="round-trip-time-to-the-gateway-refreshed-every-second" href="#round-trip-time-to-the-gateway-refreshed-every-second" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp = new +execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o &#39;[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*&#39;) | awk &#39;/no/ { print &quot;&lt;span foreground=\&quot;#faa\&quot;&gt;timeout&lt;/span&gt;&quot;; fflush(); }; /time=/ { gsub(/time=/, &quot;&quot;, $8); printf &quot;&lt;span foreground=\&quot;#7af\&quot;&gt;%3.0f %s&lt;/span&gt;\n&quot;, $8, $9; fflush(); } &#39; execp_continuous = 0 execp_interval = 1 execp_markup = 1 </code></pre> -<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new -execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }' +<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre><code>execp = new +execp_command = free | awk &#39;/^-/ { printf &quot;Mem: &#39;$(free -h | awk &#39;/^Mem:/ { print $2 }&#39;)&#39; %.0f%%\n&quot;, 100*$3/($3+$4); fflush(stdout) }&#39; execp_interval = 5 execp_continuous = 0 </code></pre> -<h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line. +<h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><pre><code># Note the use of &quot;stdbuf -oL&quot; 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 &#39;;&#39; &#39;/total/ { printf &quot;Net: %.0f Mb/s\n&quot;, ($5*8/1.0e6) }; fflush(stdout)&#39; execp_continuous = 1 execp_interval = 1 </code></pre>
M doc/readme.htmldoc/readme.html

@@ -199,7 +199,7 @@

</style> </head> <body> -<h1 id="latest-stable-release-16-6-1"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">16.6.1</span><a name="latest-stable-release-16-6-1" href="#latest-stable-release-16-6-1" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/16.6.1/ChangeLog">https://gitlab.com/o9000/tint2/blob/16.6.1/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (after you install the <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git +<h1 id="latest-stable-release-16-6-1"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">16.6.1</span><a name="latest-stable-release-16-6-1" href="#latest-stable-release-16-6-1" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/16.6.1/ChangeLog">https://gitlab.com/o9000/tint2/blob/16.6.1/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (after you install the <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><pre><code>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 </code></pre> -<p>To install, run (as root):</p><pre class="highlight plaintext"><code>make install +<p>To install, run (as root):</p><pre><code>make install update-icon-caches /usr/local/share/icons/hicolor update-mime-database /usr/local/share/mime </code></pre>
M doc/tint2.1doc/tint2.1

@@ -379,9 +379,11 @@ \fB\fCwm_menu = boolean (0 or 1)\fR : 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.

.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.
M doc/tint2.mddoc/tint2.md

@@ -306,9 +306,11 @@ * `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. * `none` means that the maximized windows use the full screen size.
M src/config.csrc/config.c

@@ -508,6 +508,8 @@ } else if (strcmp(key, "wm_menu") == 0)

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) {
M src/panel.csrc/panel.c

@@ -49,6 +49,7 @@

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 @@ panel_autohide_height = 5; // for vertical panels this is of course the width

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 @@ int d3;

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;
M src/panel.hsrc/panel.h

@@ -69,6 +69,7 @@

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;
M src/tint2conf/properties.csrc/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;

@@ -1013,6 +1013,27 @@ panel_dock,

_("If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than normal windows. " "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++;
M src/tint2conf/properties.hsrc/tint2conf/properties.h

@@ -12,8 +12,8 @@ // panel

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;
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -295,6 +295,7 @@ (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_spacing)));

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 @@ } else if (strcmp(key, "wm_menu") == 0) {

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);