Compare commits

..

52 Commits

Author SHA1 Message Date
o9000
187e7f294e Add behavior to hide an empty taskbar in multi_desktop mode: fix TODO and fix panel resize 2016-09-04 14:45:32 +02:00
Benoit Averty
8976f35c5f Add behavior to hide an empty taskbar in multi_desktop mode 2016-08-31 16:55:33 +02:00
o9000
008eebe4b1 When WM_HINTS changes for a window, reload the icon 2016-08-20 18:07:18 +02:00
o9000
cbb76849ea Fix missing include (fixes issue #594; thanks @Coacher) 2016-08-08 13:08:29 +02:00
o9000
cf930fa42e Fix hang (issue #586) 2016-08-08 12:17:15 +02:00
o9000
da51d37322 Execp: force update after custom command execution (issue #586) 2016-08-08 12:04:31 +02:00
o9000
a09e1a0e45 Fixed multiple memory leaks 2016-08-08 11:15:59 +02:00
o9000
1d4f64d745 Fixed typo causing missing startup notifications 2016-08-08 10:58:18 +02:00
o9000
2857b96c4d Fixed memory leak in icon loading 2016-08-08 10:56:06 +02:00
o9000
8b08930268 tint2conf: fix typo (issue #592) 2016-08-07 14:23:49 +02:00
o9000
2922708c18 Launcher: reload shortcut on click: updated changelog (issue #569) 2016-08-07 14:18:34 +02:00
o9000
5c6385b4c3 Launcher: reload shortcut on click (issue #569) 2016-08-07 14:15:45 +02:00
o9000
e9d6ec9f23 Release 0.12.12 2016-08-02 15:44:51 +02:00
o9000
46d7c79359 tint2conf: menus accessible with alt + letter (issue #590) 2016-07-10 19:04:40 +02:00
o9000
d3f16e00b5 Fix bad printf in geometry logging 2016-07-10 18:42:24 +02:00
o9000
d95a5a02cf tint2conf: Handle keyboard shortcuts (issue #590) 2016-07-06 14:00:20 +02:00
o9000
22cb7d6d7f Update changelog 2016-06-04 14:32:59 +02:00
o9000
fc56e48781 Add option to debug geometry (set env var DEBUG_GEOMETRY) (issue #583) 2016-06-04 13:53:22 +02:00
o9000
95a9e8a82e Set task maximum height equal to width if not specified, instead of hardcoding 30 (issue #583) 2016-06-04 13:18:24 +02:00
o9000
717f4ac30a tint2conf: process background selection correctly (issue #582) 2016-05-31 22:24:04 +02:00
o9000
ee9207e84a Updated doc 2016-05-28 13:49:37 +02:00
o9000
9cbcca04df Updated doc 2016-05-25 11:54:51 +02:00
o9000
a5528a4bc1 Update README.md 2016-05-25 08:58:07 +00:00
o9000
e284e7c74a Updated man page 2016-05-25 00:59:26 +02:00
o9000
7a419df211 Updated man page 2016-05-25 00:53:20 +02:00
o9000
2edf6aaeba Update readme 2016-05-25 00:49:19 +02:00
o9000
ce15c53c04 Updated man page 2016-05-25 00:46:44 +02:00
o9000
231a97a631 Update changelog (issue #580) 2016-05-21 15:22:35 +02:00
o9000
ed802d7602 Compute layouts correctly with partial borders (issue #580) 2016-05-21 15:14:57 +02:00
o9000
77d2a74865 tint2conf: Translate labels (issue #580) 2016-05-19 10:37:51 +02:00
o9000
a5374cbc4a Merge branch 'patch-3' into 'master'
Update ru.po

Translate "border sides", change directional strings to be relatively context-neutral.

See merge request !15
2016-05-19 08:18:40 +00:00
Vladimir
428cbc69e3 Update ru.po 2016-05-19 08:08:31 +00:00
o9000
4538617d96 Tint2conf: updated French translation (issue #580) 2016-05-19 00:06:07 +02:00
o9000
dc008ae89d Tint2conf: regenerated translation files (issue #580) 2016-05-19 00:03:52 +02:00
o9000
3615571e39 Tint2conf: remove tooltips for border sides, it is clear (issue #580) 2016-05-18 23:55:09 +02:00
o9000
ed3fcd63fc Tint2conf: use strcat instead of append (issue #580) 2016-05-18 23:27:55 +02:00
o9000
d49dac2e05 Tint2conf: read border sides correctly when enabled by default (issue #580) 2016-05-18 23:25:07 +02:00
o9000
754a697099 Tint2conf: enable all border sides by default (issue #580) 2016-05-18 23:23:15 +02:00
o9000
285afd22ad Tint2conf: use bool instead of int for border sides (issue #580) 2016-05-18 23:22:48 +02:00
o9000
50c2f72a66 Tint2conf: support border sides (issue #580, thanks @stophe) 2016-05-18 23:13:28 +02:00
o9000
42d95f2930 Updated authors file (issue #580) 2016-05-18 10:31:19 +02:00
o9000
78bc215677 Draw background correctly (issue #580, thanks @stophe) 2016-05-17 22:19:09 +02:00
o9000
78bc8b5c74 Draw border on only some sides (issue #580, thanks @stophe) 2016-05-17 21:59:43 +02:00
o9000
5a5d8fd978 Release 0.12.11 2016-05-14 08:39:54 +02:00
o9000
e09c4a0642 tint2conf: changed window title 2016-05-14 08:16:10 +02:00
o9000
c1eb404095 Update themes 2016-05-09 12:27:27 +02:00
o9000
7b3769da2a Update changelog 2016-05-09 12:22:05 +02:00
o9000
cc49e4026e tint2conf: Update translations 2016-05-09 12:20:31 +02:00
o9000
385f4fd25b tint2conf: Regenerate po files 2016-05-09 12:18:05 +02:00
o9000
6c00321262 tint2conf: Update pot file 2016-05-09 12:17:30 +02:00
o9000
aa77f05a98 tint2conf: Add extension if missing in save as dialog 2016-05-09 12:16:56 +02:00
o9000
ccd590e397 tint2conf: Workaround for a GTK quirk to prevent a crash when adding backgrounds 2016-05-07 20:13:13 +02:00
58 changed files with 9094 additions and 5356 deletions

View File

@@ -23,6 +23,7 @@ Contributors:
Craig Oakes : WM flags, issue tracker organization
Jeff Blake (https://gitlab.com/u/berkley4) : more mouse event handlers
Vladimir <vladimir-csp@yandex.ru> : translations, bug reports
Christophe D. <stophe72.d@gmail.com> : non-rectangular borders
Translations:
Bosnian:

View File

@@ -244,7 +244,8 @@ install( FILES tint2.desktop DESTINATION ${DATADIR}/applications )
install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" )
install( FILES themes/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 )
install( FILES AUTHORS ChangeLog README.md DESTINATION ${DOCDIR} )
install( FILES AUTHORS ChangeLog README.md doc/tint2.md doc/manual.html doc/readme.html DESTINATION ${DOCDIR} )
install( DIRECTORY doc/images DESTINATION ${DOCDIR} )
install( FILES doc/tint2.1 DESTINATION ${MANDIR}/man1 )
if( ENABLE_EXTRA_THEMES )
add_subdirectory(themes)

View File

@@ -1,3 +1,25 @@
2016-08-07 master
- Enhancements:
- Desktop files (shortcuts) used in launcher are reloaded on click, in case the file has changed
2016-08-02 0.12.12
- Fixes:
- Set task maximum height equal to width if not specified, instead of hardcoding 30 (issue #583; thanks @VastOne)
- tint2conf
- Process background selection events correctly (issue #582)
- Menus accessible with keyboard shortcuts (issue #590)
- Enhancements:
- Borders can now be drawn on only some sides; configurable with the option border_sides (issue #580; thanks @stophe)
- Updated man page
- The geometry of panel items is printed to stderr if the environment variable DEBUG_GEOMETRY is set
2016-05-14 0.12.11
- Fixes:
- tint2conf:
- Fixed crash in tint2conf when adding background
- Add correct extension to file name in tint2conf for 'Save as'
- Changed main window title in tint2conf
2016-05-07 0.12.10
- Fixes:
- Fixed crash in systray with non-Latin languagess (thanks zcodes)

View File

@@ -1,10 +0,0 @@
To build and install tint2 you need CMake.
These steps should be enough for building tint2:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ../
make
sudo make install
To see additional options you can set at the 'cmake' step, run 'cmake -L ../'

View File

@@ -1,13 +1,14 @@
# Latest stable release: 0.12.10
Changes: https://gitlab.com/o9000/tint2/blob/0.12.10/ChangeLog
# Latest stable release: 0.12.12
Changes: https://gitlab.com/o9000/tint2/blob/0.12.12/ChangeLog
Documentation: https://gitlab.com/o9000/tint2/wikis/Configure
Documentation: [doc/tint2.md](doc/tint2.md)
Compile it with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)):
```
git clone https://gitlab.com/o9000/tint2.git
cd tint2
git checkout 0.12.10
git checkout 0.12.12
mkdir build
cd build
cmake ..
@@ -15,6 +16,7 @@ make -j4
```
To install, run (as root):
```
make install
```
@@ -27,7 +29,7 @@ P.S. GitLab is now the official location of the tint2 project, migrated from Goo
# What is tint2?
tint2 is a simple panel/taskbar made for modern X window managers. It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.). It is based on ttm http://code.google.com/p/ttm/.
tint2 is a simple panel/taskbar made for modern X window managers. It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.). It is based on ttm https://code.google.com/p/ttm/.
# Features
@@ -50,7 +52,7 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
# How do I ...
* [Install](https://gitlab.com/o9000/tint2/wikis/Install)
* [Configure](https://gitlab.com/o9000/tint2/wikis/Configure)
* [Configure](https://gitlab.com/o9000/tint2/blob/master/doc/tint2.md)
* [Add applet not supported by tint2](https://gitlab.com/o9000/tint2/wikis/ThirdPartyApplets)
* [Other frequently asked questions](https://gitlab.com/o9000/tint2/wikis/FAQ)
* [Obtain a stack trace when tint2 crashes](https://gitlab.com/o9000/tint2/wikis/Debug)

2
doc/footer.html Normal file
View File

@@ -0,0 +1,2 @@
</body>
</html>

13
doc/generate-doc.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# You can install md2man with gem install md2man. You need gem and ruby-dev.
md2man-roff tint2.md > tint2.1
cat header.html > manual.html
cat tint2.md | sed 's/^# TINT2 .*$/# TINT2/g' | md2man-html >> manual.html
cat footer.html >> manual.html
cat header.html > readme.html
cat ../README.md | sed 's|doc/tint2.md|manual.html|g' | md2man-html >> readme.html
cat footer.html >> readme.html

201
doc/header.html Normal file
View File

@@ -0,0 +1,201 @@
<!DOCTYPE html>
<html>
<head>
<head>
<style type="text/css">
html,
body {
color: #333;
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
word-wrap: break-word;
max-width: 1000px;
margin: 0 auto;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 1em;
margin-bottom: 1rem;
}
h1 {
font-size: 1.8rem;
font-weight: normal;
font-style: normal;
border-bottom: 1px solid #eee;
}
h2 {
font-size: 1.5rem;
font-weight: normal;
font-style: normal;
border-bottom: 1px solid #eee;
}
h3 {
font-size: 1.2rem;
font-weight: bold;
font-style: normal;
}
h4 {
font-size: 1rem;
font-weight: bold;
font-style: normal;
}
h5 {
font-size: 1rem;
font-weight: bold;
font-style: italic;
}
h6 {
font-size: 1rem;
font-weight: normal;
font-style: italic;
}
code,
kbd,
pre {
font-family: monospace;
font-size: 1em;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
asdff {
box-sizing: border-box;
}
a {
color: #46c;
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
hr {
box-sizing: content-box;
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
hr::before {
display: table;
content: "";
}
hr::after {
display: table;
clear: both;
content: "";
}
p {
margin-top: 0;
margin-bottom: 0.7em;
}
blockquote {
margin: 0;
}
code {
font-family: "Liberation Mono", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 0;
font: 1em "Liberation Mono", monospace;
overflow-x: auto;
}
blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
blockquote>:first-child {
margin-top: 0;
}
blockquote>:last-child {
margin-bottom: 0;
}
table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
}
table th {
font-weight: bold;
}
table th,
table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
code {
padding: 0.2em;
margin: 0;
font-size: 0.95em;
background-color: #eee;
}
pre {
word-wrap: normal;
background-color: #eee;
margin: 1em 0;
padding: 0.2em;
}
</style>
</head>
<body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
doc/images/task_padding.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

728
doc/manual.html Normal file
View File

@@ -0,0 +1,728 @@
<!DOCTYPE html>
<html>
<head>
<head>
<style type="text/css">
html,
body {
color: #333;
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
word-wrap: break-word;
max-width: 1000px;
margin: 0 auto;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 1em;
margin-bottom: 1rem;
}
h1 {
font-size: 1.8rem;
font-weight: normal;
font-style: normal;
border-bottom: 1px solid #eee;
}
h2 {
font-size: 1.5rem;
font-weight: normal;
font-style: normal;
border-bottom: 1px solid #eee;
}
h3 {
font-size: 1.2rem;
font-weight: bold;
font-style: normal;
}
h4 {
font-size: 1rem;
font-weight: bold;
font-style: normal;
}
h5 {
font-size: 1rem;
font-weight: bold;
font-style: italic;
}
h6 {
font-size: 1rem;
font-weight: normal;
font-style: italic;
}
code,
kbd,
pre {
font-family: monospace;
font-size: 1em;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
asdff {
box-sizing: border-box;
}
a {
color: #46c;
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
hr {
box-sizing: content-box;
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
hr::before {
display: table;
content: "";
}
hr::after {
display: table;
clear: both;
content: "";
}
p {
margin-top: 0;
margin-bottom: 0.7em;
}
blockquote {
margin: 0;
}
code {
font-family: "Liberation Mono", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 0;
font: 1em "Liberation Mono", monospace;
overflow-x: auto;
}
blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
blockquote>:first-child {
margin-top: 0;
}
blockquote>:last-child {
margin-bottom: 0;
}
table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
}
table th {
font-weight: bold;
}
table th,
table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
code {
padding: 0.2em;
margin: 0;
font-size: 0.95em;
background-color: #eee;
}
pre {
word-wrap: normal;
background-color: #eee;
margin: 1em 0;
padding: 0.2em;
}
</style>
</head>
<body>
<h1 id="tint2"><span class="md2man-title">TINT2</span><a name="tint2" href="#tint2" class="md2man-permalink" title="permalink"></a></h1><h2 id="name">NAME<a name="name" href="#name" class="md2man-permalink" title="permalink"></a></h2><p>tint2 - lightweight panel/taskbar</p><h2 id="synopsis">SYNOPSIS<a name="synopsis" href="#synopsis" class="md2man-permalink" title="permalink"></a></h2><p><code>tint2 [-c path_to_config_file]</code></p><h2 id="description">DESCRIPTION<a name="description" href="#description" class="md2man-permalink" title="permalink"></a></h2><p>tint2 is a simple panel/taskbar made for modern X window managers.
It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).</p><p>Features:</p>
<ul>
<li>Panel with taskbar, system tray, clock and launcher icons;</li>
<li>Easy to customize: color/transparency on fonts, icons, borders and backgrounds;</li>
<li>Pager like capability: move tasks between workspaces (virtual desktops), switch between workspaces;</li>
<li>Multi-monitor capability: create one panel per monitor, showing only the tasks from the current monitor;</li>
<li>Customizable mouse events.</li>
</ul>
<p>Goals:</p>
<ul>
<li>Be unintrusive and light (in terms of memory, CPU and aesthetic);</li>
<li>Follow the freedesktop.org specifications;</li>
<li>Make certain workflows, such as multi-desktop and multi-monitor, easy to use.</li>
</ul>
<h2 id="options">OPTIONS<a name="options" href="#options" class="md2man-permalink" title="permalink"></a></h2><dl><dt><code>-c path_to_config_file</code></dt><dd>Specifies which configuration file to use instead of the default.</dd></dl><h2 id="configuration">CONFIGURATION<a name="configuration" href="#configuration" class="md2man-permalink" title="permalink"></a></h2><h3 id="table-of-contents">Table of contents<a name="table-of-contents" href="#table-of-contents" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><a href="#introduction">Introduction</a></p></li>
<li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li>
<li><p><a href="#panel">Panel</a></p></li>
<li><p><a href="#launcher">Launcher</a></p></li>
<li><p><a href="#taskbar-pager">Taskbar/Pager</a></p></li>
<li><p><a href="#taskbar-buttons">Taskbar buttons</a></p></li>
<li><p><a href="#mouse-actions-for-taskbar-buttons">Mouse actions for taskbar buttons</a></p></li>
<li><p><a href="#system-tray">System tray</a></p></li>
<li><p><a href="#clock">Clock</a></p></li>
<li><p><a href="#tooltip">Tooltip</a></p></li>
<li><p><a href="#battery">Battery</a></p></li>
<li><p><a href="#executor">Executor</a></p></li>
<li><p><a href="#example-configuration">Example configuration</a></p></li>
</ul>
<h3 id="introduction">Introduction<a name="introduction" href="#introduction" class="md2man-permalink" title="permalink"></a></h3><p>These are instructions for configuring tint2 directly by editing its config file.
You may also use instead the graphical interface <code>tint2conf</code>.</p><p>The first time you run tint2, it will create the config file in <code>$HOME/.config/tint2/tint2rc</code> (This applies if you have done a clean install. Running tint2 in the source directory without doing &#39;make install&#39; will not create the config file.)</p><p>You can also specify another file on the command line with the -c option, e.g.: <code>tint2 -c $HOME/tint2.conf</code>. This can be used to run multiple instances of tint2 that use different settings.</p><p>If you change the config file while tint2 is running, the command <code>killall -SIGUSR1 tint2</code> will force tint2 to reload it.</p><p>All the configuration options supported in the config file are listed below.
Try to respect as much as possible the order of the options as given below.</p><h3 id="backgrounds-and-borders">Backgrounds and borders<a name="backgrounds-and-borders" href="#backgrounds-and-borders" class="md2man-permalink" title="permalink"></a></h3><p>The tint2 config file starts with the options defining background elements with borders:</p>
<ul>
<li><p><code>rounded = number_of_pixels</code> : the corner radius</p></li>
<li><p><code>border_width = integer</code> : the border width in pixels</p></li>
<li><p><code>border_sides = LRTB</code> : the sides to draw the border on (left, right, top, bottom). If not specified, all sides are used. <em>(since 0.12.12)</em></p></li>
<li><p><code>background_color = color opacity</code></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz).</li>
</ul></li>
<li><p><code>border_color = color opacity</code></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque</li>
</ul></li>
<li><p><code>background_color_hover = color opacity</code> (default: same as <code>background_color</code>) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)</li>
</ul></li>
<li><p><code>border_color_hover = color opacity</code> (default: same as <code>border_color</code>) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque</li>
</ul></li>
<li><p><code>background_color_pressed = color opacity</code> (default: same as <code>background_color_hover</code>) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)</li>
</ul></li>
<li><p><code>border_color_pressed = color opacity</code> (default: same as <code>border_color_hover</code>) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque</li>
</ul></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
border_width = 0
background_color = #282828 100
border_color = #000000 0
rounded = 1
border_width = 0
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
taskbar_background_id = 0
task_background_id = 0
task_active_background_id = 2
systray_background_id = 0
clock_background_id = 0
</code></pre>
<p>Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.</p><h3 id="panel">Panel<a name="panel" href="#panel" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>panel_items = LTSBC</code> defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:</p>
<ul>
<li><code>L</code> shows the Launcher</li>
<li><code>T</code> shows the Taskbar</li>
<li><code>S</code> shows the Systray (also called notification area)</li>
<li><code>B</code> shows the Battery status</li>
<li><code>C</code> shows the Clock</li>
<li><code>F</code> adds an extensible spacer (freespace). Has no effect if <code>T</code> is also present. <em>(since 0.12)</em></li>
<li><code>E</code> adds an executor plugin. You can specify more than one. <em>(since 0.12.4)</em></li>
</ul>
<p>For example, <code>panel_items = STC</code> will show the systray, the taskbar and the clock (from left to right).</p></li>
<li><p><code>panel_monitor = monitor (all or 1 or 2 or ...)</code> : Which monitor tint2 draws the panel on</p>
<ul>
<li>The first monitor is <code>1</code></li>
<li>Use <code>panel_monitor = all</code> to get a separate panel per monitor</li>
</ul></li>
<li><p><code>primary_monitor_first = boolean (0 or 1)</code> : Place the primary monitor before all the other monitors in the list. <em>(since 0.12.4)</em></p></li>
</ul>
<p><img src="images/panel_padding.jpg" alt=""></p>
<ul>
<li><p><code>panel_position = vertical_position horizontal_position orientation</code></p>
<ul>
<li><code>vertical_position</code> is one of: <code>bottom</code>, <code>top</code>, <code>center</code></li>
<li><code>horizontal_position</code> is one of: <code>left</code>, <code>right</code>, <code>center</code></li>
<li><code>orientation</code> is one of: <code>horizontal</code>, <code>vertical</code></li>
</ul></li>
<li><p><code>panel_size = width height</code></p>
<ul>
<li><code>width</code> and <code>height</code> can be specified without units (e.g. <code>123</code>) as pixels, or followed by <code>%</code> as percentages of the monitor size (e.g. <code>50%</code>). Use <code>100%</code> for full monitor width/height.
Example:</li>
</ul></li>
</ul>
<pre class="highlight plaintext"><code># The panel's width is 94% the size of the monitor, the height is 30 pixels:
panel_size = 94% 30
</code></pre>
<ul>
<li><code>panel_margin = horizontal_margin vertical_margin</code> : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use <code>0</code> to obtain a panel with the same size as the edge of the monitor (no margin).</li>
</ul>
<p><img src="images/panel_size_margin.jpg" alt=""></p>
<ul>
<li><code>panel_padding = horizontal_padding vertical_padding spacing</code> : Please refer to the image below.</li>
</ul>
<p><img src="images/panel_padding.jpg" alt=""></p>
<ul>
<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_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>
<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>
<li><code>none</code> means that the maximized windows use the full screen size.</li>
</ul></li>
<li><p><code>panel_window_name = string</code> : Defines the name of the panel&#39;s window. Default: &#39;tint2&#39;. <em>(since 0.12)</em></p></li>
<li><p><code>disable_transparency = boolean (0 or 1)</code> : Whether to disable transparency instead of detecting if it is supported. Useful on broken graphics stacks. <em>(since 0.12)</em></p></li>
<li><p><code>mouse_effects = boolean (0 or 1)</code> : Whether to enable mouse hover effects for clickable items. <em>(since 0.12.3)</em></p></li>
<li><p><code>mouse_hover_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the icon color and transparency on mouse hover (works only when mouse_effects = 1).` <em>(since 0.12.3)</em></p></li>
<li><p><code>mouse_pressed_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the icon color and transparency on mouse press (works only when mouse_effects = 1).` <em>(since 0.12.3)</em></p></li>
<li><p><code>autohide = boolean (0 or 1)</code> : Whether to enable panel hiding when the mouse cursor exists the panel.</p></li>
<li><p><code>autohide_show_timeout = float</code> : Show timeout in seconds after the mouse cursor enters the panel. Use &#39;.&#39; as decimal separator.</p></li>
<li><p><code>autohide_hide_timeout = float</code> : Hide timeout in seconds after the mouse cursor exits the panel. Use &#39;.&#39; as decimal separator.</p></li>
<li><p><code>autohide_height = integer</code> : panel height (width for vertical panels) in hidden mode.</p></li>
</ul>
<h3 id="launcher">Launcher<a name="launcher" href="#launcher" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>launcher_item_app = path_to_application</code> : Each <code>launcher_item_app</code> must be a file path to a .desktop file following the freedesktop.org <a href="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html">specification</a>. The paths may begin with <code>~</code>, which is expanded to the path of the user&#39;s home directory. If only a file name is specified, the file is search in the standard application directories (<code>$XDG_DATA_HOME/applications</code>, <code>~/.local/share/applications</code>, <code>$XDG_DATA_DIRS/applications</code>, <code>/usr/local/share/applications</code>, <code>/usr/share/applications</code>, <code>/opt/share/applications</code>).</p></li>
<li><p><code>launcher_apps_dir = path_to_directory</code> : Specifies a path to a directory from which the launcher is loading all .desktop files (all subdirectories are explored recursively). Can be used multiple times. The path may begin with <code>~</code>, which is expanded to the path of the user&#39;s home directory. <em>(since 0.12)</em></p></li>
<li><p><code>launcher_background_id = integer</code> : Defines which background to use.</p></li>
<li><p><code>launcher_icon_background_id = integer</code> : Defines which background to use for icons.</p></li>
<li><p><code>launcher_padding = horizontal_padding vertical_padding spacing</code></p></li>
<li><p><code>launcher_icon_size = integer</code> : The launcher icon size, in pixels.</p></li>
<li><p><code>launcher_icon_theme = name_of_theme</code> : (Optional) Uses the specified icon theme to display shortcut icons. Note that tint2 will detect and use the icon theme of your desktop if you have an XSETTINGS manager running (which you probably do), unless <code>launcher_icon_theme_override = 1</code>.</p></li>
<li><p><code>launcher_icon_theme_override = boolean (0 or 1)</code> : Whether <code>launcher_icon_theme</code> overrides the value obtained from the XSETTINGS manager. <em>(since 0.12)</em></p></li>
<li><p><code>launcher_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the icon color and transparency.</p></li>
<li><p><code>launcher_tooltip = boolean (0 or 1)</code> : Whether to show tooltips for the launcher icons.</p></li>
<li><p><code>startup_notifications = boolean (0 or 1)</code> : Whether to show startup notifications when starting applications from the launcher. <em>(since 0.12)</em></p></li>
</ul>
<h3 id="taskbar-pager">Taskbar / Pager<a name="taskbar-pager" href="#taskbar-pager" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>taskbar_mode = single_desktop/multi_desktop</code></p>
<ul>
<li><code>single_desktop</code> : Shows a normal taskbar listing the tasks running on the current virtual desktop (also known as &#39;workspace&#39;);</li>
<li><code>multi_desktop</code> : Pager like capability. Shows multiple taskbars, one per virtual desktop, with which:
<ul>
<li>You can drag-and-drop tasks between virtual desktops;</li>
<li>You can switch between virtual desktops.</li>
</ul></li>
</ul></li>
<li><p><code>taskbar_distribute_size = boolean (0 or 1)</code> : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. <em>(since 0.12)</em></p></li>
<li><p><code>taskbar_padding = horizontal_padding vertical_padding spacing</code></p></li>
</ul>
<p><img src="images/taskbar_padding.jpg" alt=""></p>
<ul>
<li><p><code>taskbar_background_id = integer</code> : Which background to use</p></li>
<li><p><code>taskbar_active_background_id = integer</code> : Which background to use for the taskbar of the current virtual desktop.</p></li>
<li><p><code>taskbar_hide_inactive_tasks = boolean (0 or 1)</code> : If enabled, the taskbar shows only the active task. <em>(since 0.12)</em></p></li>
<li><p><code>taskbar_hide_different_monitor = boolean (0 or 1)</code> : If enabled, the taskbar shows only the tasks from the current monitor. Useful when running different tint2 instances on different monitors, each one having its own config. <em>(since 0.12)</em></p></li>
<li><p><code>taskbar_always_show_all_desktop_tasks = boolean (0 or 1)</code> : Has effect only if <code>taskbar_mode = multi_desktop</code>. If enabled, tasks that appear on all desktops are shown on all taskbars. Otherwise, they are shown only on the taskbar of the current desktop. <em>(since 0.12.4)</em></p></li>
<li><p><code>taskbar_sort_order = none/title/center</code> : Specifies the sort order of the tasks on the taskbar. <em>(since 0.12)</em></p>
<ul>
<li><code>none</code> : No sorting. New tasks are simply appended at the end of the taskbar when they appear.</li>
<li><code>title</code> : Sorts the tasks by title.</li>
<li><code>center</code> : Sorts the tasks by their window centers.</li>
<li><code>mru</code> : Shows the most recently used tasks first. <em>(since 0.12.4)</em></li>
<li><code>lru</code> : Shows the most recently used tasks last. <em>(since 0.12.4)</em></li>
</ul></li>
<li><p><code>task_align = left/center/right</code> : Specifies the alignment of the tasks on the taskbar. Default: left.</p></li>
<li><p><code>taskbar_name = boolean (0 or 1)</code> : Whether to show the virtual desktop name in the taskbar.</p></li>
<li><p><code>taskbar_name_padding = padding</code> : Padding for the virtual desktop name.</p></li>
<li><p><code>taskbar_name_background_id = integer</code> : Which background to use for the desktop name.</p></li>
<li><p><code>taskbar_name_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code> : Font configuration for the desktop name.</p></li>
<li><p><code>taskbar_name_font_color = color opacity (0 to 100)</code> : Font color for the desktop name.</p></li>
<li><p><code>taskbar_name_active_background_id = integer</code> : Which background to use for the name of the current desktop.</p></li>
<li><p><code>taskbar_name_active_font_color = color opacity (0 to 100)</code> : Font color for the name of the current desktop.</p></li>
</ul>
<h1 id="taskbar-buttons">Taskbar buttons<a name="taskbar-buttons" href="#taskbar-buttons" class="md2man-permalink" title="permalink"></a></h1><p>The following options configure the task buttons in the taskbar:</p>
<ul>
<li><p><code>task_icon = boolean (0 or 1)</code> : Whether to display the task icon.</p></li>
<li><p><code>task_text = boolean (0 or 1)</code> : Whether to display the task text.</p></li>
<li><p><code>task_centered = boolean (0 or 1)</code> : Whether the task text is centered.</p></li>
<li><p><code>task_tooltip = boolean (0 or 1)</code> : Whether to show tooltips for tasks.</p></li>
<li><p><code>task_maximum_size = width height</code></p>
<ul>
<li><code>width</code> is used with horizontal panels to limit the size of the tasks. Use <code>width = 0</code> to get full taskbar width.</li>
<li><code>height</code> is used with vertical panels.</li>
</ul></li>
<li><p><code>task_padding = horizontal_padding vertical_padding spacing</code></p></li>
<li><p><code>urgent_nb_of_blink = integer</code> : Number of blinks on &#39;get attention&#39; events.</p></li>
</ul>
<p><img src="images/task_padding.jpg" alt=""></p>
<ul>
<li><p><code>task_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>task_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>task_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjust the task icon&#39;s color and transparency.</p></li>
<li><p><code>task_background_id = integer</code> : Which background to use for non selected tasks</p></li>
</ul>
<dl><dt>For the next 3 options STATUS can be <code>active</code> / <code>iconified</code> / <code>urgent</code>:</dt><dd>* <code>task_STATUS_font_color = color opacity (0 to 100)</code></dd></dl>
<ul>
<li><p><code>task_STATUS_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the task icon&#39;s color and transparency.</p></li>
<li><p><code>task_STATUS_background_id = integer</code> : Which background to use for the task.</p></li>
</ul>
<h3 id="mouse-actions-for-taskbar-buttons">Mouse actions for taskbar buttons<a name="mouse-actions-for-taskbar-buttons" href="#mouse-actions-for-taskbar-buttons" class="md2man-permalink" title="permalink"></a></h3><p>The possible mouse events are: <code>left, middle, right, scroll_up, scroll_down</code>.</p><p>The possible mouse actions are: <code>none, close, toggle, iconify, shade, toggle_iconify, maximize_restore, desktop_left, desktop_right, next_task, prev_task</code>.</p><p>Use <code>mouse_event = action</code> to customize mouse actions. Example:
<code>
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
</code></p><dl><dt>The action semantics:</dt><dd>* <code>none</code> : If <code>wm_menu = 1</code> is set, the mouse event is forwarded to the window manager. Otherwise it is ignored.
* <code>close</code> : close the task
* <code>toggle</code> : toggle the task
* <code>iconify</code> : iconify (minimize) the task
* <code>toggle_iconify</code> : toggle or iconify the task
* <code>maximize_restore</code> : maximized or minimized the task
* <code>shade</code> : shades (collapses) the task
* <code>desktop_left</code> : send the task to the desktop on the left
* <code>desktop_right</code> : send the task to the desktop on the right
* <code>next_task</code> : send the focus to next task
* <code>prev_task</code> : send the focus to previous task</dd></dl><h3 id="system-tray">System Tray<a name="system-tray" href="#system-tray" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>systray_padding = horizontal_padding vertical_padding spacing</code></p></li>
<li><p><code>systray_background_id = integer</code> : Which background to use.</p></li>
<li><p><code>systray_sort = ascending/descending/left2right/right2left</code> : Specifies the sorting order for the icons in the systray: in ascending/descending alphabetical order of the icon title, or always add icons to the right/left (note that with <code>left2right</code> or <code>right2left</code> the order can be different on panel restart).</p></li>
<li><p><code>systray_icon_size = max_icon_size</code> : Set the maximum system tray icon size to <code>number</code>. Set to <code>0</code> for automatic icon sizing.</p></li>
<li><p><code>systray_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjust the systray icons color and transparency.</p></li>
<li><p><code>systray_monitor = integer (1, 2, ...)</code> : On which monitor to draw the systray. The first monitor is <code>1</code>. <em>(since 0.12)</em></p></li>
</ul>
<h3 id="clock">Clock<a name="clock" href="#clock" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>time1_format = %H:%M</code> : The format used by the first line of the clock.</p>
<ul>
<li><code>time1_format</code>, <code>time2_format</code> and <code>clock_tooltip</code> use the &#39;strftime&#39; syntax. More info can be found here: <a href="http://www.manpagez.com/man/3/strftime/">http://www.manpagez.com/man/3/strftime/</a></li>
<li>To hide the clock, comment <code>time1_format</code> and <code>time2_format</code>.</li>
</ul></li>
<li><p><code>time1_timezone = :US/Hawaii</code></p>
<ul>
<li><code>time1_timezone</code>, <code>time2_timezone</code> and <code>clock_tooltip_timezone</code> can be used to specify a timezone. If you do not specify a value the system-wide timezone is used. The timezones can usually be found in <code>/usr/share/zoneinfo</code>. If your timezones are in a different directory, you need to specify the absolute path, e.g. <code>time1_timezone = :/different/zoneinfo/dir/US/Hawaii</code> Always prepend the timezone with a &#39;:&#39;</li>
</ul></li>
<li><p><code>time1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>time2_format = %A %d %B</code></p></li>
<li><p><code>time2_timezone = :Europe/Berlin</code></p></li>
<li><p><code>time2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>clock_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>clock_padding = horizontal_padding vertical_padding</code></p></li>
<li><p><code>clock_background_id = integer</code> : Which background to use</p></li>
<li><p><code>clock_tooltip = %a, %d. %b %Y</code> : Format for the clock&#39;s tooltip.</p></li>
<li><p><code>clock_tooltip_timezone = :UTC</code></p></li>
<li><p><code>clock_lclick_command = text</code> : Command to execute on left click.</p></li>
<li><p><code>clock_rclick_command = text</code> : Command to execute on right click.</p></li>
<li><p><code>clock_mclick_command = text</code> : Command to execute on middle click. <em>(since 0.12.1)</em></p></li>
<li><p><code>clock_uwheel_command = text</code> : Command to execute on wheel scroll up. <em>(since 0.12.1)</em></p></li>
<li><p><code>clock_dwheel_command = text</code> : Command to execute on wheel scroll down. <em>(since 0.12.1)</em></p></li>
</ul>
<h3 id="tooltip">Tooltip<a name="tooltip" href="#tooltip" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>tooltip_padding = horizontal_padding vertical_padding</code></p></li>
<li><p><code>tooltip_show_timeout = float</code> : Delay to show the tooltip in seconds. Use <code>.</code> as decimal separator.</p></li>
<li><p><code>tooltip_hide_timeout = float</code> : Delay to hide the tooltip in seconds. Use <code>.</code> as decimal separator.</p></li>
<li><p><code>tooltip_background_id = integer</code> : Which background to use for tooltips. Note that with fake transparency the alpha channel and corner radius options are not respected.</p></li>
<li><p><code>tooltip_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>tooltip_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
</ul>
<h3 id="battery">Battery<a name="battery" href="#battery" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>battery_hide = never/integer (0 to 100)</code> : At what battery percentage the battery item is hidden.</p></li>
<li><p><code>battery_low_status = integer</code>: At what battery percentage the low command is executed.</p></li>
<li><p><code>battery_low_cmd = notify-send &quot;battery low&quot;</code> : Command to execute when the battery is low.</p></li>
<li><p><code>bat1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>bat2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>battery_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>battery_padding = horizontal_padding vertical_padding</code></p></li>
<li><p><code>battery_background_id = integer</code> : Which background to use for the battery.</p></li>
<li><p><code>battery_tooltip_enabled = boolean (0 or 1)</code> : Enable/disable battery tooltips. <em>(since 0.12.3)</em></p></li>
<li><p><code>battery_lclick_command = text</code> : Command to execute on left click. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_rclick_command = text</code> : Command to execute on right click. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_mclick_command = text</code> : Command to execute on middle click. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_uwheel_command = text</code> : Command to execute on wheel scroll up. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_dwheel_command = text</code> : Command to execute on wheel scroll down. <em>(since 0.12.1)</em></p></li>
<li><p><code>ac_connected_cmd = text</code> : Command to execute when the power adapter is plugged in. <em>(since 0.12.3)</em></p></li>
<li><p><code>ac_disconnected_cmd = text</code> : Command to execute when the power adapter is unplugged. <em>(since 0.12.3)</em></p></li>
</ul>
<h3 id="executor">Executor<a name="executor" href="#executor" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>execp = new</code> : Begins the configuration of a new executor plugin. Multiple such plugins are supported; just use multiple <code>E</code>s in <code>panel_items</code>. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_command = text</code> : Command to execute. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_interval = integer</code> : The command is executed again after <code>execp_interval</code> seconds from the moment it exits. If zero, the command is executed only once. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_continuous = integer</code> : If non-zero, the last <code>execp_continuous</code> lines from the output of the command are displayed, every <code>execp_continuous</code> lines; this is useful for showing the output of commands that run indefinitely, such as <code>ping 127.0.0.1</code>. If zero, the output of the command is displayed after it finishes executing. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_has_icon = boolean (0 or 1)</code> : If <code>execp_has_icon = 1</code>, the first line printed by the command is interpreted as a path to an image file. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_cache_icon = boolean (0 or 1)</code> : If <code>execp_cache_icon = 0</code>, the image is reloaded each time the command is executed (useful if the image file is changed on disk by the program executed by <code>execp_command</code>). <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_icon_w = integer</code> : You can use <code>execp_icon_w</code> and <code>execp_icon_h</code> to resize the image. If one of them is zero/missing, the image is rescaled proportionally. If both of them are zero/missing, the image is not rescaled. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_icon_h = integer</code> : See <code>execp_icon_w</code>. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_tooltip = text</code> : The tooltip. Leave it empty to not display a tooltip. Not specifying this option leads to showing an automatically generated tooltip with information about when the command was last executed. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code> : The font used to draw the text. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_font_color = color opacity</code> : The font color. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_markup = boolean (0 or 1)</code> : If non-zero, the output of the command is treated as Pango markup, which allows rich text formatting. The format is <a href="https://developer.gnome.org/pygtk/stable/pango-markup-language.html">documented here</a>. Note that using this with commands that print data downloaded from the Internet is a possible security risk. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_background_id = integer</code> : Which background to use. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_centered = boolean (0 or 1)</code> : Whether to center the text. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text</code> <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_lclick_command = text</code> : Command to execute on left 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_mclick_command = text</code> : Command to execute on right 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_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
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}'
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;'
execp_has_icon = 1
execp_interval = 0
execp_centered = 1
execp_font = sans 9
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_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(); }'
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(); }'
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 -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(); } '
execp_continuous = 1
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 -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
execp_interval = 1
execp_continuous = 1
</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.
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_continuous = 1
execp_interval = 1
</code></pre>
<h3 id="example-configuration">Example configuration<a name="example-configuration" href="#example-configuration" class="md2man-permalink" title="permalink"></a></h3><pre class="highlight plaintext"><code>#---------------------------------------------
## TINT2 CONFIG FILE
#---------------------------------------------
#---------------------------------------------
## BACKGROUND AND BORDER
#---------------------------------------------
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #ffffff 18
rounded = 5
border_width = 0
background_color = #ffffff 40
border_color = #ffffff 50
rounded = 5
border_width = 0
background_color = #ffffff 18
border_color = #ffffff 70
#---------------------------------------------
## PANEL
#---------------------------------------------
panel_monitor = all
panel_position = bottom center
panel_size = 94% 30
panel_margin = 0 0
panel_padding = 7 0
font_shadow = 0
panel_background_id = 1
wm_menu = 0
panel_dock = 0
panel_layer = bottom
#---------------------------------------------
## TASKBAR
#---------------------------------------------
#taskbar_mode = multi_desktop
taskbar_mode = single_desktop
taskbar_padding = 2 3 2
taskbar_background_id = 0
#taskbar_active_background_id = 0
#---------------------------------------------
## TASKS
#---------------------------------------------
task_icon = 1
task_text = 1
task_maximum_size = 140 35
task_centered = 1
task_padding = 6 3
task_font = sans 7
task_font_color = #ffffff 70
task_background_id = 3
task_icon_asb = 100 0 0
## replace STATUS by 'urgent', 'active' or 'iconfied'
#task_STATUS_background_id = 2
#task_STATUS_font_color = #ffffff 85
#task_STATUS_icon_asb = 100 0 0
## example:
task_active_background_id = 2
task_active_font_color = #ffffff 85
task_active_icon_asb = 100 0 0
urgent_nb_of_blink = 8
#---------------------------------------------
## SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 0 4 5
systray_background_id = 0
systray_sort = left2right
systray_icon_size = 0
systray_icon_asb = 100 0 0
#---------------------------------------------
## CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #ffffff 76
clock_padding = 1 0
clock_background_id = 0
#clock_lclick_command = xclock
clock_rclick_command = orage
#clock_tooltip = %A %d %B
#time1_timezone = :US/Hawaii
#time2_timezone = :Europe/Berlin
#clock_tooltip_timezone = :/usr/share/zoneinfo/Europe/Paris
#---------------------------------------------
## BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0
#---------------------------------------------
## TOOLTIP
#---------------------------------------------
tooltip = 0
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #OOOOOO 80
tooltip_font = sans 10
#---------------------------------------------
## MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
#---------------------------------------------
## AUTOHIDE OPTIONS
#---------------------------------------------
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 2
autohide_height = 4
strut_policy = minimum
</code></pre>
<h2 id="author">AUTHOR<a name="author" href="#author" class="md2man-permalink" title="permalink"></a></h2><p>tint2 was written by Thierry Lorthiois <a href="mailto:lorthiois@bbsoft.fr">lorthiois@bbsoft.fr</a>.
It is based on ttm, originally written by Pål Staurland <a href="mailto:staura@gmail.com">staura@gmail.com</a>.</p><p>This manual page was originally written by Daniel Moerner <a href="mailto:dmoerner@gmail.com">dmoerner@gmail.com</a>, for the Debian project (but may be used by others).
It was adopted from the tint2 docs.</p><h2 id="see-also">SEE ALSO<a name="see-also" href="#see-also" class="md2man-permalink" title="permalink"></a></h2><p>The main website <a href="https://gitlab.com/o9000/tint2">https://gitlab.com/o9000/tint2</a>
and the wiki page at <a href="https://gitlab.com/o9000/tint2/wikis/home">https://gitlab.com/o9000/tint2/wikis/home</a>.</p><p>This documentation is also provided in HTML and Markdown format in the system&#39;s default location
for documentation files, usually <code>/usr/share/doc/tint2</code> or <code>/usr/local/share/doc/tint2</code>.</p>
</body>
</html>

253
doc/readme.html Normal file
View File

@@ -0,0 +1,253 @@
<!DOCTYPE html>
<html>
<head>
<head>
<style type="text/css">
html,
body {
color: #333;
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
word-wrap: break-word;
max-width: 1000px;
margin: 0 auto;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 1em;
margin-bottom: 1rem;
}
h1 {
font-size: 1.8rem;
font-weight: normal;
font-style: normal;
border-bottom: 1px solid #eee;
}
h2 {
font-size: 1.5rem;
font-weight: normal;
font-style: normal;
border-bottom: 1px solid #eee;
}
h3 {
font-size: 1.2rem;
font-weight: bold;
font-style: normal;
}
h4 {
font-size: 1rem;
font-weight: bold;
font-style: normal;
}
h5 {
font-size: 1rem;
font-weight: bold;
font-style: italic;
}
h6 {
font-size: 1rem;
font-weight: normal;
font-style: italic;
}
code,
kbd,
pre {
font-family: monospace;
font-size: 1em;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
asdff {
box-sizing: border-box;
}
a {
color: #46c;
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
hr {
box-sizing: content-box;
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
hr::before {
display: table;
content: "";
}
hr::after {
display: table;
clear: both;
content: "";
}
p {
margin-top: 0;
margin-bottom: 0.7em;
}
blockquote {
margin: 0;
}
code {
font-family: "Liberation Mono", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 0;
font: 1em "Liberation Mono", monospace;
overflow-x: auto;
}
blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
blockquote>:first-child {
margin-top: 0;
}
blockquote>:last-child {
margin-bottom: 0;
}
table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
}
table th {
font-weight: bold;
}
table th,
table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
code {
padding: 0.2em;
margin: 0;
font-size: 0.95em;
background-color: #eee;
}
pre {
word-wrap: normal;
background-color: #eee;
margin: 1em 0;
padding: 0.2em;
}
</style>
</head>
<body>
<h1 id="latest-stable-release-0-12-11"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">0.12.11</span><a name="latest-stable-release-0-12-11" href="#latest-stable-release-0-12-11" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/0.12.11/ChangeLog">https://gitlab.com/o9000/tint2/blob/0.12.11/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (see also <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
cd tint2
git checkout 0.12.11
mkdir build
cd build
cmake ..
make -j4
</code></pre>
<p>To install, run (as root):</p><pre class="highlight plaintext"><code>make install
</code></pre>
<p>And then you can run the panel <code>tint2</code> and the configuration program <code>tint2conf</code>.</p><p>Please report any problems to <a href="https://gitlab.com/o9000/tint2/issues">https://gitlab.com/o9000/tint2/issues</a>. Your feedback is much appreciated.</p><p>P.S. GitLab is now the official location of the tint2 project, migrated from Google Code, which is shutting down. In case you are wondering why not GitHub, BitBucket etc., we chose GitLab because it is open source, it is mature and works well, looks cool and has a very nice team.</p><h1 id="what-is-tint2">What is tint2?<a name="what-is-tint2" href="#what-is-tint2" class="md2man-permalink" title="permalink"></a></h1><p>tint2 is a simple panel/taskbar made for modern X window managers. It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.). It is based on ttm <a href="https://code.google.com/p/ttm/">https://code.google.com/p/ttm/</a>.</p><h1 id="features">Features<a name="features" href="#features" class="md2man-permalink" title="permalink"></a></h1>
<ul>
<li>Panel with taskbar, system tray, clock and launcher icons;</li>
<li>Easy to customize: color/transparency on fonts, icons, borders and backgrounds;</li>
<li>Pager like capability: move tasks between workspaces (virtual desktops), switch between workspaces;</li>
<li>Multi-monitor capability: create one panel per monitor, showing only the tasks from the current monitor;</li>
<li>Customizable mouse events.</li>
</ul>
<h1 id="goals">Goals<a name="goals" href="#goals" class="md2man-permalink" title="permalink"></a></h1>
<ul>
<li>Be unintrusive and light (in terms of memory, CPU and aesthetic);</li>
<li>Follow the freedesktop.org specifications;</li>
<li>Make certain workflows, such as multi-desktop and multi-monitor, easy to use.</li>
</ul>
<h1 id="i-want-it">I want it!<a name="i-want-it" href="#i-want-it" class="md2man-permalink" title="permalink"></a></h1>
<ul>
<li><a href="https://gitlab.com/o9000/tint2/wikis/Install">Install tint2</a></li>
</ul>
<h1 id="how-do-i">How do I ...<a name="how-do-i" href="#how-do-i" class="md2man-permalink" title="permalink"></a></h1>
<ul>
<li><a href="https://gitlab.com/o9000/tint2/wikis/Install">Install</a></li>
<li><a href="https://gitlab.com/o9000/tint2/blob/master/manual.html">Configure</a></li>
<li><a href="https://gitlab.com/o9000/tint2/wikis/ThirdPartyApplets">Add applet not supported by tint2</a></li>
<li><a href="https://gitlab.com/o9000/tint2/wikis/FAQ">Other frequently asked questions</a></li>
<li><a href="https://gitlab.com/o9000/tint2/wikis/Debug">Obtain a stack trace when tint2 crashes</a></li>
</ul>
<h1 id="how-can-i-help-out">How can I help out?<a name="how-can-i-help-out" href="#how-can-i-help-out" class="md2man-permalink" title="permalink"></a></h1>
<ul>
<li>Report bugs and ask questions on the <a href="https://gitlab.com/o9000/tint2/issues">issue tracker</a>;</li>
<li>Contribute to the development by helping us fix bugs and suggesting new features.</li>
</ul>
<h1 id="links">Links<a name="links" href="#links" class="md2man-permalink" title="permalink"></a></h1>
<ul>
<li>Home page: <a href="https://gitlab.com/o9000/tint2">https://gitlab.com/o9000/tint2</a></li>
<li>Git repository: <a href="https://gitlab.com/o9000/tint2.git">https://gitlab.com/o9000/tint2.git</a></li>
<li>Documentation: <a href="https://gitlab.com/o9000/tint2/wikis/home">https://gitlab.com/o9000/tint2/wikis/home</a></li>
<li>Downloads: <a href="https://gitlab.com/o9000/tint2-archive/tree/master">https://gitlab.com/o9000/tint2-archive/tree/master</a> or <a href="https://code.google.com/p/tint2/downloads/list">https://code.google.com/p/tint2/downloads/list</a></li>
<li>Old project location (inactive): <a href="https://code.google.com/p/tint2">https://code.google.com/p/tint2</a></li>
</ul>
<h1 id="screenshots">Screenshots<a name="screenshots" href="#screenshots" class="md2man-permalink" title="permalink"></a></h1><h2 id="default-config">Default config:<a name="default-config" href="#default-config" class="md2man-permalink" title="permalink"></a></h2><p><img src="https://gitlab.com/o9000/tint2/uploads/948fa74eca60864352a033580350b4c3/Screenshot_2016-01-23_14-42-57.png" alt="Screenshot_2016-01-23_14-42-57"></p><h2 id="various-configs">Various configs:<a name="various-configs" href="#various-configs" class="md2man-permalink" title="permalink"></a></h2><p><img src="https://gitlab.com/o9000/tint2/wikis/screenshot.png" alt="screenshot"></p>
</body>
</html>

View File

@@ -1,51 +1,845 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH TINT2 1 "2015-07-05"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.TH TINT2 1 "2016\-05\-22"
.SH NAME
.PP
tint2 \- lightweight panel/taskbar
.SH SYNOPSIS
.B tint2
.br
.B tint2
.RI -c
.IR /path_to_config_file
.PP
\fB\fCtint2 [\-c path_to_config_file]\fR
.SH DESCRIPTION
This manual page documents briefly the
.B tint2
command.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBtint2\fP is a simple panel/taskbar intentionally made for openbox3, but
should also work with other window managers. It's based on ttm code. The goal is to keep a clean and unintrusive look with code lightweight and
compliance with freedesktop specifications.
tint2 is a simple panel/taskbar made for modern X window managers.
It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).
.PP
On the first startup tint2 creates a config file in $HOME/.config/tint2/tint2rc.
Features:
.RS
.IP \(bu 2
Panel with taskbar, system tray, clock and launcher icons;
.IP \(bu 2
Easy to customize: color/transparency on fonts, icons, borders and backgrounds;
.IP \(bu 2
Pager like capability: move tasks between workspaces (virtual desktops), switch between workspaces;
.IP \(bu 2
Multi\-monitor capability: create one panel per monitor, showing only the tasks from the current monitor;
.IP \(bu 2
Customizable mouse events.
.RE
.PP
See the wiki page at https://gitlab.com/o9000/tint2/wikis/home for more information.
Goals:
.RS
.IP \(bu 2
Be unintrusive and light (in terms of memory, CPU and aesthetic);
.IP \(bu 2
Follow the freedesktop.org specifications;
.IP \(bu 2
Make certain workflows, such as multi\-desktop and multi\-monitor, easy to use.
.RE
.SH OPTIONS
.TP
.B \-c config-file
Specify which configuration file to use instead of the default.
.SH AUTHOR
tint2 was written by Thierry Lorthiois <lorthiois@bbsoft.fr>. It is based on
ttm, originally written by Pål Staurland <staura@gmail.com>
\fB\fC\-c path_to_config_file\fR
Specifies which configuration file to use instead of the default.
.SH CONFIGURATION
.SS Table of contents
.RS
.IP \(bu 2
Introduction \[la]#introduction\[ra]
.IP \(bu 2
Backgrounds and borders \[la]#backgrounds-and-borders\[ra]
.IP \(bu 2
Panel \[la]#panel\[ra]
.IP \(bu 2
Launcher \[la]#launcher\[ra]
.IP \(bu 2
Taskbar/Pager \[la]#taskbar-pager\[ra]
.IP \(bu 2
Taskbar buttons \[la]#taskbar-buttons\[ra]
.IP \(bu 2
Mouse actions for taskbar buttons \[la]#mouse-actions-for-taskbar-buttons\[ra]
.IP \(bu 2
System tray \[la]#system-tray\[ra]
.IP \(bu 2
Clock \[la]#clock\[ra]
.IP \(bu 2
Tooltip \[la]#tooltip\[ra]
.IP \(bu 2
Battery \[la]#battery\[ra]
.IP \(bu 2
Executor \[la]#executor\[ra]
.IP \(bu 2
Example configuration \[la]#example-configuration\[ra]
.RE
.SS Introduction
.PP
This manual page was written by Daniel Moerner <dmoerner@gmail.com>,
for the Debian project (but may be used by others). It was adopted from the
tint2 docs.
These are instructions for configuring tint2 directly by editing its config file.
You may also use instead the graphical interface \fB\fCtint2conf\fR\&.
.PP
The first time you run tint2, it will create the config file in \fB\fC$HOME/.config/tint2/tint2rc\fR (This applies if you have done a clean install. Running tint2 in the source directory without doing 'make install' will not create the config file.)
.PP
You can also specify another file on the command line with the \-c option, e.g.: \fB\fCtint2 \-c $HOME/tint2.conf\fR\&. This can be used to run multiple instances of tint2 that use different settings.
.PP
If you change the config file while tint2 is running, the command \fB\fCkillall \-SIGUSR1 tint2\fR will force tint2 to reload it.
.PP
All the configuration options supported in the config file are listed below.
Try to respect as much as possible the order of the options as given below.
.SS Backgrounds and borders
.PP
The tint2 config file starts with the options defining background elements with borders:
.RS
.IP \(bu 2
\fB\fCrounded = number_of_pixels\fR : the corner radius
.IP \(bu 2
\fB\fCborder_width = integer\fR : the border width in pixels
.IP \(bu 2
\fB\fCborder_sides = LRTB\fR : the sides to draw the border on (left, right, top, bottom). If not specified, all sides are used. \fI(since 0.12.12)\fP
.IP \(bu 2
\fB\fCbackground_color = color opacity\fR
.RS
.IP \(bu 2
\fB\fCcolor\fR is specified in hex RGB, e.g. #ff0000 is red
.IP \(bu 2
\fB\fCopacity\fR varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz).
.RE
.IP \(bu 2
\fB\fCborder_color = color opacity\fR
.RS
.IP \(bu 2
\fB\fCcolor\fR is specified in hex RGB, e.g. #ff0000 is red
.IP \(bu 2
\fB\fCopacity\fR varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque
.RE
.IP \(bu 2
\fB\fCbackground_color_hover = color opacity\fR (default: same as \fB\fCbackground_color\fR) \fI(since 0.12.3)\fP
.RS
.IP \(bu 2
\fB\fCcolor\fR is specified in hex RGB, e.g. #ff0000 is red
.IP \(bu 2
\fB\fCopacity\fR varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)
.RE
.IP \(bu 2
\fB\fCborder_color_hover = color opacity\fR (default: same as \fB\fCborder_color\fR) \fI(since 0.12.3)\fP
.RS
.IP \(bu 2
\fB\fCcolor\fR is specified in hex RGB, e.g. #ff0000 is red
.IP \(bu 2
\fB\fCopacity\fR varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque
.RE
.IP \(bu 2
\fB\fCbackground_color_pressed = color opacity\fR (default: same as \fB\fCbackground_color_hover\fR) \fI(since 0.12.3)\fP
.RS
.IP \(bu 2
\fB\fCcolor\fR is specified in hex RGB, e.g. #ff0000 is red
.IP \(bu 2
\fB\fCopacity\fR varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)
.RE
.IP \(bu 2
\fB\fCborder_color_pressed = color opacity\fR (default: same as \fB\fCborder_color_hover\fR) \fI(since 0.12.3)\fP
.RS
.IP \(bu 2
\fB\fCcolor\fR is specified in hex RGB, e.g. #ff0000 is red
.IP \(bu 2
\fB\fCopacity\fR varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque
.RE
.RE
.PP
You can define as many backgrounds as you want. For example, the following config defines two backgrounds:
.PP
.RS
.nf
rounded = 1
border_width = 0
background_color = #282828 100
border_color = #000000 0
rounded = 1
border_width = 0
background_color = #f6b655 90
border_color = #cccccc 40
.fi
.RE
.PP
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:
.PP
.RS
.nf
panel_background_id = 1
taskbar_background_id = 0
task_background_id = 0
task_active_background_id = 2
systray_background_id = 0
clock_background_id = 0
.fi
.RE
.PP
Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.
.SS Panel
.RS
.IP \(bu 2
\fB\fCpanel_items = LTSBC\fR defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:
.RS
.IP \(bu 2
\fB\fCL\fR shows the Launcher
.IP \(bu 2
\fB\fCT\fR shows the Taskbar
.IP \(bu 2
\fB\fCS\fR shows the Systray (also called notification area)
.IP \(bu 2
\fB\fCB\fR shows the Battery status
.IP \(bu 2
\fB\fCC\fR shows the Clock
.IP \(bu 2
\fB\fCF\fR adds an extensible spacer (freespace). Has no effect if \fB\fCT\fR is also present. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fCE\fR adds an executor plugin. You can specify more than one. \fI(since 0.12.4)\fP
.RE
.PP
For example, \fB\fCpanel_items = STC\fR will show the systray, the taskbar and the clock (from left to right).
.IP \(bu 2
\fB\fCpanel_monitor = monitor (all or 1 or 2 or ...)\fR : Which monitor tint2 draws the panel on
.RS
.IP \(bu 2
The first monitor is \fB\fC1\fR
.IP \(bu 2
Use \fB\fCpanel_monitor = all\fR to get a separate panel per monitor
.RE
.IP \(bu 2
\fB\fCprimary_monitor_first = boolean (0 or 1)\fR : Place the primary monitor before all the other monitors in the list. \fI(since 0.12.4)\fP
.RE
.PP
[](images/panel_padding.jpg)
.RS
.IP \(bu 2
\fB\fCpanel_position = vertical_position horizontal_position orientation\fR
.RS
.IP \(bu 2
\fB\fCvertical_position\fR is one of: \fB\fCbottom\fR, \fB\fCtop\fR, \fB\fCcenter\fR
.IP \(bu 2
\fB\fChorizontal_position\fR is one of: \fB\fCleft\fR, \fB\fCright\fR, \fB\fCcenter\fR
.IP \(bu 2
\fB\fCorientation\fR is one of: \fB\fChorizontal\fR, \fB\fCvertical\fR
.RE
.IP \(bu 2
\fB\fCpanel_size = width height\fR
.RS
.IP \(bu 2
\fB\fCwidth\fR and \fB\fCheight\fR can be specified without units (e.g. \fB\fC123\fR) as pixels, or followed by \fB\fC%\fR as percentages of the monitor size (e.g. \fB\fC50%\fR). Use \fB\fC100%\fR for full monitor width/height.
Example:
.RE
.RE
.PP
.RS
.nf
# The panel's width is 94% the size of the monitor, the height is 30 pixels:
panel_size = 94% 30
.fi
.RE
.RS
.IP \(bu 2
\fB\fCpanel_margin = horizontal_margin vertical_margin\fR : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use \fB\fC0\fR to obtain a panel with the same size as the edge of the monitor (no margin).
.RE
.PP
[](images/panel\fIsize\fPmargin.jpg)
.RS
.IP \(bu 2
\fB\fCpanel_padding = horizontal_padding vertical_padding spacing\fR : Please refer to the image below.
.RE
.PP
[](images/panel_padding.jpg)
.RS
.IP \(bu 2
\fB\fCfont_shadow = boolean (0 or 1)\fR
.IP \(bu 2
\fB\fCpanel_background_id = integer\fR : Which background to use for the panel.
.IP \(bu 2
\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_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.
.RS
.IP \(bu 2
\fB\fCfollow_size\fR means that the maximized windows always resize to have a common edge with tint2.
.IP \(bu 2
\fB\fCminimum\fR means that the maximized windows always expand to have a common edge with the hidden panel. This is useful if the \fB\fCautohide\fR option is enabled.
.IP \(bu 2
\fB\fCnone\fR means that the maximized windows use the full screen size.
.RE
.IP \(bu 2
\fB\fCpanel_window_name = string\fR : Defines the name of the panel's window. Default: 'tint2'. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fCdisable_transparency = boolean (0 or 1)\fR : Whether to disable transparency instead of detecting if it is supported. Useful on broken graphics stacks. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fCmouse_effects = boolean (0 or 1)\fR : Whether to enable mouse hover effects for clickable items. \fI(since 0.12.3)\fP
.IP \(bu 2
\fB\fCmouse_hover_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjusts the icon color and transparency on mouse hover (works only when mouse_effects = 1).` \fI(since 0.12.3)\fP
.IP \(bu 2
\fB\fCmouse_pressed_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjusts the icon color and transparency on mouse press (works only when mouse_effects = 1).` \fI(since 0.12.3)\fP
.IP \(bu 2
\fB\fCautohide = boolean (0 or 1)\fR : Whether to enable panel hiding when the mouse cursor exists the panel.
.IP \(bu 2
\fB\fCautohide_show_timeout = float\fR : Show timeout in seconds after the mouse cursor enters the panel. Use '.' as decimal separator.
.IP \(bu 2
\fB\fCautohide_hide_timeout = float\fR : Hide timeout in seconds after the mouse cursor exits the panel. Use '.' as decimal separator.
.IP \(bu 2
\fB\fCautohide_height = integer\fR : panel height (width for vertical panels) in hidden mode.
.RE
.SS Launcher
.RS
.IP \(bu 2
\fB\fClauncher_item_app = path_to_application\fR : Each \fB\fClauncher_item_app\fR must be a file path to a .desktop file following the freedesktop.org specification \[la]http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html\[ra]\&. The paths may begin with \fB\fC~\fR, which is expanded to the path of the user's home directory. If only a file name is specified, the file is search in the standard application directories (\fB\fC$XDG_DATA_HOME/applications\fR, \fB\fC~/.local/share/applications\fR, \fB\fC$XDG_DATA_DIRS/applications\fR, \fB\fC/usr/local/share/applications\fR, \fB\fC/usr/share/applications\fR, \fB\fC/opt/share/applications\fR).
.IP \(bu 2
\fB\fClauncher_apps_dir = path_to_directory\fR : Specifies a path to a directory from which the launcher is loading all .desktop files (all subdirectories are explored recursively). Can be used multiple times. The path may begin with \fB\fC~\fR, which is expanded to the path of the user's home directory. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fClauncher_background_id = integer\fR : Defines which background to use.
.IP \(bu 2
\fB\fClauncher_icon_background_id = integer\fR : Defines which background to use for icons.
.IP \(bu 2
\fB\fClauncher_padding = horizontal_padding vertical_padding spacing\fR
.IP \(bu 2
\fB\fClauncher_icon_size = integer\fR : The launcher icon size, in pixels.
.IP \(bu 2
\fB\fClauncher_icon_theme = name_of_theme\fR : (Optional) Uses the specified icon theme to display shortcut icons. Note that tint2 will detect and use the icon theme of your desktop if you have an XSETTINGS manager running (which you probably do), unless \fB\fClauncher_icon_theme_override = 1\fR\&.
.IP \(bu 2
\fB\fClauncher_icon_theme_override = boolean (0 or 1)\fR : Whether \fB\fClauncher_icon_theme\fR overrides the value obtained from the XSETTINGS manager. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fClauncher_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjusts the icon color and transparency.
.IP \(bu 2
\fB\fClauncher_tooltip = boolean (0 or 1)\fR : Whether to show tooltips for the launcher icons.
.IP \(bu 2
\fB\fCstartup_notifications = boolean (0 or 1)\fR : Whether to show startup notifications when starting applications from the launcher. \fI(since 0.12)\fP
.RE
.SS Taskbar / Pager
.RS
.IP \(bu 2
\fB\fCtaskbar_mode = single_desktop/multi_desktop\fR
.RS
.IP \(bu 2
\fB\fCsingle_desktop\fR : Shows a normal taskbar listing the tasks running on the current virtual desktop (also known as 'workspace');
.IP \(bu 2
\fB\fCmulti_desktop\fR : Pager like capability. Shows multiple taskbars, one per virtual desktop, with which:
.RS
.IP \(bu 2
You can drag\-and\-drop tasks between virtual desktops;
.IP \(bu 2
You can switch between virtual desktops.
.RE
.RE
.IP \(bu 2
\fB\fCtaskbar_distribute_size = boolean (0 or 1)\fR : If enabled, in multi\-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fCtaskbar_padding = horizontal_padding vertical_padding spacing\fR
.RE
.PP
[](images/taskbar_padding.jpg)
.RS
.IP \(bu 2
\fB\fCtaskbar_background_id = integer\fR : Which background to use
.IP \(bu 2
\fB\fCtaskbar_active_background_id = integer\fR : Which background to use for the taskbar of the current virtual desktop.
.IP \(bu 2
\fB\fCtaskbar_hide_inactive_tasks = boolean (0 or 1)\fR : If enabled, the taskbar shows only the active task. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fCtaskbar_hide_different_monitor = boolean (0 or 1)\fR : If enabled, the taskbar shows only the tasks from the current monitor. Useful when running different tint2 instances on different monitors, each one having its own config. \fI(since 0.12)\fP
.IP \(bu 2
\fB\fCtaskbar_always_show_all_desktop_tasks = boolean (0 or 1)\fR : Has effect only if \fB\fCtaskbar_mode = multi_desktop\fR\&. If enabled, tasks that appear on all desktops are shown on all taskbars. Otherwise, they are shown only on the taskbar of the current desktop. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCtaskbar_sort_order = none/title/center\fR : Specifies the sort order of the tasks on the taskbar. \fI(since 0.12)\fP
.RS
.IP \(bu 2
\fB\fCnone\fR : No sorting. New tasks are simply appended at the end of the taskbar when they appear.
.IP \(bu 2
\fB\fCtitle\fR : Sorts the tasks by title.
.IP \(bu 2
\fB\fCcenter\fR : Sorts the tasks by their window centers.
.IP \(bu 2
\fB\fCmru\fR : Shows the most recently used tasks first. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fClru\fR : Shows the most recently used tasks last. \fI(since 0.12.4)\fP
.RE
.IP \(bu 2
\fB\fCtask_align = left/center/right\fR : Specifies the alignment of the tasks on the taskbar. Default: left.
.IP \(bu 2
\fB\fCtaskbar_name = boolean (0 or 1)\fR : Whether to show the virtual desktop name in the taskbar.
.IP \(bu 2
\fB\fCtaskbar_name_padding = padding\fR : Padding for the virtual desktop name.
.IP \(bu 2
\fB\fCtaskbar_name_background_id = integer\fR : Which background to use for the desktop name.
.IP \(bu 2
\fB\fCtaskbar_name_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR : Font configuration for the desktop name.
.IP \(bu 2
\fB\fCtaskbar_name_font_color = color opacity (0 to 100)\fR : Font color for the desktop name.
.IP \(bu 2
\fB\fCtaskbar_name_active_background_id = integer\fR : Which background to use for the name of the current desktop.
.IP \(bu 2
\fB\fCtaskbar_name_active_font_color = color opacity (0 to 100)\fR : Font color for the name of the current desktop.
.RE
.SH Taskbar buttons
.PP
The following options configure the task buttons in the taskbar:
.RS
.IP \(bu 2
\fB\fCtask_icon = boolean (0 or 1)\fR : Whether to display the task icon.
.IP \(bu 2
\fB\fCtask_text = boolean (0 or 1)\fR : Whether to display the task text.
.IP \(bu 2
\fB\fCtask_centered = boolean (0 or 1)\fR : Whether the task text is centered.
.IP \(bu 2
\fB\fCtask_tooltip = boolean (0 or 1)\fR : Whether to show tooltips for tasks.
.IP \(bu 2
\fB\fCtask_maximum_size = width height\fR
.RS
.IP \(bu 2
\fB\fCwidth\fR is used with horizontal panels to limit the size of the tasks. Use \fB\fCwidth = 0\fR to get full taskbar width.
.IP \(bu 2
\fB\fCheight\fR is used with vertical panels.
.RE
.IP \(bu 2
\fB\fCtask_padding = horizontal_padding vertical_padding spacing\fR
.IP \(bu 2
\fB\fCurgent_nb_of_blink = integer\fR : Number of blinks on 'get attention' events.
.RE
.PP
[](images/task_padding.jpg)
.RS
.IP \(bu 2
\fB\fCtask_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR
.IP \(bu 2
\fB\fCtask_font_color = color opacity (0 to 100)\fR
.IP \(bu 2
\fB\fCtask_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjust the task icon's color and transparency.
.IP \(bu 2
\fB\fCtask_background_id = integer\fR : Which background to use for non selected tasks
.RE
.TP
For the next 3 options STATUS can be \fB\fCactive\fR / \fB\fCiconified\fR / \fB\fCurgent\fR:
* \fB\fCtask_STATUS_font_color = color opacity (0 to 100)\fR
.RS
.IP \(bu 2
\fB\fCtask_STATUS_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjusts the task icon's color and transparency.
.IP \(bu 2
\fB\fCtask_STATUS_background_id = integer\fR : Which background to use for the task.
.RE
.SS Mouse actions for taskbar buttons
.PP
The possible mouse events are: \fB\fCleft, middle, right, scroll_up, scroll_down\fR\&.
.PP
The possible mouse actions are: \fB\fCnone, close, toggle, iconify, shade, toggle_iconify, maximize_restore, desktop_left, desktop_right, next_task, prev_task\fR\&.
.PP
Use \fB\fCmouse_event = action\fR to customize mouse actions. Example:
\fB\fC
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
\fR
.TP
The action semantics:
* \fB\fCnone\fR : If \fB\fCwm_menu = 1\fR is set, the mouse event is forwarded to the window manager. Otherwise it is ignored.
* \fB\fCclose\fR : close the task
* \fB\fCtoggle\fR : toggle the task
* \fB\fCiconify\fR : iconify (minimize) the task
* \fB\fCtoggle_iconify\fR : toggle or iconify the task
* \fB\fCmaximize_restore\fR : maximized or minimized the task
* \fB\fCshade\fR : shades (collapses) the task
* \fB\fCdesktop_left\fR : send the task to the desktop on the left
* \fB\fCdesktop_right\fR : send the task to the desktop on the right
* \fB\fCnext_task\fR : send the focus to next task
* \fB\fCprev_task\fR : send the focus to previous task
.SS System Tray
.RS
.IP \(bu 2
\fB\fCsystray_padding = horizontal_padding vertical_padding spacing\fR
.IP \(bu 2
\fB\fCsystray_background_id = integer\fR : Which background to use.
.IP \(bu 2
\fB\fCsystray_sort = ascending/descending/left2right/right2left\fR : Specifies the sorting order for the icons in the systray: in ascending/descending alphabetical order of the icon title, or always add icons to the right/left (note that with \fB\fCleft2right\fR or \fB\fCright2left\fR the order can be different on panel restart).
.IP \(bu 2
\fB\fCsystray_icon_size = max_icon_size\fR : Set the maximum system tray icon size to \fB\fCnumber\fR\&. Set to \fB\fC0\fR for automatic icon sizing.
.IP \(bu 2
\fB\fCsystray_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjust the systray icons color and transparency.
.IP \(bu 2
\fB\fCsystray_monitor = integer (1, 2, ...)\fR : On which monitor to draw the systray. The first monitor is \fB\fC1\fR\&. \fI(since 0.12)\fP
.RE
.SS Clock
.RS
.IP \(bu 2
\fB\fCtime1_format = %H:%M\fR : The format used by the first line of the clock.
.RS
.IP \(bu 2
\fB\fCtime1_format\fR, \fB\fCtime2_format\fR and \fB\fCclock_tooltip\fR use the 'strftime' syntax. More info can be found here: \[la]http://www.manpagez.com/man/3/strftime/\[ra]
.IP \(bu 2
To hide the clock, comment \fB\fCtime1_format\fR and \fB\fCtime2_format\fR\&.
.RE
.IP \(bu 2
\fB\fCtime1_timezone = :US/Hawaii\fR
.RS
.IP \(bu 2
\fB\fCtime1_timezone\fR, \fB\fCtime2_timezone\fR and \fB\fCclock_tooltip_timezone\fR can be used to specify a timezone. If you do not specify a value the system\-wide timezone is used. The timezones can usually be found in \fB\fC/usr/share/zoneinfo\fR\&. If your timezones are in a different directory, you need to specify the absolute path, e.g. \fB\fCtime1_timezone = :/different/zoneinfo/dir/US/Hawaii\fR Always prepend the timezone with a ':'
.RE
.IP \(bu 2
\fB\fCtime1_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR
.IP \(bu 2
\fB\fCtime2_format = %A %d %B\fR
.IP \(bu 2
\fB\fCtime2_timezone = :Europe/Berlin\fR
.IP \(bu 2
\fB\fCtime2_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR
.IP \(bu 2
\fB\fCclock_font_color = color opacity (0 to 100)\fR
.IP \(bu 2
\fB\fCclock_padding = horizontal_padding vertical_padding\fR
.IP \(bu 2
\fB\fCclock_background_id = integer\fR : Which background to use
.IP \(bu 2
\fB\fCclock_tooltip = %a, %d. %b %Y\fR : Format for the clock's tooltip.
.IP \(bu 2
\fB\fCclock_tooltip_timezone = :UTC\fR
.IP \(bu 2
\fB\fCclock_lclick_command = text\fR : Command to execute on left click.
.IP \(bu 2
\fB\fCclock_rclick_command = text\fR : Command to execute on right click.
.IP \(bu 2
\fB\fCclock_mclick_command = text\fR : Command to execute on middle click. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCclock_uwheel_command = text\fR : Command to execute on wheel scroll up. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCclock_dwheel_command = text\fR : Command to execute on wheel scroll down. \fI(since 0.12.1)\fP
.RE
.SS Tooltip
.RS
.IP \(bu 2
\fB\fCtooltip_padding = horizontal_padding vertical_padding\fR
.IP \(bu 2
\fB\fCtooltip_show_timeout = float\fR : Delay to show the tooltip in seconds. Use \fB\fC\&.\fR as decimal separator.
.IP \(bu 2
\fB\fCtooltip_hide_timeout = float\fR : Delay to hide the tooltip in seconds. Use \fB\fC\&.\fR as decimal separator.
.IP \(bu 2
\fB\fCtooltip_background_id = integer\fR : Which background to use for tooltips. Note that with fake transparency the alpha channel and corner radius options are not respected.
.IP \(bu 2
\fB\fCtooltip_font_color = color opacity (0 to 100)\fR
.IP \(bu 2
\fB\fCtooltip_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR
.RE
.SS Battery
.RS
.IP \(bu 2
\fB\fCbattery_hide = never/integer (0 to 100)\fR : At what battery percentage the battery item is hidden.
.IP \(bu 2
\fB\fCbattery_low_status = integer\fR: At what battery percentage the low command is executed.
.IP \(bu 2
\fB\fCbattery_low_cmd = notify\-send "battery low"\fR : Command to execute when the battery is low.
.IP \(bu 2
\fB\fCbat1_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR
.IP \(bu 2
\fB\fCbat2_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR
.IP \(bu 2
\fB\fCbattery_font_color = color opacity (0 to 100)\fR
.IP \(bu 2
\fB\fCbattery_padding = horizontal_padding vertical_padding\fR
.IP \(bu 2
\fB\fCbattery_background_id = integer\fR : Which background to use for the battery.
.IP \(bu 2
\fB\fCbattery_tooltip_enabled = boolean (0 or 1)\fR : Enable/disable battery tooltips. \fI(since 0.12.3)\fP
.IP \(bu 2
\fB\fCbattery_lclick_command = text\fR : Command to execute on left click. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCbattery_rclick_command = text\fR : Command to execute on right click. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCbattery_mclick_command = text\fR : Command to execute on middle click. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCbattery_uwheel_command = text\fR : Command to execute on wheel scroll up. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCbattery_dwheel_command = text\fR : Command to execute on wheel scroll down. \fI(since 0.12.1)\fP
.IP \(bu 2
\fB\fCac_connected_cmd = text\fR : Command to execute when the power adapter is plugged in. \fI(since 0.12.3)\fP
.IP \(bu 2
\fB\fCac_disconnected_cmd = text\fR : Command to execute when the power adapter is unplugged. \fI(since 0.12.3)\fP
.RE
.SS Executor
.RS
.IP \(bu 2
\fB\fCexecp = new\fR : Begins the configuration of a new executor plugin. Multiple such plugins are supported; just use multiple \fB\fCE\fRs in \fB\fCpanel_items\fR\&. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_command = text\fR : Command to execute. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_interval = integer\fR : The command is executed again after \fB\fCexecp_interval\fR seconds from the moment it exits. If zero, the command is executed only once. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_continuous = integer\fR : If non\-zero, the last \fB\fCexecp_continuous\fR lines from the output of the command are displayed, every \fB\fCexecp_continuous\fR lines; this is useful for showing the output of commands that run indefinitely, such as \fB\fCping 127.0.0.1\fR\&. If zero, the output of the command is displayed after it finishes executing. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_has_icon = boolean (0 or 1)\fR : If \fB\fCexecp_has_icon = 1\fR, the first line printed by the command is interpreted as a path to an image file. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_cache_icon = boolean (0 or 1)\fR : If \fB\fCexecp_cache_icon = 0\fR, the image is reloaded each time the command is executed (useful if the image file is changed on disk by the program executed by \fB\fCexecp_command\fR). \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_icon_w = integer\fR : You can use \fB\fCexecp_icon_w\fR and \fB\fCexecp_icon_h\fR to resize the image. If one of them is zero/missing, the image is rescaled proportionally. If both of them are zero/missing, the image is not rescaled. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_icon_h = integer\fR : See \fB\fCexecp_icon_w\fR\&. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_tooltip = text\fR : The tooltip. Leave it empty to not display a tooltip. Not specifying this option leads to showing an automatically generated tooltip with information about when the command was last executed. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_font = [FAMILY\-LIST] [STYLE\-OPTIONS] [SIZE]\fR : The font used to draw the text. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_font_color = color opacity\fR : The font color. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_markup = boolean (0 or 1)\fR : If non\-zero, the output of the command is treated as Pango markup, which allows rich text formatting. The format is documented here \[la]https://developer.gnome.org/pygtk/stable/pango-markup-language.html\[ra]\&. Note that using this with commands that print data downloaded from the Internet is a possible security risk. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_background_id = integer\fR : Which background to use. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_centered = boolean (0 or 1)\fR : Whether to center the text. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text\fR \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_lclick_command = text\fR : Command to execute on left click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_mclick_command = text\fR : Command to execute on right click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_rclick_command = text\fR : Command to execute on middle click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_uwheel_command = text\fR : Command to execute on wheel scroll up. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
.IP \(bu 2
\fB\fCexecp_dwheel_command = text\fR : Command to execute on wheel scroll down. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
.RE
.SS Executor samples
.SS Print the hostname
.PP
.RS
.nf
execp = new
execp_command = hostname
execp_interval = 0
.fi
.RE
.SS Print disk usage for the root partition every 10 seconds
.PP
.RS
.nf
execp = new
execp_command = df \-h | awk '/\\/$/ { print $6 ": " $2 " " $5}'
execp_interval = 10
.fi
.RE
.SS Button with icon and rich text, executes command when clicked
.PP
.RS
.nf
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
execp_font = sans 9
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_background_id = 2
.fi
.RE
.SS Desktop pager with text
.PP
.RS
.nf
execp = new
execp_command = xprop \-root \-spy | awk '/^_NET_CURRENT_DESKTOP/ { print "Workspace " ($3 + 1) ; fflush(); }'
execp_interval = 1
execp_continuous = 1
.fi
.RE
.SS Desktop pager with icon
.PP
.RS
.nf
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
.fi
.RE
.SS Round\-trip time to the gateway, refreshed every second
.PP
.RS
.nf
execp = new
execp_command = ping \-i 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 = 1
execp_interval = 1
execp_markup = 1
.fi
.RE
.SS Memory usage
.PP
.RS
.nf
execp = new
execp_command = free \-s 2 | awk '/^\-/ { printf "Mem: '$(free \-h | awk '/^Mem:/ { print $2 }')' %.0f%\\n", 100*$3/($3+$4); fflush(stdout) }'
execp_interval = 1
execp_continuous = 1
.fi
.RE
.SS Network load
.PP
.RS
.nf
# 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_continuous = 1
execp_interval = 1
.fi
.RE
.SS Example configuration
.PP
.RS
.nf
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## TINT2 CONFIG FILE
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## BACKGROUND AND BORDER
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #ffffff 18
rounded = 5
border_width = 0
background_color = #ffffff 40
border_color = #ffffff 50
rounded = 5
border_width = 0
background_color = #ffffff 18
border_color = #ffffff 70
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## PANEL
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
panel_monitor = all
panel_position = bottom center
panel_size = 94% 30
panel_margin = 0 0
panel_padding = 7 0
font_shadow = 0
panel_background_id = 1
wm_menu = 0
panel_dock = 0
panel_layer = bottom
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## TASKBAR
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
#taskbar_mode = multi_desktop
taskbar_mode = single_desktop
taskbar_padding = 2 3 2
taskbar_background_id = 0
#taskbar_active_background_id = 0
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## TASKS
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
task_icon = 1
task_text = 1
task_maximum_size = 140 35
task_centered = 1
task_padding = 6 3
task_font = sans 7
task_font_color = #ffffff 70
task_background_id = 3
task_icon_asb = 100 0 0
## replace STATUS by 'urgent', 'active' or 'iconfied'
#task_STATUS_background_id = 2
#task_STATUS_font_color = #ffffff 85
#task_STATUS_icon_asb = 100 0 0
## example:
task_active_background_id = 2
task_active_font_color = #ffffff 85
task_active_icon_asb = 100 0 0
urgent_nb_of_blink = 8
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## SYSTRAYBAR
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
systray = 1
systray_padding = 0 4 5
systray_background_id = 0
systray_sort = left2right
systray_icon_size = 0
systray_icon_asb = 100 0 0
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## CLOCK
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
time1_format = %H:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #ffffff 76
clock_padding = 1 0
clock_background_id = 0
#clock_lclick_command = xclock
clock_rclick_command = orage
#clock_tooltip = %A %d %B
#time1_timezone = :US/Hawaii
#time2_timezone = :Europe/Berlin
#clock_tooltip_timezone = :/usr/share/zoneinfo/Europe/Paris
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## BATTERY
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify\-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## TOOLTIP
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
tooltip = 0
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #OOOOOO 80
tooltip_font = sans 10
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## MOUSE ACTION ON TASK
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
## AUTOHIDE OPTIONS
#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 2
autohide_height = 4
strut_policy = minimum
.fi
.RE
.SH AUTHOR
.PP
tint2 was written by Thierry Lorthiois \[la]lorthiois@bbsoft.fr\[ra]\&.
It is based on ttm, originally written by Pål Staurland \[la]staura@gmail.com\[ra]\&.
.PP
This manual page was originally written by Daniel Moerner \[la]dmoerner@gmail.com\[ra], for the Debian project (but may be used by others).
It was adopted from the tint2 docs.
.SH SEE ALSO
.PP
The main website \[la]https://gitlab.com/o9000/tint2\[ra]
and the wiki page at \[la]https://gitlab.com/o9000/tint2/wikis/home\[ra]\&.
.PP
This documentation is also provided in HTML and Markdown format in the system's default location
for documentation files, usually \fB\fC/usr/share/doc/tint2\fR or \fB\fC/usr/local/share/doc/tint2\fR\&.

524
doc/tint2.html Normal file
View File

@@ -0,0 +1,524 @@
<h1 id="tint2-1-2016-05-22"><span class="md2man-title">TINT2</span> <span class="md2man-section">1</span> <span class="md2man-date">2016-05-22</span><a name="tint2-1-2016-05-22" href="#tint2-1-2016-05-22" class="md2man-permalink" title="permalink"></a></h1><h2 id="name">NAME<a name="name" href="#name" class="md2man-permalink" title="permalink"></a></h2><p>tint2 - lightweight panel/taskbar</p><h2 id="synopsis">SYNOPSIS<a name="synopsis" href="#synopsis" class="md2man-permalink" title="permalink"></a></h2><p><code>tint2 [-c path_to_config_file]</code></p><h2 id="description">DESCRIPTION<a name="description" href="#description" class="md2man-permalink" title="permalink"></a></h2><p>tint2 is a simple panel/taskbar made for modern X window managers.
It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).</p><p>Features:</p>
<ul>
<li>Panel with taskbar, system tray, clock and launcher icons;</li>
<li>Easy to customize: color/transparency on fonts, icons, borders and backgrounds;</li>
<li>Pager like capability: move tasks between workspaces (virtual desktops), switch between workspaces;</li>
<li>Multi-monitor capability: create one panel per monitor, showing only the tasks from the current monitor;</li>
<li>Customizable mouse events.</li>
</ul>
<p>Goals:</p>
<ul>
<li>Be unintrusive and light (in terms of memory, CPU and aesthetic);</li>
<li>Follow the freedesktop.org specifications;</li>
<li>Make certain workflows, such as multi-desktop and multi-monitor, easy to use.</li>
</ul>
<h2 id="options">OPTIONS<a name="options" href="#options" class="md2man-permalink" title="permalink"></a></h2><dl><dt><code>-c path_to_config_file</code></dt><dd>Specifies which configuration file to use instead of the default.</dd></dl><h2 id="configuration">CONFIGURATION<a name="configuration" href="#configuration" class="md2man-permalink" title="permalink"></a></h2><h3 id="table-of-contents">Table of contents<a name="table-of-contents" href="#table-of-contents" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><a href="#introduction">Introduction</a></p></li>
<li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li>
<li><p><a href="#panel">Panel</a></p></li>
<li><p><a href="#launcher">Launcher</a></p></li>
<li><p><a href="#taskbar-pager">Taskbar/Pager</a></p></li>
<li><p><a href="#taskbar-buttons">Taskbar buttons</a></p></li>
<li><p><a href="#mouse-actions-for-taskbar-buttons">Mouse actions for taskbar buttons</a></p></li>
<li><p><a href="#system-tray">System tray</a></p></li>
<li><p><a href="#clock">Clock</a></p></li>
<li><p><a href="#tooltip">Tooltip</a></p></li>
<li><p><a href="#battery">Battery</a></p></li>
<li><p><a href="#executor">Executor</a></p></li>
<li><p><a href="#example-configuration">Example configuration</a></p></li>
</ul>
<h3 id="introduction">Introduction<a name="introduction" href="#introduction" class="md2man-permalink" title="permalink"></a></h3><p>These are instructions for configuring tint2 directly by editing its config file.
You may also use instead the graphical interface <code>tint2conf</code>.</p><p>The first time you run tint2, it will create the config file in <code>$HOME/.config/tint2/tint2rc</code> (This applies if you have done a clean install. Running tint2 in the source directory without doing &#39;make install&#39; will not create the config file.)</p><p>You can also specify another file on the command line with the -c option, e.g.: <code>tint2 -c $HOME/tint2.conf</code>. This can be used to run multiple instances of tint2 that use different settings.</p><p>If you change the config file while tint2 is running, the command <code>killall -SIGUSR1 tint2</code> will force tint2 to reload it.</p><p>All the configuration options supported in the config file are listed below.
Try to respect as much as possible the order of the options as given below.</p><h3 id="backgrounds-and-borders">Backgrounds and borders<a name="backgrounds-and-borders" href="#backgrounds-and-borders" class="md2man-permalink" title="permalink"></a></h3><p>The tint2 config file starts with the options defining background elements with borders:</p>
<ul>
<li><p><code>rounded = number_of_pixels</code> : the corner radius</p></li>
<li><p><code>border_width = integer</code> : the border width in pixels</p></li>
<li><p><code>border_sides = LRTB</code> : the sides to draw the border on (left, right, top, bottom). If not specified, all sides are used.</p></li>
<li><p><code>background_color = color opacity</code></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz).</li>
</ul></li>
<li><p><code>border_color = color opacity</code></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque</li>
</ul></li>
<li><p><code>background_color_hover = color opacity</code> (default: same as background_color) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)</li>
</ul></li>
<li><p><code>border_color_hover = color opacity</code> (default: same as border_color) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque</li>
</ul></li>
<li><p><code>background_color_pressed = color opacity</code> (default: same as background<em>color</em>hover) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)</li>
</ul></li>
<li><p><code>border_color_pressed = color opacity</code> (default: same as border<em>color</em>hover) <em>(since 0.12.3)</em></p>
<ul>
<li><code>color</code> is specified in hex RGB, e.g. #ff0000 is red</li>
<li><code>opacity</code> varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque</li>
</ul></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
border_width = 0
background_color = #282828 100
border_color = #000000 0
rounded = 1
border_width = 0
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
taskbar_background_id = 0
task_background_id = 0
task_active_background_id = 2
systray_background_id = 0
clock_background_id = 0
</code></pre>
<p>Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.</p><h3 id="panel">Panel<a name="panel" href="#panel" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>panel_items = LTSBC</code> defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:</p>
<ul>
<li><code>L</code> shows the Launcher</li>
<li><code>T</code> shows the Taskbar</li>
<li><code>S</code> shows the Systray (also called notification area)</li>
<li><code>B</code> shows the Battery status</li>
<li><code>C</code> shows the Clock</li>
<li><code>F</code> adds an extensible spacer (freespace). Has no effect if <code>T</code> is also present. <em>(since 0.12)</em></li>
<li><code>E</code> adds an executor plugin. You can specify more than one. <em>(since 0.12.4)</em></li>
</ul>
<p>For example, <code>panel_items = STC</code> will show the systray, the taskbar and the clock (from left to right).</p></li>
<li><p><code>panel_monitor = monitor (all or 1 or 2 or ...)</code> : Which monitor tint2 draws the panel on</p>
<ul>
<li>The first monitor is <code>1</code></li>
<li>Use <code>panel_monitor = all</code> to get a separate panel per monitor</li>
</ul></li>
<li><p><code>primary_monitor_first = boolean (0 or 1)</code> : Place the primary monitor before all the other monitors in the list. <em>(since 0.12.4)</em></p></li>
</ul>
<p><img src="panel_padding.jpg" alt=""></p>
<ul>
<li><p><code>panel_position = vertical_position horizontal_position orientation</code></p>
<ul>
<li><code>vertical_position</code> is one of: <code>bottom</code>, <code>top</code>, <code>center</code></li>
<li><code>horizontal_position</code> is one of: <code>left</code>, <code>right</code>, <code>center</code></li>
<li><code>orientation</code> is one of: <code>horizontal</code>, <code>vertical</code></li>
</ul></li>
<li><p><code>panel_size = width height</code></p>
<ul>
<li><code>width</code> and <code>height</code> can be specified without units (e.g. <code>123</code>) as pixels, or followed by <code>%</code> as percentages of the monitor size (e.g. <code>50%</code>). Use <code>100%</code> for full monitor width/height.
Example:</li>
</ul></li>
</ul>
<pre class="highlight plaintext"><code># The panel's width is 94% the size of the monitor, the height is 30 pixels:
panel_size = 94% 30
</code></pre>
<ul>
<li><code>panel_margin = horizontal_margin vertical_margin</code> : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use <code>0</code> to obtain a panel with the same size as the edge of the monitor (no margin).</li>
</ul>
<p><img src="panel_size_margin.jpg" alt=""></p>
<ul>
<li><code>panel_padding = horizontal_padding vertical_padding spacing</code> : Please refer to the image below.</li>
</ul>
<p><img src="panel_padding.jpg" alt=""></p>
<ul>
<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_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>
<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>
<li><code>none</code> means that the maximized windows use the full screen size.</li>
</ul></li>
<li><p><code>panel_window_name = string</code> : Defines the name of the panel&#39;s window. Default: &#39;tint2&#39;. <em>(since 0.12)</em></p></li>
<li><p><code>disable_transparency = boolean (0 or 1)</code> : Whether to disable transparency instead of detecting if it is supported. Useful on broken graphics stacks. <em>(since 0.12)</em></p></li>
<li><p><code>mouse_effects = boolean (0 or 1)</code> : Whether to enable mouse hover effects for clickable items. <em>(since 0.12.3)</em></p></li>
<li><p><code>mouse_hover_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the icon color and transparency on mouse hover (works only when mouse_effects = 1).` <em>(since 0.12.3)</em></p></li>
<li><p><code>mouse_pressed_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the icon color and transparency on mouse press (works only when mouse_effects = 1).` <em>(since 0.12.3)</em></p></li>
<li><p><code>autohide = boolean (0 or 1)</code> : Whether to enable panel hiding when the mouse cursor exists the panel.</p></li>
<li><p><code>autohide_show_timeout = float</code> : Show timeout in seconds after the mouse cursor enters the panel. Use &#39;.&#39; as decimal separator.</p></li>
<li><p><code>autohide_hide_timeout = float</code> : Hide timeout in seconds after the mouse cursor exits the panel. Use &#39;.&#39; as decimal separator.</p></li>
<li><p><code>autohide_height = integer</code> : panel height (width for vertical panels) in hidden mode.</p></li>
</ul>
<h3 id="launcher">Launcher<a name="launcher" href="#launcher" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>launcher_item_app = path_to_application</code> : Each <code>launcher_item_app</code> must be a file path to a .desktop file following the freedesktop.org <a href="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html">specification</a>. The paths may begin with <code>~</code>, which is expanded to the path of the user&#39;s home directory. If only a file name is specified, the file is search in the standard application directories (<code>$XDG_DATA_HOME/applications</code>, <code>~/.local/share/applications</code>, <code>$XDG_DATA_DIRS/applications</code>, <code>/usr/local/share/applications</code>, <code>/usr/share/applications</code>, <code>/opt/share/applications</code>).</p></li>
<li><p><code>launcher_apps_dir = path_to_directory</code> : Specifies a path to a directory from which the launcher is loading all .desktop files (all subdirectories are explored recursively). Can be used multiple times. The path may begin with <code>~</code>, which is expanded to the path of the user&#39;s home directory. <em>(since 0.12)</em></p></li>
<li><p><code>launcher_background_id = integer</code> : Defines which background to use.</p></li>
<li><p><code>launcher_icon_background_id = integer</code> : Defines which background to use for icons.</p></li>
<li><p><code>launcher_padding = horizontal_padding vertical_padding spacing</code></p></li>
<li><p><code>launcher_icon_size = integer</code> : The launcher icon size, in pixels.</p></li>
<li><p><code>launcher_icon_theme = name_of_theme</code> : (Optional) Uses the specified icon theme to display shortcut icons. Note that tint2 will detect and use the icon theme of your desktop if you have an XSETTINGS manager running (which you probably do), unless <code>launcher_icon_theme_override = 1</code>.</p></li>
<li><p><code>launcher_icon_theme_override = boolean (0 or 1)</code> : Whether <code>launcher_icon_theme</code> overrides the value obtained from the XSETTINGS manager. <em>(since 0.12)</em></p></li>
<li><p><code>launcher_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the icon color and transparency.</p></li>
<li><p><code>launcher_tooltip = boolean (0 or 1)</code> : Whether to show tooltips for the launcher icons.</p></li>
<li><p><code>startup_notifications = boolean (0 or 1)</code> : Whether to show startup notifications when starting applications from the launcher. <em>(since 0.12)</em></p></li>
</ul>
<h3 id="taskbar-pager">Taskbar / Pager<a name="taskbar-pager" href="#taskbar-pager" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>taskbar_mode = single_desktop/multi_desktop</code></p>
<ul>
<li><code>single_desktop</code> : Shows a normal taskbar listing the tasks running on the current virtual desktop (also known as &#39;workspace&#39;);</li>
<li><code>multi_desktop</code> : Pager like capability. Shows multiple taskbars, one per virtual desktop, with which:
<ul>
<li>You can drag-and-drop tasks between virtual desktops;</li>
<li>You can switch between virtual desktops.</li>
</ul></li>
</ul></li>
<li><p><code>taskbar_distribute_size = boolean (0 or 1)</code> : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. <em>(since 0.12)</em></p></li>
<li><p><code>taskbar_padding = horizontal_padding vertical_padding spacing</code></p></li>
</ul>
<p><img src="taskbar_padding.jpg" alt=""></p>
<ul>
<li><p><code>taskbar_background_id = integer</code> : Which background to use</p></li>
<li><p><code>taskbar_active_background_id = integer</code> : Which background to use for the taskbar of the current virtual desktop.</p></li>
<li><p><code>taskbar_hide_inactive_tasks = boolean (0 or 1)</code> : If enabled, the taskbar shows only the active task. <em>(since 0.12)</em></p></li>
<li><p><code>taskbar_hide_different_monitor = boolean (0 or 1)</code> : If enabled, the taskbar shows only the tasks from the current monitor. Useful when running different tint2 instances on different monitors, each one having its own config. <em>(since 0.12)</em></p></li>
<li><p><code>taskbar_always_show_all_desktop_tasks = boolean (0 or 1)</code> : Has effect only if <code>taskbar_mode = multi_desktop</code>. If enabled, tasks that appear on all desktops are shown on all taskbars. Otherwise, they are shown only on the taskbar of the current desktop. <em>(since 0.12.4)</em></p></li>
<li><p><code>taskbar_sort_order = none/title/center</code> : Specifies the sort order of the tasks on the taskbar. <em>(since 0.12)</em></p>
<ul>
<li><code>none</code> : No sorting. New tasks are simply appended at the end of the taskbar when they appear.</li>
<li><code>title</code> : Sorts the tasks by title.</li>
<li><code>center</code> : Sorts the tasks by their window centers.</li>
<li><code>mru</code> : Shows the most recently used tasks first. <em>(since 0.12.4)</em></li>
<li><code>lru</code> : Shows the most recently used tasks last. <em>(since 0.12.4)</em></li>
</ul></li>
<li><p><code>task_align = left/center/right</code> : Specifies the alignment of the tasks on the taskbar. Default: left.</p></li>
<li><p><code>taskbar_name = boolean (0 or 1)</code> : Whether to show the virtual desktop name in the taskbar.</p></li>
<li><p><code>taskbar_name_padding = padding</code> : Padding for the virtual desktop name.</p></li>
<li><p><code>taskbar_name_background_id = integer</code> : Which background to use for the desktop name.</p></li>
<li><p><code>taskbar_name_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code> : Font configuration for the desktop name.</p></li>
<li><p><code>taskbar_name_font_color = color opacity (0 to 100)</code> : Font color for the desktop name.</p></li>
<li><p><code>taskbar_name_active_background_id = integer</code> : Which background to use for the name of the current desktop.</p></li>
<li><p><code>taskbar_name_active_font_color = color opacity (0 to 100)</code> : Font color for the name of the current desktop.</p></li>
</ul>
<h1 id="taskbar-buttons">Taskbar buttons<a name="taskbar-buttons" href="#taskbar-buttons" class="md2man-permalink" title="permalink"></a></h1><p>The following options configure the task buttons in the taskbar:</p>
<ul>
<li><p><code>task_icon = boolean (0 or 1)</code> : Whether to display the task icon.</p></li>
<li><p><code>task_text = boolean (0 or 1)</code> : Whether to display the task text.</p></li>
<li><p><code>task_centered = boolean (0 or 1)</code> : Whether the task text is centered.</p></li>
<li><p><code>task_tooltip = boolean (0 or 1)</code> : Whether to show tooltips for tasks.</p></li>
<li><p><code>task_maximum_size = width height</code></p>
<ul>
<li><code>width</code> is used with horizontal panels to limit the size of the tasks. Use <code>width = 0</code> to get full taskbar width.</li>
<li><code>height</code> is used with vertical panels.</li>
</ul></li>
<li><p><code>task_padding = horizontal_padding vertical_padding spacing</code></p></li>
<li><p><code>urgent_nb_of_blink = integer</code> : Number of blinks on &#39;get attention&#39; events.</p></li>
</ul>
<p><img src="task_padding.jpg" alt=""></p>
<ul>
<li><p><code>task_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>task_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>task_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjust the task icon&#39;s color and transparency.</p></li>
<li><p><code>task_background_id = integer</code> : Which background to use for non selected tasks</p></li>
</ul>
<dl><dt>For the next 3 options STATUS can be <code>active</code> / <code>iconified</code> / <code>urgent</code>:</dt><dd>* <code>task_STATUS_font_color = color opacity (0 to 100)</code></dd></dl>
<ul>
<li><p><code>task_STATUS_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjusts the task icon&#39;s color and transparency.</p></li>
<li><p><code>task_STATUS_background_id = integer</code> : Which background to use for the task.</p></li>
</ul>
<h3 id="mouse-actions-for-taskbar-buttons">Mouse actions for taskbar buttons<a name="mouse-actions-for-taskbar-buttons" href="#mouse-actions-for-taskbar-buttons" class="md2man-permalink" title="permalink"></a></h3><p>The possible mouse events are: <code>left, middle, right, scroll_up, scroll_down</code>.</p><p>The possible mouse actions are: <code>none, close, toggle, iconify, shade, toggle_iconify, maximize_restore, desktop_left, desktop_right, next_task, prev_task</code>.</p><p>Use <code>mouse_event = action</code> to customize mouse actions. Example:
<code>
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
</code></p><dl><dt>The action semantics:</dt><dd>* <code>none</code> : If <code>wm_menu = 1</code> is set, the mouse event is forwarded to the window manager. Otherwise it is ignored.
* <code>close</code> : close the task
* <code>toggle</code> : toggle the task
* <code>iconify</code> : iconify (minimize) the task
* <code>toggle_iconify</code> : toggle or iconify the task
* <code>maximize_restore</code> : maximized or minimized the task
* <code>shade</code> : shades (collapses) the task
* <code>desktop_left</code> : send the task to the desktop on the left
* <code>desktop_right</code> : send the task to the desktop on the right
* <code>next_task</code> : send the focus to next task
* <code>prev_task</code> : send the focus to previous task</dd></dl><h3 id="system-tray">System Tray<a name="system-tray" href="#system-tray" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>systray_padding = horizontal_padding vertical_padding spacing</code></p></li>
<li><p><code>systray_background_id = integer</code> : Which background to use.</p></li>
<li><p><code>systray_sort = ascending/descending/left2right/right2left</code> : Specifies the sorting order for the icons in the systray: in ascending/descending alphabetical order of the icon title, or always add icons to the right/left (note that with <code>left2right</code> or <code>right2left</code> the order can be different on panel restart).</p></li>
<li><p><code>systray_icon_size = max_icon_size</code> : Set the maximum system tray icon size to <code>number</code>. Set to <code>0</code> for automatic icon sizing.</p></li>
<li><p><code>systray_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjust the systray icons color and transparency.</p></li>
<li><p><code>systray_monitor = integer (1, 2, ...)</code> : On which monitor to draw the systray. The first monitor is <code>1</code>. <em>(since 0.12)</em></p></li>
</ul>
<h3 id="clock">Clock<a name="clock" href="#clock" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>time1_format = %H:%M</code> : The format used by the first line of the clock.</p>
<ul>
<li><code>time1_format</code>, <code>time2_format</code> and <code>clock_tooltip</code> use the &#39;strftime&#39; syntax. More info can be found here: <a href="http://www.manpagez.com/man/3/strftime/">http://www.manpagez.com/man/3/strftime/</a></li>
<li>To hide the clock, comment <code>time1_format</code> and <code>time2_format</code>.</li>
</ul></li>
<li><p><code>time1_timezone = :US/Hawaii</code></p>
<ul>
<li><code>time1_timezone</code>, <code>time2_timezone</code> and <code>clock_tooltip_timezone</code> can be used to specify a timezone. If you do not specify a value the system-wide timezone is used. The timezones can usually be found in <code>/usr/share/zoneinfo</code>. If your timezones are in a different directory, you need to specify the absolute path, e.g. <code>time1_timezone = :/different/zoneinfo/dir/US/Hawaii</code> Always prepend the timezone with a &#39;:&#39;</li>
</ul></li>
<li><p><code>time1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>time2_format = %A %d %B</code></p></li>
<li><p><code>time2_timezone = :Europe/Berlin</code></p></li>
<li><p><code>time2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>clock_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>clock_padding = horizontal_padding vertical_padding</code></p></li>
<li><p><code>clock_background_id = integer</code> : Which background to use</p></li>
<li><p><code>clock_tooltip = %a, %d. %b %Y</code> : Format for the clock&#39;s tooltip.</p></li>
<li><p><code>clock_tooltip_timezone = :UTC</code></p></li>
<li><p><code>clock_lclick_command = text</code> : Command to execute on left click.</p></li>
<li><p><code>clock_rclick_command = text</code> : Command to execute on right click.</p></li>
<li><p><code>clock_mclick_command = text</code> : Command to execute on middle click. <em>(since 0.12.1)</em></p></li>
<li><p><code>clock_uwheel_command = text</code> : Command to execute on wheel scroll up. <em>(since 0.12.1)</em></p></li>
<li><p><code>clock_dwheel_command = text</code> : Command to execute on wheel scroll down. <em>(since 0.12.1)</em></p></li>
</ul>
<h3 id="tooltip">Tooltip<a name="tooltip" href="#tooltip" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>tooltip_padding = horizontal_padding vertical_padding</code></p></li>
<li><p><code>tooltip_show_timeout = float</code> : Delay to show the tooltip in seconds. Use &#39;.&#39; as decimal separator.</p></li>
<li><p><code>tooltip_hide_timeout = float</code> : Delay to hide the tooltip in seconds. Use &#39;.&#39; as decimal separator.</p></li>
<li><p><code>tooltip_background_id = integer</code> : Which background to use for tooltips. Note that with fake transparency the alpha channel and corner radius options are not respected.</p></li>
<li><p><code>tooltip_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>tooltip_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
</ul>
<h3 id="battery">Battery<a name="battery" href="#battery" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>battery_hide = never/integer (0 to 100)</code> : At what battery percentage the battery item is hidden.</p></li>
<li><p><code>battery_low_status = integer</code>: At what battery percentage the low command is executed.</p></li>
<li><p><code>battery_low_cmd = notify-send &quot;battery low&quot;</code> : Command to execute when the battery is low.</p></li>
<li><p><code>bat1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>bat2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code></p></li>
<li><p><code>battery_font_color = color opacity (0 to 100)</code></p></li>
<li><p><code>battery_padding = horizontal_padding vertical_padding</code></p></li>
<li><p><code>battery_background_id = integer</code> : Which background to use for the battery.</p></li>
<li><p><code>battery_tooltip_enabled = boolean (0 or 1)</code> : Enable/disable battery tooltips. <em>(since 0.12.3)</em></p></li>
<li><p><code>battery_lclick_command = text</code> : Command to execute on left click. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_rclick_command = text</code> : Command to execute on right click. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_mclick_command = text</code> : Command to execute on middle click. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_uwheel_command = text</code> : Command to execute on wheel scroll up. <em>(since 0.12.1)</em></p></li>
<li><p><code>battery_dwheel_command = text</code> : Command to execute on wheel scroll down. <em>(since 0.12.1)</em></p></li>
<li><p><code>ac_connected_cmd = text</code> : Command to execute when the power adapter is plugged in. <em>(since 0.12.3)</em></p></li>
<li><p><code>ac_disconnected_cmd = text</code> : Command to execute when the power adapter is unplugged. <em>(since 0.12.3)</em></p></li>
</ul>
<h3 id="executor">Executor<a name="executor" href="#executor" class="md2man-permalink" title="permalink"></a></h3>
<ul>
<li><p><code>execp = new</code> : Begins the configuration of a new executor plugin. Multiple such plugins are supported; just use multiple <code>E</code>s in <code>panel_items</code>. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_command = text</code> : Command to execute. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_interval = integer</code> : The command is executed again after <code>execp_interval</code> seconds from the moment it exits. If zero, the command is executed only once. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_continuous = integer</code> : If non-zero, the last <code>execp_continuous</code> lines from the output of the command are displayed, every <code>execp_continuous</code> lines; this is useful for showing the output of commands that run indefinitely, such as <code>ping 127.0.0.1</code>. If zero, the output of the command is displayed after it finishes executing. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_has_icon = boolean (0 or 1)</code> : If <code>execp_has_icon = 1</code>, the first line printed by the command is interpreted as a path to an image file. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_cache_icon = boolean (0 or 1)</code> : If execp<em>cache</em>icon = 0, the image is reloaded each time the command is executed (useful if the image file is changed on disk by the program executed by <code>execp_command</code>). <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_icon_w = integer</code> : You can use execp<em>icon</em>w and execp<em>icon</em>h to resize the image. If one of them is zero/missing, the image is rescaled proportionally. If both of them are zero/missing, the image is not rescaled. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_icon_h = integer</code> : See <code>execp_icon_w</code>. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_tooltip = text</code> : The tooltip. Leave it empty to not display a tooltip. Not specifying this option leads to showing an automatically generated tooltip with information about when the command was last executed. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</code> : The font used to draw the text. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_font_color = color opacity</code> : The font color. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_markup = boolean (0 or 1)</code> : If non-zero, the output of the command is treated as Pango markup, which allows rich text formatting. The format is <a href="https://developer.gnome.org/pygtk/stable/pango-markup-language.html">documented here</a>. Note that using this with commands that print data downloaded from the Internet is a possible security risk. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_background_id = integer</code> : Which background to use. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_centered = boolean (0 or 1)</code> : Whether to center the text. <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text</code> <em>(since 0.12.4)</em></p></li>
<li><p><code>execp_lclick_command = text</code> : Command to execute on left 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_mclick_command = text</code> : Command to execute on right 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_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
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}'
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;'
execp_has_icon = 1
execp_interval = 0
execp_centered = 1
execp_font = sans 9
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_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(); }'
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(); }'
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 -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(); } '
execp_continuous = 1
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 -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
execp_interval = 1
execp_continuous = 1
</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.
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_continuous = 1
execp_interval = 1
</code></pre>
<h3 id="example-configuration">Example configuration<a name="example-configuration" href="#example-configuration" class="md2man-permalink" title="permalink"></a></h3><pre class="highlight plaintext"><code>#---------------------------------------------
## TINT2 CONFIG FILE
#---------------------------------------------
#---------------------------------------------
## BACKGROUND AND BORDER
#---------------------------------------------
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #ffffff 18
rounded = 5
border_width = 0
background_color = #ffffff 40
border_color = #ffffff 50
rounded = 5
border_width = 0
background_color = #ffffff 18
border_color = #ffffff 70
#---------------------------------------------
## PANEL
#---------------------------------------------
panel_monitor = all
panel_position = bottom center
panel_size = 94% 30
panel_margin = 0 0
panel_padding = 7 0
font_shadow = 0
panel_background_id = 1
wm_menu = 0
panel_dock = 0
panel_layer = bottom
#---------------------------------------------
## TASKBAR
#---------------------------------------------
#taskbar_mode = multi_desktop
taskbar_mode = single_desktop
taskbar_padding = 2 3 2
taskbar_background_id = 0
#taskbar_active_background_id = 0
#---------------------------------------------
## TASKS
#---------------------------------------------
task_icon = 1
task_text = 1
task_maximum_size = 140 35
task_centered = 1
task_padding = 6 3
task_font = sans 7
task_font_color = #ffffff 70
task_background_id = 3
task_icon_asb = 100 0 0
## replace STATUS by 'urgent', 'active' or 'iconfied'
#task_STATUS_background_id = 2
#task_STATUS_font_color = #ffffff 85
#task_STATUS_icon_asb = 100 0 0
## example:
task_active_background_id = 2
task_active_font_color = #ffffff 85
task_active_icon_asb = 100 0 0
urgent_nb_of_blink = 8
#---------------------------------------------
## SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 0 4 5
systray_background_id = 0
systray_sort = left2right
systray_icon_size = 0
systray_icon_asb = 100 0 0
#---------------------------------------------
## CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #ffffff 76
clock_padding = 1 0
clock_background_id = 0
#clock_lclick_command = xclock
clock_rclick_command = orage
#clock_tooltip = %A %d %B
#time1_timezone = :US/Hawaii
#time2_timezone = :Europe/Berlin
#clock_tooltip_timezone = :/usr/share/zoneinfo/Europe/Paris
#---------------------------------------------
## BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0
#---------------------------------------------
## TOOLTIP
#---------------------------------------------
tooltip = 0
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #OOOOOO 80
tooltip_font = sans 10
#---------------------------------------------
## MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
#---------------------------------------------
## AUTOHIDE OPTIONS
#---------------------------------------------
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 2
autohide_height = 4
strut_policy = minimum
</code></pre>
<h2 id="author">AUTHOR<a name="author" href="#author" class="md2man-permalink" title="permalink"></a></h2><p>tint2 was written by Thierry Lorthiois <a href="mailto:lorthiois@bbsoft.fr">lorthiois@bbsoft.fr</a>.
It is based on ttm, originally written by Pål Staurland <a href="mailto:staura@gmail.com">staura@gmail.com</a>.</p><p>This manual page was written by Daniel Moerner <a href="mailto:dmoerner@gmail.com">dmoerner@gmail.com</a>, for the Debian project (but may be used by others).
It was adopted from the tint2 docs.</p><h2 id="see-also">SEE ALSO<a name="see-also" href="#see-also" class="md2man-permalink" title="permalink"></a></h2><p>The main website <a href="https://gitlab.com/o9000/tint2">https://gitlab.com/o9000/tint2</a>
and the wiki page at <a href="https://gitlab.com/o9000/tint2/wikis/home">https://gitlab.com/o9000/tint2/wikis/home</a>.</p>

718
doc/tint2.md Normal file
View File

@@ -0,0 +1,718 @@
# TINT2 1 "2016-05-22"
## NAME
tint2 - lightweight panel/taskbar
## SYNOPSIS
`tint2 [-c path_to_config_file]`
## DESCRIPTION
tint2 is a simple panel/taskbar made for modern X window managers.
It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).
Features:
* Panel with taskbar, system tray, clock and launcher icons;
* Easy to customize: color/transparency on fonts, icons, borders and backgrounds;
* Pager like capability: move tasks between workspaces (virtual desktops), switch between workspaces;
* Multi-monitor capability: create one panel per monitor, showing only the tasks from the current monitor;
* Customizable mouse events.
Goals:
* Be unintrusive and light (in terms of memory, CPU and aesthetic);
* Follow the freedesktop.org specifications;
* Make certain workflows, such as multi-desktop and multi-monitor, easy to use.
## OPTIONS
`-c path_to_config_file`
Specifies which configuration file to use instead of the default.
## CONFIGURATION
### Table of contents
* [Introduction](#introduction)
* [Backgrounds and borders](#backgrounds-and-borders)
* [Panel](#panel)
* [Launcher](#launcher)
* [Taskbar/Pager](#taskbar-pager)
* [Taskbar buttons](#taskbar-buttons)
* [Mouse actions for taskbar buttons](#mouse-actions-for-taskbar-buttons)
* [System tray](#system-tray)
* [Clock](#clock)
* [Tooltip](#tooltip)
* [Battery](#battery)
* [Executor](#executor)
* [Example configuration](#example-configuration)
### Introduction
These are instructions for configuring tint2 directly by editing its config file.
You may also use instead the graphical interface `tint2conf`.
The first time you run tint2, it will create the config file in `$HOME/.config/tint2/tint2rc` (This applies if you have done a clean install. Running tint2 in the source directory without doing 'make install' will not create the config file.)
You can also specify another file on the command line with the -c option, e.g.: `tint2 -c $HOME/tint2.conf`. This can be used to run multiple instances of tint2 that use different settings.
If you change the config file while tint2 is running, the command `killall -SIGUSR1 tint2` will force tint2 to reload it.
All the configuration options supported in the config file are listed below.
Try to respect as much as possible the order of the options as given below.
### Backgrounds and borders
The tint2 config file starts with the options defining background elements with borders:
* `rounded = number_of_pixels` : the corner radius
* `border_width = integer` : the border width in pixels
* `border_sides = LRTB` : the sides to draw the border on (left, right, top, bottom). If not specified, all sides are used. *(since 0.12.12)*
* `background_color = color opacity`
* `color` is specified in hex RGB, e.g. #ff0000 is red
* `opacity` varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz).
* `border_color = color opacity`
* `color` is specified in hex RGB, e.g. #ff0000 is red
* `opacity` varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque
* `background_color_hover = color opacity` (default: same as `background_color`) *(since 0.12.3)*
* `color` is specified in hex RGB, e.g. #ff0000 is red
* `opacity` varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)
* `border_color_hover = color opacity` (default: same as `border_color`) *(since 0.12.3)*
* `color` is specified in hex RGB, e.g. #ff0000 is red
* `opacity` varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque
* `background_color_pressed = color opacity` (default: same as `background_color_hover`) *(since 0.12.3)*
* `color` is specified in hex RGB, e.g. #ff0000 is red
* `opacity` varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque. Note that for a transparent panel you need to enable a desktop compositor (such as compton or compiz)
* `border_color_pressed = color opacity` (default: same as `border_color_hover`) *(since 0.12.3)*
* `color` is specified in hex RGB, e.g. #ff0000 is red
* `opacity` varies from (0 to 100), where 0 is fully transparent, 100 is fully opaque
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
rounded = 1
border_width = 0
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
taskbar_background_id = 0
task_background_id = 0
task_active_background_id = 2
systray_background_id = 0
clock_background_id = 0
```
Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.
### Panel
* `panel_items = LTSBC` defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:
* `L` shows the Launcher
* `T` shows the Taskbar
* `S` shows the Systray (also called notification area)
* `B` shows the Battery status
* `C` shows the Clock
* `F` adds an extensible spacer (freespace). Has no effect if `T` is also present. *(since 0.12)*
* `E` adds an executor plugin. You can specify more than one. *(since 0.12.4)*
For example, `panel_items = STC` will show the systray, the taskbar and the clock (from left to right).
* `panel_monitor = monitor (all or 1 or 2 or ...)` : Which monitor tint2 draws the panel on
* The first monitor is `1`
* Use `panel_monitor = all` to get a separate panel per monitor
* `primary_monitor_first = boolean (0 or 1)` : Place the primary monitor before all the other monitors in the list. *(since 0.12.4)*
![](images/panel_padding.jpg)
* `panel_position = vertical_position horizontal_position orientation`
* `vertical_position` is one of: `bottom`, `top`, `center`
* `horizontal_position` is one of: `left`, `right`, `center`
* `orientation` is one of: `horizontal`, `vertical`
* `panel_size = width height`
* `width` and `height` can be specified without units (e.g. `123`) as pixels, or followed by `%` as percentages of the monitor size (e.g. `50%`). Use `100%` for full monitor width/height.
Example:
```
# The panel's width is 94% the size of the monitor, the height is 30 pixels:
panel_size = 94% 30
```
* `panel_margin = horizontal_margin vertical_margin` : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use `0` to obtain a panel with the same size as the edge of the monitor (no margin).
![](images/panel_size_margin.jpg)
* `panel_padding = horizontal_padding vertical_padding spacing` : Please refer to the image below.
![](images/panel_padding.jpg)
* `font_shadow = boolean (0 or 1)`
* `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_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.
* `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.
* `panel_window_name = string` : Defines the name of the panel's window. Default: 'tint2'. *(since 0.12)*
* `disable_transparency = boolean (0 or 1)` : Whether to disable transparency instead of detecting if it is supported. Useful on broken graphics stacks. *(since 0.12)*
* `mouse_effects = boolean (0 or 1)` : Whether to enable mouse hover effects for clickable items. *(since 0.12.3)*
* `mouse_hover_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)` : Adjusts the icon color and transparency on mouse hover (works only when mouse_effects = 1).` *(since 0.12.3)*
* `mouse_pressed_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)` : Adjusts the icon color and transparency on mouse press (works only when mouse_effects = 1).` *(since 0.12.3)*
* `autohide = boolean (0 or 1)` : Whether to enable panel hiding when the mouse cursor exists the panel.
* `autohide_show_timeout = float` : Show timeout in seconds after the mouse cursor enters the panel. Use '.' as decimal separator.
* `autohide_hide_timeout = float` : Hide timeout in seconds after the mouse cursor exits the panel. Use '.' as decimal separator.
* `autohide_height = integer` : panel height (width for vertical panels) in hidden mode.
### Launcher
* `launcher_item_app = path_to_application` : Each `launcher_item_app` must be a file path to a .desktop file following the freedesktop.org [specification](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). The paths may begin with `~`, which is expanded to the path of the user's home directory. If only a file name is specified, the file is search in the standard application directories (`$XDG_DATA_HOME/applications`, `~/.local/share/applications`, `$XDG_DATA_DIRS/applications`, `/usr/local/share/applications`, `/usr/share/applications`, `/opt/share/applications`).
* `launcher_apps_dir = path_to_directory` : Specifies a path to a directory from which the launcher is loading all .desktop files (all subdirectories are explored recursively). Can be used multiple times. The path may begin with `~`, which is expanded to the path of the user's home directory. *(since 0.12)*
* `launcher_background_id = integer` : Defines which background to use.
* `launcher_icon_background_id = integer` : Defines which background to use for icons.
* `launcher_padding = horizontal_padding vertical_padding spacing`
* `launcher_icon_size = integer` : The launcher icon size, in pixels.
* `launcher_icon_theme = name_of_theme` : (Optional) Uses the specified icon theme to display shortcut icons. Note that tint2 will detect and use the icon theme of your desktop if you have an XSETTINGS manager running (which you probably do), unless `launcher_icon_theme_override = 1`.
* `launcher_icon_theme_override = boolean (0 or 1)` : Whether `launcher_icon_theme` overrides the value obtained from the XSETTINGS manager. *(since 0.12)*
* `launcher_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)` : Adjusts the icon color and transparency.
* `launcher_tooltip = boolean (0 or 1)` : Whether to show tooltips for the launcher icons.
* `startup_notifications = boolean (0 or 1)` : Whether to show startup notifications when starting applications from the launcher. *(since 0.12)*
### Taskbar / Pager
* `taskbar_mode = single_desktop/multi_desktop`
* `single_desktop` : Shows a normal taskbar listing the tasks running on the current virtual desktop (also known as 'workspace');
* `multi_desktop` : Pager like capability. Shows multiple taskbars, one per virtual desktop, with which:
* You can drag-and-drop tasks between virtual desktops;
* You can switch between virtual desktops.
* `taskbar_distribute_size = boolean (0 or 1)` : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. *(since 0.12)*
* `taskbar_padding = horizontal_padding vertical_padding spacing`
![](images/taskbar_padding.jpg)
* `taskbar_background_id = integer` : Which background to use
* `taskbar_active_background_id = integer` : Which background to use for the taskbar of the current virtual desktop.
* `taskbar_hide_inactive_tasks = boolean (0 or 1)` : If enabled, the taskbar shows only the active task. *(since 0.12)*
* `taskbar_hide_different_monitor = boolean (0 or 1)` : If enabled, the taskbar shows only the tasks from the current monitor. Useful when running different tint2 instances on different monitors, each one having its own config. *(since 0.12)*
* `taskbar_always_show_all_desktop_tasks = boolean (0 or 1)` : Has effect only if `taskbar_mode = multi_desktop`. If enabled, tasks that appear on all desktops are shown on all taskbars. Otherwise, they are shown only on the taskbar of the current desktop. *(since 0.12.4)*
* `taskbar_sort_order = none/title/center` : Specifies the sort order of the tasks on the taskbar. *(since 0.12)*
* `none` : No sorting. New tasks are simply appended at the end of the taskbar when they appear.
* `title` : Sorts the tasks by title.
* `center` : Sorts the tasks by their window centers.
* `mru` : Shows the most recently used tasks first. *(since 0.12.4)*
* `lru` : Shows the most recently used tasks last. *(since 0.12.4)*
* `task_align = left/center/right` : Specifies the alignment of the tasks on the taskbar. Default: left.
* `taskbar_name = boolean (0 or 1)` : Whether to show the virtual desktop name in the taskbar.
* `taskbar_name_padding = padding` : Padding for the virtual desktop name.
* `taskbar_name_background_id = integer` : Which background to use for the desktop name.
* `taskbar_name_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]` : Font configuration for the desktop name.
* `taskbar_name_font_color = color opacity (0 to 100)` : Font color for the desktop name.
* `taskbar_name_active_background_id = integer` : Which background to use for the name of the current desktop.
* `taskbar_name_active_font_color = color opacity (0 to 100)` : Font color for the name of the current desktop.
# Taskbar buttons
The following options configure the task buttons in the taskbar:
* `task_icon = boolean (0 or 1)` : Whether to display the task icon.
* `task_text = boolean (0 or 1)` : Whether to display the task text.
* `task_centered = boolean (0 or 1)` : Whether the task text is centered.
* `task_tooltip = boolean (0 or 1)` : Whether to show tooltips for tasks.
* `task_maximum_size = width height`
* `width` is used with horizontal panels to limit the size of the tasks. Use `width = 0` to get full taskbar width.
* `height` is used with vertical panels.
* `task_padding = horizontal_padding vertical_padding spacing`
* `urgent_nb_of_blink = integer` : Number of blinks on 'get attention' events.
![](images/task_padding.jpg)
* `task_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]`
* `task_font_color = color opacity (0 to 100)`
* `task_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)` : Adjust the task icon's color and transparency.
* `task_background_id = integer` : Which background to use for non selected tasks
For the next 3 options STATUS can be `active` / `iconified` / `urgent`:
* `task_STATUS_font_color = color opacity (0 to 100)`
* `task_STATUS_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)` : Adjusts the task icon's color and transparency.
* `task_STATUS_background_id = integer` : Which background to use for the task.
### Mouse actions for taskbar buttons
The possible mouse events are: `left, middle, right, scroll_up, scroll_down`.
The possible mouse actions are: `none, close, toggle, iconify, shade, toggle_iconify, maximize_restore, desktop_left, desktop_right, next_task, prev_task`.
Use `mouse_event = action` to customize mouse actions. Example:
```
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
```
The action semantics:
* `none` : If `wm_menu = 1` is set, the mouse event is forwarded to the window manager. Otherwise it is ignored.
* `close` : close the task
* `toggle` : toggle the task
* `iconify` : iconify (minimize) the task
* `toggle_iconify` : toggle or iconify the task
* `maximize_restore` : maximized or minimized the task
* `shade` : shades (collapses) the task
* `desktop_left` : send the task to the desktop on the left
* `desktop_right` : send the task to the desktop on the right
* `next_task` : send the focus to next task
* `prev_task` : send the focus to previous task
### System Tray
* `systray_padding = horizontal_padding vertical_padding spacing`
* `systray_background_id = integer` : Which background to use.
* `systray_sort = ascending/descending/left2right/right2left` : Specifies the sorting order for the icons in the systray: in ascending/descending alphabetical order of the icon title, or always add icons to the right/left (note that with `left2right` or `right2left` the order can be different on panel restart).
* `systray_icon_size = max_icon_size` : Set the maximum system tray icon size to `number`. Set to `0` for automatic icon sizing.
* `systray_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)` : Adjust the systray icons color and transparency.
* `systray_monitor = integer (1, 2, ...)` : On which monitor to draw the systray. The first monitor is `1`. *(since 0.12)*
### Clock
* `time1_format = %H:%M` : The format used by the first line of the clock.
* `time1_format`, `time2_format` and `clock_tooltip` use the 'strftime' syntax. More info can be found here: http://www.manpagez.com/man/3/strftime/
* To hide the clock, comment `time1_format` and `time2_format`.
* `time1_timezone = :US/Hawaii`
* `time1_timezone`, `time2_timezone` and `clock_tooltip_timezone` can be used to specify a timezone. If you do not specify a value the system-wide timezone is used. The timezones can usually be found in `/usr/share/zoneinfo`. If your timezones are in a different directory, you need to specify the absolute path, e.g. `time1_timezone = :/different/zoneinfo/dir/US/Hawaii` Always prepend the timezone with a ':'
* `time1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]`
* `time2_format = %A %d %B`
* `time2_timezone = :Europe/Berlin`
* `time2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]`
* `clock_font_color = color opacity (0 to 100)`
* `clock_padding = horizontal_padding vertical_padding`
* `clock_background_id = integer` : Which background to use
* `clock_tooltip = %a, %d. %b %Y` : Format for the clock's tooltip.
* `clock_tooltip_timezone = :UTC`
* `clock_lclick_command = text` : Command to execute on left click.
* `clock_rclick_command = text` : Command to execute on right click.
* `clock_mclick_command = text` : Command to execute on middle click. *(since 0.12.1)*
* `clock_uwheel_command = text` : Command to execute on wheel scroll up. *(since 0.12.1)*
* `clock_dwheel_command = text` : Command to execute on wheel scroll down. *(since 0.12.1)*
### Tooltip
* `tooltip_padding = horizontal_padding vertical_padding`
* `tooltip_show_timeout = float` : Delay to show the tooltip in seconds. Use `.` as decimal separator.
* `tooltip_hide_timeout = float` : Delay to hide the tooltip in seconds. Use `.` as decimal separator.
* `tooltip_background_id = integer` : Which background to use for tooltips. Note that with fake transparency the alpha channel and corner radius options are not respected.
* `tooltip_font_color = color opacity (0 to 100)`
* `tooltip_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]`
### Battery
* `battery_hide = never/integer (0 to 100)` : At what battery percentage the battery item is hidden.
* `battery_low_status = integer`: At what battery percentage the low command is executed.
* `battery_low_cmd = notify-send "battery low"` : Command to execute when the battery is low.
* `bat1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]`
* `bat2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]`
* `battery_font_color = color opacity (0 to 100)`
* `battery_padding = horizontal_padding vertical_padding`
* `battery_background_id = integer` : Which background to use for the battery.
* `battery_tooltip_enabled = boolean (0 or 1)` : Enable/disable battery tooltips. *(since 0.12.3)*
* `battery_lclick_command = text` : Command to execute on left click. *(since 0.12.1)*
* `battery_rclick_command = text` : Command to execute on right click. *(since 0.12.1)*
* `battery_mclick_command = text` : Command to execute on middle click. *(since 0.12.1)*
* `battery_uwheel_command = text` : Command to execute on wheel scroll up. *(since 0.12.1)*
* `battery_dwheel_command = text` : Command to execute on wheel scroll down. *(since 0.12.1)*
* `ac_connected_cmd = text` : Command to execute when the power adapter is plugged in. *(since 0.12.3)*
* `ac_disconnected_cmd = text` : Command to execute when the power adapter is unplugged. *(since 0.12.3)*
### Executor
* `execp = new` : Begins the configuration of a new executor plugin. Multiple such plugins are supported; just use multiple `E`s in `panel_items`. *(since 0.12.4)*
* `execp_command = text` : Command to execute. *(since 0.12.4)*
* `execp_interval = integer` : The command is executed again after `execp_interval` seconds from the moment it exits. If zero, the command is executed only once. *(since 0.12.4)*
* `execp_continuous = integer` : If non-zero, the last `execp_continuous` lines from the output of the command are displayed, every `execp_continuous` lines; this is useful for showing the output of commands that run indefinitely, such as `ping 127.0.0.1`. If zero, the output of the command is displayed after it finishes executing. *(since 0.12.4)*
* `execp_has_icon = boolean (0 or 1)` : If `execp_has_icon = 1`, the first line printed by the command is interpreted as a path to an image file. *(since 0.12.4)*
* `execp_cache_icon = boolean (0 or 1)` : If `execp_cache_icon = 0`, the image is reloaded each time the command is executed (useful if the image file is changed on disk by the program executed by `execp_command`). *(since 0.12.4)*
* `execp_icon_w = integer` : You can use `execp_icon_w` and `execp_icon_h` to resize the image. If one of them is zero/missing, the image is rescaled proportionally. If both of them are zero/missing, the image is not rescaled. *(since 0.12.4)*
* `execp_icon_h = integer` : See `execp_icon_w`. *(since 0.12.4)*
* `execp_tooltip = text` : The tooltip. Leave it empty to not display a tooltip. Not specifying this option leads to showing an automatically generated tooltip with information about when the command was last executed. *(since 0.12.4)*
* `execp_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]` : The font used to draw the text. *(since 0.12.4)*
* `execp_font_color = color opacity` : The font color. *(since 0.12.4)*
* `execp_markup = boolean (0 or 1)` : If non-zero, the output of the command is treated as Pango markup, which allows rich text formatting. The format is [documented here](https://developer.gnome.org/pygtk/stable/pango-markup-language.html). Note that using this with commands that print data downloaded from the Internet is a possible security risk. *(since 0.12.4)*
* `execp_background_id = integer` : Which background to use. *(since 0.12.4)*
* `execp_centered = boolean (0 or 1)` : Whether to center the text. *(since 0.12.4)*
* `execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text` *(since 0.12.4)*
* `execp_lclick_command = text` : Command to execute on left click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
* `execp_mclick_command = text` : Command to execute on right click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
* `execp_rclick_command = text` : Command to execute on middle click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
* `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
##### Print the hostname
```
execp = new
execp_command = hostname
execp_interval = 0
```
##### Print disk usage for the root partition every 10 seconds
```
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>'
execp_has_icon = 1
execp_interval = 0
execp_centered = 1
execp_font = sans 9
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_background_id = 2
```
##### 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(); }'
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 -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 = 1
execp_interval = 1
execp_markup = 1
```
##### Memory usage
```
execp = new
execp_command = free -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
execp_interval = 1
execp_continuous = 1
```
##### 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_continuous = 1
execp_interval = 1
```
### Example configuration
```
#---------------------------------------------
## TINT2 CONFIG FILE
#---------------------------------------------
#---------------------------------------------
## BACKGROUND AND BORDER
#---------------------------------------------
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #ffffff 18
rounded = 5
border_width = 0
background_color = #ffffff 40
border_color = #ffffff 50
rounded = 5
border_width = 0
background_color = #ffffff 18
border_color = #ffffff 70
#---------------------------------------------
## PANEL
#---------------------------------------------
panel_monitor = all
panel_position = bottom center
panel_size = 94% 30
panel_margin = 0 0
panel_padding = 7 0
font_shadow = 0
panel_background_id = 1
wm_menu = 0
panel_dock = 0
panel_layer = bottom
#---------------------------------------------
## TASKBAR
#---------------------------------------------
#taskbar_mode = multi_desktop
taskbar_mode = single_desktop
taskbar_padding = 2 3 2
taskbar_background_id = 0
#taskbar_active_background_id = 0
#---------------------------------------------
## TASKS
#---------------------------------------------
task_icon = 1
task_text = 1
task_maximum_size = 140 35
task_centered = 1
task_padding = 6 3
task_font = sans 7
task_font_color = #ffffff 70
task_background_id = 3
task_icon_asb = 100 0 0
## replace STATUS by 'urgent', 'active' or 'iconfied'
#task_STATUS_background_id = 2
#task_STATUS_font_color = #ffffff 85
#task_STATUS_icon_asb = 100 0 0
## example:
task_active_background_id = 2
task_active_font_color = #ffffff 85
task_active_icon_asb = 100 0 0
urgent_nb_of_blink = 8
#---------------------------------------------
## SYSTRAYBAR
#---------------------------------------------
systray = 1
systray_padding = 0 4 5
systray_background_id = 0
systray_sort = left2right
systray_icon_size = 0
systray_icon_asb = 100 0 0
#---------------------------------------------
## CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #ffffff 76
clock_padding = 1 0
clock_background_id = 0
#clock_lclick_command = xclock
clock_rclick_command = orage
#clock_tooltip = %A %d %B
#time1_timezone = :US/Hawaii
#time2_timezone = :Europe/Berlin
#clock_tooltip_timezone = :/usr/share/zoneinfo/Europe/Paris
#---------------------------------------------
## BATTERY
#---------------------------------------------
battery = 0
battery_hide = 98
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #ffffff 76
battery_padding = 1 0
battery_background_id = 0
#---------------------------------------------
## TOOLTIP
#---------------------------------------------
tooltip = 0
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font_color = #OOOOOO 80
tooltip_font = sans 10
#---------------------------------------------
## MOUSE ACTION ON TASK
#---------------------------------------------
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
#---------------------------------------------
## AUTOHIDE OPTIONS
#---------------------------------------------
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 2
autohide_height = 4
strut_policy = minimum
```
## AUTHOR
tint2 was written by Thierry Lorthiois <lorthiois@bbsoft.fr>.
It is based on ttm, originally written by Pål Staurland <staura@gmail.com>.
This manual page was originally written by Daniel Moerner <dmoerner@gmail.com>, for the Debian project (but may be used by others).
It was adopted from the tint2 docs.
## SEE ALSO
The main website https://gitlab.com/o9000/tint2
and the wiki page at https://gitlab.com/o9000/tint2/wikis/home.
This documentation is also provided in HTML and Markdown format in the system's default location
for documentation files, usually `/usr/share/doc/tint2` or `/usr/local/share/doc/tint2`.

View File

@@ -58,6 +58,7 @@ gboolean battery_found;
void battery_init_fonts();
char *battery_get_tooltip(void *obj);
void battery_dump_geometry(void *obj, int indent);
void default_battery()
{
@@ -158,8 +159,8 @@ void init_battery_panel(void *p)
battery->area.on_screen = TRUE;
battery->area.resize_needed = 1;
battery->area.has_mouse_over_effect =
panel_config.mouse_effects && (battery_lclick_command || battery_mclick_command || battery_rclick_command ||
battery_uwheel_command || battery_dwheel_command);
panel_config.mouse_effects && (battery_lclick_command || battery_mclick_command || battery_rclick_command ||
battery_uwheel_command || battery_dwheel_command);
battery->area.has_mouse_press_effect = battery->area.has_mouse_over_effect;
if (battery_tooltip_enabled)
battery->area._get_tooltip_text = battery_get_tooltip;
@@ -227,12 +228,12 @@ void update_battery_tick(void *arg)
}
if (battery_state.percentage < battery_low_status && battery_state.state == BATTERY_DISCHARGING &&
!battery_low_cmd_sent) {
!battery_low_cmd_sent) {
tint_exec(battery_low_cmd);
battery_low_cmd_sent = TRUE;
}
if (battery_state.percentage > battery_low_status && battery_state.state == BATTERY_CHARGING &&
battery_low_cmd_sent) {
battery_low_cmd_sent) {
battery_low_cmd_sent = FALSE;
}
@@ -259,7 +260,7 @@ void update_battery_tick(void *arg)
// Redraw if needed
if (panels[i].battery.area.on_screen) {
if (old_found != battery_found || old_percentage != battery_state.percentage ||
old_hours != battery_state.time.hours || old_minutes != battery_state.time.minutes) {
old_hours != battery_state.time.hours || old_minutes != battery_state.time.minutes) {
panels[i].battery.area.resize_needed = TRUE;
panel_refresh = TRUE;
}
@@ -302,31 +303,31 @@ gboolean resize_battery(void *obj)
snprintf(buf_bat_time, sizeof(buf_bat_time), "%02d:%02d", battery_state.time.hours, battery_state.time.minutes);
}
get_text_size2(bat1_font_desc,
&bat_percentage_height_ink,
&bat_percentage_height,
&bat_percentage_width,
panel->area.height,
panel->area.width,
buf_bat_percentage,
strlen(buf_bat_percentage),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
FALSE);
&bat_percentage_height_ink,
&bat_percentage_height,
&bat_percentage_width,
panel->area.height,
panel->area.width,
buf_bat_percentage,
strlen(buf_bat_percentage),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
FALSE);
get_text_size2(bat2_font_desc,
&bat_time_height_ink,
&bat_time_height,
&bat_time_width,
panel->area.height,
panel->area.width,
buf_bat_time,
strlen(buf_bat_time),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
FALSE);
&bat_time_height_ink,
&bat_time_height,
&bat_time_width,
panel->area.height,
panel->area.width,
buf_bat_time,
strlen(buf_bat_time),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
FALSE);
if (panel_horizontal) {
int new_size = (bat_percentage_width > bat_time_width) ? bat_percentage_width : bat_time_width;
new_size += 2 * battery->area.paddingxlr + 2 * battery->area.bg->border.width;
new_size += 2 * battery->area.paddingxlr + left_right_border_width(&battery->area);
if (new_size > battery->area.width || new_size < battery->area.width - 2) {
// we try to limit the number of resize
battery->area.width = new_size;
@@ -335,8 +336,8 @@ gboolean resize_battery(void *obj)
ret = 1;
}
} else {
int new_size =
bat_percentage_height + bat_time_height + (2 * (battery->area.paddingxlr + battery->area.bg->border.width));
int new_size = bat_percentage_height + bat_time_height + 2 * battery->area.paddingxlr +
top_bottom_border_width(&battery->area);
if (new_size > battery->area.height || new_size < battery->area.height - 2) {
battery->area.height = new_size;
battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height - 2) / 2;
@@ -382,6 +383,23 @@ void draw_battery(void *obj, cairo_t *c)
g_object_unref(layout);
}
void battery_dump_geometry(void *obj, int indent)
{
Battery *battery = obj;
fprintf(stderr,
"%*sText 1: y = %d, text = %s\n",
indent,
"",
battery->bat1_posy,
buf_bat_percentage);
fprintf(stderr,
"%*sText 2: y = %d, text = %s\n",
indent,
"",
battery->bat2_posy,
buf_bat_time);
}
char *battery_get_tooltip(void *obj)
{
return battery_os_tooltip();

View File

@@ -55,6 +55,7 @@ static timeout *clock_timeout;
void clock_init_fonts();
char *clock_get_tooltip(void *obj);
void clock_dump_geometry(void *obj, int indent);
void default_clock()
{
@@ -188,6 +189,7 @@ void init_clock_panel(void *p)
clock->area._draw_foreground = draw_clock;
clock->area.size_mode = LAYOUT_FIXED;
clock->area._resize = resize_clock;
clock->area._dump_geometry = clock_dump_geometry;
// check consistency
if (!time1_format)
return;
@@ -276,7 +278,7 @@ gboolean resize_clock(void *obj)
if (panel_horizontal) {
int new_size = (time_width > date_width) ? time_width : date_width;
new_size += (2 * clock->area.paddingxlr) + (2 * clock->area.bg->border.width);
new_size += 2 * clock->area.paddingxlr + left_right_border_width(&clock->area);
if (new_size > clock->area.width || new_size < (clock->area.width - 6)) {
// we try to limit the number of resizes
clock->area.width = new_size + 1;
@@ -288,7 +290,7 @@ gboolean resize_clock(void *obj)
result = TRUE;
}
} else {
int new_size = time_height + date_height + (2 * (clock->area.paddingxlr + clock->area.bg->border.width));
int new_size = time_height + date_height + 2 * clock->area.paddingxlr + top_bottom_border_width(&clock->area);
if (new_size != clock->area.height) {
// we try to limit the number of resizes
clock->area.height = new_size;
@@ -334,6 +336,26 @@ void draw_clock(void *obj, cairo_t *c)
g_object_unref(layout);
}
void clock_dump_geometry(void *obj, int indent)
{
Clock *clock = (Clock *)obj;
fprintf(stderr,
"%*sText 1: y = %d, text = %s\n",
indent,
"",
clock->time1_posy,
buf_time);
if (time2_format) {
fprintf(stderr,
"%*sText 2: y = %d, text = %s\n",
indent,
"",
clock->time2_posy,
buf_date);
}
}
char *clock_get_tooltip(void *obj)
{
strftime(buf_tooltip, sizeof(buf_tooltip), time_tooltip_format, clock_gettime_for_tz(time_tooltip_timezone));

View File

@@ -239,6 +239,19 @@ void add_entry(char *key, char *value)
read_border_color_press = 0;
} else if (strcmp(key, "border_width") == 0) {
g_array_index(backgrounds, Background, backgrounds->len - 1).border.width = atoi(value);
} else if (strcmp(key, "border_sides") == 0) {
Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
bg->border.mask = 0;
if (strchr(value, 'l') || strchr(value, 'L'))
bg->border.mask |= BORDER_LEFT;
if (strchr(value, 'r') || strchr(value, 'R'))
bg->border.mask |= BORDER_RIGHT;
if (strchr(value, 't') || strchr(value, 'T'))
bg->border.mask |= BORDER_TOP;
if (strchr(value, 'b') || strchr(value, 'B'))
bg->border.mask |= BORDER_BOTTOM;
if (!bg->border.mask)
bg->border.width = 0;
} else if (strcmp(key, "background_color") == 0) {
Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
extract_values(value, &value1, &value2, &value3);
@@ -796,9 +809,10 @@ void add_entry(char *key, char *value)
} else if (strcmp(key, "task_maximum_size") == 0) {
extract_values(value, &value1, &value2, &value3);
panel_config.g_task.maximum_width = atoi(value1);
panel_config.g_task.maximum_height = 30;
if (value2)
panel_config.g_task.maximum_height = atoi(value2);
else
panel_config.g_task.maximum_height = panel_config.g_task.maximum_width;
} else if (strcmp(key, "task_padding") == 0) {
extract_values(value, &value1, &value2, &value3);
panel_config.g_task.area.paddingxlr = panel_config.g_task.area.paddingx = atoi(value1);

View File

@@ -21,6 +21,7 @@
void execp_timer_callback(void *arg);
char *execp_get_tooltip(void *obj);
void execp_init_fonts();
void execp_dump_geometry(void *obj, int indent);
void default_execp()
{
@@ -31,12 +32,11 @@ Execp *create_execp()
Execp *execp = calloc(1, sizeof(Execp));
execp->backend = calloc(1, sizeof(ExecpBackend));
execp->backend->child_pipe = -1;
execp->backend->cmd_pids = g_tree_new(cmp_ptr);
execp->backend->interval = 30;
execp->backend->cache_icon = TRUE;
execp->backend->centered = TRUE;
execp->backend->font_color.alpha = 0.5;
return execp;
}
@@ -58,6 +58,9 @@ void destroy_execp(void *obj)
// This is a frontend element
execp->backend->instances = g_list_remove_all(execp->backend->instances, execp);
free_and_null(execp->frontend);
remove_area(&execp->area);
free_area(&execp->area);
free_and_null(execp);
} else {
// This is a backend element
stop_timeout(execp->backend->timer);
@@ -79,6 +82,10 @@ void destroy_execp(void *obj)
close(execp->backend->child_pipe);
execp->backend->child_pipe = -1;
}
if (execp->backend->cmd_pids) {
g_tree_destroy(execp->backend->cmd_pids);
execp->backend->cmd_pids = NULL;
}
execp->backend->bg = NULL;
pango_font_description_free(execp->backend->font_desc);
@@ -157,17 +164,21 @@ void init_execp_panel(void *p)
execp->area.paddingxlr = execp->backend->paddingxlr;
execp->area.parent = panel;
execp->area.panel = panel;
snprintf(execp->area.name, sizeof(execp->area.name), "Execp %s", execp->backend->command ? execp->backend->command : "null");
execp->area._dump_geometry = execp_dump_geometry;
snprintf(execp->area.name,
sizeof(execp->area.name),
"Execp %s",
execp->backend->command ? execp->backend->command : "null");
execp->area._draw_foreground = draw_execp;
execp->area.size_mode = LAYOUT_FIXED;
execp->area._resize = resize_execp;
execp->area._get_tooltip_text = execp_get_tooltip;
execp->area._is_under_mouse = full_width_area_is_under_mouse;
execp->area.has_mouse_press_effect =
panel_config.mouse_effects &&
(execp->area.has_mouse_over_effect = execp->backend->lclick_command || execp->backend->mclick_command ||
execp->backend->rclick_command || execp->backend->uwheel_command ||
execp->backend->dwheel_command);
panel_config.mouse_effects &&
(execp->area.has_mouse_over_effect = execp->backend->lclick_command || execp->backend->mclick_command ||
execp->backend->rclick_command || execp->backend->uwheel_command ||
execp->backend->dwheel_command);
execp->area.resize_needed = TRUE;
execp->area.on_screen = TRUE;
@@ -265,7 +276,7 @@ gboolean reload_icon(Execp *execp)
}
if (w != imlib_image_get_width() || h != imlib_image_get_height()) {
Imlib_Image icon_scaled =
imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), w, h);
imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), w, h);
imlib_context_set_image(execp->backend->icon);
imlib_free_image();
execp->backend->icon = icon_scaled;
@@ -304,31 +315,31 @@ gboolean resize_execp(void *obj)
int txt_height_ink, txt_height, txt_width;
if (panel_horizontal) {
get_text_size2(execp->backend->font_desc,
&txt_height_ink,
&txt_height,
&txt_width,
panel->area.height,
panel->area.width,
execp->backend->text,
strlen(execp->backend->text),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
execp->backend->has_markup);
&txt_height_ink,
&txt_height,
&txt_width,
panel->area.height,
panel->area.width,
execp->backend->text,
strlen(execp->backend->text),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
execp->backend->has_markup);
} else {
get_text_size2(execp->backend->font_desc,
&txt_height_ink,
&txt_height,
&txt_width,
panel->area.height,
!text_next_line
? execp->area.width - icon_w - (icon_w ? interior_padding : 0) -
2 * (horiz_padding + execp->area.bg->border.width)
: execp->area.width - 2 * (horiz_padding + execp->area.bg->border.width),
execp->backend->text,
strlen(execp->backend->text),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
execp->backend->has_markup);
&txt_height_ink,
&txt_height,
&txt_width,
panel->area.height,
!text_next_line
? execp->area.width - icon_w - (icon_w ? interior_padding : 0) - 2 * horiz_padding -
left_right_border_width(&execp->area)
: execp->area.width - 2 * horiz_padding - left_right_border_width(&execp->area),
execp->backend->text,
strlen(execp->backend->text),
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_NONE,
execp->backend->has_markup);
}
gboolean result = FALSE;
@@ -336,7 +347,7 @@ gboolean resize_execp(void *obj)
int new_size = txt_width;
if (icon_w)
new_size += interior_padding + icon_w;
new_size += 2 * (horiz_padding + execp->area.bg->border.width);
new_size += 2 * horiz_padding + left_right_border_width(&execp->area);
if (new_size > execp->area.width || new_size < (execp->area.width - 6)) {
// we try to limit the number of resize
execp->area.width = new_size + 1;
@@ -345,12 +356,11 @@ gboolean resize_execp(void *obj)
} else {
int new_size;
if (!text_next_line) {
new_size = txt_height + (2 * (vert_padding + execp->area.bg->border.width));
if (new_size < icon_h + (2 * (vert_padding + execp->area.bg->border.width))) {
new_size = icon_h + (2 * (vert_padding + execp->area.bg->border.width));
}
new_size = txt_height + 2 * vert_padding + top_bottom_border_width(&execp->area);
new_size = MAX(new_size, icon_h + 2 * vert_padding + top_bottom_border_width(&execp->area));
} else {
new_size = icon_h + interior_padding + txt_height + (2 * (vert_padding + execp->area.bg->border.width));
new_size =
icon_h + interior_padding + txt_height + 2 * vert_padding + top_bottom_border_width(&execp->area);
}
if (new_size != execp->area.height) {
execp->area.height = new_size;
@@ -380,18 +390,18 @@ gboolean resize_execp(void *obj)
if (icon_w) {
if (!text_next_line) {
execp->frontend->icony = (execp->area.height - icon_h) / 2;
execp->frontend->iconx = execp->area.bg->border.width + horiz_padding;
execp->frontend->iconx = left_border_width(&execp->area) + horiz_padding;
execp->frontend->texty = (execp->area.height - txt_height) / 2;
execp->frontend->textx = execp->frontend->iconx + icon_w + interior_padding;
} else {
execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2;
execp->frontend->iconx = execp->area.bg->border.width + horiz_padding;
execp->frontend->iconx = left_border_width(&execp->area) + horiz_padding;
execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding;
execp->frontend->textx = execp->frontend->iconx;
}
} else {
execp->frontend->texty = (execp->area.height - txt_height) / 2;
execp->frontend->textx = execp->area.bg->border.width + horiz_padding;
execp->frontend->textx = left_border_width(&execp->area) + horiz_padding;
}
}
@@ -422,15 +432,56 @@ void draw_execp(void *obj, cairo_t *c)
pango_cairo_update_layout(c, layout);
draw_text(layout,
c,
execp->frontend->textx,
execp->frontend->texty,
&execp->backend->font_color,
panel_config.font_shadow);
c,
execp->frontend->textx,
execp->frontend->texty,
&execp->backend->font_color,
panel_config.font_shadow);
g_object_unref(layout);
}
void execp_dump_geometry(void *obj, int indent)
{
Execp *execp = obj;
if (execp->backend->has_icon && execp->backend->icon) {
Imlib_Image tmp = imlib_context_get_image();
imlib_context_set_image(execp->backend->icon);
fprintf(stderr,
"%*sIcon: x = %d, y = %d, w = %d, h = %d\n",
indent,
"",
execp->frontend->iconx,
execp->frontend->icony,
imlib_image_get_width(),
imlib_image_get_height());
if (tmp)
imlib_context_set_image(tmp);
}
fprintf(stderr,
"%*sText: x = %d, y = %d, w = %d, align = %s, text = %s\n",
indent,
"",
execp->frontend->textx,
execp->frontend->texty,
execp->frontend->textw,
execp->backend->centered ? "center" : "left",
execp->backend->text);
}
void execp_force_update(Execp *execp)
{
if (execp->backend->child_pipe > 0) {
// Command currently running, nothing to do
} else {
if (execp->backend->timer)
stop_timeout(execp->backend->timer);
// Run command right away
execp->backend->timer = add_timeout(10, 0, execp_timer_callback, execp, &execp->backend->timer);
}
}
void execp_action(void *obj, int button, int x, int y)
{
Execp *execp = obj;
@@ -462,20 +513,32 @@ void execp_action(void *obj, int button, int x, int y)
execp->area.width,
execp->area.height,
command);
tint_exec(full_cmd);
pid_t pid = fork();
if (pid < 0) {
fprintf(stderr, "Could not fork\n");
} else if (pid == 0) {
// Child process
// Allow children to exist after parent destruction
setsid();
// Run the command
execl("/bin/sh", "/bin/sh", "-c", full_cmd, NULL);
fprintf(stderr, "Failed to execlp %s\n", full_cmd);
exit(1);
}
// Parent process
g_tree_insert(execp->backend->cmd_pids, GINT_TO_POINTER(pid), GINT_TO_POINTER(1));
g_free(full_cmd);
} else {
if (execp->backend->child_pipe > 0) {
// Command currently running, nothing to do
} else {
if (execp->backend->timer)
stop_timeout(execp->backend->timer);
// Run command right away
execp->backend->timer = add_timeout(10, 0, execp_timer_callback, execp, &execp->backend->timer);
}
execp_force_update(execp);
}
}
void execp_cmd_completed(Execp *execp, pid_t pid)
{
g_tree_remove(execp->backend->cmd_pids, GINT_TO_POINTER(pid));
execp_force_update(execp);
}
void execp_timer_callback(void *arg)
{
Execp *execp = arg;
@@ -539,8 +602,8 @@ gboolean read_execp(void *obj)
execp->backend->buf_output = realloc(execp->backend->buf_output, execp->backend->buf_capacity);
}
ssize_t count = read(execp->backend->child_pipe,
execp->backend->buf_output + execp->backend->buf_length,
execp->backend->buf_capacity - execp->backend->buf_length - 1);
execp->backend->buf_output + execp->backend->buf_length,
execp->backend->buf_capacity - execp->backend->buf_length - 1);
if (count > 0) {
// Successful read
execp->backend->buf_length += count;
@@ -570,7 +633,7 @@ gboolean read_execp(void *obj)
execp->backend->child_pipe = -1;
if (execp->backend->interval)
execp->backend->timer =
add_timeout(execp->backend->interval * 1000, 0, execp_timer_callback, execp, &execp->backend->timer);
add_timeout(execp->backend->interval * 1000, 0, execp_timer_callback, execp, &execp->backend->timer);
}
if (!execp->backend->continuous && command_finished) {
@@ -596,7 +659,7 @@ gboolean read_execp(void *obj)
execp->backend->buf_output[execp->backend->buf_length] = '\0';
execp->backend->last_update_finish_time = time(NULL);
execp->backend->last_update_duration =
execp->backend->last_update_finish_time - execp->backend->last_update_start_time;
execp->backend->last_update_finish_time - execp->backend->last_update_start_time;
return TRUE;
} else if (execp->backend->continuous > 0) {
// Count lines in buffer
@@ -651,7 +714,7 @@ gboolean read_execp(void *obj)
execp->backend->last_update_finish_time = time(NULL);
execp->backend->last_update_duration =
execp->backend->last_update_finish_time - execp->backend->last_update_start_time;
execp->backend->last_update_finish_time - execp->backend->last_update_start_time;
return TRUE;
}
}
@@ -700,16 +763,16 @@ char *execp_get_tooltip(void *obj)
// We updated at least once
if (execp->backend->interval > 0) {
sprintf(execp->backend->tooltip_text,
"Last update finished %s ago (took %s). Next update starting in %s.",
time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1),
time_to_string((int)execp->backend->last_update_duration, tmp_buf2),
time_to_string((int)(execp->backend->interval - (now - execp->backend->last_update_finish_time)),
tmp_buf3));
"Last update finished %s ago (took %s). Next update starting in %s.",
time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1),
time_to_string((int)execp->backend->last_update_duration, tmp_buf2),
time_to_string((int)(execp->backend->interval - (now - execp->backend->last_update_finish_time)),
tmp_buf3));
} else {
sprintf(execp->backend->tooltip_text,
"Last update finished %s ago (took %s).",
time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1),
time_to_string((int)execp->backend->last_update_duration, tmp_buf2));
"Last update finished %s ago (took %s).",
time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1),
time_to_string((int)execp->backend->last_update_duration, tmp_buf2));
}
} else {
// we never requested an update
@@ -720,14 +783,14 @@ char *execp_get_tooltip(void *obj)
if (execp->backend->last_update_finish_time) {
// we finished updating at least once
sprintf(execp->backend->tooltip_text,
"Last update finished %s ago. Update in progress (started %s ago).",
time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1),
time_to_string((int)(now - execp->backend->last_update_start_time), tmp_buf3));
"Last update finished %s ago. Update in progress (started %s ago).",
time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1),
time_to_string((int)(now - execp->backend->last_update_start_time), tmp_buf3));
} else {
// we never finished an update
sprintf(execp->backend->tooltip_text,
"First update in progress (started %s seconds ago).",
time_to_string((int)(now - execp->backend->last_update_start_time), tmp_buf1));
"First update in progress (started %s seconds ago).",
time_to_string((int)(now - execp->backend->last_update_start_time), tmp_buf1));
}
}
return strdup(execp->backend->tooltip_text);

View File

@@ -70,6 +70,7 @@ typedef struct ExecpBackend {
// List of Execp which are frontends for this backend, one for each panel
GList *instances;
GTree *cmd_pids;
} ExecpBackend;
typedef struct ExecpFrontend {
@@ -130,6 +131,8 @@ gboolean resize_execp(void *obj);
// Called on mouse click event.
void execp_action(void *obj, int button, int x, int y);
void execp_cmd_completed(Execp *obj, pid_t pid);
// Called to check if new output from the command can be read.
// No command might be running.
// Returns 1 if the output has been updated and a redraw is needed.

View File

@@ -57,15 +57,15 @@ int freespace_get_max_size(Panel *p)
continue;
if (panel_horizontal)
size += a->width + (a->bg->border.width * 2) + p->area.paddingx;
size += a->width + p->area.paddingx;
else
size += a->height + (a->bg->border.width * 2) + p->area.paddingy;
size += a->height + p->area.paddingy;
}
if (panel_horizontal)
size = p->area.width - size - (p->area.bg->border.width * 2) - p->area.paddingxlr;
size = p->area.width - size - left_right_border_width(&p->area) - p->area.paddingxlr;
else
size = p->area.height - size - (p->area.bg->border.width * 2) - p->area.paddingxlr;
size = p->area.height - size - top_bottom_border_width(&p->area) - p->area.paddingxlr;
return size;
}

View File

@@ -305,6 +305,7 @@ void free_themes(IconThemeWrapper *wrapper)
{
if (!wrapper)
return;
free(wrapper->icon_theme_name);
for (GSList *l = wrapper->themes; l; l = l->next) {
IconTheme *theme = (IconTheme *)l->data;
free_icon_theme(theme);

View File

@@ -56,6 +56,11 @@ Background *launcher_icon_bg;
Imlib_Image scale_icon(Imlib_Image original, int icon_size);
void free_icon(Imlib_Image icon);
void launcher_icon_dump_geometry(void *obj, int indent);
void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon);
void launcher_reload_icon_image(Launcher *launcher, LauncherIcon *launcherIcon);
void launcher_reload_hidden_icons(Launcher *launcher);
void launcher_icon_on_change_layout(void *obj);
void default_launcher()
{
@@ -142,6 +147,7 @@ void cleanup_launcher_theme(Launcher *launcher)
free(launcherIcon->icon_path);
free(launcherIcon->cmd);
g_free(launcherIcon->icon_tooltip);
free(launcherIcon->config_path);
}
free(launcherIcon);
}
@@ -163,7 +169,8 @@ gboolean resize_launcher(void *obj)
} else {
icon_size = launcher->area.width;
}
icon_size = icon_size - (2 * launcher->area.bg->border.width) - (2 * launcher->area.paddingy);
icon_size = icon_size - MAX(left_right_border_width(&launcher->area), top_bottom_border_width(&launcher->area)) -
(2 * launcher->area.paddingy);
if (launcher_max_icon_size > 0 && icon_size > launcher_max_icon_size)
icon_size = launcher_max_icon_size;
@@ -174,109 +181,63 @@ gboolean resize_launcher(void *obj)
launcherIcon->icon_size = icon_size;
launcherIcon->area.width = launcherIcon->icon_size;
launcherIcon->area.height = launcherIcon->icon_size;
// Get the path for an icon file with the new size
char *new_icon_path =
get_icon_path(launcher->icon_theme_wrapper, launcherIcon->icon_name, launcherIcon->icon_size);
if (!new_icon_path) {
// Draw a blank icon
free_icon(launcherIcon->image);
free_icon(launcherIcon->image_hover);
free_icon(launcherIcon->image_pressed);
launcherIcon->image = NULL;
continue;
}
// Free the old files
free_icon(launcherIcon->image);
free_icon(launcherIcon->image_hover);
free_icon(launcherIcon->image_pressed);
// Load the new file
launcherIcon->image = load_image(new_icon_path, 1);
// On loading error, fallback to default
if (!launcherIcon->image) {
free(new_icon_path);
new_icon_path = get_icon_path(launcher->icon_theme_wrapper, DEFAULT_ICON, launcherIcon->icon_size);
if (new_icon_path)
launcherIcon->image = imlib_load_image_immediately(new_icon_path);
}
if (!launcherIcon->image) {
// Loading default icon failed, draw a blank icon
free(new_icon_path);
} else {
// Loaded icon successfully, rescale it
Imlib_Image original = launcherIcon->image;
launcherIcon->image = scale_icon(launcherIcon->image, launcherIcon->icon_size);
free_icon(original);
free(launcherIcon->icon_path);
launcherIcon->icon_path = new_icon_path;
fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
}
}
if (panel_config.mouse_effects) {
launcherIcon->image_hover = adjust_icon(launcherIcon->image,
panel_config.mouse_over_alpha,
panel_config.mouse_over_saturation,
panel_config.mouse_over_brightness);
launcherIcon->image_pressed = adjust_icon(launcherIcon->image,
panel_config.mouse_pressed_alpha,
panel_config.mouse_pressed_saturation,
panel_config.mouse_pressed_brightness);
launcher_reload_icon_image(launcher, launcherIcon);
}
}
save_icon_cache(launcher->icon_theme_wrapper);
int count = g_slist_length(launcher->list_icons);
int count = 0;
for (GSList *l = launcher->list_icons; l; l = l->next) {
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
if (launcherIcon->area.on_screen)
count++;
}
if (panel_horizontal) {
if (!count) {
launcher->area.width = 0;
} else {
int height = launcher->area.height - 2 * launcher->area.bg->border.width - 2 * launcher->area.paddingy;
int height = launcher->area.height - top_bottom_border_width(&launcher->area) - 2 * launcher->area.paddingy;
// here icons_per_column always higher than 0
icons_per_column = (height + launcher->area.paddingx) / (icon_size + launcher->area.paddingx);
margin = height - (icons_per_column - 1) * (icon_size + launcher->area.paddingx) - icon_size;
icons_per_row = count / icons_per_column + (count % icons_per_column != 0);
launcher->area.width = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) +
(icon_size * icons_per_row) + ((icons_per_row - 1) * launcher->area.paddingx);
launcher->area.width = left_right_border_width(&launcher->area) + 2 * launcher->area.paddingxlr +
(icon_size * icons_per_row) + ((icons_per_row - 1) * launcher->area.paddingx);
}
} else {
if (!count) {
launcher->area.height = 0;
} else {
int width = launcher->area.width - 2 * launcher->area.bg->border.width - 2 * launcher->area.paddingy;
int width = launcher->area.width - top_bottom_border_width(&launcher->area) - 2 * launcher->area.paddingy;
// here icons_per_row always higher than 0
icons_per_row = (width + launcher->area.paddingx) / (icon_size + launcher->area.paddingx);
margin = width - (icons_per_row - 1) * (icon_size + launcher->area.paddingx) - icon_size;
icons_per_column = count / icons_per_row + (count % icons_per_row != 0);
launcher->area.height = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) +
(icon_size * icons_per_column) + ((icons_per_column - 1) * launcher->area.paddingx);
launcher->area.height = top_bottom_border_width(&launcher->area) + 2 * launcher->area.paddingxlr +
(icon_size * icons_per_column) + ((icons_per_column - 1) * launcher->area.paddingx);
}
}
int posx, posy;
int start = launcher->area.bg->border.width + launcher->area.paddingy + margin / 2;
int start;
if (panel_horizontal) {
posy = start;
posx = launcher->area.bg->border.width + launcher->area.paddingxlr;
posy = start = top_border_width(&launcher->area) + launcher->area.paddingy + margin / 2;
posx = left_border_width(&launcher->area) + launcher->area.paddingxlr;
} else {
posx = start;
posy = launcher->area.bg->border.width + launcher->area.paddingxlr;
posx = start = left_border_width(&launcher->area) + launcher->area.paddingy + margin / 2;
posy = top_border_width(&launcher->area) + launcher->area.paddingxlr;
}
int i;
GSList *l;
for (i = 1, l = launcher->list_icons; l; i++, l = l->next) {
int i = 0;
for (GSList *l = launcher->list_icons; l; l = l->next) {
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
if (!launcherIcon->area.on_screen)
continue;
i++;
launcherIcon->y = posy;
launcherIcon->x = posx;
launcherIcon->area.posy = ((Area *)launcherIcon->area.parent)->posy + launcherIcon->y;
launcherIcon->area.posx = ((Area *)launcherIcon->area.parent)->posx + launcherIcon->x;
launcherIcon->area.width = launcherIcon->icon_size;
launcherIcon->area.height = launcherIcon->icon_size;
launcher_icon_on_change_layout(launcherIcon);
// printf("launcher %d : %d,%d\n", i, posx, posy);
if (panel_horizontal) {
if (i % icons_per_column) {
@@ -345,27 +306,38 @@ void draw_launcher_icon(void *obj, cairo_t *c)
render_image(launcherIcon->area.pix, 0, 0);
}
void launcher_icon_dump_geometry(void *obj, int indent)
{
LauncherIcon *launcherIcon = (LauncherIcon *)obj;
fprintf(stderr,
"%*sIcon: w = h = %d, name = %s\n",
indent,
"",
launcherIcon->icon_size,
launcherIcon->icon_name);
}
Imlib_Image scale_icon(Imlib_Image original, int icon_size)
{
Imlib_Image icon_scaled;
if (original) {
imlib_context_set_image(original);
icon_scaled = imlib_create_cropped_scaled_image(0,
0,
imlib_image_get_width(),
imlib_image_get_height(),
icon_size,
icon_size);
0,
imlib_image_get_width(),
imlib_image_get_height(),
icon_size,
icon_size);
imlib_context_set_image(icon_scaled);
imlib_image_set_has_alpha(1);
DATA32 *data = imlib_image_get_data();
adjust_asb(data,
icon_size,
icon_size,
launcher_alpha / 100.0,
launcher_saturation / 100.0,
launcher_brightness / 100.0);
icon_size,
icon_size,
launcher_alpha / 100.0,
launcher_saturation / 100.0,
launcher_brightness / 100.0);
imlib_image_put_back_data(data);
imlib_context_set_image(icon_scaled);
@@ -388,6 +360,8 @@ void free_icon(Imlib_Image icon)
void launcher_action(LauncherIcon *icon, XEvent *evt)
{
launcher_reload_icon((Launcher *)icon->area.parent, icon);
launcher_reload_hidden_icons((Launcher *)icon->area.parent);
char *cmd = calloc(strlen(icon->cmd) + 10, 1);
sprintf(cmd, "(%s&)", icon->cmd);
#if HAVE_SN
@@ -448,52 +422,109 @@ void launcher_load_icons(Launcher *launcher)
// Load apps (.desktop style launcher items)
GSList *app = launcher->list_apps;
while (app != NULL) {
DesktopEntry entry;
read_desktop_file(app->data, &entry);
if (entry.exec) {
LauncherIcon *launcherIcon = calloc(1, sizeof(LauncherIcon));
launcherIcon->area.panel = launcher->area.panel;
snprintf(launcherIcon->area.name, sizeof(launcherIcon->area.name), "LauncherIcon %s", entry.name ? entry.name : "null");
launcherIcon->area._draw_foreground = draw_launcher_icon;
launcherIcon->area.size_mode = LAYOUT_FIXED;
launcherIcon->area._resize = NULL;
launcherIcon->area.resize_needed = 0;
schedule_redraw(&launcherIcon->area);
launcherIcon->area.has_mouse_over_effect = panel_config.mouse_effects;
launcherIcon->area.has_mouse_press_effect = launcherIcon->area.has_mouse_over_effect;
launcherIcon->area.bg = launcher_icon_bg;
launcherIcon->area.on_screen = TRUE;
launcherIcon->area._on_change_layout = launcher_icon_on_change_layout;
if (launcher_tooltip_enabled) {
launcherIcon->area._get_tooltip_text = launcher_icon_get_tooltip_text;
} else {
launcherIcon->area._get_tooltip_text = NULL;
}
launcherIcon->is_app_desktop = 1;
launcherIcon->cmd = strdup(entry.exec);
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
launcherIcon->icon_size = 1;
if (entry.name) {
if (entry.generic_name) {
launcherIcon->icon_tooltip = g_strdup_printf("%s (%s)", entry.name, entry.generic_name);
} else {
launcherIcon->icon_tooltip = g_strdup_printf("%s", entry.name);
}
} else {
if (entry.generic_name) {
launcherIcon->icon_tooltip = g_strdup_printf("%s", entry.generic_name);
} else if (entry.exec) {
launcherIcon->icon_tooltip = g_strdup_printf("%s", entry.exec);
}
}
launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon);
add_area(&launcherIcon->area, (Area *)launcher);
LauncherIcon *launcherIcon = calloc(1, sizeof(LauncherIcon));
launcherIcon->area.panel = launcher->area.panel;
launcherIcon->area._draw_foreground = draw_launcher_icon;
launcherIcon->area.size_mode = LAYOUT_FIXED;
launcherIcon->area._resize = NULL;
launcherIcon->area.resize_needed = 0;
launcherIcon->area.has_mouse_over_effect = panel_config.mouse_effects;
launcherIcon->area.has_mouse_press_effect = launcherIcon->area.has_mouse_over_effect;
launcherIcon->area.bg = launcher_icon_bg;
launcherIcon->area.on_screen = TRUE;
launcherIcon->area._on_change_layout = launcher_icon_on_change_layout;
launcherIcon->area._dump_geometry = launcher_icon_dump_geometry;
if (launcher_tooltip_enabled) {
launcherIcon->area._get_tooltip_text = launcher_icon_get_tooltip_text;
} else {
launcherIcon->area._get_tooltip_text = NULL;
}
free_desktop_entry(&entry);
launcherIcon->config_path = strdup(app->data);
add_area(&launcherIcon->area, (Area *)launcher);
launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon);
launcher_reload_icon(launcher, launcherIcon);
app = g_slist_next(app);
}
}
void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon)
{
DesktopEntry entry;
if (read_desktop_file(launcherIcon->config_path, &entry) && entry.exec) {
schedule_redraw(&launcherIcon->area);
if (launcherIcon->cmd)
free(launcherIcon->cmd);
launcherIcon->cmd = strdup(entry.exec);
if (launcherIcon->icon_name)
free(launcherIcon->icon_name);
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
if (entry.name) {
if (entry.generic_name) {
launcherIcon->icon_tooltip = g_strdup_printf("%s (%s)", entry.name, entry.generic_name);
} else {
launcherIcon->icon_tooltip = g_strdup_printf("%s", entry.name);
}
} else {
if (entry.generic_name) {
launcherIcon->icon_tooltip = g_strdup_printf("%s", entry.generic_name);
} else if (entry.exec) {
launcherIcon->icon_tooltip = g_strdup_printf("%s", entry.exec);
}
}
launcher_reload_icon_image(launcher, launcherIcon);
if (!launcherIcon->area.on_screen)
show(&launcherIcon->area);
} else {
hide(&launcherIcon->area);
}
free_desktop_entry(&entry);
}
void launcher_reload_hidden_icons(Launcher *launcher)
{
for (GSList *l = launcher->list_icons; l; l = l->next) {
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
if (!launcherIcon->area.on_screen)
launcher_reload_icon(launcher, launcherIcon);
}
}
void launcher_reload_icon_image(Launcher *launcher, LauncherIcon *launcherIcon)
{
free_icon(launcherIcon->image);
free_icon(launcherIcon->image_hover);
free_icon(launcherIcon->image_pressed);
launcherIcon->image = NULL;
char *new_icon_path = get_icon_path(launcher->icon_theme_wrapper, launcherIcon->icon_name, launcherIcon->icon_size);
if (new_icon_path)
launcherIcon->image = load_image(new_icon_path, 1);
// On loading error, fallback to default
if (!launcherIcon->image) {
free(new_icon_path);
new_icon_path = get_icon_path(launcher->icon_theme_wrapper, DEFAULT_ICON, launcherIcon->icon_size);
if (new_icon_path)
launcherIcon->image = imlib_load_image_immediately(new_icon_path);
}
Imlib_Image original = launcherIcon->image;
launcherIcon->image = scale_icon(launcherIcon->image, launcherIcon->icon_size);
free_icon(original);
free(launcherIcon->icon_path);
launcherIcon->icon_path = new_icon_path;
// fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
if (panel_config.mouse_effects) {
launcherIcon->image_hover = adjust_icon(launcherIcon->image,
panel_config.mouse_over_alpha,
panel_config.mouse_over_saturation,
panel_config.mouse_over_brightness);
launcherIcon->image_pressed = adjust_icon(launcherIcon->image,
panel_config.mouse_pressed_alpha,
panel_config.mouse_pressed_saturation,
panel_config.mouse_pressed_brightness);
}
}
// Populates the icon_theme_wrapper list
void launcher_load_themes(Launcher *launcher)
{

View File

@@ -23,6 +23,7 @@ typedef struct Launcher {
typedef struct LauncherIcon {
// always start with area
Area area;
char *config_path;
Imlib_Image image;
Imlib_Image image_hover;
Imlib_Image image_pressed;
@@ -31,7 +32,6 @@ typedef struct LauncherIcon {
char *icon_path;
char *icon_tooltip;
int icon_size;
int is_app_desktop;
int x, y;
} LauncherIcon;

View File

@@ -55,6 +55,7 @@ gboolean panel_horizontal;
gboolean panel_refresh;
gboolean task_dragged;
char *panel_window_name = NULL;
gboolean debug_geometry;
gboolean panel_autohide;
int panel_autohide_show_timeout;
@@ -184,10 +185,10 @@ void init_panel()
}
fprintf(stderr,
"tint2 : nb monitor %d, nb monitor used %d, nb desktop %d\n",
server.num_monitors,
num_panels,
server.num_desktops);
"tint2 : nb monitor %d, nb monitor used %d, nb desktop %d\n",
server.num_monitors,
num_panels,
server.num_desktops);
for (int i = 0; i < num_panels; i++) {
Panel *p = &panels[i];
@@ -231,28 +232,28 @@ void init_panel()
XSetWindowAttributes att = {.colormap = server.colormap, .background_pixel = 0, .border_pixel = 0};
unsigned long mask = CWEventMask | CWColormap | CWBackPixel | CWBorderPixel;
p->main_win = XCreateWindow(server.display,
server.root_win,
p->posx,
p->posy,
p->area.width,
p->area.height,
0,
server.depth,
InputOutput,
server.visual,
mask,
&att);
server.root_win,
p->posx,
p->posy,
p->area.width,
p->area.height,
0,
server.depth,
InputOutput,
server.visual,
mask,
&att);
long event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PropertyChangeMask;
if (p->mouse_effects || p->g_task.tooltip_enabled || p->clock.area._get_tooltip_text ||
(launcher_enabled && launcher_tooltip_enabled))
(launcher_enabled && launcher_tooltip_enabled))
event_mask |= PointerMotionMask | LeaveWindowMask;
if (panel_autohide)
event_mask |= LeaveWindowMask | EnterWindowMask;
XChangeWindowAttributes(server.display,
p->main_win,
CWEventMask,
&(XSetWindowAttributes){.event_mask = event_mask});
p->main_win,
CWEventMask,
&(XSetWindowAttributes){.event_mask = event_mask});
if (!server.gc) {
XGCValues gcv;
@@ -268,12 +269,11 @@ void init_panel()
if (panel_autohide)
autohide_trigger_hide(p);
update_taskbar_visibility(p);
}
taskbar_refresh_tasklist();
reset_active_task();
update_all_taskbars_visibility();
}
void init_panel_size_and_position(Panel *panel)
@@ -337,11 +337,11 @@ void init_panel_size_and_position(Panel *panel)
} else {
if (panel_position & RIGHT) {
panel->posx = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width -
panel->area.width - panel->marginx;
panel->area.width - panel->marginx;
} else {
if (panel_horizontal)
panel->posx = server.monitors[panel->monitor].x +
((server.monitors[panel->monitor].width - panel->area.width) / 2);
((server.monitors[panel->monitor].width - panel->area.width) / 2);
else
panel->posx = server.monitors[panel->monitor].x + panel->marginx;
}
@@ -351,10 +351,10 @@ void init_panel_size_and_position(Panel *panel)
} else {
if (panel_position & BOTTOM) {
panel->posy = server.monitors[panel->monitor].y + server.monitors[panel->monitor].height -
panel->area.height - panel->marginy;
panel->area.height - panel->marginy;
} else {
panel->posy =
server.monitors[panel->monitor].y + ((server.monitors[panel->monitor].height - panel->area.height) / 2);
server.monitors[panel->monitor].y + ((server.monitors[panel->monitor].height - panel->area.height) / 2);
}
}
@@ -394,7 +394,11 @@ gboolean resize_panel(void *obj)
int total_size = 0;
int total_name_size = 0;
int total_items = 0;
int visible_taskbars = 0;
for (int i = 0; i < panel->num_desktops; i++) {
if (!panel->taskbar[i].area.on_screen)
continue;
visible_taskbars++;
if (panel_horizontal) {
total_size += panel->taskbar[i].area.width;
} else {
@@ -426,16 +430,20 @@ gboolean resize_panel(void *obj)
if (total_items) {
int actual_name_size;
if (total_name_size <= total_size) {
actual_name_size = total_name_size / panel->num_desktops;
actual_name_size = total_name_size / visible_taskbars;
} else {
actual_name_size = total_size / panel->num_desktops;
actual_name_size = total_size / visible_taskbars;
}
total_size -= total_name_size;
for (int i = 0; i < panel->num_desktops; i++) {
Taskbar *taskbar = &panel->taskbar[i];
if (!taskbar->area.on_screen)
continue;
int requested_size = (2 * taskbar->area.bg->border.width) + (2 * taskbar->area.paddingxlr);
int requested_size = (panel_horizontal ? left_right_border_width(&taskbar->area)
: top_bottom_border_width(&taskbar->area)) +
2 * taskbar->area.paddingxlr;
int items = 0;
GList *l = taskbar->area.children;
if (taskbarname_enabled)
@@ -519,21 +527,21 @@ void update_strut(Panel *p)
}
// Old specification : fluxbox need _NET_WM_STRUT.
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_STRUT,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)&struts,
4);
p->main_win,
server.atom._NET_WM_STRUT,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)&struts,
4);
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_STRUT_PARTIAL,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)&struts,
12);
p->main_win,
server.atom._NET_WM_STRUT_PARTIAL,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)&struts,
12);
}
void set_panel_items_order(Panel *p)
@@ -579,13 +587,13 @@ void place_panel_all_desktops(Panel *p)
{
long val = ALL_DESKTOPS;
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_DESKTOP,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)&val,
1);
p->main_win,
server.atom._NET_WM_DESKTOP,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)&val,
1);
Atom state[4];
state[0] = server.atom._NET_WM_STATE_SKIP_PAGER;
@@ -594,13 +602,13 @@ void place_panel_all_desktops(Panel *p)
state[3] = panel_layer == BOTTOM_LAYER ? server.atom._NET_WM_STATE_BELOW : server.atom._NET_WM_STATE_ABOVE;
int num_atoms = panel_layer == NORMAL_LAYER ? 3 : 4;
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_STATE,
XA_ATOM,
32,
PropModeReplace,
(unsigned char *)state,
num_atoms);
p->main_win,
server.atom._NET_WM_STATE,
XA_ATOM,
32,
PropModeReplace,
(unsigned char *)state,
num_atoms);
}
void replace_panel_all_desktops(Panel *p)
@@ -627,34 +635,34 @@ void set_panel_properties(Panel *p)
gchar *name = g_locale_to_utf8(panel_window_name, -1, NULL, &len, NULL);
if (name != NULL) {
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_NAME,
server.atom.UTF8_STRING,
8,
PropModeReplace,
(unsigned char *)name,
(int)len);
p->main_win,
server.atom._NET_WM_NAME,
server.atom.UTF8_STRING,
8,
PropModeReplace,
(unsigned char *)name,
(int)len);
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_ICON_NAME,
server.atom.UTF8_STRING,
8,
PropModeReplace,
(unsigned char *)name,
(int)len);
p->main_win,
server.atom._NET_WM_ICON_NAME,
server.atom.UTF8_STRING,
8,
PropModeReplace,
(unsigned char *)name,
(int)len);
g_free(name);
}
// Dock
long val = server.atom._NET_WM_WINDOW_TYPE_DOCK;
XChangeProperty(server.display,
p->main_win,
server.atom._NET_WM_WINDOW_TYPE,
XA_ATOM,
32,
PropModeReplace,
(unsigned char *)&val,
1);
p->main_win,
server.atom._NET_WM_WINDOW_TYPE,
XA_ATOM,
32,
PropModeReplace,
(unsigned char *)&val,
1);
place_panel_all_desktops(p);
@@ -675,24 +683,24 @@ void set_panel_properties(Panel *p)
// Undecorated
long prop[5] = {2, 0, 0, 0, 0};
XChangeProperty(server.display,
p->main_win,
server.atom._MOTIF_WM_HINTS,
server.atom._MOTIF_WM_HINTS,
32,
PropModeReplace,
(unsigned char *)prop,
5);
p->main_win,
server.atom._MOTIF_WM_HINTS,
server.atom._MOTIF_WM_HINTS,
32,
PropModeReplace,
(unsigned char *)prop,
5);
// XdndAware - Register for Xdnd events
Atom version = 4;
XChangeProperty(server.display,
p->main_win,
server.atom.XdndAware,
XA_ATOM,
32,
PropModeReplace,
(unsigned char *)&version,
1);
p->main_win,
server.atom.XdndAware,
XA_ATOM,
32,
PropModeReplace,
(unsigned char *)&version,
1);
update_strut(p);
@@ -858,21 +866,21 @@ void autohide_show(void *p)
XResizeWindow(server.display, panel->main_win, panel->area.width, panel->area.height);
else
XMoveResizeWindow(server.display,
panel->main_win,
panel->posx,
panel->posy,
panel->area.width,
panel->area.height);
panel->main_win,
panel->posx,
panel->posy,
panel->area.width,
panel->area.height);
} else {
if (panel_position & LEFT)
XResizeWindow(server.display, panel->main_win, panel->area.width, panel->area.height);
else
XMoveResizeWindow(server.display,
panel->main_win,
panel->posx,
panel->posy,
panel->area.width,
panel->area.height);
panel->main_win,
panel->posx,
panel->posy,
panel->area.width,
panel->area.height);
}
if (panel_strut_policy == STRUT_FOLLOW_SIZE)
update_strut(panel);
@@ -896,21 +904,21 @@ void autohide_hide(void *p)
XResizeWindow(server.display, panel->main_win, panel->hidden_width, panel->hidden_height);
else
XMoveResizeWindow(server.display,
panel->main_win,
panel->posx,
panel->posy + diff,
panel->hidden_width,
panel->hidden_height);
panel->main_win,
panel->posx,
panel->posy + diff,
panel->hidden_width,
panel->hidden_height);
} else {
if (panel_position & LEFT)
XResizeWindow(server.display, panel->main_win, panel->hidden_width, panel->hidden_height);
else
XMoveResizeWindow(server.display,
panel->main_win,
panel->posx + diff,
panel->posy,
panel->hidden_width,
panel->hidden_height);
panel->main_win,
panel->posx + diff,
panel->posy,
panel->hidden_width,
panel->hidden_height);
}
panel_refresh = TRUE;
}
@@ -940,6 +948,8 @@ void autohide_trigger_hide(Panel *p)
void render_panel(Panel *panel)
{
relayout(&panel->area);
if (debug_geometry)
area_dump_geometry(&panel->area, 0);
draw_tree(&panel->area);
}

View File

@@ -86,6 +86,7 @@ extern Imlib_Image default_icon;
#define DEFAULT_FONT "sans 10"
extern char *default_font;
extern XSettingsClient *xsettings_client;
extern gboolean debug_geometry;
typedef struct Panel {
Area area;

View File

@@ -140,6 +140,11 @@ void cleanup_server()
XFreeGC(server.display, server.gc);
server.gc = NULL;
server.disable_transparency = FALSE;
#ifdef HAVE_SN
if (server.pids)
g_tree_destroy(server.pids);
server.pids = NULL;
#endif
}
void send_event32(Window win, Atom at, long data1, long data2, long data3)

View File

@@ -65,6 +65,8 @@ const int slow_resize_period = 5000;
const int min_bad_resize_events = 3;
const int max_bad_resize_events = 10;
void systray_dump_geometry(void *obj, int indent);
void default_systray()
{
systray_enabled = 0;
@@ -114,6 +116,7 @@ void init_systray_panel(void *p)
Panel *panel = (Panel *)p;
systray.area.parent = panel;
systray.area.panel = panel;
systray.area._dump_geometry = systray_dump_geometry;
snprintf(systray.area.name, sizeof(systray.area.name), "Systray");
if (!systray.area.bg)
systray.area.bg = &g_array_index(backgrounds, Background, 0);
@@ -131,7 +134,8 @@ gboolean resize_systray(void *obj)
systray.icon_size = systray.area.height;
else
systray.icon_size = systray.area.width;
systray.icon_size -= (2 * systray.area.bg->border.width) + (2 * systray.area.paddingy);
systray.icon_size -= MAX(left_right_border_width(&systray.area), top_bottom_border_width(&systray.area)) +
2 * systray.area.paddingy;
if (systray_max_icon_size > 0)
systray.icon_size = MIN(systray.icon_size, systray_max_icon_size);
@@ -155,25 +159,25 @@ gboolean resize_systray(void *obj)
fprintf(stderr, BLUE "%s:%d number of icons = %d" RESET "\n", __FUNCTION__, __LINE__, count);
if (panel_horizontal) {
int height = systray.area.height - 2 * systray.area.bg->border.width - 2 * systray.area.paddingy;
int height = systray.area.height - top_bottom_border_width(&systray.area) - 2 * systray.area.paddingy;
// here icons_per_column always higher than 0
systray.icons_per_column = (height + systray.area.paddingx) / (systray.icon_size + systray.area.paddingx);
systray.margin =
height - (systray.icons_per_column - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
height - (systray.icons_per_column - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
systray.icons_per_row = count / systray.icons_per_column + (count % systray.icons_per_column != 0);
systray.area.width = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) +
(systray.icon_size * systray.icons_per_row) +
((systray.icons_per_row - 1) * systray.area.paddingx);
systray.area.width = left_right_border_width(&systray.area) + 2 * systray.area.paddingxlr +
(systray.icon_size * systray.icons_per_row) +
((systray.icons_per_row - 1) * systray.area.paddingx);
} else {
int width = systray.area.width - 2 * systray.area.bg->border.width - 2 * systray.area.paddingy;
int width = systray.area.width - left_right_border_width(&systray.area) - 2 * systray.area.paddingy;
// here icons_per_row always higher than 0
systray.icons_per_row = (width + systray.area.paddingx) / (systray.icon_size + systray.area.paddingx);
systray.margin =
width - (systray.icons_per_row - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
width - (systray.icons_per_row - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
systray.icons_per_column = count / systray.icons_per_row + (count % systray.icons_per_row != 0);
systray.area.height = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) +
(systray.icon_size * systray.icons_per_column) +
((systray.icons_per_column - 1) * systray.area.paddingx);
systray.area.height = top_bottom_border_width(&systray.area) + (2 * systray.area.paddingxlr) +
(systray.icon_size * systray.icons_per_column) +
((systray.icons_per_column - 1) * systray.area.paddingx);
}
if (net_sel_win == None) {
@@ -191,7 +195,7 @@ void draw_systray(void *obj, cairo_t *c)
if (render_background)
XFreePixmap(server.display, render_background);
render_background =
XCreatePixmap(server.display, server.root_win, systray.area.width, systray.area.height, server.depth);
XCreatePixmap(server.display, server.root_win, systray.area.width, systray.area.height, server.depth);
XCopyArea(server.display,
systray.area.pix,
render_background,
@@ -207,6 +211,29 @@ void draw_systray(void *obj, cairo_t *c)
refresh_systray = TRUE;
}
void systray_dump_geometry(void *obj, int indent)
{
Systray *tray = (Systray *)obj;
fprintf(stderr,
"%*sIcons:\n",
indent,
"");
indent += 2;
for (GSList *l = tray->list_icons; l; l = l->next) {
TrayWindow *traywin = (TrayWindow *)l->data;
fprintf(stderr,
"%*sIcon: x = %d, y = %d, w = %d, h = %d, name = %s\n",
indent,
"",
traywin->x,
traywin->y,
traywin->width,
traywin->height,
traywin->name);
}
}
void on_change_systray(void *obj)
{
if (systray_profile)
@@ -218,14 +245,15 @@ void on_change_systray(void *obj)
// Based on this we calculate the positions of the tray icons.
Panel *panel = systray.area.panel;
int posx, posy;
int start = panel->area.bg->border.width + panel->area.paddingy + systray.area.bg->border.width +
systray.area.paddingy + systray.margin / 2;
int start;
if (panel_horizontal) {
posy = start;
posx = systray.area.posx + systray.area.bg->border.width + systray.area.paddingxlr;
posy = start = top_border_width(&panel->area) + panel->area.paddingy + top_border_width(&systray.area) +
systray.area.paddingy + systray.margin / 2;
posx = systray.area.posx + left_border_width(&systray.area) + systray.area.paddingxlr;
} else {
posx = start;
posy = systray.area.posy + systray.area.bg->border.width + systray.area.paddingxlr;
posx = start = left_border_width(&panel->area) + panel->area.paddingy + left_border_width(&systray.area) +
systray.area.paddingy + systray.margin / 2;
posy = systray.area.posy + top_border_width(&systray.area) + systray.area.paddingxlr;
}
TrayWindow *traywin;
@@ -275,7 +303,7 @@ void on_change_systray(void *obj)
if (width != traywin->width || height != traywin->height || xpos != traywin->x || ypos != traywin->y) {
if (systray_profile)
fprintf(stderr,
"XMoveResizeWindow(server.display, traywin->parent = %ld, traywin->x = %d, traywin->y = %d, "
"XMoveResizeWindow(server.display, traywin->parent = %ld, traywin->x = %d, traywin->y = %d, "
"traywin->width = %d, traywin->height = %d)\n",
traywin->parent,
traywin->x,
@@ -386,7 +414,7 @@ void start_net()
vid = XVisualIDFromVisual(server.visual);
XChangeProperty(server.display,
net_sel_win,
XInternAtom(server.display, "_NET_SYSTEM_TRAY_VISUAL", False),
XInternAtom(server.display, "_NET_SYSTEM_TRAY_VISUAL", False),
XA_VISUALID,
32,
PropModeReplace,
@@ -535,7 +563,7 @@ gboolean add_icon(Window win)
XSelectInput(server.display, win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
char *name = get_window_name(win);
char *name = get_window_name(win);
if (systray_profile)
fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, win, name);
Panel *panel = systray.area.panel;
@@ -589,7 +617,7 @@ gboolean add_icon(Window win)
XSetWindowAttributes set_attr;
Visual *visual = server.visual;
fprintf(stderr,
GREEN "add_icon: %lu (%s), pid %d, visual %p, colormap %lu, depth %d, width %d, height %d" RESET "\n",
GREEN "add_icon: %lu (%s), pid %d, visual %p, colormap %lu, depth %d, width %d, height %d" RESET "\n",
win,
name,
pid,
@@ -668,10 +696,10 @@ gboolean add_icon(Window win)
// Resize and redraw the systray
if (systray_profile)
fprintf(stderr,
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
systray.area.resize_needed = TRUE;
panel->area.resize_needed = TRUE;
schedule_redraw(&systray.area);
@@ -701,8 +729,8 @@ gboolean reparent_icon(TrayWindow *traywin)
if (systray_profile)
fprintf(stderr,
"XMoveResizeWindow(server.display, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height = "
"%d)\n",
"XMoveResizeWindow(server.display, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height = "
"%d)\n",
traywin->win,
traywin->width,
traywin->height);
@@ -783,7 +811,7 @@ gboolean embed_icon(TrayWindow *traywin)
if (systray_profile)
fprintf(stderr,
"XGetWindowProperty(server.display, traywin->win, server.atom._XEMBED_INFO, 0, 2, False, "
"XGetWindowProperty(server.display, traywin->win, server.atom._XEMBED_INFO, 0, 2, False, "
"server.atom._XEMBED_INFO, &acttype, &actfmt, &nbitem, &bytes, &data)\n");
ret = XGetWindowProperty(server.display,
traywin->win,
@@ -925,10 +953,10 @@ void remove_icon(TrayWindow *traywin)
// Resize and redraw the systray
if (systray_profile)
fprintf(stderr,
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
systray.area.resize_needed = TRUE;
panel->area.resize_needed = TRUE;
schedule_redraw(&systray.area);
@@ -948,10 +976,10 @@ void systray_resize_icon(void *t)
} else {
if (systray_profile)
fprintf(stderr,
"systray_resize_icon win = %ld, w = %d, h = %d\n",
traywin->win,
traywin->width,
traywin->height);
"systray_resize_icon win = %ld, w = %d, h = %d\n",
traywin->win,
traywin->width,
traywin->height);
// This is the obvious thing to do but GTK tray icons do not respect the new size
if (0) {
XMoveResizeWindow(server.display, traywin->win, 0, 0, traywin->width, traywin->height);
@@ -1048,10 +1076,10 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
// Resize and redraw the systray
if (systray_profile)
fprintf(stderr,
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
panel_refresh = TRUE;
refresh_systray = TRUE;
}
@@ -1061,7 +1089,7 @@ void systray_property_notify(TrayWindow *traywin, XEvent *e)
Atom at = e->xproperty.atom;
if (at == server.atom.WM_NAME) {
free(traywin->name);
traywin->name = get_window_name(traywin->win);
traywin->name = get_window_name(traywin->win);
if (systray.sort == SYSTRAY_SORT_ASCENDING || systray.sort == SYSTRAY_SORT_DESCENDING) {
systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows);
// print_icons();
@@ -1127,10 +1155,10 @@ void systray_resize_request_event(TrayWindow *traywin, XEvent *e)
// Resize and redraw the systray
if (systray_profile)
fprintf(stderr,
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
profiling_get_time(),
__FUNCTION__,
__LINE__);
panel_refresh = TRUE;
refresh_systray = TRUE;
}
@@ -1154,15 +1182,15 @@ void systray_render_icon_from_image(TrayWindow *traywin)
return;
imlib_context_set_image(traywin->image);
XCopyArea(server.display,
render_background,
systray.area.pix,
server.gc,
traywin->x - systray.area.posx,
traywin->y - systray.area.posy,
traywin->width,
traywin->height,
traywin->x - systray.area.posx,
traywin->y - systray.area.posy);
render_background,
systray.area.pix,
server.gc,
traywin->x - systray.area.posx,
traywin->y - systray.area.posy,
traywin->width,
traywin->height,
traywin->x - systray.area.posx,
traywin->y - systray.area.posy);
render_image(systray.area.pix, traywin->x - systray.area.posx, traywin->y - systray.area.posy);
}
@@ -1267,7 +1295,7 @@ void systray_render_icon_composited(void *t)
goto on_error;
}
Picture pict_drawable =
XRenderCreatePicture(server.display, tmp_pmap, XRenderFindVisualFormat(server.display, server.visual32), 0, 0);
XRenderCreatePicture(server.display, tmp_pmap, XRenderFindVisualFormat(server.display, server.visual32), 0, 0);
if (!pict_drawable) {
XRenderFreePicture(server.display, pict_image);
XFreePixmap(server.display, tmp_pmap);
@@ -1324,9 +1352,9 @@ void systray_render_icon_composited(void *t)
adjust_asb(data,
traywin->width,
traywin->height,
systray.alpha / 100.0,
systray.saturation / 100.0,
systray.brightness / 100.0);
systray.alpha / 100.0,
systray.saturation / 100.0,
systray.brightness / 100.0);
imlib_image_put_back_data(data);
systray_render_icon_from_image(traywin);
@@ -1449,12 +1477,12 @@ void systray_render_icon(void *t)
// Trigger window repaint
if (systray_profile)
fprintf(stderr,
"XClearArea(server.display, traywin->parent = %ld, 0, 0, traywin->width, traywin->height, True)\n",
"XClearArea(server.display, traywin->parent = %ld, 0, 0, traywin->width, traywin->height, True)\n",
traywin->parent);
XClearArea(server.display, traywin->parent, 0, 0, 0, 0, True);
if (systray_profile)
fprintf(stderr,
"XClearArea(server.display, traywin->win = %ld, 0, 0, traywin->width, traywin->height, True)\n",
"XClearArea(server.display, traywin->win = %ld, 0, 0, traywin->width, traywin->height, True)\n",
traywin->win);
XClearArea(server.display, traywin->win, 0, 0, 0, 0, True);
}

View File

@@ -38,6 +38,8 @@
timeout *urgent_timeout;
GSList *urgent_list;
void task_dump_geometry(void *obj, int indent);
char *task_get_tooltip(void *obj)
{
Task *t = (Task *)obj;
@@ -68,6 +70,7 @@ Task *add_task(Window win)
snprintf(task_template.area.name, sizeof(task_template.area.name), "Task %d", (int)win);
task_template.area.has_mouse_over_effect = panel_config.mouse_effects;
task_template.area.has_mouse_press_effect = panel_config.mouse_effects;
task_template.area._dump_geometry = task_dump_geometry;
task_template.area._is_under_mouse = full_width_area_is_under_mouse;
task_template.win = win;
task_template.desktop = get_window_desktop(win);
@@ -83,7 +86,11 @@ Task *add_task(Window win)
}
task_update_title(&task_template);
task_update_icon(&task_template);
snprintf(task_template.area.name, sizeof(task_template.area.name), "Task %d %s", (int)win, task_template.title ? task_template.title : "null");
snprintf(task_template.area.name,
sizeof(task_template.area.name),
"Task %d %s",
(int)win,
task_template.title ? task_template.title : "null");
// fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task_template.title ?
// task_template.title : "??");
@@ -99,6 +106,7 @@ Task *add_task(Window win)
memcpy(&task_instance->area, &panels[monitor].g_task.area, sizeof(Area));
task_instance->area.has_mouse_over_effect = panel_config.mouse_effects;
task_instance->area.has_mouse_press_effect = panel_config.mouse_effects;
task_instance->area._dump_geometry = task_dump_geometry;
task_instance->area._is_under_mouse = full_width_area_is_under_mouse;
task_instance->win = task_template.win;
task_instance->desktop = task_template.desktop;
@@ -260,21 +268,26 @@ void task_update_icon(Task *task)
Imlib_Image img = NULL;
int i;
gulong *data = server_get_property(task->win, server.atom._NET_WM_ICON, XA_CARDINAL, &i);
if (data) {
// get ARGB icon
int w, h;
gulong *tmp_data;
if (!img) {
int i;
gulong *data = server_get_property(task->win, server.atom._NET_WM_ICON, XA_CARDINAL, &i);
if (data) {
// get ARGB icon
int w, h;
gulong *tmp_data;
tmp_data = get_best_icon(data, get_icon_count(data, i), i, &w, &h, panel->g_task.icon_size1);
DATA32 icon_data[w * h];
for (int j = 0; j < w * h; ++j)
icon_data[j] = tmp_data[j];
img = imlib_create_image_using_copied_data(w, h, icon_data);
XFree(data);
} else {
// get Pixmap icon
tmp_data = get_best_icon(data, get_icon_count(data, i), i, &w, &h, panel->g_task.icon_size1);
DATA32 icon_data[w * h];
for (int j = 0; j < w * h; ++j)
icon_data[j] = tmp_data[j];
img = imlib_create_image_using_copied_data(w, h, icon_data);
if (img)
fprintf(stderr, "%s: Got %dx%d icon via _NET_WM_ICON for %s\n", __FUNCTION__, w, h, task->title ? task->title : "task");
XFree(data);
}
}
if (!img) {
XWMHints *hints = XGetWMHints(server.display, task->win);
if (hints) {
if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) {
@@ -284,17 +297,20 @@ void task_update_icon(Task *task)
uint border_width, bpp;
uint w, h;
// printf(" get pixmap\n");
XGetGeometry(server.display, hints->icon_pixmap, &root, &icon_x, &icon_y, &w, &h, &border_width, &bpp);
imlib_context_set_drawable(hints->icon_pixmap);
img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, w, h, 0);
if (img)
fprintf(stderr, "%s: Got %dx%d pixmap icon via WM_HINTS for %s\n", __FUNCTION__, w, h, task->title ? task->title : "task");
}
XFree(hints);
}
}
if (img == NULL) {
imlib_context_set_image(default_icon);
img = imlib_clone_image();
fprintf(stderr, "%s: Using default icon for %s\n", __FUNCTION__, task->title ? task->title : "task");
}
// transform icons
@@ -303,7 +319,7 @@ void task_update_icon(Task *task)
int w = imlib_image_get_width();
int h = imlib_image_get_height();
Imlib_Image orig_image =
imlib_create_cropped_scaled_image(0, 0, w, h, panel->g_task.icon_size1, panel->g_task.icon_size1);
imlib_create_cropped_scaled_image(0, 0, w, h, panel->g_task.icon_size1, panel->g_task.icon_size1);
imlib_free_image();
imlib_context_set_image(orig_image);
@@ -317,22 +333,22 @@ void task_update_icon(Task *task)
if (panel->g_task.alpha[k] != 100 || panel->g_task.saturation[k] != 0 || panel->g_task.brightness[k] != 0) {
data32 = imlib_image_get_data();
adjust_asb(data32,
task->icon_width,
task->icon_height,
panel->g_task.alpha[k] / 100.0,
panel->g_task.saturation[k] / 100.0,
panel->g_task.brightness[k] / 100.0);
task->icon_width,
task->icon_height,
panel->g_task.alpha[k] / 100.0,
panel->g_task.saturation[k] / 100.0,
panel->g_task.brightness[k] / 100.0);
imlib_image_put_back_data(data32);
}
if (panel_config.mouse_effects) {
task->icon_hover[k] = adjust_icon(task->icon[k],
panel_config.mouse_over_alpha,
panel_config.mouse_over_saturation,
panel_config.mouse_over_brightness);
panel_config.mouse_over_alpha,
panel_config.mouse_over_saturation,
panel_config.mouse_over_brightness);
task->icon_press[k] = adjust_icon(task->icon[k],
panel_config.mouse_pressed_alpha,
panel_config.mouse_pressed_saturation,
panel_config.mouse_pressed_brightness);
panel_config.mouse_pressed_alpha,
panel_config.mouse_pressed_saturation,
panel_config.mouse_pressed_brightness);
}
}
imlib_context_set_image(orig_image);
@@ -340,7 +356,7 @@ void task_update_icon(Task *task)
GPtrArray *task_buttons = get_task_buttons(task->win);
if (task_buttons) {
for (i = 0; i < task_buttons->len; ++i) {
for (int i = 0; i < task_buttons->len; ++i) {
Task *task2 = g_ptr_array_index(task_buttons, i);
task2->icon_width = task->icon_width;
task2->icon_height = task->icon_height;
@@ -361,15 +377,14 @@ void draw_task_icon(Task *task, int text_width)
return;
// Find pos
int pos_x;
Panel *panel = (Panel *)task->area.panel;
if (panel->g_task.centered) {
if (panel->g_task.has_text)
pos_x = (task->area.width - text_width - panel->g_task.icon_size1) / 2;
task->_icon_x = (task->area.width - text_width - panel->g_task.icon_size1) / 2;
else
pos_x = (task->area.width - panel->g_task.icon_size1) / 2;
task->_icon_x = (task->area.width - panel->g_task.icon_size1) / 2;
} else {
pos_x = task->area.bg->border.width + task->area.paddingxlr;
task->_icon_x = left_border_width(&task->area) + task->area.paddingxlr;
}
// Render
@@ -388,14 +403,8 @@ void draw_task_icon(Task *task, int text_width)
}
imlib_context_set_image(image);
render_image(task->area.pix, pos_x, (task->area.height - panel->g_task.icon_size1) / 2);
if (0) {
fprintf(stderr, "Task icon size: %d %d pos %d %d\n", imlib_image_get_width(), imlib_image_get_height(), pos_x, panel->g_task.icon_posy);
fprintf(stderr, "Task max size : %d %d\n", panel->g_task.maximum_width, panel->g_task.maximum_height);
fprintf(stderr, "Task area size: %d %d\n", task->area.width, task->area.height);
fprintf(stderr, "Task border : %d\n", task->area.bg->border.width);
fprintf(stderr, "\n");
}
task->_icon_y = (task->area.height - panel->g_task.icon_size1) / 2;
render_image(task->area.pix, task->_icon_x, task->_icon_y);
}
void draw_task(void *obj, cairo_t *c)
@@ -403,7 +412,7 @@ void draw_task(void *obj, cairo_t *c)
Task *task = (Task *)obj;
Panel *panel = (Panel *)task->area.panel;
int text_width = 0;
task->_text_width = 0;
if (panel->g_task.has_text) {
PangoLayout *layout = pango_cairo_create_layout(c);
pango_layout_set_font_description(layout, panel->g_task.font_desc);
@@ -419,18 +428,41 @@ void draw_task(void *obj, cairo_t *c)
else
pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
int text_height;
pango_layout_get_pixel_size(layout, &text_width, &text_height);
double text_posy = (panel->g_task.area.height - text_height) / 2.0;
pango_layout_get_pixel_size(layout, &task->_text_width, &task->_text_height);
task->_text_posy = (panel->g_task.area.height - task->_text_height) / 2.0;
Color *config_text = &panel->g_task.font[task->current_state];
draw_text(layout, c, panel->g_task.text_posx, text_posy, config_text, panel->font_shadow);
draw_text(layout, c, panel->g_task.text_posx, task->_text_posy, config_text, panel->font_shadow);
g_object_unref(layout);
}
if (panel->g_task.has_icon)
draw_task_icon(task, text_width);
draw_task_icon(task, task->_text_width);
}
void task_dump_geometry(void *obj, int indent)
{
Task *task = (Task *)obj;
Panel *panel = (Panel *)task->area.panel;
fprintf(stderr,
"%*sText: x = %d, y = %d, w = %d, h = %d, align = %s, text = %s\n",
indent,
"",
(int)panel->g_task.text_posx,
(int)task->_text_posy,
task->_text_width,
task->_text_height,
panel->g_task.centered ? "center" : "left",
task->title);
fprintf(stderr,
"%*sIcon: x = %d, y = %d, w = h = %d\n",
indent,
"",
task->_icon_x,
task->_icon_y,
panel->g_task.icon_size1);
}
void on_change_task(void *obj)
@@ -440,13 +472,13 @@ void on_change_task(void *obj)
long value[] = {panel->posx + task->area.posx, panel->posy + task->area.posy, task->area.width, task->area.height};
XChangeProperty(server.display,
task->win,
server.atom._NET_WM_ICON_GEOMETRY,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)value,
4);
task->win,
server.atom._NET_WM_ICON_GEOMETRY,
XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)value,
4);
}
Task *find_active_task(Task *current_task)
@@ -579,7 +611,7 @@ void set_task_state(Task *task, TaskState state)
}
}
if (get_window_monitor(task->win) != ((Panel *)task->area.panel)->monitor &&
(hide_task_diff_monitor || num_panels > 1)) {
(hide_task_diff_monitor || num_panels > 1)) {
hide = TRUE;
}
if ((!hide) != task1->area.on_screen) {

View File

@@ -67,6 +67,11 @@ typedef struct Task {
int win_w;
int win_h;
struct timespec last_activation_time;
int _text_width;
int _text_height;
double _text_posy;
int _icon_x;
int _icon_y;
} Task;
extern timeout *urgent_timeout;

View File

@@ -167,13 +167,15 @@ void init_taskbar_panel(void *p)
panel->g_taskbar.area.resize_needed = 1;
panel->g_taskbar.area.on_screen = TRUE;
if (panel_horizontal) {
panel->g_taskbar.area.posy = panel->area.bg->border.width + panel->area.paddingy;
panel->g_taskbar.area.height = panel->area.height - (2 * panel->g_taskbar.area.posy);
panel->g_taskbar.area.posy = top_border_width(&panel->area) + panel->area.paddingy;
panel->g_taskbar.area.height =
panel->area.height - top_bottom_border_width(&panel->area) - 2 * panel->area.paddingy;
panel->g_taskbar.area_name.posy = panel->g_taskbar.area.posy;
panel->g_taskbar.area_name.height = panel->g_taskbar.area.height;
} else {
panel->g_taskbar.area.posx = panel->area.bg->border.width + panel->area.paddingy;
panel->g_taskbar.area.width = panel->area.width - (2 * panel->g_taskbar.area.posx);
panel->g_taskbar.area.posx = left_border_width(&panel->area) + panel->area.paddingy;
panel->g_taskbar.area.width =
panel->area.width - left_right_border_width(&panel->area) - 2 * panel->area.paddingy;
panel->g_taskbar.area_name.posx = panel->g_taskbar.area.posx;
panel->g_taskbar.area_name.width = panel->g_taskbar.area.width;
}
@@ -230,15 +232,19 @@ void init_taskbar_panel(void *p)
if (panel_horizontal) {
panel->g_task.area.posy = panel->g_taskbar.area.posy +
panel->g_taskbar.background[TASKBAR_NORMAL]->border.width +
panel->g_taskbar.area.paddingy;
top_bg_border_width(panel->g_taskbar.background[TASKBAR_NORMAL]) +
panel->g_taskbar.area.paddingy;
panel->g_task.area.width = panel->g_task.maximum_width;
panel->g_task.area.height = panel->area.height - (2 * panel->g_task.area.posy);
panel->g_task.area.height = panel->g_taskbar.area.height -
top_bottom_bg_border_width(panel->g_taskbar.background[TASKBAR_NORMAL]) -
2 * panel->g_taskbar.area.paddingy;
} else {
panel->g_task.area.posx = panel->g_taskbar.area.posx +
panel->g_taskbar.background[TASKBAR_NORMAL]->border.width +
panel->g_taskbar.area.paddingy;
panel->g_task.area.width = panel->area.width - (2 * panel->g_task.area.posx);
left_bg_border_width(panel->g_taskbar.background[TASKBAR_NORMAL]) +
panel->g_taskbar.area.paddingy;
panel->g_task.area.width = panel->g_taskbar.area.width -
left_right_bg_border_width(panel->g_taskbar.background[TASKBAR_NORMAL]) -
2 * panel->g_taskbar.area.paddingy;
panel->g_task.area.height = panel->g_task.maximum_height;
}
@@ -247,7 +253,7 @@ void init_taskbar_panel(void *p)
panel->g_task.background[j] = &g_array_index(backgrounds, Background, 0);
if (panel->g_task.background[j]->border.radius > panel->g_task.area.height / 2) {
printf("task%sbackground_id has a too large rounded value. Please fix your tint2rc\n",
j == 0 ? "_" : j == 1 ? "_active_" : j == 2 ? "_iconified_" : "_urgent_");
j == 0 ? "_" : j == 1 ? "_active_" : j == 2 ? "_iconified_" : "_urgent_");
g_array_append_val(backgrounds, *panel->g_task.background[j]);
panel->g_task.background[j] = &g_array_index(backgrounds, Background, backgrounds->len - 1);
panel->g_task.background[j]->border.radius = panel->g_task.area.height / 2;
@@ -257,36 +263,36 @@ void init_taskbar_panel(void *p)
// compute vertical position : text and icon
int height_ink, height, width;
get_text_size2(panel->g_task.font_desc,
&height_ink,
&height,
&width,
panel->area.height,
panel->area.width,
"TAjpg",
5,
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_END,
FALSE);
&height_ink,
&height,
&width,
panel->area.height,
panel->area.width,
"TAjpg",
5,
PANGO_WRAP_WORD_CHAR,
PANGO_ELLIPSIZE_END,
FALSE);
panel->g_task.text_posx = panel->g_task.background[0]->border.width + panel->g_task.area.paddingxlr;
panel->g_task.text_posx = left_bg_border_width(panel->g_task.background[0]) + panel->g_task.area.paddingxlr;
panel->g_task.text_height = panel->g_task.area.height - (2 * panel->g_task.area.paddingy);
if (panel->g_task.has_icon) {
panel->g_task.icon_size1 =
MIN(MIN(panel->g_task.maximum_width, panel->g_task.maximum_height),
MIN(panel->g_task.area.width, panel->g_task.area.height)) -
(2 * panel->g_task.area.paddingy) - 2 * panel->g_task.area.bg->border.width;
panel->g_task.icon_size1 = MIN(MIN(panel->g_task.maximum_width, panel->g_task.maximum_height),
MIN(panel->g_task.area.width, panel->g_task.area.height)) -
2 * panel->g_task.area.paddingy - MAX(left_right_border_width(&panel->g_task.area),
top_bottom_border_width(&panel->g_task.area));
panel->g_task.text_posx += panel->g_task.icon_size1 + panel->g_task.area.paddingx;
panel->g_task.icon_posy = (panel->g_task.area.height - panel->g_task.icon_size1) / 2;
if (0)
printf("task: icon_size = %d, textx = %f, texth = %f, icony = %d, w = %d, h = %d, maxw = %d, maxh = %d\n",
panel->g_task.icon_size1,
panel->g_task.text_posx,
panel->g_task.text_height,
panel->g_task.icon_posy,
panel->g_task.area.width,
panel->g_task.area.height,
panel->g_task.maximum_width,
panel->g_task.maximum_height);
panel->g_task.icon_size1,
panel->g_task.text_posx,
panel->g_task.text_height,
panel->g_task.icon_posy,
panel->g_task.area.width,
panel->g_task.area.height,
panel->g_task.maximum_width,
panel->g_task.maximum_height);
}
Taskbar *taskbar;
@@ -413,36 +419,69 @@ gboolean resize_taskbar(void *obj)
break;
}
}
taskbar->text_width =
text_width - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingxlr;
taskbar->text_width = text_width - panel->g_task.text_posx - right_border_width(&panel->g_task.area) -
panel->g_task.area.paddingxlr;
} else {
relayout_with_constraint(&taskbar->area, panel->g_task.maximum_height);
taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.area.paddingy) - panel->g_task.text_posx -
panel->g_task.area.bg->border.width - panel->g_task.area.paddingxlr;
right_border_width(&panel->g_task.area) - panel->g_task.area.paddingxlr;
}
return FALSE;
}
gboolean taskbar_is_empty(Taskbar *taskbar)
{
GList *l = taskbar->area.children;
if (taskbarname_enabled)
l = l->next;
for (; l != NULL; l = l->next) {
if (((Task *)l->data)->area.on_screen) {
return TRUE;
}
}
return FALSE;
}
void update_one_taskbar_visibility(Taskbar *taskbar)
{
if (taskbar->desktop == server.desktop) {
// Taskbar for current desktop is always shown
show(&taskbar->area);
} else if (taskbar_mode == MULTI_DESKTOP && taskbar_is_empty(taskbar)) {
// MULTI_DESKTOP : show non-empty taskbars
show(&taskbar->area);
} else {
hide(&taskbar->area);
}
}
void update_all_taskbars_visibility()
{
for (int i = 0; i < num_panels; i++) {
Panel *panel = &panels[i];
for (int j = 0; j < panel->num_desktops; j++) {
update_one_taskbar_visibility(&panel->taskbar[j]);
}
}
}
void set_taskbar_state(Taskbar *taskbar, TaskbarState state)
{
taskbar->area.bg = panels[0].g_taskbar.background[state];
if (taskbarname_enabled) {
taskbar->bar_name.area.bg = panels[0].g_taskbar.background_name[state];
}
if (taskbar_mode != MULTI_DESKTOP) {
if (state == TASKBAR_NORMAL)
taskbar->area.on_screen = FALSE;
else
taskbar->area.on_screen = TRUE;
}
update_one_taskbar_visibility(taskbar);
if (taskbar->area.on_screen) {
schedule_redraw(&taskbar->area);
if (taskbarname_enabled) {
schedule_redraw(&taskbar->bar_name.area);
}
if (taskbar_mode == MULTI_DESKTOP &&
panels[0].g_taskbar.background[TASKBAR_NORMAL] != panels[0].g_taskbar.background[TASKBAR_ACTIVE]) {
panels[0].g_taskbar.background[TASKBAR_NORMAL] != panels[0].g_taskbar.background[TASKBAR_ACTIVE]) {
GList *l = taskbar->area.children;
if (taskbarname_enabled)
l = l->next;
@@ -453,22 +492,6 @@ void set_taskbar_state(Taskbar *taskbar, TaskbarState state)
panel_refresh = TRUE;
}
void update_taskbar_visibility(void *p)
{
Panel *panel = (Panel *)p;
for (int j = 0; j < panel->num_desktops; j++) {
Taskbar *taskbar = &panel->taskbar[j];
if (taskbar_mode != MULTI_DESKTOP && taskbar->desktop != server.desktop) {
// SINGLE_DESKTOP and not current desktop
taskbar->area.on_screen = FALSE;
} else {
taskbar->area.on_screen = TRUE;
}
}
panel_refresh = TRUE;
}
#define NONTRIVIAL 2
gint compare_tasks_trivial(Task *a, Task *b, Taskbar *taskbar)
{
@@ -486,7 +509,7 @@ gint compare_tasks_trivial(Task *a, Task *b, Taskbar *taskbar)
gboolean contained_within(Task *a, Task *b)
{
if ((a->win_x <= b->win_x) && (a->win_y <= b->win_y) && (a->win_x + a->win_w >= b->win_x + b->win_w) &&
(a->win_y + a->win_h >= b->win_y + b->win_h)) {
(a->win_y + a->win_h >= b->win_y + b->win_h)) {
return TRUE;
}
return FALSE;

View File

@@ -79,10 +79,11 @@ Task *get_task(Window win);
// However for windows shown on all desktops, there are multiple buttons, one for each taskbar.
GPtrArray *get_task_buttons(Window win);
// Change state of a taskbar (ACTIVE or NORMAL)
void set_taskbar_state(Taskbar *taskbar, TaskbarState state);
// Updates the visibility of each taskbar when the current desktop changes.
void update_taskbar_visibility(void *p);
// Updates the visibility of all taskbars
void update_all_taskbars_visibility();
// Sorts the taskbar(s) on which the window is present.
void sort_taskbar_for_win(Window win);

View File

@@ -147,14 +147,14 @@ gboolean resize_taskbarname(void *obj)
FALSE);
if (panel_horizontal) {
int new_size = name_width + (2 * (taskbar_name->area.paddingxlr + taskbar_name->area.bg->border.width));
int new_size = name_width + 2 * taskbar_name->area.paddingxlr + left_right_border_width(&taskbar_name->area);
if (new_size != taskbar_name->area.width) {
taskbar_name->area.width = new_size;
taskbar_name->posy = (taskbar_name->area.height - name_height) / 2;
result = TRUE;
}
} else {
int new_size = name_height + (2 * (taskbar_name->area.paddingxlr + taskbar_name->area.bg->border.width));
int new_size = name_height + 2 * taskbar_name->area.paddingxlr + top_bottom_border_width(&taskbar_name->area);
if (new_size != taskbar_name->area.height) {
taskbar_name->area.height = new_size;
taskbar_name->posy = (taskbar_name->area.height - name_height) / 2;

View File

@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**************************************************************************/
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
@@ -36,10 +37,10 @@
#include <pwd.h>
#include <time.h>
#include <sys/time.h>
#include <sys/wait.h>
#ifdef HAVE_SN
#include <libsn/sn.h>
#include <sys/wait.h>
#endif
#include <version.h>
@@ -372,10 +373,12 @@ void init(int argc, char *argv[])
sigaction(SIGABRT, &sa_crash, 0);
sigaction(SIGSYS, &sa_crash, 0);
#endif
debug_geometry = getenv("DEBUG_GEOMETRY") != NULL;
}
static int sn_pipe_valid = 0;
static int sn_pipe[2];
static int sigchild_pipe_valid = FALSE;
static int sigchild_pipe[2];
#ifdef HAVE_SN
static int error_trap_depth = 0;
@@ -395,50 +398,41 @@ static void error_trap_pop(SnDisplay *display, Display *xdisplay)
XSync(xdisplay, False); /* get all errors out of the queue */
--error_trap_depth;
}
#endif // HAVE_SN
static void sigchld_handler(int sig)
{
if (!startup_notifications)
if (!sigchild_pipe_valid)
return;
if (!sn_pipe_valid)
return;
ssize_t wur = write(sn_pipe[1], "x", 1);
(void)wur;
fsync(sn_pipe[1]);
int savedErrno = errno;
ssize_t unused = write(sigchild_pipe[1], "x", 1);
(void)unused;
fsync(sigchild_pipe[1]);
errno = savedErrno;
}
static void sigchld_handler_async()
{
if (!startup_notifications)
return;
// Wait for all dead processes
pid_t pid;
while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
SnLauncherContext *ctx;
ctx = (SnLauncherContext *)g_tree_lookup(server.pids, GINT_TO_POINTER(pid));
int status;
while ((pid = waitpid(-1, &status, WNOHANG)) != -1 && pid != 0) {
#ifdef HAVE_SN
SnLauncherContext *ctx = (SnLauncherContext *)g_tree_lookup(server.pids, GINT_TO_POINTER(pid));
if (ctx) {
g_tree_remove(server.pids, GINT_TO_POINTER(pid));
sn_launcher_context_complete(ctx);
sn_launcher_context_unref(ctx);
}
#endif
for (GList *l = panel_config.execp_list; l; l = l->next) {
Execp *execp = (Execp *)l->data;
if (g_tree_lookup(execp->backend->cmd_pids, GINT_TO_POINTER(pid)))
execp_cmd_completed(execp, pid);
}
}
}
static gint cmp_ptr(gconstpointer a, gconstpointer b)
{
if (a < b)
return -1;
else if (a == b)
return 0;
else
return 1;
}
#else
static void sigchld_handler_async()
{
}
#endif // HAVE_SN
void init_X11_pre_config()
{
server.display = XOpenDisplay(NULL);
@@ -473,25 +467,32 @@ void init_X11_post_config()
{
server_init_visual();
gboolean need_sigchld = FALSE;
#ifdef HAVE_SN
// Initialize startup-notification
if (startup_notifications) {
server.sn_display = sn_display_new(server.display, error_trap_push, error_trap_pop);
server.pids = g_tree_new(cmp_ptr);
need_sigchld = TRUE;
}
#endif // HAVE_SN
if (panel_config.execp_list)
need_sigchld = TRUE;
if (need_sigchld) {
// Setup a handler for child termination
if (pipe(sn_pipe) != 0) {
if (pipe(sigchild_pipe) != 0) {
fprintf(stderr, "Creating pipe failed.\n");
} else {
fcntl(sn_pipe[0], F_SETFL, O_NONBLOCK | fcntl(sn_pipe[0], F_GETFL));
fcntl(sn_pipe[1], F_SETFL, O_NONBLOCK | fcntl(sn_pipe[1], F_GETFL));
sn_pipe_valid = 1;
struct sigaction act = {.sa_handler = sigchld_handler, .sa_flags = SA_NOCLDWAIT | SA_RESTART};
fcntl(sigchild_pipe[0], F_SETFL, O_NONBLOCK | fcntl(sigchild_pipe[0], F_GETFL));
fcntl(sigchild_pipe[1], F_SETFL, O_NONBLOCK | fcntl(sigchild_pipe[1], F_GETFL));
sigchild_pipe_valid = 1;
struct sigaction act = {.sa_handler = sigchld_handler, .sa_flags = SA_RESTART};
if (sigaction(SIGCHLD, &act, 0)) {
perror("sigaction");
}
}
}
#endif // HAVE_SN
imlib_context_set_display(server.display);
imlib_context_set_visual(server.visual);
@@ -541,15 +542,11 @@ void cleanup()
XCloseDisplay(server.display);
server.display = NULL;
#ifdef HAVE_SN
if (startup_notifications) {
if (sn_pipe_valid) {
sn_pipe_valid = 0;
close(sn_pipe[1]);
close(sn_pipe[0]);
}
if (sigchild_pipe_valid) {
sigchild_pipe_valid = FALSE;
close(sigchild_pipe[1]);
close(sigchild_pipe[0]);
}
#endif
uevent_cleanup();
}
@@ -1013,7 +1010,7 @@ void event_property_notify(XEvent *e)
int old_desktop = server.desktop;
server_get_number_of_desktops();
server.desktop = get_current_desktop();
if (old_num_desktops != server.num_desktops) {
if (old_num_desktops != server.num_desktops) { // If number of desktop changed
if (server.num_desktops <= server.desktop) {
server.desktop = server.num_desktops - 1;
}
@@ -1022,11 +1019,11 @@ void event_property_notify(XEvent *e)
for (int i = 0; i < num_panels; i++) {
init_taskbar_panel(&panels[i]);
set_panel_items_order(&panels[i]);
update_taskbar_visibility(&panels[i]);
panels[i].area.resize_needed = 1;
}
taskbar_refresh_tasklist();
reset_active_task();
update_all_taskbars_visibility();
panel_refresh = TRUE;
} else if (old_desktop != server.desktop) {
for (int i = 0; i < num_panels; i++) {
@@ -1095,6 +1092,7 @@ void event_property_notify(XEvent *e)
if (debug)
fprintf(stderr, "%s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__);
taskbar_refresh_tasklist();
update_all_taskbars_visibility();
panel_refresh = TRUE;
}
// Change active
@@ -1206,6 +1204,8 @@ void event_property_notify(XEvent *e)
add_urgent(task);
}
XFree(wmhints);
task_update_icon(task);
panel_refresh = TRUE;
}
if (!server.got_root_win)
@@ -1639,9 +1639,9 @@ start:
FD_ZERO(&fdset);
FD_SET(x11_fd, &fdset);
int maxfd = x11_fd;
if (sn_pipe_valid) {
FD_SET(sn_pipe[0], &fdset);
maxfd = maxfd < sn_pipe[0] ? sn_pipe[0] : maxfd;
if (sigchild_pipe_valid) {
FD_SET(sigchild_pipe[0], &fdset);
maxfd = maxfd < sigchild_pipe[0] ? sigchild_pipe[0] : maxfd;
}
for (GList *l = panel_config.execp_list; l; l = l->next) {
Execp *execp = (Execp *)l->data;
@@ -1662,9 +1662,9 @@ start:
if (XPending(server.display) > 0 || select(maxfd + 1, &fdset, 0, 0, select_timeout) >= 0) {
uevent_handler();
if (sn_pipe_valid) {
if (sigchild_pipe_valid) {
char buffer[1];
while (read(sn_pipe[0], buffer, sizeof(buffer)) > 0) {
while (read(sigchild_pipe[0], buffer, sizeof(buffer)) > 0) {
sigchld_handler_async();
}
}

View File

@@ -237,7 +237,7 @@ int main(int argc, char **argv)
// define main layout : container, menubar, toolbar
g_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(g_window), _("Panel theming"));
gtk_window_set_title(GTK_WINDOW(g_window), _("Tint2 panel themes"));
gtk_window_resize(GTK_WINDOW(g_window), 920, 600);
g_signal_connect(G_OBJECT(g_window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
vBox = gtk_vbox_new(FALSE, 0);
@@ -247,7 +247,7 @@ int main(int argc, char **argv)
// Menubar and toolbar entries
GtkActionEntry entries[] =
{{"ThemeMenu", NULL, _("Theme"), NULL, NULL, NULL},
{{"ThemeMenu", NULL, _("_Theme"), NULL, NULL, NULL},
{"ThemeImportFile", GTK_STOCK_ADD, _("_Import theme..."), "<Control>N", _("Import theme(s) from file system"), G_CALLBACK(menuImportFile)},
{"ThemeSaveAs", GTK_STOCK_SAVE_AS, _("_Save as..."), NULL, _("Save the theme with a new name"), G_CALLBACK(menuSaveAs)},
{"ThemeDelete", GTK_STOCK_DELETE, _("_Delete"), NULL, _("Delete the selected theme"), G_CALLBACK(menuDelete)},
@@ -257,12 +257,13 @@ int main(int argc, char **argv)
{"ThemeRefresh", GTK_STOCK_REFRESH, _("Refresh"), NULL, _("Redraw the selected theme"), G_CALLBACK(refresh_current_theme)},
{"RefreshAll", GTK_STOCK_REFRESH, _("Refresh all"), NULL, _("Redraw all themes"), G_CALLBACK(load_all_themes)},
{"Quit", GTK_STOCK_QUIT, _("_Quit"), "<control>Q", _("Quit"), G_CALLBACK(gtk_main_quit)},
{"HelpMenu", NULL, _("Help"), NULL, NULL, NULL},
{"HelpMenu", NULL, _("_Help"), NULL, NULL, NULL},
{"HelpAbout", GTK_STOCK_ABOUT, _("_About"), "<Control>A", _("About"), G_CALLBACK(menuAbout)}};
gtk_action_group_add_actions(actionGroup, entries, G_N_ELEMENTS(entries), NULL);
globalUIManager = gtk_ui_manager_new();
gtk_ui_manager_insert_action_group(globalUIManager, actionGroup, 0);
gtk_window_add_accel_group(GTK_WINDOW(g_window), gtk_ui_manager_get_accel_group(globalUIManager));
gtk_ui_manager_add_ui_from_string(globalUIManager, global_ui, -1, (NULL));
g_signal_connect(globalUIManager, "add_widget", G_CALLBACK(menuAddWidget), vBox);
gtk_ui_manager_ensure_update(globalUIManager);
@@ -418,13 +419,38 @@ static void menuSaveAs()
GTK_RESPONSE_ACCEPT,
NULL);
GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog);
gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE);
gtk_file_chooser_set_do_overwrite_confirmation(chooser, FALSE);
gchar *config_dir = g_build_filename(g_get_home_dir(), ".config", "tint2", NULL);
gtk_file_chooser_set_current_folder(chooser, config_dir);
g_free(config_dir);
GtkFileFilter *filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter, "*.tint2rc");
gtk_file_filter_add_pattern(filter, "tint2rc");
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
gtk_file_chooser_set_current_name(chooser, filename);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
gchar *newpath = gtk_file_chooser_get_filename(chooser);
if (!endswith(newpath, ".tint2rc") && !endswith(newpath, "/tint2rc")) {
gchar *proper_path = g_strdup_printf("%s.tint2rc", newpath);
g_free(newpath);
newpath = proper_path;
}
if (g_file_test(newpath, G_FILE_TEST_EXISTS)) {
GtkWidget *w = gtk_message_dialog_new(GTK_WINDOW(g_window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
_("A file named \"%s\" already exists. Do you want to replace it?"),
newpath);
gint response = gtk_dialog_run(GTK_DIALOG(w));
gtk_widget_destroy(w);
if (response != GTK_RESPONSE_YES) {
g_free(newpath);
gtk_widget_destroy(dialog);
g_free(filepath);
return;
}
}
import_with_overwrite(filepath, newpath);
g_free(newpath);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -147,7 +147,11 @@ GtkWidget *current_background,
*background_fill_color_press,
*background_border_color_press,
*background_border_width,
*background_corner_radius;
*background_corner_radius,
*background_border_sides_top,
*background_border_sides_bottom,
*background_border_sides_left,
*background_border_sides_right;
GtkWidget *addScrollBarToWidget(GtkWidget *widget);
@@ -503,7 +507,11 @@ void create_background(GtkWidget *parent)
GDK_TYPE_COLOR,
GTK_TYPE_INT,
GDK_TYPE_COLOR,
GTK_TYPE_INT);
GTK_TYPE_INT,
GTK_TYPE_BOOL,
GTK_TYPE_BOOL,
GTK_TYPE_BOOL,
GTK_TYPE_BOOL);
GtkWidget *table, *label, *button;
int row, col;
@@ -659,6 +667,34 @@ void create_background(GtkWidget *parent)
col++;
gtk_tooltips_set_tip(tooltips, background_corner_radius, _("The corner radius of the current background"), NULL);
row++;
col = 2;
label = gtk_label_new(_("Border sides"));
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++;
background_border_sides_top = gtk_check_button_new_with_label(_("Top"));
gtk_widget_show(background_border_sides_top);
gtk_table_attach(GTK_TABLE(table), background_border_sides_top, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
background_border_sides_bottom = gtk_check_button_new_with_label(_("Bottom"));
gtk_widget_show(background_border_sides_bottom);
gtk_table_attach(GTK_TABLE(table), background_border_sides_bottom, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
background_border_sides_left = gtk_check_button_new_with_label(_("Left"));
gtk_widget_show(background_border_sides_left);
gtk_table_attach(GTK_TABLE(table), background_border_sides_left, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
background_border_sides_right = gtk_check_button_new_with_label(_("Right"));
gtk_widget_show(background_border_sides_right);
gtk_table_attach(GTK_TABLE(table), background_border_sides_right, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
g_signal_connect(G_OBJECT(current_background), "changed", G_CALLBACK(current_background_changed), NULL);
g_signal_connect(G_OBJECT(background_fill_color), "color-set", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_border_color), "color-set", G_CALLBACK(background_update), NULL);
@@ -668,6 +704,10 @@ void create_background(GtkWidget *parent)
g_signal_connect(G_OBJECT(background_border_color_press), "color-set", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_border_width), "value-changed", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_corner_radius), "value-changed", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_border_sides_top), "toggled", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_border_sides_bottom), "toggled", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_border_sides_left), "toggled", G_CALLBACK(background_update), NULL);
g_signal_connect(G_OBJECT(background_border_sides_right), "toggled", G_CALLBACK(background_update), NULL);
change_paragraph(parent);
}
@@ -702,6 +742,10 @@ void background_create_new()
{
int r = 0;
int b = 0;
gboolean sideTop = TRUE;
gboolean sideBottom = TRUE;
gboolean sideLeft = TRUE;
gboolean sideRight = TRUE;
GdkColor fillColor;
cairoColor2GdkColor(0, 0, 0, &fillColor);
int fillOpacity = 0;
@@ -735,6 +779,7 @@ void background_create_new()
bgColBorderOpacity, borderOpacity,
bgColBorderWidth, b,
bgColCornerRadius, r,
bgColText, "",
bgColFillColorOver, &fillColorOver,
bgColFillOpacityOver, fillOpacityOver,
bgColBorderColorOver, &borderColorOver,
@@ -743,7 +788,10 @@ void background_create_new()
bgColFillOpacityPress, fillOpacityPress,
bgColBorderColorPress, &borderColorPress,
bgColBorderOpacityPress, borderOpacityPress,
bgColText, "",
bgColBorderSidesTop, sideTop,
bgColBorderSidesBottom, sideBottom,
bgColBorderSidesLeft, sideLeft,
bgColBorderSidesRight, sideRight,
-1);
background_update_image(index);
@@ -768,6 +816,10 @@ void background_duplicate(GtkWidget *widget, gpointer data)
int r;
int b;
gboolean sideTop;
gboolean sideBottom;
gboolean sideLeft;
gboolean sideRight;
GdkColor *fillColor;
int fillOpacity;
GdkColor *borderColor;
@@ -796,6 +848,10 @@ void background_duplicate(GtkWidget *widget, gpointer data)
bgColBorderOpacityPress, &borderOpacityPress,
bgColBorderWidth, &b,
bgColCornerRadius, &r,
bgColBorderSidesTop, &sideTop,
bgColBorderSidesBottom, &sideBottom,
bgColBorderSidesLeft, &sideLeft,
bgColBorderSidesRight, &sideRight,
-1);
gtk_list_store_append(backgrounds, &iter);
@@ -805,6 +861,7 @@ void background_duplicate(GtkWidget *widget, gpointer data)
bgColFillOpacity, fillOpacity,
bgColBorderColor, borderColor,
bgColBorderOpacity, borderOpacity,
bgColText, "",
bgColFillColorOver, fillColorOver,
bgColFillOpacityOver, fillOpacityOver,
bgColBorderColorOver, borderColorOver,
@@ -815,7 +872,10 @@ void background_duplicate(GtkWidget *widget, gpointer data)
bgColBorderOpacityPress, borderOpacityPress,
bgColBorderWidth, b,
bgColCornerRadius, r,
bgColText, ""
bgColBorderSidesTop, sideTop,
bgColBorderSidesBottom, sideBottom,
bgColBorderSidesLeft, sideLeft,
bgColBorderSidesRight, sideRight,
-1);
g_boxed_free(GDK_TYPE_COLOR, fillColor);
g_boxed_free(GDK_TYPE_COLOR, borderColor);
@@ -930,8 +990,11 @@ void background_force_update()
background_update(NULL, NULL);
}
static gboolean background_updates_disabled = FALSE;
void background_update(GtkWidget *widget, gpointer data)
{
if (background_updates_disabled)
return;
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_background));
if (index < 0)
return;
@@ -945,9 +1008,15 @@ void background_update(GtkWidget *widget, gpointer data)
int r;
int b;
r = gtk_spin_button_get_value(GTK_SPIN_BUTTON(background_corner_radius));
b = gtk_spin_button_get_value(GTK_SPIN_BUTTON(background_border_width));
gboolean sideTop = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(background_border_sides_top));
gboolean sideBottom = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(background_border_sides_bottom));
gboolean sideLeft = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(background_border_sides_left));
gboolean sideRight = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(background_border_sides_right));
GdkColor fillColor;
int fillOpacity;
GdkColor borderColor;
@@ -991,6 +1060,10 @@ void background_update(GtkWidget *widget, gpointer data)
bgColBorderOpacityPress, borderOpacityPress,
bgColBorderWidth, b,
bgColCornerRadius, r,
bgColBorderSidesTop, sideTop,
bgColBorderSidesBottom, sideBottom,
bgColBorderSidesLeft, sideLeft,
bgColBorderSidesRight, sideRight,
-1);
background_update_image(index);
}
@@ -1001,6 +1074,8 @@ void current_background_changed(GtkWidget *widget, gpointer data)
if (index < 0)
return;
background_updates_disabled = TRUE;
GtkTreePath *path;
GtkTreeIter iter;
@@ -1010,6 +1085,12 @@ void current_background_changed(GtkWidget *widget, gpointer data)
int r;
int b;
gboolean sideTop;
gboolean sideBottom;
gboolean sideLeft;
gboolean sideRight;
GdkColor *fillColor;
int fillOpacity;
GdkColor *borderColor;
@@ -1039,8 +1120,17 @@ void current_background_changed(GtkWidget *widget, gpointer data)
bgColBorderOpacityPress, &borderOpacityPress,
bgColBorderWidth, &b,
bgColCornerRadius, &r,
bgColBorderSidesTop, &sideTop,
bgColBorderSidesBottom, &sideBottom,
bgColBorderSidesLeft, &sideLeft,
bgColBorderSidesRight, &sideRight,
-1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_top), sideTop);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_bottom), sideBottom);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_left), sideLeft);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_right), sideRight);
gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color), fillColor);
gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color), (fillOpacity*0xffff)/100);
gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color), borderColor);
@@ -1065,6 +1155,9 @@ void current_background_changed(GtkWidget *widget, gpointer data)
g_boxed_free(GDK_TYPE_COLOR, borderColorOver);
g_boxed_free(GDK_TYPE_COLOR, fillColorPress);
g_boxed_free(GDK_TYPE_COLOR, borderColorPress);
background_updates_disabled = FALSE;
background_update_image(index);
}
void create_panel(GtkWidget *parent)
@@ -2080,9 +2173,9 @@ void launcher_add_app(GtkWidget *widget, gpointer data)
gtk_list_store_append(launcher_apps, &iter);
gtk_list_store_set(launcher_apps, &iter,
appsColIcon, pixbuf,
appsColIconName, g_strdup(iconName),
appsColText, g_strdup(name),
appsColPath, g_strdup(path),
appsColIconName, g_strdup(iconName),
-1);
if (pixbuf)
g_object_unref(pixbuf);
@@ -2324,9 +2417,9 @@ void load_desktop_file(const char *file, gboolean selected)
gtk_list_store_insert(store, &iter, index);
gtk_list_store_set(store, &iter,
appsColIcon, pixbuf,
appsColIconName, g_strdup(entry.icon),
appsColText, g_strdup(entry.name),
appsColPath, g_strdup(file),
appsColIconName, g_strdup(entry.icon),
-1);
if (pixbuf)
g_object_unref(pixbuf);
@@ -2337,9 +2430,9 @@ void load_desktop_file(const char *file, gboolean selected)
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
appsColIcon, pixbuf,
appsColIconName, g_strdup(""),
appsColText, g_strdup(file),
appsColPath, g_strdup(file),
appsColIconName, g_strdup(""),
-1);
if (pixbuf)
g_object_unref(pixbuf);
@@ -2359,9 +2452,9 @@ void populate_from_entries(GList *entries, gboolean selected)
gtk_list_store_append(selected ? launcher_apps : all_apps, &iter);
gtk_list_store_set(selected ? launcher_apps :all_apps, &iter,
appsColIcon, pixbuf,
appsColIconName, g_strdup(entry->icon),
appsColText, g_strdup(entry->name),
appsColPath, g_strdup(entry->path),
appsColIconName, g_strdup(entry->icon),
-1);
if (pixbuf)
g_object_unref(pixbuf);
@@ -3410,7 +3503,7 @@ void create_task(GtkWidget *parent)
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Close"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Toggle"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Iconify"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("sShade"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Shade"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Toggle or iconify"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Maximize or restore"));
gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Desktop left"));
@@ -5289,7 +5382,7 @@ void create_tooltip(GtkWidget *parent)
col++;
change_paragraph(parent);
label = gtk_label_new(_("<b>Appearance</b>"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);

View File

@@ -179,6 +179,10 @@ enum {
bgColFillOpacityPress,
bgColBorderColorPress,
bgColBorderOpacityPress,
bgColBorderSidesTop,
bgColBorderSidesBottom,
bgColBorderSidesLeft,
bgColBorderSidesRight,
bgNumCols
};
@@ -191,6 +195,10 @@ extern GtkWidget *current_background,
*background_fill_color_press,
*background_border_color_press,
*background_border_width,
*background_border_sides_top,
*background_border_sides_bottom,
*background_border_sides_left,
*background_border_sides_right,
*background_corner_radius;
void background_create_new();

View File

@@ -115,6 +115,10 @@ void config_write_backgrounds(FILE *fp)
int r;
int b;
gboolean sideTop;
gboolean sideBottom;
gboolean sideLeft;
gboolean sideRight;
GdkColor *fillColor;
int fillOpacity;
GdkColor *borderColor;
@@ -145,10 +149,27 @@ void config_write_backgrounds(FILE *fp)
bgColBorderWidth, &b,
bgColCornerRadius, &r,
bgColText, &text,
bgColBorderSidesTop, &sideTop,
bgColBorderSidesBottom, &sideBottom,
bgColBorderSidesLeft, &sideLeft,
bgColBorderSidesRight, &sideRight,
-1);
fprintf(fp, "# Background %d: %s\n", index, text ? text : "");
fprintf(fp, "rounded = %d\n", r);
fprintf(fp, "border_width = %d\n", b);
char sides[10];
sides[0] = '\0';
if (sideTop)
strcat(sides, "T");
if (sideBottom)
strcat(sides, "B");
if (sideLeft)
strcat(sides, "L");
if (sideRight)
strcat(sides, "R");
fprintf(fp, "border_sides = %s\n", sides);
config_write_color(fp, "background_color", *fillColor, fillOpacity);
config_write_color(fp, "border_color", *borderColor, borderOpacity);
config_write_color(fp, "background_color_hover", *fillColorOver, fillOpacityOver);
@@ -922,7 +943,17 @@ void add_entry(char *key, char *value)
background_force_update();
read_border_color_press = 1;
}
else if (strcmp(key, "border_sides") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_top),
strchr(value, 't') || strchr(value, 'T'));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_bottom),
strchr(value, 'b') || strchr(value, 'B'));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_left),
strchr(value, 'l') || strchr(value, 'L'));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(background_border_sides_right),
strchr(value, 'r') || strchr(value, 'R'));
background_force_update();
}
/* Panel */
else if (strcmp(key, "panel_size") == 0) {
extract_values(value, &value1, &value2, &value3);
@@ -1086,7 +1117,7 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "primary_monitor_first") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_primary_monitor_first), atoi(value));
}
/* autohide options */
else if (strcmp(key, "autohide") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_autohide), atoi(value));

View File

@@ -160,8 +160,8 @@ void tooltip_update_geometry()
pango_layout_set_text(layout, g_tooltip.tooltip_text, -1);
pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
pango_layout_get_pixel_extents(layout, &r1, &r2);
width = 2 * g_tooltip.bg->border.width + 2 * g_tooltip.paddingx + r2.width;
height = 2 * g_tooltip.bg->border.width + 2 * g_tooltip.paddingy + r2.height;
width = left_right_bg_border_width(g_tooltip.bg) + 2 * g_tooltip.paddingx + r2.width;
height = top_bottom_bg_border_width(g_tooltip.bg) + 2 * g_tooltip.paddingy + r2.height;
if (panel_horizontal && panel_position & BOTTOM)
y = panel->posy - height;
@@ -275,8 +275,8 @@ void tooltip_update()
// I do not know why this is the right way, but with the below cairo_move_to it seems to be centered (horiz. and
// vert.)
cairo_move_to(c,
-r1.x / 2 + g_tooltip.bg->border.width + g_tooltip.paddingx,
-r1.y / 2 + 1 + g_tooltip.bg->border.width + g_tooltip.paddingy);
-r1.x / 2 + left_bg_border_width(g_tooltip.bg) + g_tooltip.paddingx,
-r1.y / 2 + 1 + top_bg_border_width(g_tooltip.bg) + g_tooltip.paddingy);
pango_cairo_show_layout(c, layout);
g_object_unref(layout);

View File

@@ -36,6 +36,7 @@ Area *mouse_over_area = NULL;
void init_background(Background *bg)
{
memset(bg, 0, sizeof(Background));
bg->border.mask = BORDER_TOP | BORDER_BOTTOM | BORDER_LEFT | BORDER_RIGHT;
}
void initialize_positions(void *obj, int offset)
@@ -44,14 +45,14 @@ void initialize_positions(void *obj, int offset)
for (GList *l = a->children; l; l = l->next) {
Area *child = ((Area *)l->data);
if (panel_horizontal) {
child->posy = offset + a->bg->border.width + a->paddingy;
child->height = a->height - (2 * (a->bg->border.width + a->paddingy));
child->posy = offset + top_border_width(a) + a->paddingy;
child->height = a->height - 2 * a->paddingy - top_bottom_border_width(a);
if (child->_on_change_layout)
child->_on_change_layout(child);
initialize_positions(child, child->posy);
} else {
child->posx = offset + a->bg->border.width + a->paddingy;
child->width = a->width - (2 * (a->bg->border.width + a->paddingy));
child->posx = offset + left_border_width(a) + a->paddingy;
child->width = a->width - 2 * a->paddingy - left_right_border_width(a);
if (child->_on_change_layout)
child->_on_change_layout(child);
initialize_positions(child, child->posx);
@@ -107,7 +108,8 @@ void relayout_dynamic(Area *a, int level)
// Layout children
if (a->children) {
if (a->alignment == ALIGN_LEFT) {
int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr;
int pos =
(panel_horizontal ? a->posx + left_border_width(a) : a->posy + top_border_width(a)) + a->paddingxlr;
for (GList *l = a->children; l; l = l->next) {
Area *child = ((Area *)l->data);
@@ -133,8 +135,9 @@ void relayout_dynamic(Area *a, int level)
pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx;
}
} else if (a->alignment == ALIGN_RIGHT) {
int pos =
(panel_horizontal ? a->posx + a->width : a->posy + a->height) - a->bg->border.width - a->paddingxlr;
int pos = (panel_horizontal ? a->posx + a->width - right_border_width(a)
: a->posy + a->height - bottom_border_width(a)) -
a->paddingxlr;
for (GList *l = g_list_last(a->children); l; l = l->prev) {
Area *child = ((Area *)l->data);
@@ -174,7 +177,8 @@ void relayout_dynamic(Area *a, int level)
children_size += (l == a->children) ? 0 : a->paddingx;
}
int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr;
int pos =
(panel_horizontal ? a->posx + left_border_width(a) : a->posy + top_border_width(a)) + a->paddingxlr;
pos += ((panel_horizontal ? a->width : a->height) - children_size) / 2;
for (GList *l = a->children; l; l = l->next) {
@@ -229,15 +233,15 @@ void draw_tree(Area *a)
if (a->pix)
XCopyArea(server.display,
a->pix,
((Panel *)a->panel)->temp_pmap,
server.gc,
0,
0,
a->width,
a->height,
a->posx,
a->posy);
a->pix,
((Panel *)a->panel)->temp_pmap,
server.gc,
0,
0,
a->width,
a->height,
a->posx,
a->posy);
for (GList *l = a->children; l; l = l->next)
draw_tree((Area *)l->data);
@@ -250,7 +254,7 @@ int relayout_with_constraint(Area *a, int maximum_size)
if (panel_horizontal) {
// detect free size for LAYOUT_DYNAMIC Areas
int size = a->width - (2 * (a->paddingxlr + a->bg->border.width));
int size = a->width - 2 * a->paddingxlr - left_right_border_width(a);
for (GList *l = a->children; l; l = l->next) {
Area *child = (Area *)l->data;
if (child->on_screen && child->size_mode == LAYOUT_FIXED) {
@@ -290,7 +294,7 @@ int relayout_with_constraint(Area *a, int maximum_size)
}
} else {
// detect free size for LAYOUT_DYNAMIC's Area
int size = a->height - (2 * (a->paddingxlr + a->bg->border.width));
int size = a->height - 2 * a->paddingxlr - top_bottom_border_width(a);
for (GList *l = a->children; l; l = l->next) {
Area *child = (Area *)l->data;
if (child->on_screen && child->size_mode == LAYOUT_FIXED) {
@@ -407,15 +411,15 @@ void draw(Area *a)
if (server.real_transparency)
clear_pixmap(a->pix, 0, 0, a->width, a->height);
XCopyArea(server.display,
((Panel *)a->panel)->temp_pmap,
a->pix,
server.gc,
a->posx,
a->posy,
a->width,
a->height,
0,
0);
((Panel *)a->panel)->temp_pmap,
a->pix,
server.gc,
a->posx,
a->posy,
a->width,
a->height,
0,
0);
} else {
a->_clear(a);
}
@@ -435,31 +439,33 @@ void draw(Area *a)
void draw_background(Area *a, cairo_t *c)
{
if (a->bg->fill_color.alpha > 0.0 ||
(panel_config.mouse_effects && (a->has_mouse_over_effect || a->has_mouse_press_effect))) {
(panel_config.mouse_effects && (a->has_mouse_over_effect || a->has_mouse_press_effect))) {
if (a->mouse_state == MOUSE_OVER)
cairo_set_source_rgba(c,
a->bg->fill_color_hover.rgb[0],
a->bg->fill_color_hover.rgb[1],
a->bg->fill_color_hover.rgb[2],
a->bg->fill_color_hover.alpha);
a->bg->fill_color_hover.rgb[0],
a->bg->fill_color_hover.rgb[1],
a->bg->fill_color_hover.rgb[2],
a->bg->fill_color_hover.alpha);
else if (a->mouse_state == MOUSE_DOWN)
cairo_set_source_rgba(c,
a->bg->fill_color_pressed.rgb[0],
a->bg->fill_color_pressed.rgb[1],
a->bg->fill_color_pressed.rgb[2],
a->bg->fill_color_pressed.alpha);
a->bg->fill_color_pressed.rgb[0],
a->bg->fill_color_pressed.rgb[1],
a->bg->fill_color_pressed.rgb[2],
a->bg->fill_color_pressed.alpha);
else
cairo_set_source_rgba(c,
a->bg->fill_color.rgb[0],
a->bg->fill_color.rgb[1],
a->bg->fill_color.rgb[2],
a->bg->fill_color.alpha);
a->bg->fill_color.rgb[0],
a->bg->fill_color.rgb[1],
a->bg->fill_color.rgb[2],
a->bg->fill_color.alpha);
// Not sure about this
draw_rect(c,
a->bg->border.width,
a->bg->border.width,
a->width - (2.0 * a->bg->border.width),
a->height - (2.0 * a->bg->border.width),
a->bg->border.radius - a->bg->border.width / 1.571);
left_border_width(a),
top_border_width(a),
a->width - left_right_border_width(a),
a->height - top_bottom_border_width(a),
a->bg->border.radius - a->bg->border.width / 1.571);
cairo_fill(c);
}
@@ -469,28 +475,29 @@ void draw_background(Area *a, cairo_t *c)
// draw border inside (x, y, width, height)
if (a->mouse_state == MOUSE_OVER)
cairo_set_source_rgba(c,
a->bg->border_color_hover.rgb[0],
a->bg->border_color_hover.rgb[1],
a->bg->border_color_hover.rgb[2],
a->bg->border_color_hover.alpha);
a->bg->border_color_hover.rgb[0],
a->bg->border_color_hover.rgb[1],
a->bg->border_color_hover.rgb[2],
a->bg->border_color_hover.alpha);
else if (a->mouse_state == MOUSE_DOWN)
cairo_set_source_rgba(c,
a->bg->border_color_pressed.rgb[0],
a->bg->border_color_pressed.rgb[1],
a->bg->border_color_pressed.rgb[2],
a->bg->border_color_pressed.alpha);
a->bg->border_color_pressed.rgb[0],
a->bg->border_color_pressed.rgb[1],
a->bg->border_color_pressed.rgb[2],
a->bg->border_color_pressed.alpha);
else
cairo_set_source_rgba(c,
a->bg->border.color.rgb[0],
a->bg->border.color.rgb[1],
a->bg->border.color.rgb[2],
a->bg->border.color.alpha);
draw_rect(c,
a->bg->border.width / 2.0,
a->bg->border.width / 2.0,
a->width - a->bg->border.width,
a->height - a->bg->border.width,
a->bg->border.radius);
a->bg->border.color.rgb[0],
a->bg->border.color.rgb[1],
a->bg->border.color.rgb[2],
a->bg->border.color.alpha);
draw_rect_on_sides(c,
left_border_width(a) / 2.,
top_border_width(a) / 2.,
a->width - left_right_border_width(a) / 2.,
a->height - top_bottom_border_width(a) / 2.,
a->bg->border.radius,
a->bg->border.mask);
cairo_stroke(c);
}
@@ -565,7 +572,7 @@ void mouse_over(Area *area, int pressed)
new_state = area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL;
} else {
new_state =
area->has_mouse_press_effect ? MOUSE_DOWN : area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL;
area->has_mouse_press_effect ? MOUSE_DOWN : area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL;
}
}
@@ -578,7 +585,7 @@ void mouse_over(Area *area, int pressed)
mouse_over_area->mouse_state = new_state;
mouse_over_area->pix =
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
if (!mouse_over_area->pix)
mouse_over_area->_redraw_needed = TRUE;
panel_refresh = TRUE;
@@ -590,7 +597,7 @@ void mouse_out()
return;
mouse_over_area->mouse_state = MOUSE_NORMAL;
mouse_over_area->pix =
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
if (!mouse_over_area->pix)
mouse_over_area->_redraw_needed = TRUE;
panel_refresh = TRUE;
@@ -701,3 +708,109 @@ Area *find_area_under_mouse(void *root, int x, int y)
} while (new_result != result);
return result;
}
int left_border_width(Area *a)
{
return left_bg_border_width(a->bg);
}
int right_border_width(Area *a)
{
return right_bg_border_width(a->bg);
}
int top_border_width(Area *a)
{
return top_bg_border_width(a->bg);
}
int bottom_border_width(Area *a)
{
return bottom_bg_border_width(a->bg);
}
int left_right_border_width(Area *a)
{
return left_right_bg_border_width(a->bg);
}
int top_bottom_border_width(Area *a)
{
return top_bottom_bg_border_width(a->bg);
}
int bg_border_width(Background *bg, int mask)
{
return bg->border.mask & mask ? bg->border.width : 0;
}
int left_bg_border_width(Background *bg)
{
return bg_border_width(bg, BORDER_LEFT);
}
int top_bg_border_width(Background *bg)
{
return bg_border_width(bg, BORDER_TOP);
}
int right_bg_border_width(Background *bg)
{
return bg_border_width(bg, BORDER_RIGHT);
}
int bottom_bg_border_width(Background *bg)
{
return bg_border_width(bg, BORDER_BOTTOM);
}
int left_right_bg_border_width(Background *bg)
{
return left_bg_border_width(bg) + right_bg_border_width(bg);
}
int top_bottom_bg_border_width(Background *bg)
{
return top_bg_border_width(bg) + bottom_bg_border_width(bg);
}
void area_dump_geometry(Area *area, int indent)
{
fprintf(stderr, "%*s%s:\n", indent, "", area->name);
indent += 2;
if (!area->on_screen) {
fprintf(stderr, "%*shidden\n", indent, "");
return;
}
fprintf(stderr,
"%*sBox: x = %d, y = %d, w = %d, h = %d\n",
indent,
"",
area->posx,
area->posy,
area->width,
area->height);
fprintf(stderr,
"%*sBorder: left = %d, right = %d, top = %d, bottom = %d\n",
indent,
"",
left_border_width(area),
right_border_width(area),
top_border_width(area),
bottom_border_width(area));
fprintf(stderr,
"%*sPadding: left = right = %d, top = bottom = %d, spacing = %d\n",
indent,
"",
area->paddingxlr,
area->paddingy,
area->paddingx);
if (area->_dump_geometry)
area->_dump_geometry(area, indent);
if (area->children) {
fprintf(stderr, "%*sChildren:\n", indent, "");
indent += 2;
for (GList *l = area->children; l; l = l->next)
area_dump_geometry((Area *)l->data, indent);
}
}

View File

@@ -124,6 +124,15 @@ typedef struct Color {
double alpha;
} Color;
typedef enum BorderMask {
BORDER_TOP = 1 << 0,
BORDER_BOTTOM = 1 << 1,
BORDER_LEFT = 1 << 2,
BORDER_RIGHT = 1 << 3
} BorderMask;
#define BORDER_ALL (BORDER_TOP | BORDER_BOTTOM | BORDER_LEFT | BORDER_RIGHT)
typedef struct Border {
// It's essential that the first member is color
Color color;
@@ -131,6 +140,8 @@ typedef struct Border {
int width;
// Corner radius
int radius;
// Mask: bitwise OR of BorderMask
int mask;
} Border;
typedef struct Background {
@@ -219,6 +230,9 @@ typedef struct Area {
// Returns true if the Area handles a mouse event at the given x, y coordinates relative to the window.
// Leave this to NULL to use a default implementation.
gboolean (*_is_under_mouse)(void *obj, int x, int y);
// Prints the geometry of the object on stderr, with left indentation of indent spaces.
void (*_dump_geometry)(void *obj, int indent);
} Area;
// Initializes the Background member to default values.
@@ -239,6 +253,20 @@ void relayout(Area *a);
// If maximum_size > 0, it is an upper limit for the child size.
int relayout_with_constraint(Area *a, int maximum_size);
int left_border_width(Area *a);
int right_border_width(Area *a);
int left_right_border_width(Area *a);
int top_border_width(Area *a);
int bottom_border_width(Area *a);
int top_bottom_border_width(Area *a);
int left_bg_border_width(Background *bg);
int right_bg_border_width(Background *bg);
int top_bg_border_width(Background *bg);
int bottom_bg_border_width(Background *bg);
int left_right_bg_border_width(Background *bg);
int top_bottom_bg_border_width(Background *bg);
// Rendering
// Sets the redraw_needed flag on the area and its descendants
@@ -281,6 +309,8 @@ gboolean area_is_under_mouse(void *obj, int x, int y);
// they are outside the drawing area of the button.
gboolean full_width_area_is_under_mouse(void *obj, int x, int y);
void area_dump_geometry(Area *area, int indent);
void mouse_over(Area *area, int pressed);
void mouse_out();

View File

@@ -86,6 +86,8 @@ void load_cache(Cache *cache, const gchar *cache_path)
if (parse_line(line, &key, &value)) {
g_hash_table_insert(cache->_table, g_strdup(key), g_strdup(value));
free(key);
free(value);
}
}
free(line);

View File

@@ -73,15 +73,15 @@ void copy_file(const char *path_src, const char *path_dest)
fclose(file_src);
}
int parse_line(const char *line, char **key, char **value)
gboolean parse_line(const char *line, char **key, char **value)
{
char *a, *b;
/* Skip useless lines */
if ((line[0] == '#') || (line[0] == '\n'))
return 0;
return FALSE;
if (!(a = strchr(line, '=')))
return 0;
return FALSE;
/* overwrite '=' with '\0' */
a[0] = '\0';
@@ -96,7 +96,7 @@ int parse_line(const char *line, char **key, char **value)
g_strstrip(*key);
g_strstrip(*value);
return 1;
return TRUE;
}
void tint_exec(const char *command)
@@ -508,20 +508,61 @@ Imlib_Image adjust_icon(Imlib_Image original, int alpha, int saturation, int bri
void draw_rect(cairo_t *c, double x, double y, double w, double h, double r)
{
if (r > 0.0) {
double c1 = 0.55228475 * r;
draw_rect_on_sides(c, x, y, w, h, r, BORDER_ALL);
}
cairo_move_to(c, x + r, y);
void draw_rect_on_sides(cairo_t *c, double x, double y, double w, double h, double r, int border_mask)
{
double c1 = 0.55228475 * r;
cairo_move_to(c, x + r, y);
// Top line
if (border_mask & BORDER_TOP)
cairo_rel_line_to(c, w - 2 * r, 0);
cairo_rel_curve_to(c, c1, 0.0, r, c1, r, r);
else
cairo_rel_move_to(c, w - 2 * r, y);
// Top right corner
if (r > 0) {
if ((border_mask & BORDER_TOP) && (border_mask & BORDER_RIGHT))
cairo_rel_curve_to(c, c1, 0.0, r, c1, r, r);
else
cairo_rel_move_to(c, r, r);
}
// Right line
if (border_mask & BORDER_RIGHT)
cairo_rel_line_to(c, 0, h - 2 * r);
cairo_rel_curve_to(c, 0.0, c1, c1 - r, r, -r, r);
else
cairo_rel_move_to(c, 0, h - 2 * r);
// Bottom right corner
if (r > 0) {
if ((border_mask & BORDER_RIGHT) && (border_mask & BORDER_BOTTOM))
cairo_rel_curve_to(c, 0.0, c1, c1 - r, r, -r, r);
else
cairo_rel_move_to(c, -r, r);
}
// Bottom line
if (border_mask & BORDER_BOTTOM)
cairo_rel_line_to(c, -w + 2 * r, 0);
cairo_rel_curve_to(c, -c1, 0, -r, -c1, -r, -r);
else
cairo_rel_move_to(c, -w + 2 * r, 0);
// Bottom left corner
if (r > 0) {
if ((border_mask & BORDER_LEFT) && (border_mask & BORDER_BOTTOM))
cairo_rel_curve_to(c, -c1, 0, -r, -c1, -r, -r);
else
cairo_rel_move_to(c, -r, -r);
}
// Left line
if (border_mask & BORDER_LEFT)
cairo_rel_line_to(c, 0, -h + 2 * r);
cairo_rel_curve_to(c, 0, -c1, r - c1, -r, r, -r);
} else
cairo_rectangle(c, x, y, w, h);
else
cairo_rel_move_to(c, 0, -h + 2 * r);
// Top left corner
if (r > 0) {
if ((border_mask & BORDER_LEFT) && (border_mask & BORDER_TOP))
cairo_rel_curve_to(c, 0, -c1, r - c1, -r, r, -r);
else
cairo_rel_move_to(c, r, -r);
}
}
void clear_pixmap(Pixmap p, int x, int y, int w, int h)
@@ -632,3 +673,13 @@ GSList *slist_remove_duplicates(GSList *list, GCompareFunc eq, GDestroyNotify fr
return new_list;
}
gint cmp_ptr(gconstpointer a, gconstpointer b)
{
if (a < b)
return -1;
else if (a == b)
return 0;
else
return 1;
}

View File

@@ -48,7 +48,7 @@ void copy_file(const char *path_src, const char *path_dest);
// Strips key and value.
// Values may contain spaces and the equal sign.
// Returns 1 if both key and value could be read, zero otherwise.
int parse_line(const char *line, char **key, char **value);
gboolean parse_line(const char *line, char **key, char **value);
void extract_values(const char *value, char **value1, char **value2, char **value3);
@@ -108,6 +108,7 @@ void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color
// Draws a rounded rectangle
void draw_rect(cairo_t *c, double x, double y, double w, double h, double r);
void draw_rect_on_sides(cairo_t *c, double x, double y, double w, double h, double r, int border_mask);
// Clears the pixmap (with transparent color)
void clear_pixmap(Pixmap p, int x, int y, int w, int h);
@@ -119,6 +120,9 @@ GSList *load_locations_from_env(GSList *locations, const char *var, ...);
GSList *slist_remove_duplicates(GSList *list, GCompareFunc eq, GDestroyNotify fr);
// A trivial pointer comparator.
gint cmp_ptr(gconstpointer a, gconstpointer b);
#define free_and_null(p) \
{ \
free(p); \

View File

@@ -1,4 +1,4 @@
#---- Generated by tint2conf bd50 ----
#---- Generated by tint2conf 2e3c ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for
# full documentation of the configuration options.
#-------------------------------------
@@ -67,11 +67,11 @@ border_color_pressed = #555555 100
rounded = 2
border_width = 1
background_color = #222222 100
border_color = #777777 100
border_color = #777777 30
background_color_hover = #222222 100
border_color_hover = #777777 100
border_color_hover = #777777 30
background_color_pressed = #222222 100
border_color_pressed = #777777 100
border_color_pressed = #777777 30
#-------------------------------------
# Panel
@@ -85,6 +85,7 @@ panel_dock = 0
panel_position = bottom center horizontal
panel_layer = normal
panel_monitor = all
primary_monitor_first = 0
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
@@ -106,6 +107,7 @@ taskbar_active_background_id = 0
taskbar_name = 1
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_always_show_all_desktop_tasks = 0
taskbar_name_padding = 6 3
taskbar_name_background_id = 6
taskbar_name_active_background_id = 7

View File

@@ -1,4 +1,4 @@
#---- Generated by tint2conf 5b63 ----
#---- Generated by tint2conf 2c73 ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for
# full documentation of the configuration options.
#-------------------------------------
@@ -57,11 +57,11 @@ border_color_pressed = #999999 100
rounded = 2
border_width = 1
background_color = #eeeeee 4
border_color = #cccccc 100
border_color = #cccccc 30
background_color_hover = #eeeeee 22
border_color_hover = #999999 100
border_color_hover = #999999 30
background_color_pressed = #dddddd 4
border_color_pressed = #999999 100
border_color_pressed = #999999 30
# Background 7: Active desktop name
rounded = 2
@@ -85,6 +85,7 @@ panel_dock = 0
panel_position = bottom center horizontal
panel_layer = normal
panel_monitor = all
primary_monitor_first = 0
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
@@ -106,6 +107,7 @@ taskbar_active_background_id = 0
taskbar_name = 1
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_always_show_all_desktop_tasks = 0
taskbar_name_padding = 6 3
taskbar_name_background_id = 6
taskbar_name_active_background_id = 7

View File

@@ -1,4 +1,4 @@
#---- Generated by tint2conf 812e ----
#---- Generated by tint2conf ac71 ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for
# full documentation of the configuration options.
#-------------------------------------
@@ -57,11 +57,11 @@ border_color_pressed = #999999 100
rounded = 2
border_width = 1
background_color = #eeeeee 4
border_color = #999999 100
border_color = #999999 30
background_color_hover = #eeeeee 22
border_color_hover = #999999 100
border_color_hover = #999999 30
background_color_pressed = #dddddd 4
border_color_pressed = #999999 100
border_color_pressed = #999999 30
# Background 7: Active desktop name
rounded = 2
@@ -85,6 +85,7 @@ panel_dock = 0
panel_position = bottom left vertical
panel_layer = normal
panel_monitor = all
primary_monitor_first = 0
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
@@ -106,6 +107,7 @@ taskbar_active_background_id = 0
taskbar_name = 1
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_always_show_all_desktop_tasks = 0
taskbar_name_padding = 6 3
taskbar_name_background_id = 6
taskbar_name_active_background_id = 7

View File

@@ -207,3 +207,4 @@ themes/vertical-dark-transparent.tint2rc
themes/vertical-light-opaque.tint2rc
themes/vertical-light-transparent.tint2rc
themes/vertical-neutral-icons.tint2rc
doc/tint2.md

View File

@@ -22,3 +22,4 @@ src/tint2conf/po
src/freespace
src/execplugin
themes
doc