Compare commits
149 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9d6ec9f23 | ||
|
|
46d7c79359 | ||
|
|
d3f16e00b5 | ||
|
|
d95a5a02cf | ||
|
|
22cb7d6d7f | ||
|
|
fc56e48781 | ||
|
|
95a9e8a82e | ||
|
|
717f4ac30a | ||
|
|
ee9207e84a | ||
|
|
9cbcca04df | ||
|
|
a5528a4bc1 | ||
|
|
e284e7c74a | ||
|
|
7a419df211 | ||
|
|
2edf6aaeba | ||
|
|
ce15c53c04 | ||
|
|
231a97a631 | ||
|
|
ed802d7602 | ||
|
|
77d2a74865 | ||
|
|
a5374cbc4a | ||
|
|
428cbc69e3 | ||
|
|
4538617d96 | ||
|
|
dc008ae89d | ||
|
|
3615571e39 | ||
|
|
ed3fcd63fc | ||
|
|
d49dac2e05 | ||
|
|
754a697099 | ||
|
|
285afd22ad | ||
|
|
50c2f72a66 | ||
|
|
42d95f2930 | ||
|
|
78bc215677 | ||
|
|
78bc8b5c74 | ||
|
|
5a5d8fd978 | ||
|
|
e09c4a0642 | ||
|
|
c1eb404095 | ||
|
|
7b3769da2a | ||
|
|
cc49e4026e | ||
|
|
385f4fd25b | ||
|
|
6c00321262 | ||
|
|
aa77f05a98 | ||
|
|
ccd590e397 | ||
|
|
4ee1e8f2fa | ||
|
|
690f30308f | ||
|
|
fea91746a4 | ||
|
|
9d8350dabc | ||
|
|
a6879ea2a5 | ||
|
|
d2b32d528f | ||
|
|
ad675495e6 | ||
|
|
48e7e38b11 | ||
|
|
dc191668fe | ||
|
|
955be3658b | ||
|
|
dcc163ec0b | ||
|
|
14716d41b9 | ||
|
|
9018313fb2 | ||
|
|
92b391a1b2 | ||
|
|
b023229600 | ||
|
|
82b71ec5b6 | ||
|
|
1edaf21bde | ||
|
|
76bd4baa9c | ||
|
|
0bd49f4227 | ||
|
|
580c3e765f | ||
|
|
7dc24b8ee6 | ||
|
|
6e6dff2ca3 | ||
|
|
3e03e81dbf | ||
|
|
9150a180fa | ||
|
|
7b6ce97940 | ||
|
|
d398795202 | ||
|
|
5f82ef4d3b | ||
|
|
d1b959818e | ||
|
|
219b24cbdb | ||
|
|
7b36910be7 | ||
|
|
4656f7fc94 | ||
|
|
1dcf9c676d | ||
|
|
9768b326aa | ||
|
|
b608cd5960 | ||
|
|
fc7aa2d342 | ||
|
|
3000740213 | ||
|
|
c5c8786363 | ||
|
|
c8250e5200 | ||
|
|
5a08d028ce | ||
|
|
6c3ec392e8 | ||
|
|
e665efb3a0 | ||
|
|
d79b48e3f7 | ||
|
|
9af0f83c89 | ||
|
|
b62138beca | ||
|
|
0c54c36c71 | ||
|
|
9b6d68f966 | ||
|
|
d36d2a5e0b | ||
|
|
e13a03ff74 | ||
|
|
c66f9a0fd4 | ||
|
|
38ef80637f | ||
|
|
7f9ac5c584 | ||
|
|
856ac5d821 | ||
|
|
3811929a6e | ||
|
|
85a97a9cab | ||
|
|
f5236f1d21 | ||
|
|
b0f172a8e1 | ||
|
|
71abe9a7e1 | ||
|
|
b4677426a4 | ||
|
|
745108dc6d | ||
|
|
448feae732 | ||
|
|
3b5ecb631d | ||
|
|
50e6278327 | ||
|
|
4dfe411bf4 | ||
|
|
5a9dc31fbb | ||
|
|
734af1c025 | ||
|
|
1000cbf491 | ||
|
|
df241dfd89 | ||
|
|
a2f02194ee | ||
|
|
fcbc006e43 | ||
|
|
edbf9f4437 | ||
|
|
e8eae27029 | ||
|
|
c4d1614cc3 | ||
|
|
8f40060583 | ||
|
|
46e386a6f8 | ||
|
|
805693f67f | ||
|
|
08c13c10c8 | ||
|
|
f72a7b88ce | ||
|
|
5c54fcb55c | ||
|
|
2f95d31092 | ||
|
|
0a77293f7d | ||
|
|
b038b58015 | ||
|
|
2d57168905 | ||
|
|
1d28475a0c | ||
|
|
7c70ae365e | ||
|
|
6ce441ecf1 | ||
|
|
995a257b2c | ||
|
|
354f679d72 | ||
|
|
e103918050 | ||
|
|
f18345ede6 | ||
|
|
4ab996e796 | ||
|
|
0668e722b6 | ||
|
|
67057adeaf | ||
|
|
e4ced531ad | ||
|
|
7bdae24ddf | ||
|
|
107bfc85a3 | ||
|
|
85536065bc | ||
|
|
efd28f38d9 | ||
|
|
4b26a5ef8a | ||
|
|
b196bb1c00 | ||
|
|
402713d4b1 | ||
|
|
f0de284dd9 | ||
|
|
9d9d6aa302 | ||
|
|
117ffb2bfd | ||
|
|
a8e7f4137a | ||
|
|
27715a5dbb | ||
|
|
7d0b0b85bc | ||
|
|
ec7e9e18ad | ||
|
|
5966b198b6 | ||
|
|
8af45bf3e6 |
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
build
|
||||
*.user
|
||||
version.h
|
||||
|
||||
2
AUTHORS
@@ -22,6 +22,8 @@ Contributors:
|
||||
Xico Atelo : startup notifications
|
||||
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:
|
||||
|
||||
@@ -3,7 +3,7 @@ cmake_minimum_required( VERSION 2.6 )
|
||||
|
||||
option( ENABLE_BATTERY "Enable battery status plugin" ON )
|
||||
option( ENABLE_TINT2CONF "Enable tint2conf build, a GTK+2 theme configurator for tint2" ON )
|
||||
option( ENABLE_EXAMPLES "Install additional tin2rc examples" ON )
|
||||
option( ENABLE_EXTRA_THEMES "Install additional tint2 themes" ON )
|
||||
option( ENABLE_RSVG "Rsvg support (launcher only)" ON )
|
||||
option( ENABLE_SN "Startup notification support" ON )
|
||||
option( ENABLE_ASAN "Build tint2 with AddressSanitizer" OFF )
|
||||
@@ -85,7 +85,7 @@ include_directories( ${PROJECT_BINARY_DIR}
|
||||
src/launcher
|
||||
src/tooltip
|
||||
src/util
|
||||
src/execplugin
|
||||
src/execplugin
|
||||
src/freespace
|
||||
${X11_INCLUDE_DIRS}
|
||||
${PANGOCAIRO_INCLUDE_DIRS}
|
||||
@@ -112,12 +112,13 @@ set( SOURCES src/config.c
|
||||
src/taskbar/taskbar.c
|
||||
src/taskbar/taskbarname.c
|
||||
src/tooltip/tooltip.c
|
||||
src/execplugin/execplugin.c
|
||||
src/execplugin/execplugin.c
|
||||
src/freespace/freespace.c
|
||||
src/util/area.c
|
||||
src/util/common.c
|
||||
src/util/strnatcmp.c
|
||||
src/util/timer.c
|
||||
src/util/cache.c
|
||||
src/util/window.c )
|
||||
|
||||
if( ENABLE_BATTERY )
|
||||
@@ -241,11 +242,11 @@ install( TARGETS tint2 DESTINATION bin )
|
||||
install( FILES tint2.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps )
|
||||
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 sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
|
||||
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_EXAMPLES )
|
||||
file( GLOB SAMPLEFILES sample/*.tint2rc )
|
||||
install( FILES ${SAMPLEFILES} DESTINATION ${DATADIR}/tint2 )
|
||||
endif( ENABLE_EXAMPLES )
|
||||
if( ENABLE_EXTRA_THEMES )
|
||||
add_subdirectory(themes)
|
||||
endif( ENABLE_EXTRA_THEMES )
|
||||
|
||||
84
ChangeLog
@@ -1,3 +1,87 @@
|
||||
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)
|
||||
- Invalidate cached pixmaps on resize/move (issue #576)
|
||||
- Battery: do not show negative durations when the sensors return garbage
|
||||
- Proper workaround for issue #555
|
||||
|
||||
2016-04-02 0.12.9
|
||||
- Fixes:
|
||||
- Regression: Do not detect empty areas as clickable (issue #572)
|
||||
- Regression: Position and resize task icon correctly (issue #575)
|
||||
- Use imlib2 for taking screenshot; if it fails, use Xlib (issue #574)
|
||||
- Battery: lower sample frequency when there is no support for reading current/power
|
||||
|
||||
2016-03-25 0.12.8
|
||||
- Major changes (see details below):
|
||||
- Icon cache and lazy icon theme loading to improve performance in tint2 and tint2conf
|
||||
- Extra tint2rc themes are installed to /usr/share/tint2 and available in tint2conf
|
||||
- Tint2conf GUI improvements
|
||||
- Config options with changed behavior:
|
||||
- The launcher now also allows launcher_item_app entries without a full path.
|
||||
In this case the .desktop file is searched in the standard application directories (issue #565).
|
||||
- If the panel size is given as a percentage and a non-zero margin is also specified,
|
||||
the size is now computed as a fraction of the available size (i.e. monitor size - margin).
|
||||
Before it was computed as a fraction of the monitor size first, then the margin was subtracted from the value, which
|
||||
was not intuitive (issue #559).
|
||||
- Fixes:
|
||||
- Taskbar icons are now resized correctly for certain geometries (issue #560)
|
||||
- Fix get_version.sh so that it returns the correct version when .git is missing
|
||||
- Fix build on powerpc
|
||||
- Temporary files are now created in /tmp
|
||||
- The XDG paths are now used in the icon and application lookup in addition to the hardcoded defaults
|
||||
- Brigtness adjustments no longer distort colors
|
||||
- Fixed race in sorting systray icons by name
|
||||
- Fixed desktop entry parsing (issue #570)
|
||||
- tint2conf:
|
||||
- Applications are now sorted correctly
|
||||
- Avoid duplicate icon themes due to symlinks
|
||||
- Avoid loading desktop files marked as NoDisplay
|
||||
- Enhancements:
|
||||
- Launcher icon paths are now cached, which greatly improves loading time for tint2 and tint2conf.
|
||||
The correct icon should be found even if you change the icon theme or install a new theme.
|
||||
If this is not the case, delete the file ~/.cache/tint2/icon.cache, restart tint2 and please file a bug report
|
||||
indicating the application name and the icon theme name.
|
||||
- Fallback icon themes are loaded lazily to speed up tint2 and tint2conf startup
|
||||
- A better Name and GenericName is used in the tint2 and tint2conf .desktop files
|
||||
- tint2conf:
|
||||
- Allows selection of themes from /usr/share
|
||||
- Menu reorganization (thanks @Vladimir-csp for feedback)
|
||||
- Icon themes are now sorted in the displayed list
|
||||
- Updated ru translation (thanks @Vladimir-csp)
|
||||
|
||||
2016-01-29 0.12.7
|
||||
- Fixes:
|
||||
- Fix crash caused by race when reading inconsistent values for _NET_CURRENT_DESKTOP and _NET_NUMBER_OF_DESKTOPS
|
||||
- Fix regression (all desktop tasks not working)
|
||||
- Fix small memory leak in launcher
|
||||
|
||||
2016-01-25 0.12.6
|
||||
- Fixes:
|
||||
- Fix crash on 32-bit systems (issue #546)
|
||||
- Fix compilation on Slackware (issue #547)
|
||||
- Terminal color reset code moved to the same line to prevent interference with logging (issue #545)
|
||||
- Enhancements:
|
||||
- Executor now sends click coordinates via environment variables (issue #544)
|
||||
|
||||
2016-01-24 0.12.5
|
||||
- Fixes:
|
||||
- Fix rendering corruption triggered occasionally when the compositor is disabled (regression in 0.12.4)
|
||||
|
||||
10
INSTALL.txt
@@ -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 ../'
|
||||
29
README.md
@@ -1,33 +1,35 @@
|
||||
# New stable release: 0.12.5
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/0.12.5/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)):
|
||||
|
||||
Try it out 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.5
|
||||
git checkout 0.12.12
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
./tint2 &
|
||||
./src/tint2conf/tint2conf &
|
||||
```
|
||||
|
||||
To install from source, also run (as root):
|
||||
To install, run (as root):
|
||||
|
||||
```
|
||||
make install
|
||||
```
|
||||
|
||||
And then you can run the panel `tint2` and the configuration program `tint2conf`.
|
||||
|
||||
Please report any problems to https://gitlab.com/o9000/tint2/issues. Your feedback is much appreciated.
|
||||
|
||||
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.
|
||||
|
||||
# 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)
|
||||
@@ -67,15 +69,12 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
|
||||
* Downloads: https://gitlab.com/o9000/tint2-archive/tree/master or https://code.google.com/p/tint2/downloads/list
|
||||
* Old project location (inactive): https://code.google.com/p/tint2
|
||||
|
||||
# Releases
|
||||
* Latest stable release: tint2 0.12.4 (January 2016)
|
||||
|
||||
# Screenshots
|
||||
|
||||
## Default config of the latest release:
|
||||
## Default config:
|
||||
|
||||

|
||||
|
||||
## Various configurations:
|
||||
## Various configs:
|
||||
|
||||

|
||||
|
||||
2
doc/footer.html
Normal file
@@ -0,0 +1,2 @@
|
||||
</body>
|
||||
</html>
|
||||
13
doc/generate-doc.sh
Executable 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
@@ -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>
|
||||
BIN
doc/images/panel_padding.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
doc/images/panel_size_margin.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
doc/images/task_padding.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
doc/images/taskbar_padding.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
728
doc/manual.html
Normal 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 'make install' 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'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's window. Default: 'tint2'. <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 '.' 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 '.' 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'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'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 'workspace');</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 'get attention' 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'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'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 'strftime' 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 ':'</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'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 "battery low"</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 '<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
|
||||
</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 "<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
|
||||
</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'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
@@ -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>
|
||||
876
doc/tint2.1
@@ -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
@@ -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 'make install' 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'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's window. Default: 'tint2'. <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 '.' 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 '.' 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'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'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 'workspace');</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 'get attention' 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'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'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 'strftime' 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 ':'</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'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 '.' as decimal separator.</p></li>
|
||||
<li><p><code>tooltip_hide_timeout = float</code> : Delay to hide the tooltip in seconds. Use '.' 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 "battery low"</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 '<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
|
||||
</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 "<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
|
||||
</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
@@ -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)*
|
||||
|
||||

|
||||
|
||||
* `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).
|
||||
|
||||

|
||||
|
||||
* `panel_padding = horizontal_padding vertical_padding spacing` : Please refer to the image below.
|
||||
|
||||

|
||||
|
||||
* `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`
|
||||
|
||||

|
||||
|
||||
* `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.
|
||||
|
||||

|
||||
|
||||
* `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`.
|
||||
@@ -3,34 +3,43 @@
|
||||
MAJOR=0.12
|
||||
DIRTY=""
|
||||
|
||||
git update-index -q --ignore-submodules --refresh
|
||||
# Disallow unstaged changes in the working tree
|
||||
if ! git diff-files --quiet --ignore-submodules --
|
||||
if git status 1>/dev/null 2>/dev/null
|
||||
then
|
||||
if [ "$1" = "--strict" ]
|
||||
git update-index -q --ignore-submodules --refresh
|
||||
# Disallow unstaged changes in the working tree
|
||||
if ! git diff-files --quiet --ignore-submodules --
|
||||
then
|
||||
echo >&2 "Error: there are unstaged changes."
|
||||
git diff-files --name-status -r --ignore-submodules -- >&2
|
||||
exit 1
|
||||
else
|
||||
DIRTY="-dirty"
|
||||
if [ "$1" = "--strict" ]
|
||||
then
|
||||
echo >&2 "Error: there are unstaged changes."
|
||||
git diff-files --name-status -r --ignore-submodules -- >&2
|
||||
exit 1
|
||||
else
|
||||
DIRTY="-dirty"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Disallow uncommitted changes in the index
|
||||
if ! git diff-index --cached --quiet HEAD --ignore-submodules --
|
||||
then
|
||||
if [ "$1" = "--strict" ]
|
||||
then
|
||||
echo >&2 "Error: there are uncommitted changes."
|
||||
git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
|
||||
exit 1
|
||||
else
|
||||
DIRTY="-dirty"
|
||||
fi
|
||||
fi
|
||||
VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%ci | cut -d ' ' -f 1 | tr -d '-').$(git show -s --pretty=format:%h)")$DIRTY
|
||||
else
|
||||
VERSION=$(head -n 1 ChangeLog | cut -d ' ' -f 2)
|
||||
if [ $VERSION = "master" ]
|
||||
then
|
||||
VERSION=$VERSION-$(head -n 1 ChangeLog | cut -d ' ' -f 1)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Disallow uncommitted changes in the index
|
||||
if ! git diff-index --cached --quiet HEAD --ignore-submodules --
|
||||
then
|
||||
if [ "$1" = "--strict" ]
|
||||
then
|
||||
echo >&2 "Error: there are uncommitted changes."
|
||||
git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
|
||||
exit 1
|
||||
else
|
||||
DIRTY="-dirty"
|
||||
fi
|
||||
fi
|
||||
|
||||
VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%cI.%h | tr -d ':' | tr -d '-' | tr '.' '-' | sed 's/T[0-9\+]*//g')")$DIRTY
|
||||
VERSION=$(echo "$VERSION" | sed 's/^v//')
|
||||
|
||||
echo '#define VERSION_STRING "'$VERSION'"' > version.h
|
||||
|
||||
75
packaging/make_ubuntu.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
rm -rf tint2* 2>/dev/null || true
|
||||
|
||||
if [ ! -z "$1" ]
|
||||
then
|
||||
MINOR="$1"
|
||||
else
|
||||
MINOR="1"
|
||||
fi
|
||||
|
||||
# Get version (and check that the repository is clean)
|
||||
VERSION=$(../get_version.sh --strict)
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
echo >&2 "Error: get_version.sh failed!"
|
||||
exit 1
|
||||
fi
|
||||
rm -f version.h
|
||||
VERSION=$(git describe --exact-match 2>/dev/null)
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
VERSION=$(echo "$VERSION" | sed 's/^v//')
|
||||
REPO="tint2"
|
||||
else
|
||||
VERSION="$(git show -s --pretty=format:%cI.%ct.%h | tr -d ':' | tr -d '-' | tr '.' '-' | sed 's/T[0-9\+]*//g').$MINOR"
|
||||
REPO="tint2-git"
|
||||
fi
|
||||
|
||||
# Export repository contents to source directory
|
||||
DIR=tint2-$VERSION
|
||||
echo "Making release $DIR"
|
||||
|
||||
pushd .
|
||||
cd ..
|
||||
git checkout-index --prefix=packaging/$DIR/ -a
|
||||
popd
|
||||
|
||||
# Update version file in source directory
|
||||
rm -f $DIR/make_release.sh
|
||||
echo "echo \"#define VERSION_STRING \\\"$VERSION\\\"\" > version.h" > $DIR/get_version.sh
|
||||
|
||||
# Copy the debian files into the source directory
|
||||
cp -r ubuntu $DIR/debian
|
||||
|
||||
for DISTRO in precise trusty wily xenial
|
||||
do
|
||||
# Cleanup from previous builds
|
||||
rm -rf tint2_$VERSION-*
|
||||
|
||||
# Update debian package changelog if necessary
|
||||
echo -e "tint2 ($VERSION-$DISTRO-1) $DISTRO; urgency=medium\n\n$(git log --pretty=format:' * %h %an (%ci) %s %d')\n -- o9000 <mrovi9000@gmail.com> $(date -R)\n" > $DIR/debian/changelog
|
||||
|
||||
# Create source tarball
|
||||
ARCHIVE=tint2_$VERSION-$DISTRO.orig.tar.gz
|
||||
rm -rf $ARCHIVE
|
||||
tar -czf $ARCHIVE $DIR
|
||||
|
||||
# Build package
|
||||
KEY=$(gpg --list-secret-keys | awk '/^sec/ { print $2 }' | cut -d / -f 2)
|
||||
|
||||
pushd .
|
||||
cd $DIR
|
||||
debuild -S -k$KEY
|
||||
popd
|
||||
|
||||
# Upload package
|
||||
dput ppa:o9000/$REPO tint2_$VERSION-$DISTRO-1_source.changes
|
||||
done
|
||||
|
||||
# Cleanup
|
||||
rm -rf $DIR $ARCHIVE
|
||||
rm -rf tint2_$VERSION-*
|
||||
212
packaging/ubuntu/changelog
Normal file
@@ -0,0 +1,212 @@
|
||||
tint2 (0.12.7-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* Update Debian Standards Version to 3.9.7
|
||||
* Drop -dbg package (Debian will build -dbgsym package automatically)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Wed, 10 Feb 2016 00:42:23 +0100
|
||||
|
||||
tint2 (0.12.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* Fix privacy-breach-generic in documentation
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Thu, 26 Nov 2015 22:49:26 +0100
|
||||
|
||||
tint2 (0.12.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* Drop all patches (applied upstream)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Fri, 11 Sep 2015 18:41:22 +0200
|
||||
|
||||
tint2 (0.12.1-2) unstable; urgency=medium
|
||||
|
||||
* Import upstream patch fixing bug with blinking systray icon
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Tue, 04 Aug 2015 01:16:08 +0200
|
||||
|
||||
tint2 (0.12.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Mon, 03 Aug 2015 17:03:13 +0200
|
||||
|
||||
tint2 (0.12-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release (Closes: #793797)
|
||||
- Drop 04-freespace.patch (applied upstream)
|
||||
- Drop 05-task-align.patch (needs rework)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Wed, 29 Jul 2015 18:53:03 +0200
|
||||
|
||||
tint2 (0.11+svn20121014-3) unstable; urgency=low
|
||||
|
||||
* Add some patches from upstream's bug tracker. Those are already
|
||||
used by the Debian based VSIDO distribution for some time.
|
||||
- 03-launcher_apps_dir.patch
|
||||
Add support for loading multiple launcher icons by specifing
|
||||
the directory for their *.desktop files.
|
||||
- 04-freespace.patch
|
||||
Add support for a separator panel element.
|
||||
- 05-task-align.patch, 06-sample-task-align.patch
|
||||
Add support for task alignment.
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Thu, 05 Jun 2014 17:39:43 +0200
|
||||
|
||||
tint2 (0.11+svn20121014-2) unstable; urgency=low
|
||||
|
||||
* Reintroduce tint2conf (Closes: #720200)
|
||||
* Add patch fixing argv evaluation (Closes: #716390)
|
||||
* Add patch fixing incorrect function declaration (Closes: #748171)
|
||||
* Bump Debian Standards Version to 3.9.5
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Sun, 01 Jun 2014 17:13:06 +0200
|
||||
|
||||
tint2 (0.11+svn20121014-1) unstable; urgency=low
|
||||
|
||||
* New upstream checkout (Closes: #678918)
|
||||
- Fix for no task cycling if all windows are minimized
|
||||
- Fix for incorrect task cycling when windows visible on
|
||||
all desktops are present
|
||||
- Adding startup-notification support
|
||||
- Drag and drop support for launchers
|
||||
- Localize launcher tooltips
|
||||
- Launcher: add icon lookup in ~/.local and /usr/local
|
||||
- Disable mouse hover events when the launcher tooltip
|
||||
is disabled
|
||||
* Do not install tint2conf (Closes: #672840)
|
||||
* Add libstartup-notification dependency
|
||||
* Bump Debian Standards Version to 3.9.4
|
||||
* Bump compat level to 9
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Thu, 25 Oct 2012 13:35:15 +0200
|
||||
|
||||
tint2 (0.11+svn20111022-3) unstable; urgency=low
|
||||
|
||||
* Update debian/copyright to conform with Debian copyright format 1.0
|
||||
* Update Debian Standards Version to 3.9.3
|
||||
* Add dump of tint2's FAQ and Configure wiki page as offline
|
||||
documentation (Closes: #658226)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Wed, 07 Mar 2012 10:09:20 +0100
|
||||
|
||||
tint2 (0.11+svn20111022-2) unstable; urgency=low
|
||||
|
||||
* Add inform-about-unsupported-saving.patch (Closes: #646055)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Sun, 23 Oct 2011 10:57:35 +0200
|
||||
|
||||
tint2 (0.11+svn20111022-1) unstable; urgency=low
|
||||
|
||||
* New upstream checkout
|
||||
- Fix double free of launcher configuration (Closes: #645208)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Sat, 22 Oct 2011 08:17:18 +0200
|
||||
|
||||
tint2 (0.11+svn20111011-2) unstable; urgency=low
|
||||
|
||||
* build debug symbols
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Fri, 21 Oct 2011 16:30:50 +0200
|
||||
|
||||
tint2 (0.11+svn20111011-1) unstable; urgency=low
|
||||
|
||||
* New upstream snapshot
|
||||
- misc. fixes
|
||||
- added alpha, saturation, brightness control for launcher icons
|
||||
- launcher tooltips configurable, default off
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Wed, 19 Oct 2011 19:49:54 +0200
|
||||
|
||||
tint2 (0.11+svn20110307-1) unstable; urgency=low
|
||||
|
||||
* New upstream snapshot (Closes: #624792)
|
||||
* Remove power_now support patch (applied upstream)
|
||||
* Do not install tintwizard (it does not support config of SVN snapshot)
|
||||
* Also build a tint2-dbg package
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Sun, 01 May 2011 19:35:32 +0200
|
||||
|
||||
tint2 (0.11-2) unstable; urgency=low
|
||||
|
||||
* Recommend python-gtk2 instead of python-gtk
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Sun, 05 Dec 2010 05:05:46 +0100
|
||||
|
||||
tint2 (0.11-1) unstable; urgency=low
|
||||
|
||||
* Make me the maintainer of this package (Closes: #598688)
|
||||
* New Upstream Version (Closes: #591008)
|
||||
* drop patch (applied upstream)
|
||||
* Update watch file
|
||||
+ use googlecode.debian.net
|
||||
+ new files are release as tar.bz2
|
||||
* Update Debian Standards Version to 3.9.1
|
||||
* Use DEP5 for debian/copyright
|
||||
* Added build dependencies: cmake, libgtk2.0-dev
|
||||
* Add patch renaming tintwizard.py to tintwizard
|
||||
* Add patch adding power_now support
|
||||
* Recommend python (needed by tintwizard)
|
||||
|
||||
-- Sebastian Reichel <sre@debian.org> Fri, 26 Nov 2010 22:01:43 +0100
|
||||
|
||||
tint2 (0.9-2) unstable; urgency=low
|
||||
|
||||
* debian/patches/update-systray-clock-every-second.diff: Cherry-pick
|
||||
patch from upstream to keep systray clock in sync with system time.
|
||||
(Closes: #572227)
|
||||
|
||||
-- Daniel Moerner <dmoerner@gmail.com> Wed, 03 Mar 2010 23:40:02 -0800
|
||||
|
||||
tint2 (0.9-1) unstable; urgency=low
|
||||
|
||||
* New Upstream Version
|
||||
* debian/watch: Upstream uses both _beta and -rc1 for version strings,
|
||||
update uversionmangle to handle both.
|
||||
* debian/control:
|
||||
- Bump to Version 3.8.4, no changes.
|
||||
- Add libxdamage-dev and libxcomposite-dev to Build-Depends.
|
||||
|
||||
-- Daniel Moerner <dmoerner@gmail.com> Wed, 24 Feb 2010 10:21:01 -0800
|
||||
|
||||
tint2 (0.8-1) unstable; urgency=low
|
||||
|
||||
* New Upstream Version
|
||||
* debian/examples: Upstream has renamed the sample tint2rc files.
|
||||
* debian/source: Switch to dpkg-source 3.0 (quilt) format.
|
||||
* debian/copyright: Update with new upstream authors.
|
||||
|
||||
-- Daniel Moerner <dmoerner@gmail.com> Tue, 12 Jan 2010 11:48:49 -0800
|
||||
|
||||
tint2 (0.7.1-1) unstable; urgency=low
|
||||
|
||||
* New Upstream Version
|
||||
* debian/watch: add uversionmangle line to ignore upstream's beta
|
||||
releases.
|
||||
* debian/control: Update to Debian Policy 3.8.3, fix description typo.
|
||||
|
||||
-- Daniel Moerner <dmoerner@gmail.com> Sun, 06 Sep 2009 18:57:06 -0700
|
||||
|
||||
tint2 (0.7-1) unstable; urgency=low
|
||||
|
||||
* New Upstream Version. (LP: #319436)
|
||||
- Update watch file to point to tint2 instead of tint.
|
||||
- Remove debian/tint.1: integrated upstream (Closes: #532307)
|
||||
- Remove dpatch and patches/01-remove-strip-from-makefile.dpatch:
|
||||
integrated upstream.
|
||||
- Refresh debian/examples and remove debian/docs
|
||||
- tint2 is now licensed under the GPL-2.
|
||||
* Added Vcs-Git and Vcs-Browser fields to debian/control.
|
||||
* Updated to Standards Version 3.8.2
|
||||
* Switched to tiny dh 7 rules file with overrides.
|
||||
|
||||
-- Daniel Moerner <dmoerner@gmail.com> Wed, 01 Jul 2009 02:01:27 -0700
|
||||
|
||||
tint2 (0.6.0-1) unstable; urgency=low
|
||||
|
||||
* Initial release (closes: #491596)
|
||||
* Wrote manpage from upstream docs
|
||||
* 01-remove-strip-from-makefile.dpatch: dh_strip will strip the binary instead
|
||||
|
||||
-- Daniel Moerner <dmoerner@gmail.com> Sat, 06 Sep 2008 07:54:24 -0700
|
||||
1
packaging/ubuntu/compat
Normal file
@@ -0,0 +1 @@
|
||||
9
|
||||
36
packaging/ubuntu/control
Normal file
@@ -0,0 +1,36 @@
|
||||
Source: tint2
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: o9000 <mrovi9000@gmail.com>
|
||||
Build-Depends: cmake,
|
||||
debhelper (>= 9),
|
||||
libcairo2-dev,
|
||||
libglib2.0-dev,
|
||||
libgtk2.0-dev,
|
||||
libimlib2-dev,
|
||||
libpango1.0-dev,
|
||||
librsvg2-dev,
|
||||
libstartup-notification0-dev,
|
||||
libxcomposite-dev,
|
||||
libxdamage-dev,
|
||||
libxinerama-dev,
|
||||
libxrandr-dev
|
||||
Standards-Version: 3.9.7
|
||||
Vcs-Git: git://anonscm.debian.org/collab-maint/tint2.git
|
||||
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/tint2.git
|
||||
Homepage: https://gitlab.com/o9000/tint2/
|
||||
|
||||
Package: tint2
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: lightweight taskbar
|
||||
Tint is a simple panel/taskbar intentionally made for openbox3, but should
|
||||
also work with other window managers. The taskbar includes transparency and
|
||||
color settings for the font, icons, border, and background. It also supports
|
||||
multihead setups, customized mouse actions, and a built-in clock. Tint was
|
||||
originally based on ttm code. Since then, support has also been added
|
||||
for a battery monitor and system tray.
|
||||
.
|
||||
The goal is to keep a clean and unintrusive look with lightweight code and
|
||||
compliance with freedesktop specification.
|
||||
66
packaging/ubuntu/copyright
Normal file
@@ -0,0 +1,66 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Source: https://gitlab.com/o9000/tint2.git
|
||||
|
||||
Files: *
|
||||
Copyright: 2007-2008 Pål Staurland <staura@gmail.com>
|
||||
2008-2009 Thierry Lorthiois <lorthiois@bbsoft.fr>
|
||||
2009 Andreas Fink <andreas.fink85@googlemail.com>
|
||||
2011-2015 Ovidiu M <mrovi9000@gmail.com>
|
||||
License: GPL-2
|
||||
|
||||
Files: src/battery/*
|
||||
Copyright: 2009 Sebastian Reichel <sre@debian.org>
|
||||
License: GPL-2+
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation, or (at your option) any
|
||||
later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
.
|
||||
On Debian systems, the full text of the GNU General Public License 2
|
||||
can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2008-2010 Daniel Moerner <dmoerner@gmail.com>
|
||||
2010-2012 Sebastian Reichel <sre@debian.org>
|
||||
License: ISC
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Files: debian/wiki/*
|
||||
Copyright: 2009-2012 Andreas Fink <andreas.fink85@googlemail.com>
|
||||
License: GPL-2
|
||||
|
||||
License: GPL-2
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
version 2 as published by the Free Software Foundation.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
.
|
||||
On Debian systems, the full text of the GNU General Public License 2
|
||||
can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
1
packaging/ubuntu/examples
Normal file
@@ -0,0 +1 @@
|
||||
sample/*.tint2rc
|
||||
14
packaging/ubuntu/rules
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install --destdir=$(CURDIR)/debian/tmp
|
||||
|
||||
override_dh_installdocs:
|
||||
dh_installdocs --link-doc=tint2
|
||||
cp -r debian/wiki debian/tint2/usr/share/doc/tint2/html
|
||||
1
packaging/ubuntu/source/format
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
||||
4
packaging/ubuntu/source/include-binaries
Normal file
@@ -0,0 +1,4 @@
|
||||
debian/wiki/3265475271_81e8ed56e0.jpg
|
||||
debian/wiki/3265475337_262799ded3.jpg
|
||||
debian/wiki/3266303192_476a188196.jpg
|
||||
debian/wiki/3266303292_14d9b6b623.jpg
|
||||
12
packaging/ubuntu/tint2.install
Normal file
@@ -0,0 +1,12 @@
|
||||
/usr/bin/tint2
|
||||
/usr/bin/tint2conf
|
||||
/etc/xdg/tint2/tint2rc
|
||||
/usr/share/applications/tint2.desktop
|
||||
/usr/share/applications/tint2conf.desktop
|
||||
/usr/share/man/man1/tint2.1
|
||||
/usr/share/doc/tint2/AUTHORS
|
||||
/usr/share/doc/tint2/README.md
|
||||
/usr/share/icons/hicolor/scalable/apps/tint2.svg
|
||||
/usr/share/icons/hicolor/scalable/apps/tint2conf.svg
|
||||
/usr/share/locale/*
|
||||
/usr/share/tint2/*
|
||||
1
packaging/ubuntu/tint2.manpages
Normal file
@@ -0,0 +1 @@
|
||||
debian/tint2conf.1
|
||||
15
packaging/ubuntu/tint2conf.1
Normal file
@@ -0,0 +1,15 @@
|
||||
.TH TINT2CONF 1 "April 25, 2011"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.SH NAME
|
||||
tint2conf \- tint configuration manager
|
||||
.SH SYNOPSIS
|
||||
.B tint2conf
|
||||
.SH DESCRIPTION
|
||||
tint2conf is a GTK based configuration previewer for tint2.
|
||||
.SH OPTIONS
|
||||
tint2conf takes no parameters.
|
||||
.SH AUTHOR
|
||||
tint2conf was written by the tint2 team.
|
||||
.PP
|
||||
This manual page was written by Sebastian Reichel <sre@debian.org>,
|
||||
for the Debian project (but may be used by others).
|
||||
4
packaging/ubuntu/watch
Normal file
@@ -0,0 +1,4 @@
|
||||
version=3
|
||||
|
||||
opts=filenamemangle=s/.*\.tar\.gz\?ref=v?(\d\S*)/tint2-$1\.tar\.gz/g,uversionmangle=s/\-rc(\d)/\~rc$1/ \
|
||||
https://gitlab.com/o9000/tint2/tags .*archive\.tar\.gz\?ref=v?(\d\S*)
|
||||
BIN
packaging/ubuntu/wiki/3265475271_81e8ed56e0.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
packaging/ubuntu/wiki/3265475337_262799ded3.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
packaging/ubuntu/wiki/3266303192_476a188196.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
packaging/ubuntu/wiki/3266303292_14d9b6b623.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
405
packaging/ubuntu/wiki/Configure.html
Normal file
@@ -0,0 +1,405 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>tint2 - Configure</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
</head>
|
||||
|
||||
<body class="t6">
|
||||
|
||||
<table class="st" width="100%" cellpadding="0" cellspacing="0" align="center" border="0">
|
||||
<tbody><tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="bevel-right" valign="top" align="right"></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
|
||||
|
||||
<div id="maincol" style="padding: 0pt 3px 3px 0pt; margin: 0pt;">
|
||||
|
||||
|
||||
<!-- IE -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="wikipage">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<td style="vertical-align: top; padding-left: 5px;">
|
||||
|
||||
|
||||
|
||||
<div id="wikicontent">
|
||||
<div class="vt" id="wikimaincol">
|
||||
|
||||
<h1>tint2 - Configure</h1>
|
||||
|
||||
<p></p><ul><li><a href="#Background_and_border">Background and border</a></li><li><a href="#Panel">Panel</a></li><li><a href="#Launcher_SVN_Only">Launcher SVN Only</a></li><li><a href="#Taskbar_%28pager_like_capability%29">Taskbar (pager like capability)</a></li><li><a href="#Task">Task</a></li><li><a href="#System_Tray">System Tray</a></li><li><a href="#Clock">Clock</a></li><li><a href="#Tooltip">Tooltip</a></li><li><a href="#Battery">Battery</a></li><li><a href="#Mouse_action_on_task">Mouse action on task</a></li><li><a href="#Panel_autohide">Panel autohide</a></li><li><a href="#An_example_tint2rc">An example tint2rc</a></li></ul> <p></p><p>The first time you run tint2, it will create the config file in <tt>$HOME/.config/tint2/tint2rc</tt> . (this is true if you have done a clean install. running tint2 in the source directory without doing 'make install' will not create the config file.) </p><p>You can specify another file on the command line with -c option. eg. : <tt>tint2 -c $HOME/tint2.conf</tt> </p><p>When you change the config file, the command line 'killall -SIGUSR1 tint2' will force tint2 to reload it. </p><p>Configuration marked as <tt>SVN ONLY</tt> are not yet supported and could change in the next stable release. </p><h1><a name="Background_and_border"></a>Background and border<a href="#Background_and_border" class="section_anchor"></a></h1><blockquote>tint2rc config file starts with background option.
|
||||
</blockquote><p> </p><ul><li><tt>rounded = number_of_pixels</tt> : How rounded the borders are </li></ul><p></p><ul><li><tt>background_color = color opacity</tt> </li><ul><li><tt>opacity = 0</tt> to get background transparency </li></ul></ul><p> </p><ul><li><tt>border_width = width</tt> </li></ul><p></p><ul><li><tt>border_color = color opacity (0 to 100)</tt> </li><ul><li><tt>opacity = 0</tt> to get border transparency </li></ul></ul><blockquote>you are free to put 1, 2, 3... background
|
||||
<pre class="prettyprint"> 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</pre>tint2 automatically identifies each background with a number (1, 2, ...).
|
||||
then you can applied background on objects (panel, taskbar, task, clock, systray) with
|
||||
<pre class="prettyprint"> 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</pre>identifier 0 applied full transparency, identifer 1 applied the first background...
|
||||
</blockquote><h1><a name="Panel"></a>Panel<a href="#Panel" class="section_anchor"></a></h1><ul><li><tt>panel_monitor = monitor (all, 1, 2, ...)</tt> Which monitor tint2 draws the panel on </li><ul><li>the first monitor is <tt>1</tt> </li><li>use <tt>panel_monitor = all</tt> to get one panel per monitor (unless it's included into another one) </li></ul></ul><p> </p><blockquote><img src="3265475271_81e8ed56e0.jpg">
|
||||
</blockquote><p></p><p> </p><ul><li><tt>panel_position = vertical_position horizontal_position orientation</tt> </li><ul><li><tt>value for vertical_position : bottom, top, center</tt> </li><li><tt>value for horizontal_position : left, right, center</tt> </li><li><tt>value for orientation : horizontal, vertical</tt> </li></ul></ul> <ul><li><tt>panel_size = width height</tt> </li><ul><li><tt>width = 0</tt> to get full monitor width </li><li>Use <tt>%</tt> to adjust the panel size to monitor size. </li></ul></ul> <blockquote>Example:
|
||||
<p></p><pre class="prettyprint"> #The panel's width is 94% the size of the monitor
|
||||
panel_size = 94% 30</pre></blockquote><ul><li><tt>panel_items = LTSBC</tt> define the items tint2 will show and the order of those items. panel_items = STC will show the Systray, the taskbar and the clock (from left to right). SVN ONLY. </li><ul><li>L to show Launcher </li><li>T to show Taskbar </li><li>S to show Systray (also called notification area) </li><li>B to show Battery status </li><li>C to show Clock </li></ul></ul><ul><li><tt>panel_margin = horizontal_margin vertical_margin</tt> </li><ul><li><tt>horizontal_margin = 0</tt> to get full monitor width </li></ul></ul><blockquote><img src="3266303192_476a188196.jpg">
|
||||
</blockquote><p> </p><ul><li><tt>panel_padding = horizontal_left_right_padding vertical_padding horizontal_spacing</tt> </li></ul><p></p><ul><li><tt>font_shadow = boolean (0 or 1)</tt> </li></ul><ul><li><tt>panel_background_id = integer</tt> : Which background to use </li></ul><ul><li><tt>wm_menu = boolean (0 or 1)</tt> : Allow tint2 to forward mouse event to your Window Manager. </li></ul><ul><li><tt>panel_dock = boolean (0 or 1)</tt> : Put tint2 into the window managers dock. For the openbox window manager I can advise to use also a modifier for the moveButton option, otherwise the mouse click is not forwarded to tint2 (in ~/.config/openbox/rc.xml). </li></ul><p> </p><ul><li><tt>panel_layer = bottom,normal,top</tt> : Puts tint2 into the bottom/normal/top layer. Default is the bottom layer, but for real transparency normal or top layer may be a nice alternative. </li></ul><p></p><ul><li><tt>strut_policy = follow_size/minimum/none</tt> : STRUTs are used by the window manager to decide the size of maximized windows. Should the 'maximized windows' follow tint2 size (follow_size) or use the minimum size (minimum), or use the screen size (none). <tt>minimum</tt> option is interresting when used with <tt>autohide_height</tt> parameter. </li></ul><h1><a name="Launcher_SVN_Only"></a>Launcher SVN Only<a href="#Launcher_SVN_Only" class="section_anchor"></a></h1><ul><li><tt>launcher_icon_theme = name_of_theme</tt> tint2 will follow the theme of your desktop when you have an XSETTINGS manager running. Otherwise, <tt>launcher_icon_theme</tt> parameter is used. </li><li><tt>launcher_padding = horizontal_left_right_padding vertical_padding horizontal_spacing</tt> </li><li><tt>launcher_background_id = integer</tt> : Which background to use </li><li><tt>launcher_icon_size = number</tt> : Set the launcher icon size to <tt>number</tt>. </li><li><tt>launcher_item_app = path_to_application</tt> : Each launcher_item_app must be a full path to a .desktop file. </li></ul><h1><a name="Taskbar_(pager_like_capability)"></a>Taskbar (pager like capability)<a href="#Taskbar_%28pager_like_capability%29" class="section_anchor"></a></h1><ul><li><tt>taskbar_mode = single_desktop or multi_desktop</tt> </li><ul><li><tt>taskbar_mode = single_desktop</tt> : Show one(1) taskbar (current desktop) </li><li><tt>taskbar_mode = multi_desktop</tt> : Pager like capability. Show one(1) taskbar per desktop </li><ul><li>You can drag-and-drop task between desktops` </li><li>And also click on an empty taskbar to switch desktops` </li></ul></ul></ul><p> </p><ul><li><tt>taskbar_padding = horizontal_left_right_padding vertical_padding horizontal_spacing</tt> </li></ul><p></p><ul><li><tt>taskbar_background_id = integer</tt> : Which background to use </li></ul><ul><li><tt>taskbar_active_background_id = integer</tt> : Which background to use for current desktop. </li></ul><blockquote><img src="3266303292_14d9b6b623.jpg">
|
||||
</blockquote><ul><li><tt>taskbar_name = boolean (0 or 1)</tt> : SVN Only enabled(=1) or disabled(=0) desktop name in taskbar </li></ul><ul><li><tt>taskbar_name_padding = left_right_padding</tt> SVN Only </li></ul><ul><li><tt>taskbar_name_background_id = integer</tt> : SVN Only Which background to use </li></ul><ul><li><tt>taskbar_name_active_background_id = integer</tt> : SVN Only Which background to use for current desktop. </li></ul><ul><li><tt>taskbar_name_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> SVN Only </li></ul><ul><li><tt>taskbar_name_font_color = color opacity (0 to 100)</tt> SVN Only </li></ul><ul><li><tt>taskbar_name_active_font_color = color opacity (0 to 100)</tt> </li></ul><h1><a name="Task"></a>Task<a href="#Task" class="section_anchor"></a></h1><ul><li><tt>urgent_nb_of_blink = integer</tt> : Number of blink on 'get attention' event </li></ul><ul><li><tt>task_icon = boolean (0 or 1)</tt> : Display task icon or not </li></ul><ul><li><tt>task_text = boolean (0 or 1)</tt> : Display task text or not </li></ul><ul><li><tt>task_centered = boolean (0 or 1)</tt> : Task name centered or not </li></ul><ul><li><tt>task_maximum_size = width height</tt> </li><ul><li><tt>width is used with horizontal panel. width = 0 to get full taskbar width</tt> </li><li><tt>height is used with vertical panel</tt> </li></ul></ul><p> </p><ul><li><tt>task_padding = horizontal_padding vertical_padding</tt> </li></ul><p></p><ul><li><tt>task_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> </li></ul><ul><li><tt>task_font_color = color opacity (0 to 100)</tt> </li></ul><p> </p><ul><li><tt>task_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</tt> : adjust icon's color and transparency for task. </li></ul><p></p><ul><li><tt>task_background_id = integer</tt> : Which background to use for non selected tasks </li></ul><blockquote>For the next 3 options STATUS can be <tt>active</tt> / <tt>iconified</tt> / <tt>urgent</tt>.
|
||||
</blockquote><ul><li><tt>task_STATUS_font_color = color opacity (0 to 100)</tt> </li></ul><ul><li><tt>task_STATUS_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</tt> : adjust icon's color and transparency for active task </li></ul><ul><li><tt>task_STATUS_background_id = integer</tt> : Which background to use when task is selected </li></ul><ul><li><tt>task_tooltip = boolean (0 or 1)</tt> : enabled(=1) or disabled(=0) tooltip on task </li></ul><blockquote><img src="3265475337_262799ded3.jpg">
|
||||
</blockquote><h1><a name="System_Tray"></a>System Tray<a href="#System_Tray" class="section_anchor"></a></h1><ul><li><tt>systray = boolean (0 or 1)</tt> : enabled(=1) or disabled(=0) systray </li></ul><ul><li><tt>systray_padding = horizontal_left_right_padding vertical_padding horizontal_spacing</tt> </li></ul><ul><li><tt>systray_background_id = integer</tt> : Which background to use for non selected tasks </li></ul><ul><li> <tt>systray_sort = ascending/descending/left2right/right2left</tt> : Sorting order for icon's systray (if left2right or right2left the order can be different on restart) </li></ul><ul><li> <tt>systray_icon_size = max_icon_size</tt> : Set the maximum system tray icon size to <tt>number</tt>. Set to <tt>0</tt> for automatic icon size </li></ul><ul><li><tt>systray_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</tt> : adjust icon's color and transparency for system tray icons </li></ul><h1><a name="Clock"></a>Clock<a href="#Clock" class="section_anchor"></a></h1><ul><li><tt>time1_format = %H:%M</tt> </li><ul><li>time1_format, time2_format and clock_tooltip use 'strftime' syntax. more info on parameters on <a href="http://www.manpagez.com/man/3/strftime/" rel="nofollow">http://www.manpagez.com/man/3/strftime/</a> </li><li>comment time1_format and time2_format to hide clock </li></ul></ul><p> </p><ul><li><tt>time1_timezone = :US/Hawaii</tt> </li><ul><li>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, i.e. time1_timezone = :/different/zoneinfo/dir/US/Hawaii (always prepend with a ':') </li></ul></ul><p></p><ul><li><tt>time1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> </li></ul><ul><li><tt>time2_format = %A %d %B</tt> </li></ul><ul><li><tt>time2_timezone = :Europe/Berlin</tt> </li></ul><ul><li><tt>time2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> </li></ul><ul><li><tt>clock_font_color = color opacity (0 to 100)</tt> </li></ul><ul><li><tt>clock_padding = horizontal_padding vertical_padding</tt> </li></ul><ul><li><tt>clock_background_id = integer</tt> : Which background to use </li></ul><ul><li><tt>clock_tooltip = %a, %d. %b %Y : clock tooltip text</tt> </li></ul><ul><li><tt>clock_tooltip_timezone = :UTC</tt> </li></ul><ul><li><tt>clock_lclick_command = text</tt> : Which command to execute on left click </li></ul><ul><li><tt>clock_rclick_command = text</tt> : Which command to execute on right click </li></ul><h1><a name="Tooltip"></a>Tooltip<a href="#Tooltip" class="section_anchor"></a></h1><ul><li><tt>tooltip_padding = horizontal_padding vertical_padding</tt> </li></ul><ul><li><tt>tooltip_show_timeout = float</tt> : delay to show tooltip in second. Use '.' as decimal separator. </li></ul><ul><li><tt>tooltip_hide_timeout = float</tt> : delay to close tooltip in second. Use '.' as decimal separator. </li></ul><ul><li><tt>tooltip_background_id = integer</tt> : Which background to use (in fake transparency the alpha channel and rounded are not respected) </li></ul><ul><li><tt>tooltip_font_color = color opacity (0 to 100)</tt> </li></ul><ul><li><tt>tooltip_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> </li></ul><h1><a name="Battery"></a>Battery<a href="#Battery" class="section_anchor"></a></h1><ul><li><tt>battery = boolean (0 or 1)</tt> : enabled(=1) or disabled(=0) battery applet </li></ul><ul><li><tt>battery_hide = never or an integer (0 to 100)</tt>: At what battery percent does the battery hide </li></ul><ul><li><tt>battery_low_status = integer</tt>: At what battery percent does the icon show battery low command </li></ul><ul><li><tt>battery_low_cmd = notify-send "battery low"</tt> :What to do when battery is low </li></ul><ul><li><tt>bat1_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> </li></ul><ul><li><tt>bat2_font = [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]</tt> </li></ul><ul><li><tt>battery_font_color = color opacity (0 to 100)</tt> </li></ul><ul><li><tt>battery_padding = horizontal_padding vertical_padding</tt> </li></ul><ul><li><tt>battery_background_id = integer</tt> : Which background to use </li></ul><h1><a name="Mouse_action_on_task"></a>Mouse action on task<a href="#Mouse_action_on_task" class="section_anchor"></a></h1><blockquote>Customize mouse action with : <tt>none, close, toggle, iconify, shade, toggle_iconify, maximize_restore, desktop_left, desktop_right, next_task, prev_task</tt>.
|
||||
</blockquote><blockquote>Sample format:
|
||||
<pre class="prettyprint"> mouse_middle = none
|
||||
mouse_right = close
|
||||
mouse_scroll_up = toggle
|
||||
mouse_scroll_down = iconify</pre></blockquote><pre class="prettyprint"> close : close the task
|
||||
toggle : toggle the task
|
||||
iconify : iconify the task
|
||||
toggle_iconify : toggle or iconify the task
|
||||
maximize_restore : maximized or minimized 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</pre><p>If a mouse action is set to <tt>none</tt> and <tt>wm_menu = 1</tt> is set, the mouse click is forwarded to the window manager </p><h1><a name="Panel_autohide"></a>Panel autohide<a href="#Panel_autohide" class="section_anchor"></a></h1><ul><li><tt>autohide = boolean (0 or 1)</tt> : enable(=1) or disable(=0) autohiding </li></ul><ul><li><tt>autohide_show_timeout = float</tt> : show timeout in seconds. Use '.' as decimal separator. </li></ul><ul><li><tt>autohide_hide_timeout = float</tt> : hide timeout in seconds. Use '.' as decimal separator. </li></ul><ul><li><tt>autohide_height = integer</tt> : panel height (width for vertical panels) in hidden mode </li></ul><h1><a name="An_example_tint2rc"></a>An example tint2rc<a href="#An_example_tint2rc" class="section_anchor"></a></h1><pre class="prettyprint">#---------------------------------------------
|
||||
# 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</pre>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr><tr>
|
||||
</tr></tbody></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="wikicommentcol">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="collapse">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="commentlist">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="hostedBy" style="margin-top: -20px;">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
217
packaging/ubuntu/wiki/FAQ.html
Normal file
@@ -0,0 +1,217 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>tint2 - FAQ</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
</head>
|
||||
|
||||
<body class="t6">
|
||||
|
||||
<table class="st" width="100%" cellpadding="0" cellspacing="0" align="center" border="0">
|
||||
<tbody><tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="bevel-right" valign="top" align="right"></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
|
||||
|
||||
<div id="maincol" style="padding: 0pt 3px 3px 0pt; margin: 0pt;">
|
||||
|
||||
<!-- IE -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="wikipage">
|
||||
<table>
|
||||
<tbody><tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<td style="vertical-align: top; padding-left: 5px;">
|
||||
|
||||
|
||||
|
||||
<div id="wikicontent">
|
||||
<div class="vt" id="wikimaincol">
|
||||
|
||||
<h1>tint2 - FAQ</h1>
|
||||
|
||||
<p></p><ul><li><a href="#What_is_tint2?">What is tint2?</a></li><li><a href="#Who_is_the_developer_of_tint2_?">Who is the developer of tint2 ?</a></li><li><a href="#Does_tint2_have_a_system_tray/notification_area?">Does tint2 have a system tray/notification area?</a></li><li><a href="#I_have_the_latest_build_of_tint2_but_still_no_system_tray">I have the latest build of tint2 but still no system tray</a></li><li><a href="#tint2_doesn%27t_show_the_systray/notification">tint2 doesn't show the systray/notification</a></li><li><a href="#Why_did_some_systray_icons_disappear_from_the_panel?">Why did some systray icons disappear from the panel?</a></li><li><a href="#Why_don%27t_some_systray_icons_appear_when_you_run_tint2_in_a">Why don't some systray icons appear when you run tint2 in a KDE session?</a></li><li><a href="#I_want_to_disable_the_tint2_systray">I want to disable the tint2 systray</a></li><li><a href="#How_to_configure_real_transparency">How to configure real transparency</a></li><li><a href="#Tint2_doesn%27t_work_on_compiz_correctly?">Tint2 doesn't work on compiz correctly?</a></li><li><a href="#I_want_to_disable_compiz_shadow_on_Tint2">I want to disable compiz shadow on Tint2</a></li><li><a href="#Adding_a_%27show_desktop%27_button">Adding a 'show desktop' button</a></li><li><a href="#Task_list_is_limited">Task list is limited</a></li><li><a href="#How_can_I_get_%27pager_like_capability%27_?">How can I get 'pager like capability' ?</a></li><li><a href="#I_want_to_hide_some_tasks_from_the_panel_?">I want to hide some tasks from the panel ?</a></li><li><a href="#The_tint2_panel_is_blank">The tint2 panel is blank</a></li><li><a href="#How_to_maximize_window_over_tint2">How to maximize window over tint2</a></li><li><a href="#I_get_errors_when_I_try_to_compile_tint2_on_my_own">I get errors when I try to compile tint2 on my own</a></li><li><a href="#I_upgraded_to_tint2_and_I_still_have_the_old_panel_with_its_bugs">I upgraded to tint2 and I still have the old panel with its bugs</a></li><li><a href="#Tint2_doesn%27t_show_in_Pekwm">Tint2 doesn't show in Pekwm</a></li><li><a href="#Is_there_an_IRC_channel?">Is there an IRC channel?</a></li></ul> <p></p><p>Frequently asked questions. Please add any extra tips to the comments. </p><h1><a name="What_is_tint2?"></a>What is tint2?<a href="#What_is_tint2?" class="section_anchor"></a></h1><ul><li>Tint2 is a panel/taskbar for modern x window managers like GNOME, KDE, XFCE, openbox, pekwm,etc.. </li></ul><h1><a name="Who_is_the_developer_of_tint2_?"></a>Who is the developer of tint2 ?<a href="#Who_is_the_developer_of_tint2_?" class="section_anchor"></a></h1><ul><li>Main developers of tint2 are Thierry Lorthiois and Andreas Fink </li></ul><h1><a name="Does_tint2_have_a_system_tray/notification_area?"></a>Does tint2 have a system tray/notification area?<a href="#Does_tint2_have_a_system_tray/notification_area?" class="section_anchor"></a></h1><ul><li>YES! Tint2 finally has system tray/notification area. Please <a href="https://code.google.com/p/tint2/wiki/Install">install</a> the latest build if your current build doesn't have it. </li></ul><h1><a name="I_have_the_latest_build_of_tint2_but_still_no_system_tray"></a>I have the latest build of tint2 but still no system tray<a href="#I_have_the_latest_build_of_tint2_but_still_no_system_tray" class="section_anchor"></a></h1><ul><li>Check your tint2rc to see if you have the systray option configured and the options are not commented out. </li><li>The systray section looks like this </li><pre class="prettyprint">#---------------------------------------------
|
||||
# SYSTRAYBAR
|
||||
#---------------------------------------------
|
||||
systray = 1
|
||||
systray_padding = 0 3 3
|
||||
systray_background_id = 0
|
||||
systray_sort = left2right</pre></ul><h1><a name="tint2_doesn't_show_the_systray/notification"></a>tint2 doesn't show the systray/notification<a href="#tint2_doesn%27t_show_the_systray/notification" class="section_anchor"></a></h1><ul><li>Check your tint2rc to see if you have 'systray = 1' </li><li>run tint2 in a terminal. if you get 'tint2 : another systray is running' it's because you have another systray/notification and you can't run more than one at a time. </li><ul><li>In gnome, remove the systray/notification with a right clic on the separator before your systray/notification -> remove </li></ul></ul><h1><a name="Why_did_some_systray_icons_disappear_from_the_panel?"></a>Why did some systray icons disappear from the panel?<a href="#Why_did_some_systray_icons_disappear_from_the_panel?" class="section_anchor"></a></h1><ul><li>tint2 stops/restarts the systray protocol on some events (like switching theme with tint2conf). But some systray icons do not implement the stop/restart of the manager and so disappear from the panel. You can report the problem to us and also to the systray icon developer. </li></ul><h1><a name="Why_don't_some_systray_icons_appear_when_you_run_tint2_in_a"></a>Why don't some systray icons appear when you run tint2 in a KDE session?<a href="#Why_don%27t_some_systray_icons_appear_when_you_run_tint2_in_a" class="section_anchor"></a></h1><ul><li>Some KDE applications use the KDE status notifier service to show system tray icons. If you disable this service (systemsettings -> Startup and Shutdown -> Service Manager -> uncheck "Status Notifier Manager") all the icons should appear normally in tint2. </li></ul><h1><a name="I_want_to_disable_the_tint2_systray"></a>I want to disable the tint2 systray<a href="#I_want_to_disable_the_tint2_systray" class="section_anchor"></a></h1><ul><li>To disable the systray, just put <tt>systray = 0</tt> in your tint2rc </li><li>Example: </li><pre class="prettyprint">systray = 0
|
||||
systray_padding = 0 3 3
|
||||
systray_background_id = 0</pre></ul><h1><a name="How_to_configure_real_transparency"></a>How to configure real transparency<a href="#How_to_configure_real_transparency" class="section_anchor"></a></h1><ul><li>tint2 autodetects your composite manager and uses real transparency when possible. However, xcompmgr have a little bug which prevents tint2 from detecting it. </li><li>If you want autodetect with xcompmgr, download and apply xcompmgr's patch (in bug report). See <a href="http://bugs.freedesktop.org/show_bug.cgi?id=26090" rel="nofollow">xcompmgr patch</a> </li></ul><h1><a name="Tint2_doesn't_work_on_compiz_correctly?"></a>Tint2 doesn't work on compiz correctly?<a href="#Tint2_doesn%27t_work_on_compiz_correctly?" class="section_anchor"></a></h1><ul><li>All my tasks are on one desktop in compiz? </li><ul><li>This is a known issue in compiz. Compiz doesn't support 'Virtual desktop' specification (or you have to disabled visual effect).<br>I look like 'Desktop number' use Viewport instead of 'Virtual desktop'. So pager capabilities are not supported. <br>See <a href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/153322" rel="nofollow">https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/153322</a> <br>or <a href="http://forum.compiz.org/viewtopic.php?f=86&t=11943" rel="nofollow">http://forum.compiz.org/viewtopic.php?f=86&t=11943</a> <br>or <a href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/150690" rel="nofollow">https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/150690</a> </li></ul><li>Tint is being decorated with a window/ has a shadow /is not fully transparent </li><ul><li>Open CompizConfig Settings manager -> Window Decorations Plugin </li><ul><li>In the box for Decoration windows, put <tt>any & !type=dock</tt> </li><li>In the box for Shadow windows, put <tt>any & !type=dock</tt> </li></ul></ul><blockquote>
|
||||
</blockquote><li>Tint has ugly white streaks </li><ul><li>Set a background for your desktop </li></ul></ul><h1><a name="I_want_to_disable_compiz_shadow_on_Tint2"></a>I want to disable compiz shadow on Tint2<a href="#I_want_to_disable_compiz_shadow_on_Tint2" class="section_anchor"></a></h1><ul><li>Run ccsm the compiz configuration tool. Go to Window Decorations. For both decoration and shadow windows, replace 'any' with 'any & !name=tint2'. </li></ul><h1><a name="Adding_a_'show_desktop'_button"></a>Adding a 'show desktop' button<a href="#Adding_a_%27show_desktop%27_button" class="section_anchor"></a></h1><ul><li>tint2 doesn't implement 'show desktop' button. But here a way to get it. <br> </li></ul><p>Create a file with following text </p><pre class="prettyprint">#!/bin/sh
|
||||
if wmctrl -m | grep "mode: ON"; then
|
||||
exec wmctrl -k off
|
||||
else
|
||||
exec wmctrl -k on
|
||||
fi</pre><p>Save it in /usr/bin/show_desktop.sh and make it executable.<br> Install the package 'wmctrl'. And call the script in tint2rc config file. </p><pre class="prettyprint">time1_format = %H:%M
|
||||
time1_font = sans 8
|
||||
time2_format = %A %d %B
|
||||
time2_font = sans 6
|
||||
clock_font_color = #ffffff 76
|
||||
clock_padding = 4 4
|
||||
clock_background_id = 0
|
||||
clock_lclick_command = show_desktop.sh</pre><p>Then left click on the clock will do it. </p><h1><a name="Task_list_is_limited"></a>Task list is limited<a href="#Task_list_is_limited" class="section_anchor"></a></h1><ul><li>In your tint2rc file, check the value of <tt>taskbar_mode</tt>. If it's <tt>multi_desktop</tt>, tint2 show one taskbar per desktop. Change the value to <tt>single_desktop</tt> if you want just one taskbar. </li></ul><h1><a name="How_can_I_get_'pager_like_capability'_?"></a>How can I get 'pager like capability' ?<a href="#How_can_I_get_%27pager_like_capability%27_?" class="section_anchor"></a></h1><ul><li>In your tint2rc file, change the value of <tt>taskbar_mode</tt> to <tt>multi_desktop</tt>. This option will show one taskbar per desktop. So you can detect on witch desktop is an application and witch desktop is empty (or full). You can close an application whithout switching to the desktop. You can drag n drop application between desktop. </li></ul><h1><a name="I_want_to_hide_some_tasks_from_the_panel_?"></a>I want to hide some tasks from the panel ?<a href="#I_want_to_hide_some_tasks_from_the_panel_?" class="section_anchor"></a></h1><ul><li>In Openbox config file 'rc.xml' you can assign the property 'skip_taskbar' to your window </li></ul><h1><a name="The_tint2_panel_is_blank"></a>The tint2 panel is blank<a href="#The_tint2_panel_is_blank" class="section_anchor"></a></h1><ul><li>A new option, called <tt>panel_items</tt> has been added to the config file. This option defines the items tint2 will show and the order of those items(from left to right). Please define that in your tint2rc file. The format is shown below. The options are <tt>L</tt> for <tt>Launcher</tt>, <tt>S</tt> for the <tt>Systray</tt>, <tt>T</tt> for the <tt>taskbar</tt>, <tt>C</tt> for the <tt>clock</tt> and <tt>B</tt> for the <tt>battery</tt>. </li><pre class="prettyprint">panel_items = LTSBC </pre></ul><h1><a name="How_to_maximize_window_over_tint2"></a>How to maximize window over tint2<a href="#How_to_maximize_window_over_tint2" class="section_anchor"></a></h1><ul><li>You can manage interaction between tint2 and window with : </li><pre class="prettyprint">panel_layer = bottom,normal,top
|
||||
strut_policy = follow_size/minimum/none
|
||||
autohide_height = integer</pre></ul><blockquote>If you want maximized window never cover tint2:
|
||||
<pre class="prettyprint">panel_layer = top
|
||||
strut_policy = follow_size</pre>If you want maximized window behind tint2:
|
||||
<pre class="prettyprint">panel_layer = top
|
||||
strut_policy = none</pre>If you want maximized window behind tint2, but 2 pixels free so you can use desktop action (right click, ...):
|
||||
<pre class="prettyprint">panel_layer = top
|
||||
strut_policy = minimum
|
||||
autohide_height = 2</pre></blockquote><h1><a name="I_get_errors_when_I_try_to_compile_tint2_on_my_own"></a>I get errors when I try to compile tint2 on my own<a href="#I_get_errors_when_I_try_to_compile_tint2_on_my_own" class="section_anchor"></a></h1><ul><li>Do you have all the dependencies installed? Please check <a href="https://code.google.com/p/tint2/wiki/Install#Dependencies">here</a> </li></ul><h1><a name="I_upgraded_to_tint2_and_I_still_have_the_old_panel_with_its_bugs"></a>I upgraded to tint2 and I still have the old panel with its bugs<a href="#I_upgraded_to_tint2_and_I_still_have_the_old_panel_with_its_bugs" class="section_anchor"></a></h1><ul><li>The tint binary was renamed tint2 to avoid a conflict with another package.So your new tint2 startup command is <strong>tint2</strong> </li><li>Since a new stable release hasn't been released yet, both the old tint and the new tint2 binaries will be on your system when you upgrade just incase you run into some problems and want to fall back on the old binary. </li></ul><h1><a name="Tint2_doesn't_show_in_Pekwm"></a>Tint2 doesn't show in Pekwm<a href="#Tint2_doesn%27t_show_in_Pekwm" class="section_anchor"></a></h1><ul><li>The problem is that pekwm defines by default edge borders, and doesn't allow a panel to get inside these edge borders. The config option is in <tt>~/.pekwm/config</tt> under <tt>Screen/EdgeSize</tt>. You can either disable the edge borders or set tint2 to a size where it doesn't enter these borders (i.e. play with <tt>panel_size</tt> and <tt>panel_margin</tt>) </li><li>Setting the margin to one pixel made it appear on my screen. With horizontal panel: </li><pre class="prettyprint">panel_size = 95% height
|
||||
panel_margin = 0 1</pre><li>With vertical panel: </li><pre class="prettyprint">panel_size = width 95%
|
||||
panel_margin = 1 0</pre></ul><h1><a name="Is_there_an_IRC_channel?"></a>Is there an IRC channel?<a href="#Is_there_an_IRC_channel?" class="section_anchor"></a></h1><ul><li>Yes. There is now an irc channel, <strong>#tint2</strong> on <a href="irc://irc.freenode.net" rel="nofollow">irc.freenode.net</a>. </li><li>Just ask your question and stay there, because we are not always watching the channel ;) </li></ul>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr><tr>
|
||||
</tr></tbody></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="wikicommentcol">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="collapse">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="commentform">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="hostedBy" style="margin-top: -20px;">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
@@ -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()
|
||||
{
|
||||
@@ -150,14 +151,16 @@ void init_battery_panel(void *p)
|
||||
|
||||
battery->area.parent = p;
|
||||
battery->area.panel = p;
|
||||
snprintf(battery->area.name, sizeof(battery->area.name), "Battery");
|
||||
battery->area._draw_foreground = draw_battery;
|
||||
battery->area.size_mode = LAYOUT_FIXED;
|
||||
battery->area._resize = resize_battery;
|
||||
battery->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||
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);
|
||||
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);
|
||||
battery->area.has_mouse_press_effect = battery->area.has_mouse_over_effect;
|
||||
if (battery_tooltip_enabled)
|
||||
battery->area._get_tooltip_text = battery_get_tooltip;
|
||||
@@ -167,13 +170,11 @@ void battery_init_fonts()
|
||||
{
|
||||
if (!bat1_font_desc) {
|
||||
bat1_font_desc = pango_font_description_from_string(get_default_font());
|
||||
pango_font_description_set_size(bat1_font_desc,
|
||||
pango_font_description_get_size(bat1_font_desc) - PANGO_SCALE);
|
||||
pango_font_description_set_size(bat1_font_desc, pango_font_description_get_size(bat1_font_desc) - PANGO_SCALE);
|
||||
}
|
||||
if (!bat2_font_desc) {
|
||||
bat2_font_desc = pango_font_description_from_string(get_default_font());
|
||||
pango_font_description_set_size(bat2_font_desc,
|
||||
pango_font_description_get_size(bat2_font_desc) - PANGO_SCALE);
|
||||
pango_font_description_set_size(bat2_font_desc, pango_font_description_get_size(bat2_font_desc) - PANGO_SCALE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef __linux
|
||||
#ifdef __linux__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -235,7 +235,7 @@ static void add_battery(const char *entryname)
|
||||
fprintf(stdout, "found battery \"%s\"\n", bat->name);
|
||||
} else {
|
||||
g_free(bat);
|
||||
fprintf(stderr, RED "failed to initialize battery \"%s\"\n" RESET, entryname);
|
||||
fprintf(stderr, RED "failed to initialize battery \"%s\"" RESET "\n", entryname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ static void add_mains(const char *entryname)
|
||||
fprintf(stdout, "found mains \"%s\"\n", ac->name);
|
||||
} else {
|
||||
g_free(ac);
|
||||
fprintf(stderr, RED "failed to initialize mains \"%s\"\n" RESET, entryname);
|
||||
fprintf(stderr, RED "failed to initialize mains \"%s\"" RESET "\n", entryname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,6 +306,7 @@ static gboolean update_linux_battery(struct psy_battery *bat)
|
||||
|
||||
gint64 old_timestamp = bat->timestamp;
|
||||
int old_energy_now = bat->energy_now;
|
||||
gint old_power_now = bat->power_now;
|
||||
|
||||
/* reset values */
|
||||
bat->present = 0;
|
||||
@@ -356,6 +357,12 @@ static gboolean update_linux_battery(struct psy_battery *bat)
|
||||
/* some hardware does not support reading current power consumption */
|
||||
g_error_free(error);
|
||||
bat->power_now = estimate_power_usage(bat, old_energy_now, old_timestamp);
|
||||
if (bat->power_now == 0 && bat->status != BATTERY_FULL) {
|
||||
/* If the hardware updates the level slower than our sampling period,
|
||||
* we need to sample more rarely */
|
||||
bat->power_now = old_power_now;
|
||||
bat->timestamp = old_timestamp;
|
||||
}
|
||||
} else if (error) {
|
||||
g_error_free(error);
|
||||
return FALSE;
|
||||
@@ -430,6 +437,7 @@ int battery_os_update(BatteryState *state)
|
||||
seconds = 3600 * (total_energy_full - total_energy_now) / total_power_now;
|
||||
else if (state->state == BATTERY_DISCHARGING)
|
||||
seconds = 3600 * total_energy_now / total_power_now;
|
||||
seconds = MAX(0, seconds);
|
||||
}
|
||||
battery_state_set_time(state, seconds);
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
@@ -180,12 +181,15 @@ void init_clock_panel(void *p)
|
||||
clock_init_fonts();
|
||||
clock->area.parent = p;
|
||||
clock->area.panel = p;
|
||||
snprintf(clock->area.name, sizeof(clock->area.name), "Clock");
|
||||
clock->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||
clock->area.has_mouse_press_effect = clock->area.has_mouse_over_effect =
|
||||
panel_config.mouse_effects && (clock_lclick_command || clock_mclick_command || clock_rclick_command || clock_uwheel_command ||
|
||||
clock_dwheel_command);
|
||||
panel_config.mouse_effects && (clock_lclick_command || clock_mclick_command || clock_rclick_command ||
|
||||
clock_uwheel_command || clock_dwheel_command);
|
||||
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;
|
||||
@@ -204,8 +208,7 @@ void clock_init_fonts()
|
||||
if (!time1_font_desc) {
|
||||
time1_font_desc = pango_font_description_from_string(get_default_font());
|
||||
pango_font_description_set_weight(time1_font_desc, PANGO_WEIGHT_BOLD);
|
||||
pango_font_description_set_size(time1_font_desc,
|
||||
pango_font_description_get_size(time1_font_desc));
|
||||
pango_font_description_set_size(time1_font_desc, pango_font_description_get_size(time1_font_desc));
|
||||
}
|
||||
if (!time2_font_desc) {
|
||||
time2_font_desc = pango_font_description_from_string(get_default_font());
|
||||
@@ -275,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;
|
||||
@@ -287,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;
|
||||
@@ -333,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));
|
||||
|
||||
22
src/config.c
@@ -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);
|
||||
@@ -304,13 +317,13 @@ void add_entry(char *key, char *value)
|
||||
char *b;
|
||||
if ((b = strchr(value1, '%'))) {
|
||||
b[0] = '\0';
|
||||
panel_config.fractional_width = 1;
|
||||
panel_config.fractional_width = TRUE;
|
||||
}
|
||||
panel_config.area.width = atoi(value1);
|
||||
if (panel_config.area.width == 0) {
|
||||
// full width mode
|
||||
panel_config.area.width = 100;
|
||||
panel_config.fractional_width = 1;
|
||||
panel_config.fractional_width = TRUE;
|
||||
}
|
||||
if (value2) {
|
||||
if ((b = strchr(value2, '%'))) {
|
||||
@@ -732,7 +745,7 @@ void add_entry(char *key, char *value)
|
||||
panel_config.g_taskbar.background_name[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id);
|
||||
if (panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] == 0)
|
||||
panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] =
|
||||
panel_config.g_taskbar.background_name[TASKBAR_NORMAL];
|
||||
panel_config.g_taskbar.background_name[TASKBAR_NORMAL];
|
||||
} else if (strcmp(key, "taskbar_name_active_background_id") == 0) {
|
||||
int id = atoi(value);
|
||||
id = (id < backgrounds->len && id >= 0) ? id : 0;
|
||||
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
@@ -155,16 +156,23 @@ void init_execp_panel(void *p)
|
||||
execp->area.paddingx = execp->backend->paddingx;
|
||||
execp->area.paddingy = execp->backend->paddingy;
|
||||
execp->area.paddingxlr = execp->backend->paddingxlr;
|
||||
|
||||
execp->area.parent = panel;
|
||||
execp->area.panel = panel;
|
||||
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.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);
|
||||
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);
|
||||
|
||||
execp->area.resize_needed = TRUE;
|
||||
execp->area.on_screen = TRUE;
|
||||
@@ -262,7 +270,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;
|
||||
@@ -301,31 +309,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;
|
||||
@@ -333,7 +341,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;
|
||||
@@ -342,12 +350,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;
|
||||
@@ -377,18 +384,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,16 +426,45 @@ 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_action(void *obj, int button)
|
||||
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_action(void *obj, int button, int x, int y)
|
||||
{
|
||||
Execp *execp = obj;
|
||||
char *command = NULL;
|
||||
@@ -450,7 +486,17 @@ void execp_action(void *obj, int button)
|
||||
break;
|
||||
}
|
||||
if (command) {
|
||||
tint_exec(command);
|
||||
char *full_cmd = g_strdup_printf("export EXECP_X=%d;"
|
||||
"export EXECP_Y=%d;"
|
||||
"export EXECP_W=%d;"
|
||||
"export EXECP_H=%d; %s",
|
||||
x,
|
||||
y,
|
||||
execp->area.width,
|
||||
execp->area.height,
|
||||
command);
|
||||
tint_exec(full_cmd);
|
||||
g_free(full_cmd);
|
||||
} else {
|
||||
if (execp->backend->child_pipe > 0) {
|
||||
// Command currently running, nothing to do
|
||||
@@ -526,8 +572,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;
|
||||
@@ -557,7 +603,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) {
|
||||
@@ -583,7 +629,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
|
||||
@@ -638,7 +684,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;
|
||||
}
|
||||
}
|
||||
@@ -660,11 +706,7 @@ const char *time_to_string(int seconds, char *buffer)
|
||||
int m = seconds / 60;
|
||||
seconds = seconds % 60;
|
||||
int s = seconds;
|
||||
sprintf(buffer,
|
||||
"%d:%d:%ds",
|
||||
h,
|
||||
m,
|
||||
s);
|
||||
sprintf(buffer, "%d:%d:%ds", h, m, s);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
@@ -691,16 +733,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
|
||||
@@ -711,14 +753,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);
|
||||
|
||||
@@ -90,7 +90,6 @@ typedef struct Execp {
|
||||
ExecpFrontend *frontend;
|
||||
} Execp;
|
||||
|
||||
|
||||
// Called before the config is read and panel_config/panels are created.
|
||||
// Afterwards, the config parsing code creates the array of Execp in panel_config and populates the configuration fields
|
||||
// in the backend.
|
||||
@@ -121,7 +120,6 @@ void init_execp_panel(void *panel);
|
||||
// GUI element tree cleanup function (remove_area).
|
||||
void cleanup_execp();
|
||||
|
||||
|
||||
// Called on draw, obj = pointer to the front-end Execp item.
|
||||
void draw_execp(void *obj, cairo_t *c);
|
||||
|
||||
@@ -130,7 +128,7 @@ void draw_execp(void *obj, cairo_t *c);
|
||||
gboolean resize_execp(void *obj);
|
||||
|
||||
// Called on mouse click event.
|
||||
void execp_action(void *obj, int button);
|
||||
void execp_action(void *obj, int button, int x, int y);
|
||||
|
||||
// Called to check if new output from the command can be read.
|
||||
// No command might be running.
|
||||
|
||||
@@ -39,6 +39,7 @@ void init_freespace_panel(void *p)
|
||||
freespace->area.bg = &g_array_index(backgrounds, Background, 0);
|
||||
freespace->area.parent = p;
|
||||
freespace->area.panel = p;
|
||||
snprintf(freespace->area.name, sizeof(freespace->area.name), "Freespace");
|
||||
freespace->area.size_mode = LAYOUT_FIXED;
|
||||
freespace->area.resize_needed = 1;
|
||||
freespace->area.on_screen = TRUE;
|
||||
@@ -56,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;
|
||||
}
|
||||
|
||||
@@ -19,12 +19,19 @@
|
||||
/* http://standards.freedesktop.org/desktop-entry-spec/ */
|
||||
|
||||
#include "apps-common.h"
|
||||
#include "common.h"
|
||||
#include "strnatcmp.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static gint compare_strings(gconstpointer a, gconstpointer b)
|
||||
{
|
||||
return strnatcasecmp((const char *)a, (const char *)b);
|
||||
}
|
||||
|
||||
int parse_dektop_line(char *line, char **key, char **value)
|
||||
{
|
||||
char *p;
|
||||
@@ -53,8 +60,8 @@ void expand_exec(DesktopEntry *entry, const char *path)
|
||||
// %k -> path
|
||||
if (entry->exec) {
|
||||
char *exec2 = calloc(strlen(entry->exec) + (entry->name ? strlen(entry->name) : 1) +
|
||||
(entry->icon ? strlen(entry->icon) : 1) + 100,
|
||||
1);
|
||||
(entry->icon ? strlen(entry->icon) : 1) + 100,
|
||||
1);
|
||||
char *p, *q;
|
||||
// p will never point to an escaped char
|
||||
for (p = entry->exec, q = exec2; *p; p++, q++) {
|
||||
@@ -101,61 +108,77 @@ void expand_exec(DesktopEntry *entry, const char *path)
|
||||
}
|
||||
}
|
||||
|
||||
int read_desktop_file(const char *path, DesktopEntry *entry)
|
||||
gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
|
||||
{
|
||||
FILE *fp;
|
||||
char *line = NULL;
|
||||
size_t line_size;
|
||||
char *key, *value;
|
||||
int i;
|
||||
entry->name = entry->generic_name = entry->icon = entry->exec = NULL;
|
||||
entry->hidden_from_menus = FALSE;
|
||||
|
||||
entry->path = strdup(path);
|
||||
entry->name = entry->icon = entry->exec = NULL;
|
||||
|
||||
if ((fp = fopen(path, "rt")) == NULL) {
|
||||
FILE *fp = fopen(path, "rt");
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "Could not open file %s\n", path);
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const gchar **languages = (const gchar **)g_get_language_names();
|
||||
const gchar **languages = (const gchar **)g_get_language_names();
|
||||
// lang_index is the index of the language for the best Name key in the language vector
|
||||
// lang_index_default is a constant that encodes the Name key without a language
|
||||
int lang_index, lang_index_default;
|
||||
int lang_index_default = 1;
|
||||
#define LANG_DBG 0
|
||||
if (LANG_DBG)
|
||||
printf("Languages:");
|
||||
for (i = 0; languages[i]; i++) {
|
||||
for (int i = 0; languages[i]; i++) {
|
||||
lang_index_default = i + 1;
|
||||
if (LANG_DBG)
|
||||
printf(" %s", languages[i]);
|
||||
}
|
||||
if (LANG_DBG)
|
||||
printf("\n");
|
||||
lang_index_default = i;
|
||||
// we currently do not know about any Name key at all, so use an invalid index
|
||||
lang_index = lang_index_default + 1;
|
||||
int lang_index_name = lang_index_default + 1;
|
||||
int lang_index_generic_name = lang_index_default + 1;
|
||||
|
||||
int inside_desktop_entry = 0;
|
||||
gboolean inside_desktop_entry = 0;
|
||||
char *line = NULL;
|
||||
size_t line_size;
|
||||
while (getline(&line, &line_size, fp) >= 0) {
|
||||
int len = strlen(line);
|
||||
if (len == 0)
|
||||
continue;
|
||||
line[len - 1] = '\0';
|
||||
if (line[len - 1] == '\n')
|
||||
line[len - 1] = '\0';
|
||||
if (line[0] == '[') {
|
||||
inside_desktop_entry = (strcmp(line, "[Desktop Entry]") == 0);
|
||||
}
|
||||
char *key, *value;
|
||||
if (inside_desktop_entry && parse_dektop_line(line, &key, &value)) {
|
||||
if (strstr(key, "Name") == key) {
|
||||
if (strcmp(key, "Name") == 0 && lang_index > lang_index_default) {
|
||||
if (strcmp(key, "Name") == 0 && lang_index_name > lang_index_default) {
|
||||
entry->name = strdup(value);
|
||||
lang_index = lang_index_default;
|
||||
lang_index_name = lang_index_default;
|
||||
} else {
|
||||
for (i = 0; languages[i] && i < lang_index; i++) {
|
||||
for (int i = 0; languages[i] && i < lang_index_name; i++) {
|
||||
gchar *localized_key = g_strdup_printf("Name[%s]", languages[i]);
|
||||
if (strcmp(key, localized_key) == 0) {
|
||||
if (entry->name)
|
||||
free(entry->name);
|
||||
entry->name = strdup(value);
|
||||
lang_index = i;
|
||||
lang_index_name = i;
|
||||
}
|
||||
g_free(localized_key);
|
||||
}
|
||||
}
|
||||
} else if (strstr(key, "GenericName") == key) {
|
||||
if (strcmp(key, "GenericName") == 0 && lang_index_generic_name > lang_index_default) {
|
||||
entry->generic_name = strdup(value);
|
||||
lang_index_generic_name = lang_index_default;
|
||||
} else {
|
||||
for (int i = 0; languages[i] && i < lang_index_generic_name; i++) {
|
||||
gchar *localized_key = g_strdup_printf("GenericName[%s]", languages[i]);
|
||||
if (strcmp(key, localized_key) == 0) {
|
||||
if (entry->generic_name)
|
||||
free(entry->generic_name);
|
||||
entry->generic_name = strdup(value);
|
||||
lang_index_generic_name = i;
|
||||
}
|
||||
g_free(localized_key);
|
||||
}
|
||||
@@ -164,26 +187,90 @@ int read_desktop_file(const char *path, DesktopEntry *entry)
|
||||
entry->exec = strdup(value);
|
||||
} else if (!entry->icon && strcmp(key, "Icon") == 0) {
|
||||
entry->icon = strdup(value);
|
||||
} else if (strcmp(key, "NoDisplay") == 0) {
|
||||
entry->hidden_from_menus = strcasecmp(value, "true") == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
// From this point:
|
||||
// entry->name, entry->icon, entry->exec will never be empty strings (can be NULL though)
|
||||
// entry->name, entry->generic_name, entry->icon, entry->exec will never be empty strings (can be NULL though)
|
||||
|
||||
expand_exec(entry, path);
|
||||
expand_exec(entry, entry->path);
|
||||
|
||||
free(line);
|
||||
return 1;
|
||||
return entry->exec != NULL;
|
||||
}
|
||||
|
||||
gboolean read_desktop_file_from_dir(const char *path, const char *file_name, DesktopEntry *entry)
|
||||
{
|
||||
gchar *full_path = g_build_filename(path, file_name, NULL);
|
||||
if (read_desktop_file_full_path(full_path, entry)) {
|
||||
g_free(full_path);
|
||||
return TRUE;
|
||||
}
|
||||
free(entry->name);
|
||||
free(entry->generic_name);
|
||||
free(entry->icon);
|
||||
free(entry->exec);
|
||||
entry->name = entry->generic_name = entry->icon = entry->exec = NULL;
|
||||
|
||||
GList *subdirs = NULL;
|
||||
|
||||
GDir *d = g_dir_open(path, 0, NULL);
|
||||
if (d) {
|
||||
const gchar *name;
|
||||
while ((name = g_dir_read_name(d))) {
|
||||
gchar *child = g_build_filename(path, name, NULL);
|
||||
if (g_file_test(child, G_FILE_TEST_IS_DIR)) {
|
||||
subdirs = g_list_append(subdirs, child);
|
||||
} else {
|
||||
g_free(child);
|
||||
}
|
||||
}
|
||||
g_dir_close(d);
|
||||
}
|
||||
|
||||
subdirs = g_list_sort(subdirs, compare_strings);
|
||||
gboolean found = FALSE;
|
||||
for (GList *l = subdirs; l; l = g_list_next(l)) {
|
||||
if (read_desktop_file_from_dir(l->data, file_name, entry)) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (GList *l = subdirs; l; l = g_list_next(l)) {
|
||||
g_free(l->data);
|
||||
}
|
||||
g_list_free(subdirs);
|
||||
g_free(full_path);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
gboolean read_desktop_file(const char *path, DesktopEntry *entry)
|
||||
{
|
||||
entry->path = strdup(path);
|
||||
entry->name = entry->generic_name = entry->icon = entry->exec = NULL;
|
||||
|
||||
if (strchr(path, '/'))
|
||||
return read_desktop_file_full_path(path, entry);
|
||||
for (const GSList *location = get_apps_locations(); location; location = g_slist_next(location)) {
|
||||
if (read_desktop_file_from_dir(location->data, path, entry))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void free_desktop_entry(DesktopEntry *entry)
|
||||
{
|
||||
free(entry->name);
|
||||
free(entry->generic_name);
|
||||
free(entry->icon);
|
||||
free(entry->exec);
|
||||
free(entry->path);
|
||||
entry->name = entry->icon = entry->exec = entry->path = NULL;
|
||||
entry->name = entry->generic_name = entry->icon = entry->exec = entry->path = NULL;
|
||||
}
|
||||
|
||||
void test_read_desktop_file()
|
||||
@@ -191,6 +278,29 @@ void test_read_desktop_file()
|
||||
fprintf(stdout, "\033[1;33m");
|
||||
DesktopEntry entry;
|
||||
read_desktop_file("/usr/share/applications/firefox.desktop", &entry);
|
||||
printf("Name:%s Icon:%s Exec:%s\n", entry.name, entry.icon, entry.exec);
|
||||
printf("Name:%s GenericName:%s Icon:%s Exec:%s\n", entry.name, entry.generic_name, entry.icon, entry.exec);
|
||||
fprintf(stdout, "\033[0m");
|
||||
}
|
||||
|
||||
GSList *apps_locations = NULL;
|
||||
// Do not free the result.
|
||||
const GSList *get_apps_locations()
|
||||
{
|
||||
if (apps_locations)
|
||||
return apps_locations;
|
||||
|
||||
apps_locations = load_locations_from_env(apps_locations, "XDG_DATA_HOME", "applications", NULL);
|
||||
|
||||
apps_locations =
|
||||
g_slist_append(apps_locations, g_build_filename(g_get_home_dir(), ".local/share/applications", NULL));
|
||||
|
||||
apps_locations = load_locations_from_env(apps_locations, "XDG_DATA_DIRS", "applications", NULL);
|
||||
|
||||
apps_locations = g_slist_append(apps_locations, g_strdup("/usr/local/share/applications"));
|
||||
apps_locations = g_slist_append(apps_locations, g_strdup("/usr/share/applications"));
|
||||
apps_locations = g_slist_append(apps_locations, g_strdup("/opt/share/applications"));
|
||||
|
||||
apps_locations = slist_remove_duplicates(apps_locations, g_str_equal, g_free);
|
||||
|
||||
return apps_locations;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,15 @@
|
||||
#ifndef APPS_COMMON_H
|
||||
#define APPS_COMMON_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
typedef struct DesktopEntry {
|
||||
char *name;
|
||||
char *generic_name;
|
||||
char *exec;
|
||||
char *icon;
|
||||
char *path;
|
||||
gboolean hidden_from_menus;
|
||||
} DesktopEntry;
|
||||
|
||||
// Parses a line of the form "key = value". Modifies the line.
|
||||
@@ -22,9 +26,13 @@ int parse_dektop_line(char *line, char **key, char **value);
|
||||
// Reads the .desktop file from the given path into the DesktopEntry entry.
|
||||
// The DesktopEntry object must be initially empty.
|
||||
// Returns 1 if successful.
|
||||
int read_desktop_file(const char *path, DesktopEntry *entry);
|
||||
gboolean read_desktop_file(const char *path, DesktopEntry *entry);
|
||||
|
||||
// Empties DesktopEntry: releases the memory of the *members* of entry.
|
||||
void free_desktop_entry(DesktopEntry *entry);
|
||||
|
||||
// Returns a list of the directories used to store desktop files.
|
||||
// Do not free the result, it is cached.
|
||||
const GSList *get_apps_locations();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,11 +20,14 @@
|
||||
|
||||
#include "icon-theme-common.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "apps-common.h"
|
||||
#include "common.h"
|
||||
#include "cache.h"
|
||||
|
||||
#define ICON_DIR_TYPE_SCALABLE 0
|
||||
#define ICON_DIR_TYPE_FIXED 1
|
||||
@@ -50,19 +53,22 @@ const GSList *get_icon_locations()
|
||||
if (icon_locations)
|
||||
return icon_locations;
|
||||
|
||||
gchar *path;
|
||||
path = g_build_filename(g_get_home_dir(), ".icons", NULL);
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup(path));
|
||||
g_free(path);
|
||||
path = g_build_filename(g_get_home_dir(), ".local/share/icons", NULL);
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup(path));
|
||||
g_free(path);
|
||||
icon_locations = load_locations_from_env(icon_locations, "XDG_DATA_HOME", ".icons", NULL);
|
||||
|
||||
icon_locations = g_slist_append(icon_locations, g_build_filename(g_get_home_dir(), ".icons", NULL));
|
||||
icon_locations = g_slist_append(icon_locations, g_build_filename(g_get_home_dir(), ".local/share/icons", NULL));
|
||||
|
||||
icon_locations = load_locations_from_env(icon_locations, "XDG_DATA_DIRS", ".icons", ".pixmaps", NULL);
|
||||
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup("/usr/local/share/icons"));
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup("/usr/local/share/pixmaps"));
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup("/usr/share/icons"));
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup("/usr/share/pixmaps"));
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup("/opt/share/icons"));
|
||||
icon_locations = g_slist_append(icon_locations, g_strdup("/opt/share/pixmaps"));
|
||||
|
||||
icon_locations = slist_remove_duplicates(icon_locations, g_str_equal, g_free);
|
||||
|
||||
return icon_locations;
|
||||
}
|
||||
|
||||
@@ -279,6 +285,8 @@ void free_icon_theme(IconTheme *theme)
|
||||
return;
|
||||
free(theme->name);
|
||||
theme->name = NULL;
|
||||
free(theme->description);
|
||||
theme->description = NULL;
|
||||
for (GSList *l_inherits = theme->list_inherits; l_inherits; l_inherits = l_inherits->next) {
|
||||
free(l_inherits->data);
|
||||
}
|
||||
@@ -293,23 +301,25 @@ void free_icon_theme(IconTheme *theme)
|
||||
theme->list_directories = NULL;
|
||||
}
|
||||
|
||||
void free_themes(IconThemeWrapper *themes)
|
||||
void free_themes(IconThemeWrapper *wrapper)
|
||||
{
|
||||
if (!themes)
|
||||
if (!wrapper)
|
||||
return;
|
||||
for (GSList *l = themes->themes; l; l = l->next) {
|
||||
for (GSList *l = wrapper->themes; l; l = l->next) {
|
||||
IconTheme *theme = (IconTheme *)l->data;
|
||||
free_icon_theme(theme);
|
||||
free(theme);
|
||||
}
|
||||
g_slist_free(themes->themes);
|
||||
for (GSList *l = themes->themes_fallback; l; l = l->next) {
|
||||
g_slist_free(wrapper->themes);
|
||||
for (GSList *l = wrapper->themes_fallback; l; l = l->next) {
|
||||
IconTheme *theme = (IconTheme *)l->data;
|
||||
free_icon_theme(theme);
|
||||
free(theme);
|
||||
}
|
||||
g_slist_free(themes->themes_fallback);
|
||||
free(themes);
|
||||
g_slist_free(wrapper->themes_fallback);
|
||||
g_slist_free_full(wrapper->_queued, free);
|
||||
free_cache(&wrapper->_cache);
|
||||
free(wrapper);
|
||||
}
|
||||
|
||||
void test_launcher_read_theme_file()
|
||||
@@ -336,9 +346,9 @@ void test_launcher_read_theme_file()
|
||||
dir->max_size,
|
||||
dir->threshold,
|
||||
dir->type == ICON_DIR_TYPE_FIXED ? "Fixed" : dir->type == ICON_DIR_TYPE_SCALABLE
|
||||
? "Scalable"
|
||||
: dir->type == ICON_DIR_TYPE_THRESHOLD ? "Threshold"
|
||||
: "?????");
|
||||
? "Scalable"
|
||||
: dir->type == ICON_DIR_TYPE_THRESHOLD ? "Threshold"
|
||||
: "?????");
|
||||
item = g_slist_next(item);
|
||||
}
|
||||
fprintf(stdout, "\033[0m");
|
||||
@@ -397,20 +407,25 @@ void load_themes_helper(const char *name, GSList **themes, GSList **queued)
|
||||
g_slist_free(queue);
|
||||
}
|
||||
|
||||
IconThemeWrapper *load_themes(const char *icon_theme_name)
|
||||
void load_default_theme(IconThemeWrapper *wrapper)
|
||||
{
|
||||
IconThemeWrapper *wrapper = calloc(1, sizeof(IconThemeWrapper));
|
||||
if (wrapper->_themes_loaded)
|
||||
return;
|
||||
|
||||
if (!icon_theme_name) {
|
||||
fprintf(stderr, "Missing icon_theme_name theme, default to 'hicolor'.\n");
|
||||
icon_theme_name = "hicolor";
|
||||
} else {
|
||||
fprintf(stderr, "Loading %s. Icon theme :", icon_theme_name);
|
||||
}
|
||||
fprintf(stderr, GREEN "Loading icon theme %s:" RESET "\n", wrapper->icon_theme_name);
|
||||
|
||||
GSList *queued = NULL;
|
||||
load_themes_helper(icon_theme_name, &wrapper->themes, &queued);
|
||||
load_themes_helper("hicolor", &wrapper->themes, &queued);
|
||||
load_themes_helper(wrapper->icon_theme_name, &wrapper->themes, &wrapper->_queued);
|
||||
load_themes_helper("hicolor", &wrapper->themes, &wrapper->_queued);
|
||||
|
||||
wrapper->_themes_loaded = TRUE;
|
||||
}
|
||||
|
||||
void load_fallbacks(IconThemeWrapper *wrapper)
|
||||
{
|
||||
if (wrapper->_fallback_loaded)
|
||||
return;
|
||||
|
||||
fprintf(stderr, RED "Loading additional icon themes (this means your icon theme is incomplete)..." RESET "\n");
|
||||
|
||||
// Load wrapper->themes_fallback
|
||||
const GSList *location;
|
||||
@@ -422,7 +437,7 @@ IconThemeWrapper *load_themes(const char *icon_theme_name)
|
||||
while ((name = g_dir_read_name(d))) {
|
||||
gchar *file_name = g_build_filename(path, name, "index.theme", NULL);
|
||||
if (g_file_test(file_name, G_FILE_TEST_EXISTS) && !g_file_test(file_name, G_FILE_TEST_IS_DIR)) {
|
||||
load_themes_helper(name, &wrapper->themes_fallback, &queued);
|
||||
load_themes_helper(name, &wrapper->themes_fallback, &wrapper->_queued);
|
||||
}
|
||||
g_free(file_name);
|
||||
}
|
||||
@@ -430,11 +445,47 @@ IconThemeWrapper *load_themes(const char *icon_theme_name)
|
||||
}
|
||||
}
|
||||
|
||||
// Free the queued list
|
||||
GSList *l;
|
||||
for (l = queued; l; l = l->next)
|
||||
free(l->data);
|
||||
g_slist_free(queued);
|
||||
wrapper->_fallback_loaded = TRUE;
|
||||
}
|
||||
|
||||
gchar *get_icon_cache_path()
|
||||
{
|
||||
return g_build_filename(g_get_user_cache_dir(), "tint2", "icon.cache", NULL);
|
||||
}
|
||||
|
||||
void load_icon_cache(IconThemeWrapper *wrapper)
|
||||
{
|
||||
if (wrapper->_cache.loaded)
|
||||
return;
|
||||
|
||||
fprintf(stderr, GREEN "Loading icon theme cache..." RESET "\n");
|
||||
|
||||
gchar *cache_path = get_icon_cache_path();
|
||||
load_cache(&wrapper->_cache, cache_path);
|
||||
g_free(cache_path);
|
||||
}
|
||||
|
||||
void save_icon_cache(IconThemeWrapper *wrapper)
|
||||
{
|
||||
if (!wrapper || !wrapper->_cache.dirty)
|
||||
return;
|
||||
|
||||
fprintf(stderr, GREEN "Saving icon theme cache..." RESET "\n");
|
||||
gchar *cache_path = get_icon_cache_path();
|
||||
save_cache(&wrapper->_cache, cache_path);
|
||||
g_free(cache_path);
|
||||
}
|
||||
|
||||
IconThemeWrapper *load_themes(const char *icon_theme_name)
|
||||
{
|
||||
IconThemeWrapper *wrapper = calloc(1, sizeof(IconThemeWrapper));
|
||||
|
||||
if (!icon_theme_name) {
|
||||
fprintf(stderr, "Missing icon_theme_name theme, default to 'hicolor'.\n");
|
||||
icon_theme_name = "hicolor";
|
||||
}
|
||||
|
||||
wrapper->icon_theme_name = strdup(icon_theme_name);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
@@ -534,9 +585,9 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
|
||||
for (theme = themes; theme; theme = g_slist_next(theme)) {
|
||||
((IconTheme *)theme->data)->list_directories =
|
||||
g_slist_sort_with_data(((IconTheme *)theme->data)->list_directories,
|
||||
compare_theme_directories,
|
||||
GINT_TO_POINTER(size));
|
||||
g_slist_sort_with_data(((IconTheme *)theme->data)->list_directories,
|
||||
compare_theme_directories,
|
||||
GINT_TO_POINTER(size));
|
||||
GSList *dir;
|
||||
for (dir = ((IconTheme *)theme->data)->list_directories; dir; dir = g_slist_next(dir)) {
|
||||
// Closest match
|
||||
@@ -556,7 +607,7 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
char *dir_name = ((IconThemeDir *)dir->data)->name;
|
||||
char *extension = (char *)ext->data;
|
||||
if (strlen(base_name) + strlen(theme_name) + strlen(dir_name) + strlen(icon_name) +
|
||||
strlen(extension) + 100 >
|
||||
strlen(extension) + 100 >
|
||||
file_name_size) {
|
||||
file_name_size = strlen(base_name) + strlen(theme_name) + strlen(dir_name) + strlen(icon_name) +
|
||||
strlen(extension) + 100;
|
||||
@@ -640,21 +691,89 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *get_icon_path(IconThemeWrapper *theme, const char *icon_name, int size)
|
||||
char *get_icon_path_from_cache(IconThemeWrapper *wrapper, const char *icon_name, int size)
|
||||
{
|
||||
if (!theme)
|
||||
if (!wrapper || !icon_name || strlen(icon_name) == 0)
|
||||
return NULL;
|
||||
|
||||
load_icon_cache(wrapper);
|
||||
|
||||
gchar *key = g_strdup_printf("%s\t%s\t%d", wrapper->icon_theme_name, icon_name, size);
|
||||
const gchar *value = get_from_cache(&wrapper->_cache, key);
|
||||
g_free(key);
|
||||
|
||||
if (!value) {
|
||||
fprintf(stderr,
|
||||
YELLOW "Icon path not found in cache: theme = %s, icon = %s, size = %d" RESET "\n",
|
||||
wrapper->icon_theme_name,
|
||||
icon_name,
|
||||
size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!g_file_test(value, G_FILE_TEST_EXISTS))
|
||||
return NULL;
|
||||
|
||||
// fprintf(stderr, "Icon path found in cache: theme = %s, icon = %s, size = %d, path = %s\n",
|
||||
// wrapper->icon_theme_name, icon_name, size, value);
|
||||
|
||||
return strdup(value);
|
||||
}
|
||||
|
||||
void add_icon_path_to_cache(IconThemeWrapper *wrapper, const char *icon_name, int size, const char *path)
|
||||
{
|
||||
if (!wrapper || !icon_name || strlen(icon_name) == 0 || !path || strlen(path) == 0)
|
||||
return;
|
||||
|
||||
fprintf(stderr,
|
||||
"Adding icon path to cache: theme = %s, icon = %s, size = %d, path = %s\n",
|
||||
wrapper->icon_theme_name,
|
||||
icon_name,
|
||||
size,
|
||||
path);
|
||||
|
||||
load_icon_cache(wrapper);
|
||||
|
||||
gchar *key = g_strdup_printf("%s\t%s\t%d", wrapper->icon_theme_name, icon_name, size);
|
||||
add_to_cache(&wrapper->_cache, key, path);
|
||||
g_free(key);
|
||||
}
|
||||
|
||||
char *get_icon_path(IconThemeWrapper *wrapper, const char *icon_name, int size)
|
||||
{
|
||||
if (!wrapper)
|
||||
return NULL;
|
||||
|
||||
if (!icon_name || strlen(icon_name) == 0)
|
||||
goto notfound;
|
||||
|
||||
char *path = get_icon_path_from_cache(wrapper, icon_name, size);
|
||||
if (path)
|
||||
return path;
|
||||
|
||||
load_default_theme(wrapper);
|
||||
|
||||
icon_name = icon_name ? icon_name : DEFAULT_ICON;
|
||||
char *path = get_icon_path_helper(theme->themes, icon_name, size);
|
||||
if (!path) {
|
||||
path = get_icon_path_helper(theme->themes_fallback, icon_name, size);
|
||||
path = get_icon_path_helper(wrapper->themes, icon_name, size);
|
||||
if (path) {
|
||||
add_icon_path_to_cache(wrapper, icon_name, size, path);
|
||||
return path;
|
||||
}
|
||||
if (!path) {
|
||||
fprintf(stderr, "Could not find icon %s\n", icon_name);
|
||||
path = get_icon_path_helper(theme->themes, DEFAULT_ICON, size);
|
||||
}
|
||||
if (!path) {
|
||||
path = get_icon_path_helper(theme->themes_fallback, DEFAULT_ICON, size);
|
||||
|
||||
fprintf(stderr, YELLOW "Icon not found in default theme: %s" RESET "\n", icon_name);
|
||||
load_fallbacks(wrapper);
|
||||
|
||||
path = get_icon_path_helper(wrapper->themes_fallback, icon_name, size);
|
||||
if (path) {
|
||||
add_icon_path_to_cache(wrapper, icon_name, size, path);
|
||||
return path;
|
||||
}
|
||||
|
||||
notfound:
|
||||
fprintf(stderr, RED "Could not find icon '%s', using default." RESET "\n", icon_name);
|
||||
path = get_icon_path_helper(wrapper->themes, DEFAULT_ICON, size);
|
||||
if (path)
|
||||
return path;
|
||||
path = get_icon_path_helper(wrapper->themes_fallback, DEFAULT_ICON, size);
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -7,16 +7,28 @@
|
||||
#define ICON_THEME_COMMON_H
|
||||
|
||||
#include <glib.h>
|
||||
#include "cache.h"
|
||||
|
||||
typedef struct IconThemeWrapper {
|
||||
// The icon theme name for which this wrapper was created
|
||||
char *icon_theme_name;
|
||||
// List of IconTheme*
|
||||
GSList *themes;
|
||||
// Themes are loaded lazily when needed.
|
||||
gboolean _themes_loaded;
|
||||
// List of IconTheme*
|
||||
GSList *themes_fallback;
|
||||
// Fallback themes are loaded lazily when needed.
|
||||
gboolean _fallback_loaded;
|
||||
Cache _cache;
|
||||
// List of icon theme names that have been queued for loading.
|
||||
// Used to avoid loading the same theme twice, and to avoid cycles.
|
||||
GSList *_queued;
|
||||
} IconThemeWrapper;
|
||||
|
||||
typedef struct IconTheme {
|
||||
char *name;
|
||||
char *description;
|
||||
GSList *list_inherits; // each item is a char* (theme name)
|
||||
GSList *list_directories; // each item is an IconThemeDir*
|
||||
} IconTheme;
|
||||
@@ -30,13 +42,16 @@ int parse_theme_line(char *line, char **key, char **value);
|
||||
// inherited themes, the hicolor theme and possibly fallback themes.
|
||||
IconThemeWrapper *load_themes(const char *icon_theme_name);
|
||||
|
||||
void free_themes(IconThemeWrapper *themes);
|
||||
void save_icon_cache(IconThemeWrapper *wrapper);
|
||||
|
||||
void free_themes(IconThemeWrapper *wrapper);
|
||||
void free_icon_theme(IconTheme *theme);
|
||||
|
||||
#define DEFAULT_ICON "application-x-executable"
|
||||
|
||||
// Returns the full path to an icon file (or NULL) given the list of icon themes to search and the icon name
|
||||
// Note: needs to be released with free().
|
||||
char *get_icon_path(IconThemeWrapper *theme, const char *icon_name, int size);
|
||||
char *get_icon_path(IconThemeWrapper *wrapper, const char *icon_name, int size);
|
||||
|
||||
// Returns a list of the directories used to store icons.
|
||||
// Do not free the result, it is cached.
|
||||
|
||||
@@ -56,6 +56,7 @@ 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 default_launcher()
|
||||
{
|
||||
@@ -83,6 +84,7 @@ void init_launcher_panel(void *p)
|
||||
|
||||
launcher->area.parent = p;
|
||||
launcher->area.panel = p;
|
||||
snprintf(launcher->area.name, sizeof(launcher->area.name), "Launcher");
|
||||
launcher->area._draw_foreground = NULL;
|
||||
launcher->area.size_mode = LAYOUT_FIXED;
|
||||
launcher->area._resize = resize_launcher;
|
||||
@@ -140,15 +142,15 @@ void cleanup_launcher_theme(Launcher *launcher)
|
||||
free(launcherIcon->icon_name);
|
||||
free(launcherIcon->icon_path);
|
||||
free(launcherIcon->cmd);
|
||||
free(launcherIcon->icon_tooltip);
|
||||
g_free(launcherIcon->icon_tooltip);
|
||||
}
|
||||
free(launcherIcon);
|
||||
}
|
||||
g_slist_free(launcher->list_icons);
|
||||
launcher->list_icons = NULL;
|
||||
|
||||
free_themes(launcher->list_themes);
|
||||
launcher->list_themes = NULL;
|
||||
free_themes(launcher->icon_theme_wrapper);
|
||||
launcher->icon_theme_wrapper = NULL;
|
||||
}
|
||||
|
||||
gboolean resize_launcher(void *obj)
|
||||
@@ -162,7 +164,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;
|
||||
|
||||
@@ -176,7 +179,7 @@ gboolean resize_launcher(void *obj)
|
||||
|
||||
// Get the path for an icon file with the new size
|
||||
char *new_icon_path =
|
||||
get_icon_path(launcher->list_themes, launcherIcon->icon_name, launcherIcon->icon_size);
|
||||
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);
|
||||
@@ -195,7 +198,7 @@ gboolean resize_launcher(void *obj)
|
||||
// On loading error, fallback to default
|
||||
if (!launcherIcon->image) {
|
||||
free(new_icon_path);
|
||||
new_icon_path = get_icon_path(launcher->list_themes, DEFAULT_ICON, launcherIcon->icon_size);
|
||||
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);
|
||||
}
|
||||
@@ -216,15 +219,16 @@ gboolean resize_launcher(void *obj)
|
||||
|
||||
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);
|
||||
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);
|
||||
panel_config.mouse_pressed_alpha,
|
||||
panel_config.mouse_pressed_saturation,
|
||||
panel_config.mouse_pressed_brightness);
|
||||
}
|
||||
}
|
||||
save_icon_cache(launcher->icon_theme_wrapper);
|
||||
|
||||
int count = g_slist_length(launcher->list_icons);
|
||||
|
||||
@@ -232,36 +236,36 @@ gboolean resize_launcher(void *obj)
|
||||
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;
|
||||
@@ -293,6 +297,16 @@ gboolean resize_launcher(void *obj)
|
||||
}
|
||||
}
|
||||
|
||||
if ((panel_horizontal && icons_per_column == 1) || (!panel_horizontal && icons_per_row == 1)) {
|
||||
launcher->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||
for (GSList *l = launcher->list_icons; l; l = l->next)
|
||||
((LauncherIcon *)l->data)->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||
} else {
|
||||
launcher->area._is_under_mouse = NULL;
|
||||
for (GSList *l = launcher->list_icons; l; l = l->next)
|
||||
((LauncherIcon *)l->data)->area._is_under_mouse = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -333,23 +347,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);
|
||||
icon_scaled = imlib_create_cropped_scaled_image(0,
|
||||
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,
|
||||
(float)launcher_saturation / 100,
|
||||
(float)launcher_brightness / 100);
|
||||
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);
|
||||
@@ -437,6 +466,10 @@ void launcher_load_icons(Launcher *launcher)
|
||||
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;
|
||||
@@ -447,6 +480,7 @@ void launcher_load_icons(Launcher *launcher)
|
||||
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 {
|
||||
@@ -456,19 +490,31 @@ void launcher_load_icons(Launcher *launcher)
|
||||
launcherIcon->cmd = strdup(entry.exec);
|
||||
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
|
||||
launcherIcon->icon_size = 1;
|
||||
launcherIcon->icon_tooltip = entry.name ? strdup(entry.name) : strdup(entry.exec);
|
||||
free_desktop_entry(&entry);
|
||||
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);
|
||||
}
|
||||
free_desktop_entry(&entry);
|
||||
app = g_slist_next(app);
|
||||
}
|
||||
}
|
||||
|
||||
// Populates the list_themes list
|
||||
// Populates the icon_theme_wrapper list
|
||||
void launcher_load_themes(Launcher *launcher)
|
||||
{
|
||||
launcher->list_themes =
|
||||
launcher->icon_theme_wrapper =
|
||||
load_themes(launcher_icon_theme_override
|
||||
? (icon_theme_name_config ? icon_theme_name_config
|
||||
: icon_theme_name_xsettings ? icon_theme_name_xsettings : "hicolor")
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef struct Launcher {
|
||||
Area area;
|
||||
GSList *list_apps; // List of char*, each is a path to a app.desktop file
|
||||
GSList *list_icons; // List of LauncherIcon*
|
||||
IconThemeWrapper *list_themes;
|
||||
IconThemeWrapper *icon_theme_wrapper;
|
||||
} Launcher;
|
||||
|
||||
typedef struct LauncherIcon {
|
||||
|
||||
@@ -350,17 +350,17 @@ static void read_settings(XSettingsClient *client)
|
||||
|
||||
old_handler = XSetErrorHandler(ignore_errors);
|
||||
int result = XGetWindowProperty(client->display,
|
||||
client->manager_window,
|
||||
server.atom._XSETTINGS_SETTINGS,
|
||||
0,
|
||||
LONG_MAX,
|
||||
False,
|
||||
server.atom._XSETTINGS_SETTINGS,
|
||||
&type,
|
||||
&format,
|
||||
&n_items,
|
||||
&bytes_after,
|
||||
&data);
|
||||
client->manager_window,
|
||||
server.atom._XSETTINGS_SETTINGS,
|
||||
0,
|
||||
LONG_MAX,
|
||||
False,
|
||||
server.atom._XSETTINGS_SETTINGS,
|
||||
&type,
|
||||
&format,
|
||||
&n_items,
|
||||
&bytes_after,
|
||||
&data);
|
||||
XSetErrorHandler(old_handler);
|
||||
|
||||
if (result == Success && type == server.atom._XSETTINGS_SETTINGS) {
|
||||
|
||||
413
src/panel.c
@@ -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;
|
||||
@@ -99,6 +100,7 @@ void default_panel()
|
||||
backgrounds = g_array_new(0, 0, sizeof(Background));
|
||||
|
||||
memset(&panel_config, 0, sizeof(Panel));
|
||||
snprintf(panel_config.area.name, sizeof(panel_config.area.name), "Panel");
|
||||
panel_config.mouse_over_alpha = 100;
|
||||
panel_config.mouse_over_saturation = 0;
|
||||
panel_config.mouse_over_brightness = 10;
|
||||
@@ -183,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];
|
||||
|
||||
@@ -196,6 +198,7 @@ void init_panel()
|
||||
p->area.bg = &g_array_index(backgrounds, Background, 0);
|
||||
p->area.parent = p;
|
||||
p->area.panel = p;
|
||||
snprintf(p->area.name, sizeof(p->area.name), "Panel %d", i);
|
||||
p->area.on_screen = TRUE;
|
||||
p->area.resize_needed = 1;
|
||||
p->area.size_mode = LAYOUT_DYNAMIC;
|
||||
@@ -229,25 +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;
|
||||
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});
|
||||
XChangeWindowAttributes(server.display,
|
||||
p->main_win,
|
||||
CWEventMask,
|
||||
&(XSetWindowAttributes){.event_mask = event_mask});
|
||||
|
||||
if (!server.gc) {
|
||||
XGCValues gcv;
|
||||
@@ -284,11 +290,9 @@ void init_panel_size_and_position(Panel *panel)
|
||||
panel->area.height = 32;
|
||||
}
|
||||
if (panel->fractional_width)
|
||||
panel->area.width = (float)server.monitors[panel->monitor].width * panel->area.width / 100;
|
||||
panel->area.width = (server.monitors[panel->monitor].width - panel->marginx) * panel->area.width / 100;
|
||||
if (panel->fractional_height)
|
||||
panel->area.height = (float)server.monitors[panel->monitor].height * panel->area.height / 100;
|
||||
if (panel->area.width + panel->marginx > server.monitors[panel->monitor].width)
|
||||
panel->area.width = server.monitors[panel->monitor].width - panel->marginx;
|
||||
panel->area.height = (server.monitors[panel->monitor].height - panel->marginy) * panel->area.height / 100;
|
||||
if (panel->area.bg->border.radius > panel->area.height / 2) {
|
||||
printf("panel_background_id rounded is too big... please fix your tint2rc\n");
|
||||
g_array_append_val(backgrounds, *panel->area.bg);
|
||||
@@ -306,18 +310,15 @@ void init_panel_size_and_position(Panel *panel)
|
||||
}
|
||||
int old_panel_height = panel->area.height;
|
||||
if (panel->fractional_width)
|
||||
panel->area.height = (float)server.monitors[panel->monitor].height * panel->area.width / 100;
|
||||
panel->area.height = (server.monitors[panel->monitor].height - panel->marginy) * panel->area.width / 100;
|
||||
else
|
||||
panel->area.height = panel->area.width;
|
||||
|
||||
if (panel->fractional_height)
|
||||
panel->area.width = (float)server.monitors[panel->monitor].width * old_panel_height / 100;
|
||||
panel->area.width = (server.monitors[panel->monitor].width - panel->marginx) * old_panel_height / 100;
|
||||
else
|
||||
panel->area.width = old_panel_height;
|
||||
|
||||
if (panel->area.height + panel->marginy > server.monitors[panel->monitor].height)
|
||||
panel->area.height = server.monitors[panel->monitor].height - panel->marginy;
|
||||
|
||||
if (panel->area.bg->border.radius > panel->area.width / 2) {
|
||||
printf("panel_background_id rounded is too big... please fix your tint2rc\n");
|
||||
g_array_append_val(backgrounds, *panel->area.bg);
|
||||
@@ -326,17 +327,22 @@ void init_panel_size_and_position(Panel *panel)
|
||||
}
|
||||
}
|
||||
|
||||
if (panel->area.width + panel->marginx > server.monitors[panel->monitor].width)
|
||||
panel->area.width = server.monitors[panel->monitor].width - panel->marginx;
|
||||
if (panel->area.height + panel->marginy > server.monitors[panel->monitor].height)
|
||||
panel->area.height = server.monitors[panel->monitor].height - panel->marginy;
|
||||
|
||||
// panel position determined here
|
||||
if (panel_position & LEFT) {
|
||||
panel->posx = server.monitors[panel->monitor].x + panel->marginx;
|
||||
} else {
|
||||
if (panel_position & RIGHT) {
|
||||
panel->posx = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width - panel->area.width -
|
||||
panel->marginx;
|
||||
panel->posx = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width -
|
||||
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);
|
||||
panel->posx = server.monitors[panel->monitor].x +
|
||||
((server.monitors[panel->monitor].width - panel->area.width) / 2);
|
||||
else
|
||||
panel->posx = server.monitors[panel->monitor].x + panel->marginx;
|
||||
}
|
||||
@@ -346,10 +352,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +436,9 @@ gboolean resize_panel(void *obj)
|
||||
for (int i = 0; i < panel->num_desktops; i++) {
|
||||
Taskbar *taskbar = &panel->taskbar[i];
|
||||
|
||||
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)
|
||||
@@ -514,21 +522,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)
|
||||
@@ -564,12 +572,55 @@ void set_panel_items_order(Panel *p)
|
||||
GList *item = g_list_nth(p->execp_list, i_execp);
|
||||
i_execp++;
|
||||
if (item)
|
||||
p->area.children = g_list_append(p->area.children, (Area*)item->data);
|
||||
p->area.children = g_list_append(p->area.children, (Area *)item->data);
|
||||
}
|
||||
}
|
||||
initialize_positions(&p->area, 0);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Atom state[4];
|
||||
state[0] = server.atom._NET_WM_STATE_SKIP_PAGER;
|
||||
state[1] = server.atom._NET_WM_STATE_SKIP_TASKBAR;
|
||||
state[2] = server.atom._NET_WM_STATE_STICKY;
|
||||
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);
|
||||
}
|
||||
|
||||
void replace_panel_all_desktops(Panel *p)
|
||||
{
|
||||
XClientMessageEvent m;
|
||||
memset(&m, 0, sizeof(m));
|
||||
m.type = ClientMessage;
|
||||
m.send_event = True;
|
||||
m.display = server.display;
|
||||
m.window = p->main_win;
|
||||
m.message_type = server.atom._NET_WM_DESKTOP;
|
||||
m.format = 32;
|
||||
m.data.l[0] = ALL_DESKTOPS;
|
||||
XSendEvent(server.display, server.root_win, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&m);
|
||||
XSync(server.display, False);
|
||||
}
|
||||
|
||||
void set_panel_properties(Panel *p)
|
||||
{
|
||||
XStoreName(server.display, p->main_win, panel_window_name);
|
||||
@@ -579,59 +630,36 @@ 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);
|
||||
|
||||
val = ALL_DESKTOPS;
|
||||
XChangeProperty(server.display,
|
||||
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;
|
||||
state[1] = server.atom._NET_WM_STATE_SKIP_TASKBAR;
|
||||
state[2] = server.atom._NET_WM_STATE_STICKY;
|
||||
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);
|
||||
place_panel_all_desktops(p);
|
||||
|
||||
XWMHints wmhints;
|
||||
memset(&wmhints, 0, sizeof(wmhints));
|
||||
@@ -650,24 +678,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);
|
||||
|
||||
@@ -740,18 +768,10 @@ Panel *get_panel(Window win)
|
||||
|
||||
Taskbar *click_taskbar(Panel *panel, int x, int y)
|
||||
{
|
||||
if (panel_horizontal) {
|
||||
for (int i = 0; i < panel->num_desktops; i++) {
|
||||
Taskbar *taskbar = &panel->taskbar[i];
|
||||
if (taskbar->area.on_screen && x >= taskbar->area.posx && x <= (taskbar->area.posx + taskbar->area.width))
|
||||
return taskbar;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < panel->num_desktops; i++) {
|
||||
Taskbar *taskbar = &panel->taskbar[i];
|
||||
if (taskbar->area.on_screen && y >= taskbar->area.posy && y <= (taskbar->area.posy + taskbar->area.height))
|
||||
return taskbar;
|
||||
}
|
||||
for (int i = 0; i < panel->num_desktops; i++) {
|
||||
Taskbar *taskbar = &panel->taskbar[i];
|
||||
if (area_is_under_mouse(taskbar, x, y))
|
||||
return taskbar;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -760,25 +780,13 @@ Task *click_task(Panel *panel, int x, int y)
|
||||
{
|
||||
Taskbar *taskbar = click_taskbar(panel, x, y);
|
||||
if (taskbar) {
|
||||
if (panel_horizontal) {
|
||||
GList *l = taskbar->area.children;
|
||||
if (taskbarname_enabled)
|
||||
l = l->next;
|
||||
for (; l; l = l->next) {
|
||||
Task *task = (Task *)l->data;
|
||||
if (task->area.on_screen && x >= task->area.posx && x <= (task->area.posx + task->area.width)) {
|
||||
return task;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GList *l = taskbar->area.children;
|
||||
if (taskbarname_enabled)
|
||||
l = l->next;
|
||||
for (; l; l = l->next) {
|
||||
Task *task = (Task *)l->data;
|
||||
if (task->area.on_screen && y >= task->area.posy && y <= (task->area.posy + task->area.height)) {
|
||||
return task;
|
||||
}
|
||||
GList *l = taskbar->area.children;
|
||||
if (taskbarname_enabled)
|
||||
l = l->next;
|
||||
for (; l; l = l->next) {
|
||||
Task *task = (Task *)l->data;
|
||||
if (area_is_under_mouse(task, x, y)) {
|
||||
return task;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -789,108 +797,53 @@ Launcher *click_launcher(Panel *panel, int x, int y)
|
||||
{
|
||||
Launcher *launcher = &panel->launcher;
|
||||
|
||||
if (panel_horizontal) {
|
||||
if (launcher->area.on_screen && x >= launcher->area.posx && x <= (launcher->area.posx + launcher->area.width))
|
||||
return launcher;
|
||||
} else {
|
||||
if (launcher->area.on_screen && y >= launcher->area.posy && y <= (launcher->area.posy + launcher->area.height))
|
||||
return launcher;
|
||||
}
|
||||
if (area_is_under_mouse(launcher, x, y))
|
||||
return launcher;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LauncherIcon *click_launcher_icon(Panel *panel, int x, int y)
|
||||
{
|
||||
Launcher *launcher = click_launcher(panel, x, y);
|
||||
|
||||
if (launcher) {
|
||||
for (GSList *l = launcher->list_icons; l; l = l->next) {
|
||||
LauncherIcon *icon = (LauncherIcon *)l->data;
|
||||
if (x >= (launcher->area.posx + icon->x) && x <= (launcher->area.posx + icon->x + icon->icon_size) &&
|
||||
y >= (launcher->area.posy + icon->y) && y <= (launcher->area.posy + icon->y + icon->icon_size)) {
|
||||
if (area_is_under_mouse(icon, x, y))
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean click_padding(Panel *panel, int x, int y)
|
||||
{
|
||||
if (panel_horizontal) {
|
||||
if (x < panel->area.paddingxlr || x > panel->area.width - panel->area.paddingxlr)
|
||||
return TRUE;
|
||||
} else {
|
||||
if (y < panel->area.paddingxlr || y > panel->area.height - panel->area.paddingxlr)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int click_clock(Panel *panel, int x, int y)
|
||||
Clock *click_clock(Panel *panel, int x, int y)
|
||||
{
|
||||
Clock *clock = &panel->clock;
|
||||
if (panel_horizontal) {
|
||||
if (clock->area.on_screen && x >= clock->area.posx && x <= (clock->area.posx + clock->area.width))
|
||||
return TRUE;
|
||||
} else {
|
||||
if (clock->area.on_screen && y >= clock->area.posy && y <= (clock->area.posy + clock->area.height))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
if (area_is_under_mouse(clock, x, y))
|
||||
return clock;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
int click_battery(Panel *panel, int x, int y)
|
||||
Battery *click_battery(Panel *panel, int x, int y)
|
||||
{
|
||||
Battery *bat = &panel->battery;
|
||||
if (panel_horizontal) {
|
||||
if (bat->area.on_screen && x >= bat->area.posx && x <= (bat->area.posx + bat->area.width))
|
||||
return TRUE;
|
||||
} else {
|
||||
if (bat->area.on_screen && y >= bat->area.posy && y <= (bat->area.posy + bat->area.height))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
if (area_is_under_mouse(bat, x, y))
|
||||
return bat;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
Execp *click_execp(Panel *panel, int x, int y)
|
||||
{
|
||||
GList *l;
|
||||
for (l = panel->execp_list; l; l = l->next) {
|
||||
for (GList *l = panel->execp_list; l; l = l->next) {
|
||||
Execp *execp = (Execp *)l->data;
|
||||
if (panel_horizontal) {
|
||||
if (execp->area.on_screen && x >= execp->area.posx && x <= (execp->area.posx + execp->area.width))
|
||||
return execp;
|
||||
} else {
|
||||
if (execp->area.on_screen && y >= execp->area.posy && y <= (execp->area.posy + execp->area.height))
|
||||
return execp;
|
||||
}
|
||||
if (area_is_under_mouse(execp, x, y))
|
||||
return execp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Area *click_area(Panel *panel, int x, int y)
|
||||
{
|
||||
Area *result = &panel->area;
|
||||
Area *new_result = result;
|
||||
do {
|
||||
result = new_result;
|
||||
GList *it = result->children;
|
||||
while (it) {
|
||||
Area *a = (Area *)it->data;
|
||||
if (a->on_screen && x >= a->posx && x <= (a->posx + a->width) && y >= a->posy &&
|
||||
y <= (a->posy + a->height)) {
|
||||
new_result = a;
|
||||
break;
|
||||
}
|
||||
it = it->next;
|
||||
}
|
||||
} while (new_result != result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void stop_autohide_timeout(Panel *p)
|
||||
{
|
||||
stop_timeout(p->autohide_timeout);
|
||||
@@ -908,21 +861,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);
|
||||
@@ -946,21 +899,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;
|
||||
}
|
||||
@@ -990,6 +943,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);
|
||||
}
|
||||
|
||||
|
||||
10
src/panel.h
@@ -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;
|
||||
@@ -96,7 +97,7 @@ typedef struct Panel {
|
||||
// position relative to root window
|
||||
int posx, posy;
|
||||
int marginx, marginy;
|
||||
int fractional_width, fractional_height;
|
||||
gboolean fractional_width, fractional_height;
|
||||
int monitor;
|
||||
int font_shadow;
|
||||
gboolean mouse_effects;
|
||||
@@ -154,6 +155,8 @@ gboolean resize_panel(void *obj);
|
||||
void render_panel(Panel *panel);
|
||||
|
||||
void set_panel_items_order(Panel *p);
|
||||
void place_panel_all_desktops(Panel *p);
|
||||
void replace_panel_all_desktops(Panel *p);
|
||||
void set_panel_properties(Panel *p);
|
||||
|
||||
// draw background panel
|
||||
@@ -166,11 +169,10 @@ Taskbar *click_taskbar(Panel *panel, int x, int y);
|
||||
Task *click_task(Panel *panel, int x, int y);
|
||||
Launcher *click_launcher(Panel *panel, int x, int y);
|
||||
LauncherIcon *click_launcher_icon(Panel *panel, int x, int y);
|
||||
gboolean click_padding(Panel *panel, int x, int y);
|
||||
gboolean click_clock(Panel *panel, int x, int y);
|
||||
Clock *click_clock(Panel *panel, int x, int y);
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
gboolean click_battery(Panel *panel, int x, int y);
|
||||
Battery *click_battery(Panel *panel, int x, int y);
|
||||
#endif
|
||||
|
||||
Area *click_area(Panel *panel, int x, int y);
|
||||
|
||||
34
src/server.c
@@ -419,7 +419,8 @@ void server_get_number_of_desktops()
|
||||
int work_area_height = work_area_size[1] + work_area_size[3];
|
||||
XFree(work_area_size);
|
||||
|
||||
long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
|
||||
long *x_screen_size =
|
||||
server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
|
||||
if (!x_screen_size)
|
||||
return;
|
||||
int x_screen_width = x_screen_size[0];
|
||||
@@ -427,8 +428,10 @@ void server_get_number_of_desktops()
|
||||
XFree(x_screen_size);
|
||||
|
||||
int num_viewports = MAX(x_screen_width / work_area_width, 1) * MAX(x_screen_height / work_area_height, 1);
|
||||
if (num_viewports <= 1)
|
||||
if (num_viewports <= 1) {
|
||||
server.num_desktops = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
server.viewports = calloc(num_viewports, sizeof(Viewport));
|
||||
int k = 0;
|
||||
@@ -457,7 +460,8 @@ GSList *get_desktop_names()
|
||||
|
||||
int count;
|
||||
GSList *list = NULL;
|
||||
gchar *data_ptr = server_get_property(server.root_win, server.atom._NET_DESKTOP_NAMES, server.atom.UTF8_STRING, &count);
|
||||
gchar *data_ptr =
|
||||
server_get_property(server.root_win, server.atom._NET_DESKTOP_NAMES, server.atom.UTF8_STRING, &count);
|
||||
if (data_ptr) {
|
||||
list = g_slist_append(list, g_strdup(data_ptr));
|
||||
for (int j = 0; j < count - 1; j++) {
|
||||
@@ -473,8 +477,11 @@ GSList *get_desktop_names()
|
||||
|
||||
int get_current_desktop()
|
||||
{
|
||||
if (!server.viewports)
|
||||
return get_property32(server.root_win, server.atom._NET_CURRENT_DESKTOP, XA_CARDINAL);
|
||||
if (!server.viewports) {
|
||||
return MAX(0,
|
||||
MIN(server.num_desktops - 1,
|
||||
get_property32(server.root_win, server.atom._NET_CURRENT_DESKTOP, XA_CARDINAL)));
|
||||
}
|
||||
|
||||
int num_results;
|
||||
long *work_area_size = server_get_property(server.root_win, server.atom._NET_WORKAREA, XA_CARDINAL, &num_results);
|
||||
@@ -494,7 +501,8 @@ int get_current_desktop()
|
||||
int viewport_y = viewport[1];
|
||||
XFree(viewport);
|
||||
|
||||
long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
|
||||
long *x_screen_size =
|
||||
server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
|
||||
if (!x_screen_size)
|
||||
return 0;
|
||||
int x_screen_width = x_screen_size[0];
|
||||
@@ -502,12 +510,13 @@ int get_current_desktop()
|
||||
|
||||
int ncols = x_screen_width / work_area_width;
|
||||
|
||||
// fprintf(stderr, "\n");
|
||||
// fprintf(stderr, "Work area size: %d x %d\n", work_area_width, work_area_height);
|
||||
// fprintf(stderr, "Viewport pos: %d x %d\n", viewport_x, viewport_y);
|
||||
// fprintf(stderr, "Viewport i: %d\n", (viewport_y / work_area_height) * ncols + viewport_x / work_area_width);
|
||||
// fprintf(stderr, "\n");
|
||||
// fprintf(stderr, "Work area size: %d x %d\n", work_area_width, work_area_height);
|
||||
// fprintf(stderr, "Viewport pos: %d x %d\n", viewport_x, viewport_y);
|
||||
// fprintf(stderr, "Viewport i: %d\n", (viewport_y / work_area_height) * ncols + viewport_x / work_area_width);
|
||||
|
||||
return (viewport_y / work_area_height) * ncols + viewport_x / work_area_width;
|
||||
int result = (viewport_y / work_area_height) * ncols + viewport_x / work_area_width;
|
||||
return MAX(0, MIN(server.num_desktops - 1, result));
|
||||
}
|
||||
|
||||
void change_desktop(int desktop)
|
||||
@@ -544,7 +553,8 @@ void server_init_visual()
|
||||
// inspired by freedesktops fdclock ;)
|
||||
XVisualInfo templ = {.screen = server.screen, .depth = 32, .class = TrueColor};
|
||||
int nvi;
|
||||
XVisualInfo *xvi = XGetVisualInfo(server.display, VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi);
|
||||
XVisualInfo *xvi =
|
||||
XGetVisualInfo(server.display, VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi);
|
||||
|
||||
Visual *visual = NULL;
|
||||
if (xvi) {
|
||||
|
||||
@@ -166,5 +166,4 @@ GSList *get_desktop_names();
|
||||
int get_current_desktop();
|
||||
void change_desktop(int desktop);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "systraybar.h"
|
||||
#include "server.h"
|
||||
#include "panel.h"
|
||||
#include "window.h"
|
||||
|
||||
GSList *icons;
|
||||
|
||||
@@ -45,9 +46,9 @@ GSList *icons;
|
||||
Window net_sel_win = None;
|
||||
|
||||
// freedesktop specification doesn't allow multi systray
|
||||
Systraybar systray;
|
||||
int refresh_systray;
|
||||
int systray_enabled;
|
||||
Systray systray;
|
||||
gboolean refresh_systray;
|
||||
gboolean systray_enabled;
|
||||
int systray_max_icon_size;
|
||||
int systray_monitor;
|
||||
int chrono;
|
||||
@@ -64,10 +65,12 @@ 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;
|
||||
memset(&systray, 0, sizeof(Systraybar));
|
||||
memset(&systray, 0, sizeof(systray));
|
||||
render_background = 0;
|
||||
chrono = 0;
|
||||
systray.alpha = 100;
|
||||
@@ -113,29 +116,28 @@ 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);
|
||||
show(&systray.area);
|
||||
systray.area.resize_needed = 1;
|
||||
panel->area.resize_needed = 1;
|
||||
schedule_redraw(&systray.area);
|
||||
panel_refresh = TRUE;
|
||||
refresh_systray = 1;
|
||||
refresh_systray = TRUE;
|
||||
}
|
||||
|
||||
gboolean resize_systray(void *obj)
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
Systraybar *sysbar = obj;
|
||||
|
||||
if (panel_horizontal)
|
||||
sysbar->icon_size = sysbar->area.height;
|
||||
systray.icon_size = systray.area.height;
|
||||
else
|
||||
sysbar->icon_size = sysbar->area.width;
|
||||
sysbar->icon_size = sysbar->icon_size - (2 * sysbar->area.bg->border.width) - (2 * sysbar->area.paddingy);
|
||||
if (systray_max_icon_size > 0 && sysbar->icon_size > systray_max_icon_size)
|
||||
sysbar->icon_size = systray_max_icon_size;
|
||||
systray.icon_size = systray.area.width;
|
||||
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);
|
||||
|
||||
if (systray.icon_size > 0) {
|
||||
long icon_size = systray.icon_size;
|
||||
@@ -151,33 +153,31 @@ gboolean resize_systray(void *obj)
|
||||
|
||||
int count = 0;
|
||||
for (GSList *l = systray.list_icons; l; l = l->next) {
|
||||
if (((TrayWindow *)l->data)->hide)
|
||||
continue;
|
||||
count++;
|
||||
}
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "%s:%d number of icons = %d\n" RESET, __FUNCTION__, __LINE__, count);
|
||||
fprintf(stderr, BLUE "%s:%d number of icons = %d" RESET "\n", __FUNCTION__, __LINE__, count);
|
||||
|
||||
if (panel_horizontal) {
|
||||
int height = sysbar->area.height - 2 * sysbar->area.bg->border.width - 2 * sysbar->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
|
||||
sysbar->icons_per_column = (height + sysbar->area.paddingx) / (sysbar->icon_size + sysbar->area.paddingx);
|
||||
sysbar->margin =
|
||||
height - (sysbar->icons_per_column - 1) * (sysbar->icon_size + sysbar->area.paddingx) - sysbar->icon_size;
|
||||
sysbar->icons_per_row = count / sysbar->icons_per_column + (count % sysbar->icons_per_column != 0);
|
||||
systray.area.width = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) +
|
||||
(sysbar->icon_size * sysbar->icons_per_row) +
|
||||
((sysbar->icons_per_row - 1) * systray.area.paddingx);
|
||||
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;
|
||||
systray.icons_per_row = count / systray.icons_per_column + (count % systray.icons_per_column != 0);
|
||||
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 = sysbar->area.width - 2 * sysbar->area.bg->border.width - 2 * sysbar->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
|
||||
sysbar->icons_per_row = (width + sysbar->area.paddingx) / (sysbar->icon_size + sysbar->area.paddingx);
|
||||
sysbar->margin =
|
||||
width - (sysbar->icons_per_row - 1) * (sysbar->icon_size + sysbar->area.paddingx) - sysbar->icon_size;
|
||||
sysbar->icons_per_column = count / sysbar->icons_per_row + (count % sysbar->icons_per_row != 0);
|
||||
systray.area.height = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) +
|
||||
(sysbar->icon_size * sysbar->icons_per_column) +
|
||||
((sysbar->icons_per_column - 1) * systray.area.paddingx);
|
||||
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;
|
||||
systray.icons_per_column = count / systray.icons_per_row + (count % systray.icons_per_row != 0);
|
||||
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) {
|
||||
@@ -190,12 +190,12 @@ gboolean resize_systray(void *obj)
|
||||
void draw_systray(void *obj, cairo_t *c)
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
if (systray_composited) {
|
||||
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,
|
||||
@@ -211,25 +211,49 @@ 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)
|
||||
fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
// here, systray.area.posx/posy are defined by rendering engine. so we can calculate position of tray icon.
|
||||
Systraybar *sysbar = obj;
|
||||
if (sysbar->icons_per_column == 0 || sysbar->icons_per_row == 0)
|
||||
if (systray.icons_per_column == 0 || systray.icons_per_row == 0)
|
||||
return;
|
||||
|
||||
Panel *panel = sysbar->area.panel;
|
||||
// systray.area.posx/posy are computed by rendering engine.
|
||||
// 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 + sysbar->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;
|
||||
@@ -237,8 +261,6 @@ void on_change_systray(void *obj)
|
||||
int i;
|
||||
for (i = 1, l = systray.list_icons; l; i++, l = l->next) {
|
||||
traywin = (TrayWindow *)l->data;
|
||||
if (traywin->hide)
|
||||
continue;
|
||||
|
||||
traywin->y = posy;
|
||||
traywin->x = posx;
|
||||
@@ -252,21 +274,21 @@ void on_change_systray(void *obj)
|
||||
traywin->parent,
|
||||
posx,
|
||||
posy);
|
||||
traywin->width = sysbar->icon_size;
|
||||
traywin->height = sysbar->icon_size;
|
||||
traywin->width = systray.icon_size;
|
||||
traywin->height = systray.icon_size;
|
||||
if (panel_horizontal) {
|
||||
if (i % sysbar->icons_per_column) {
|
||||
posy += sysbar->icon_size + sysbar->area.paddingx;
|
||||
if (i % systray.icons_per_column) {
|
||||
posy += systray.icon_size + systray.area.paddingx;
|
||||
} else {
|
||||
posy = start;
|
||||
posx += (sysbar->icon_size + systray.area.paddingx);
|
||||
posx += (systray.icon_size + systray.area.paddingx);
|
||||
}
|
||||
} else {
|
||||
if (i % sysbar->icons_per_row) {
|
||||
posx += sysbar->icon_size + systray.area.paddingx;
|
||||
if (i % systray.icons_per_row) {
|
||||
posx += systray.icon_size + systray.area.paddingx;
|
||||
} else {
|
||||
posx = start;
|
||||
posy += (sysbar->icon_size + systray.area.paddingx);
|
||||
posy += (systray.icon_size + systray.area.paddingx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,12 +298,12 @@ void on_change_systray(void *obj)
|
||||
unsigned int width, height, depth;
|
||||
Window root;
|
||||
if (!XGetGeometry(server.display, traywin->parent, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) {
|
||||
fprintf(stderr, RED "Couldn't get geometry of window!\n" RESET);
|
||||
fprintf(stderr, RED "Couldn't get geometry of window!" RESET "\n");
|
||||
}
|
||||
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,
|
||||
@@ -345,7 +367,7 @@ void start_net()
|
||||
pid += prop[0];
|
||||
fprintf(stderr, " pid=%d", pid);
|
||||
}
|
||||
fprintf(stderr, "\n" RESET);
|
||||
fprintf(stderr, RESET "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -392,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,
|
||||
@@ -402,11 +424,11 @@ void start_net()
|
||||
XSetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime);
|
||||
if (XGetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) {
|
||||
stop_net();
|
||||
fprintf(stderr, RED "tint2 : can't get systray manager\n" RESET);
|
||||
fprintf(stderr, RED "tint2 : can't get systray manager" RESET "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(stderr, GREEN "tint2 : systray started\n" RESET);
|
||||
fprintf(stderr, GREEN "tint2 : systray started" RESET "\n");
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
XClientMessageEvent ev;
|
||||
@@ -445,7 +467,7 @@ void net_message(XClientMessageEvent *e)
|
||||
if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA)
|
||||
fprintf(stderr, "message from dockapp: %s\n", e->data.b);
|
||||
else
|
||||
fprintf(stderr, RED "SYSTEM_TRAY : unknown message type\n" RESET);
|
||||
fprintf(stderr, RED "SYSTEM_TRAY : unknown message type" RESET "\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -473,10 +495,10 @@ gboolean error;
|
||||
int window_error_handler(Display *d, XErrorEvent *e)
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, RED "[%f] %s:%d\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, RED "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
error = TRUE;
|
||||
if (e->error_code != BadWindow) {
|
||||
fprintf(stderr, RED "systray: error code %d\n" RESET, e->error_code);
|
||||
fprintf(stderr, RED "systray: error code %d" RESET "\n", e->error_code);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -519,26 +541,32 @@ void print_icons()
|
||||
TrayWindow *t = l->data;
|
||||
TrayWindow *u = l->next->data;
|
||||
int cmp = compare_traywindows(t, u);
|
||||
fprintf(stderr, "%s %s %s\n", t->name, cmp < 0 ? "<" : cmp == 0 ? "=" : ">" , u->name);
|
||||
fprintf(stderr, "%s %s %s\n", t->name, cmp < 0 ? "<" : cmp == 0 ? "=" : ">", u->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gboolean add_icon(Window win)
|
||||
{
|
||||
XTextProperty xname;
|
||||
char *name;
|
||||
if (XGetWMName(server.display, win, &xname)) {
|
||||
name = strdup((char *)xname.value);
|
||||
XFree(xname.value);
|
||||
} else {
|
||||
name = strdup("");
|
||||
// Avoid duplicates
|
||||
for (GSList *l = systray.list_icons; l; l = l->next) {
|
||||
TrayWindow *other = (TrayWindow *)l->data;
|
||||
if (other->win == win) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Dangerous actions begin
|
||||
XSync(server.display, False);
|
||||
error = FALSE;
|
||||
XErrorHandler old = XSetErrorHandler(window_error_handler);
|
||||
|
||||
XSelectInput(server.display, win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
|
||||
|
||||
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;
|
||||
int hide = 0;
|
||||
|
||||
// Get the process ID of the application that created the window
|
||||
int pid = 0;
|
||||
@@ -566,111 +594,33 @@ gboolean add_icon(Window win)
|
||||
}
|
||||
}
|
||||
|
||||
for (GSList *l = systray.list_icons; l; l = l->next) {
|
||||
TrayWindow *other = (TrayWindow *)l->data;
|
||||
if (other->win == win) {
|
||||
free(name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the application leaves behind empty icons
|
||||
int num_empty_same_pid = 0;
|
||||
#if 0
|
||||
for (GSList *l = systray.list_icons; l; l = l->next) {
|
||||
TrayWindow *other = (TrayWindow *)l->data;
|
||||
if (!systray_composited) {
|
||||
// Empty icon detection: we compare the contents of the icon with the contents of the panel pixmap.
|
||||
// If any pixel is different, the icon is not empty.
|
||||
imlib_context_set_visual(server.visual);
|
||||
imlib_context_set_colormap(server.colormap);
|
||||
imlib_context_set_drawable(other->win);
|
||||
Imlib_Image image = imlib_create_image_from_drawable(0, 0, 0, other->width, other->height, 1);
|
||||
if (image) {
|
||||
imlib_context_set_drawable(panel->temp_pmap);
|
||||
Imlib_Image bg =
|
||||
imlib_create_image_from_drawable(0, other->x, other->y, other->width, other->height, 1);
|
||||
imlib_context_set_image(bg);
|
||||
DATA32 *data_bg = imlib_image_get_data_for_reading_only();
|
||||
imlib_context_set_image(image);
|
||||
imlib_image_set_has_alpha(other->depth > 24);
|
||||
DATA32 *data = imlib_image_get_data_for_reading_only();
|
||||
int x, y;
|
||||
gboolean empty = TRUE;
|
||||
for (x = 0; x < other->width && empty; x++) {
|
||||
for (y = 0; y < other->height && empty; y++) {
|
||||
DATA32 pixel = data[y * other->width + x];
|
||||
DATA32 a = (pixel >> 24) & 0xff;
|
||||
if (a == 0)
|
||||
continue;
|
||||
|
||||
DATA32 rgb = pixel & 0xffFFff;
|
||||
DATA32 pixel_bg = data_bg[y * other->width + x];
|
||||
DATA32 rgb_bg = pixel_bg & 0xffFFff;
|
||||
if (rgb != rgb_bg) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "Pixel: %x different from bg %x at pos %d %d\n", pixel, pixel_bg, x, y);
|
||||
empty = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
other->empty = empty;
|
||||
imlib_free_image_and_decache();
|
||||
imlib_context_set_image(bg);
|
||||
imlib_free_image_and_decache();
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
"[%f] %s:%d win = %lu (%s) empty = %d\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
other->win,
|
||||
other->name,
|
||||
other->empty);
|
||||
}
|
||||
}
|
||||
if (pid && other->pid == pid) {
|
||||
if (other->empty)
|
||||
num_empty_same_pid++;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty icons if the application leaves behind more than 1
|
||||
const int max_num_empty_same_pid = 0;
|
||||
if (num_empty_same_pid > max_num_empty_same_pid) {
|
||||
for (GSList *l = systray.list_icons; l; l = l->next) {
|
||||
if (pid && ((TrayWindow *)l->data)->pid == pid && ((TrayWindow *)l->data)->empty) {
|
||||
num_empty_same_pid++;
|
||||
fprintf(stderr,
|
||||
RED
|
||||
"Removing tray icon %lu (%s) from misbehaving application with pid=%d (too many icons)\n" RESET,
|
||||
((TrayWindow *)l->data)->win,
|
||||
((TrayWindow *)l->data)->name,
|
||||
pid);
|
||||
remove_icon((TrayWindow *)l->data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Create the parent window that will embed the icon
|
||||
XWindowAttributes attr;
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XGetWindowAttributes(server.display, win = %ld, &attr)\n", win);
|
||||
if (XGetWindowAttributes(server.display, win, &attr) == False) {
|
||||
free(name);
|
||||
XSelectInput(server.display, win, NoEventMask);
|
||||
|
||||
// Dangerous actions end
|
||||
XSync(server.display, False);
|
||||
XSetErrorHandler(old);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Dangerous actions end
|
||||
XSync(server.display, False);
|
||||
XSetErrorHandler(old);
|
||||
|
||||
unsigned long mask = 0;
|
||||
XSetWindowAttributes set_attr;
|
||||
Visual *visual = server.visual;
|
||||
fprintf(stderr,
|
||||
GREEN "add_icon: %lu (%s), pid %d, %d, visual %p, colormap %lu, depth %d, width %d, height %d\n" RESET,
|
||||
GREEN "add_icon: %lu (%s), pid %d, visual %p, colormap %lu, depth %d, width %d, height %d" RESET "\n",
|
||||
win,
|
||||
name,
|
||||
pid,
|
||||
num_empty_same_pid,
|
||||
attr.visual,
|
||||
attr.colormap,
|
||||
attr.depth,
|
||||
@@ -696,6 +646,7 @@ gboolean add_icon(Window win)
|
||||
mask = CWBackPixmap;
|
||||
}
|
||||
}
|
||||
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XCreateWindow(...)\n");
|
||||
Window parent = XCreateWindow(server.display,
|
||||
@@ -715,7 +666,6 @@ gboolean add_icon(Window win)
|
||||
TrayWindow *traywin = g_new0(TrayWindow, 1);
|
||||
traywin->parent = parent;
|
||||
traywin->win = win;
|
||||
traywin->hide = hide;
|
||||
traywin->depth = attr.depth;
|
||||
// Reparenting is done at the first paint event when the window is positioned correctly over its empty background,
|
||||
// to prevent graphical corruptions in icons with fake transparency
|
||||
@@ -724,7 +674,7 @@ gboolean add_icon(Window win)
|
||||
traywin->chrono = chrono;
|
||||
chrono++;
|
||||
|
||||
if (systray.area.on_screen == 0)
|
||||
if (!systray.area.on_screen)
|
||||
show(&systray.area);
|
||||
|
||||
if (systray.sort == SYSTRAY_SORT_RIGHT2LEFT)
|
||||
@@ -734,7 +684,7 @@ gboolean add_icon(Window win)
|
||||
systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows);
|
||||
// print_icons();
|
||||
|
||||
if (!traywin->hide && !panel->is_hidden) {
|
||||
if (!panel->is_hidden) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XMapRaised(server.display, traywin->parent)\n");
|
||||
XMapRaised(server.display, traywin->parent);
|
||||
@@ -745,11 +695,14 @@ gboolean add_icon(Window win)
|
||||
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
systray.area.resize_needed = TRUE;
|
||||
schedule_redraw(&systray.area);
|
||||
panel->area.resize_needed = TRUE;
|
||||
panel_refresh = TRUE;
|
||||
schedule_redraw(&systray.area);
|
||||
refresh_systray = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -771,15 +724,13 @@ gboolean reparent_icon(TrayWindow *traywin)
|
||||
XSync(server.display, False);
|
||||
error = FALSE;
|
||||
XErrorHandler old = XSetErrorHandler(window_error_handler);
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XSelectInput(server.display, traywin->win, ...)\n");
|
||||
XSelectInput(server.display, traywin->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
|
||||
XWithdrawWindow(server.display, traywin->win, server.screen);
|
||||
XReparentWindow(server.display, traywin->win, traywin->parent, 0, 0);
|
||||
|
||||
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);
|
||||
@@ -808,7 +759,7 @@ gboolean reparent_icon(TrayWindow *traywin)
|
||||
XSetErrorHandler(old);
|
||||
if (error != FALSE) {
|
||||
fprintf(stderr,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d\n" RESET,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d" RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -860,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,
|
||||
@@ -881,13 +832,11 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
if (hide) {
|
||||
// In theory we have to check the embedding with this and remove icons that refuse embedding.
|
||||
// In practice we have no idea when the other application processes the event and accepts the
|
||||
// embed
|
||||
// so we cannot check now without a race.
|
||||
// embed so we cannot check now without a race.
|
||||
// Race can be triggered with PyGtk(2) apps.
|
||||
// We could defer this for later (if we set PropertyChangeMask in XSelectInput we get notified)
|
||||
// but
|
||||
// for some reason it breaks transparency for Qt icons. So we don't.
|
||||
// fprintf(stderr, RED "tint2: window refused embedding\n" RESET);
|
||||
// but for some reason it breaks transparency for Qt icons. So we don't.
|
||||
// fprintf(stderr, RED "tint2: window refused embedding" RESET "\n");
|
||||
// remove_icon(traywin);
|
||||
// XFree(data);
|
||||
// return FALSE;
|
||||
@@ -896,7 +845,7 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
XFree(data);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, RED "tint2 : xembed error\n" RESET);
|
||||
fprintf(stderr, RED "tint2 : xembed error" RESET "\n");
|
||||
remove_icon(traywin);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -915,12 +864,10 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
XRaiseWindow(server.display, traywin->win);
|
||||
|
||||
// Make the icon visible
|
||||
if (!traywin->hide) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XMapWindow(server.display, traywin->win)\n");
|
||||
XMapWindow(server.display, traywin->win);
|
||||
}
|
||||
if (!traywin->hide && !panel->is_hidden) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XMapWindow(server.display, traywin->win)\n");
|
||||
XMapWindow(server.display, traywin->win);
|
||||
if (!panel->is_hidden) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "XMapRaised(server.display, traywin->parent)\n");
|
||||
XMapRaised(server.display, traywin->parent);
|
||||
@@ -932,7 +879,7 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
XSetErrorHandler(old);
|
||||
if (error != FALSE) {
|
||||
fprintf(stderr,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d\n" RESET,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d" RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -958,8 +905,6 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
|
||||
void remove_icon(TrayWindow *traywin)
|
||||
{
|
||||
// This code causes an X11 I/O error
|
||||
// close(((_XPrivDisplay)server.display)->fd);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
"[%f] %s:%d win = %lu (%s)\n",
|
||||
@@ -972,7 +917,7 @@ void remove_icon(TrayWindow *traywin)
|
||||
|
||||
// remove from our list
|
||||
systray.list_icons = g_slist_remove(systray.list_icons, traywin);
|
||||
fprintf(stderr, YELLOW "remove_icon: %lu (%s)\n" RESET, traywin->win, traywin->name);
|
||||
fprintf(stderr, YELLOW "remove_icon: %lu (%s)" RESET "\n", traywin->win, traywin->name);
|
||||
|
||||
XSelectInput(server.display, traywin->win, NoEventMask);
|
||||
if (traywin->damage)
|
||||
@@ -982,8 +927,7 @@ void remove_icon(TrayWindow *traywin)
|
||||
XSync(server.display, False);
|
||||
error = FALSE;
|
||||
XErrorHandler old = XSetErrorHandler(window_error_handler);
|
||||
if (!traywin->hide)
|
||||
XUnmapWindow(server.display, traywin->win);
|
||||
XUnmapWindow(server.display, traywin->win);
|
||||
XReparentWindow(server.display, traywin->win, server.root_win, 0, 0);
|
||||
XDestroyWindow(server.display, traywin->parent);
|
||||
XSync(server.display, False);
|
||||
@@ -1001,8 +945,6 @@ void remove_icon(TrayWindow *traywin)
|
||||
int count = 0;
|
||||
GSList *l;
|
||||
for (l = systray.list_icons; l; l = l->next) {
|
||||
if (((TrayWindow *)l->data)->hide)
|
||||
continue;
|
||||
count++;
|
||||
}
|
||||
if (count == 0)
|
||||
@@ -1010,18 +952,19 @@ void remove_icon(TrayWindow *traywin)
|
||||
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
systray.area.resize_needed = TRUE;
|
||||
schedule_redraw(&systray.area);
|
||||
panel->area.resize_needed = TRUE;
|
||||
panel_refresh = TRUE;
|
||||
schedule_redraw(&systray.area);
|
||||
refresh_systray = TRUE;
|
||||
}
|
||||
|
||||
void systray_resize_icon(void *t)
|
||||
{
|
||||
// we end up in this function only in real transparency mode or if systray_task_asb != 100 0 0
|
||||
// we made also sure, that we always have a 32 bit visual, i.e. we can safely create 32 bit pixmaps here
|
||||
TrayWindow *traywin = t;
|
||||
|
||||
unsigned int border_width;
|
||||
@@ -1031,42 +974,43 @@ void systray_resize_icon(void *t)
|
||||
if (!XGetGeometry(server.display, traywin->win, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) {
|
||||
return;
|
||||
} else {
|
||||
if (1 || xpos != 0 || ypos != 0 || width != traywin->width || height != traywin->height) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
"XMoveResizeWindow(server.display, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height "
|
||||
"= %d)\n",
|
||||
traywin->win,
|
||||
traywin->width,
|
||||
traywin->height);
|
||||
if (0) {
|
||||
XMoveResizeWindow(server.display, traywin->win, 0, 0, traywin->width, traywin->height);
|
||||
}
|
||||
if (0) {
|
||||
XWindowChanges changes;
|
||||
changes.x = changes.y = 0;
|
||||
changes.width = traywin->width;
|
||||
changes.height = traywin->height;
|
||||
XConfigureWindow(server.display, traywin->win, CWX | CWY | CWWidth | CWHeight, &changes);
|
||||
}
|
||||
if (1) {
|
||||
XConfigureEvent ev;
|
||||
ev.type = ConfigureNotify;
|
||||
ev.serial = 0;
|
||||
ev.send_event = True;
|
||||
ev.event = traywin->win;
|
||||
ev.window = traywin->win;
|
||||
ev.x = 0;
|
||||
ev.y = 0;
|
||||
ev.width = traywin->width;
|
||||
ev.height = traywin->height;
|
||||
ev.border_width = 0;
|
||||
ev.above = None;
|
||||
ev.override_redirect = False;
|
||||
XSendEvent(server.display, traywin->win, False, StructureNotifyMask, (XEvent *)&ev);
|
||||
}
|
||||
XSync(server.display, False);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
"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);
|
||||
}
|
||||
// This is similar but GTK tray icons still do not respect the new size
|
||||
if (0) {
|
||||
XWindowChanges changes;
|
||||
changes.x = changes.y = 0;
|
||||
changes.width = traywin->width;
|
||||
changes.height = traywin->height;
|
||||
XConfigureWindow(server.display, traywin->win, CWX | CWY | CWWidth | CWHeight, &changes);
|
||||
}
|
||||
// This is what WMs send to windows to resize them, the new size must not be ignored.
|
||||
// A bit brutal but works with GTK and everything else.
|
||||
if (1) {
|
||||
XConfigureEvent ev;
|
||||
ev.type = ConfigureNotify;
|
||||
ev.serial = 0;
|
||||
ev.send_event = True;
|
||||
ev.event = traywin->win;
|
||||
ev.window = traywin->win;
|
||||
ev.x = 0;
|
||||
ev.y = 0;
|
||||
ev.width = traywin->width;
|
||||
ev.height = traywin->height;
|
||||
ev.border_width = 0;
|
||||
ev.above = None;
|
||||
ev.override_redirect = False;
|
||||
XSendEvent(server.display, traywin->win, False, StructureNotifyMask, (XEvent *)&ev);
|
||||
}
|
||||
XSync(server.display, False);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1111,7 +1055,7 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
|
||||
if (traywin->bad_size_counter == max_bad_resize_events) {
|
||||
traywin->bad_size_counter++;
|
||||
fprintf(stderr,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events\n" RESET,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events" RESET "\n",
|
||||
traywin->win,
|
||||
traywin->name);
|
||||
}
|
||||
@@ -1131,9 +1075,13 @@ 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\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
panel_refresh = TRUE;
|
||||
refresh_systray = 1;
|
||||
refresh_systray = TRUE;
|
||||
}
|
||||
|
||||
void systray_property_notify(TrayWindow *traywin, XEvent *e)
|
||||
@@ -1141,17 +1089,8 @@ void systray_property_notify(TrayWindow *traywin, XEvent *e)
|
||||
Atom at = e->xproperty.atom;
|
||||
if (at == server.atom.WM_NAME) {
|
||||
free(traywin->name);
|
||||
|
||||
XTextProperty xname;
|
||||
if (XGetWMName(server.display, traywin->win, &xname)) {
|
||||
traywin->name = strdup((char *)xname.value);
|
||||
XFree(xname.value);
|
||||
} else {
|
||||
traywin->name = strdup("");
|
||||
}
|
||||
|
||||
if (systray.sort == SYSTRAY_SORT_ASCENDING ||
|
||||
systray.sort == SYSTRAY_SORT_DESCENDING) {
|
||||
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();
|
||||
}
|
||||
@@ -1196,14 +1135,13 @@ void systray_resize_request_event(TrayWindow *traywin, XEvent *e)
|
||||
if (traywin->bad_size_counter == max_bad_resize_events) {
|
||||
traywin->bad_size_counter++;
|
||||
fprintf(stderr,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events\n" RESET,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events" RESET "\n",
|
||||
traywin->win,
|
||||
traywin->name);
|
||||
}
|
||||
// Delayed resize
|
||||
// FIXME Normally we should force the icon to resize fill_color to the size we resized it to when we
|
||||
// embedded it.
|
||||
// However this triggers a resize loop in new versions of GTK, which we must avoid.
|
||||
// FIXME Normally we should force the icon to resize to the size we resized it to when we embedded it.
|
||||
// However this triggers a resize loop in some versions of GTK, which we must avoid.
|
||||
if (!traywin->resize_timeout)
|
||||
traywin->resize_timeout =
|
||||
add_timeout(slow_resize_period, 0, systray_resize_icon, traywin, &traywin->resize_timeout);
|
||||
@@ -1216,9 +1154,13 @@ 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\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
panel_refresh = TRUE;
|
||||
refresh_systray = 1;
|
||||
refresh_systray = TRUE;
|
||||
}
|
||||
|
||||
void systray_destroy_event(TrayWindow *traywin)
|
||||
@@ -1240,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);
|
||||
}
|
||||
|
||||
@@ -1278,7 +1220,7 @@ void systray_render_icon_composited(void *t)
|
||||
add_timeout(min_refresh_period, 0, systray_render_icon_composited, traywin, &traywin->render_timeout);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1298,7 +1240,7 @@ void systray_render_icon_composited(void *t)
|
||||
add_timeout(min_refresh_period, 0, systray_render_icon_composited, traywin, &traywin->render_timeout);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1315,7 +1257,6 @@ void systray_render_icon_composited(void *t)
|
||||
// good systray icons support 32 bit depth, but some icons are still 24 bit.
|
||||
// We create a heuristic mask for these icons, i.e. we get the rgb value in the top left corner, and
|
||||
// mask out all pixel with the same rgb value
|
||||
Panel *panel = systray.area.panel;
|
||||
|
||||
// Very ugly hack, but somehow imlib2 is not able to get the image from the traywindow itself,
|
||||
// so we first render the tray window onto a pixmap, and then we tell imlib2 to use this pixmap as
|
||||
@@ -1330,7 +1271,7 @@ void systray_render_icon_composited(void *t)
|
||||
} else if (traywin->depth == 32) {
|
||||
f = XRenderFindStandardFormat(server.display, PictStandardARGB32);
|
||||
} else {
|
||||
fprintf(stderr, RED "Strange tray icon found with depth: %d\n" RESET, traywin->depth);
|
||||
fprintf(stderr, RED "Strange tray icon found with depth: %d" RESET "\n", traywin->depth);
|
||||
XFreePixmap(server.display, tmp_pmap);
|
||||
return;
|
||||
}
|
||||
@@ -1354,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);
|
||||
@@ -1407,14 +1348,13 @@ void systray_render_icon_composited(void *t)
|
||||
create_heuristic_mask(data, traywin->width, traywin->height);
|
||||
}
|
||||
|
||||
gboolean empty = FALSE; //image_empty(data, traywin->width, traywin->height);
|
||||
if (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
|
||||
adjust_asb(data,
|
||||
traywin->width,
|
||||
traywin->height,
|
||||
systray.alpha,
|
||||
(float)systray.saturation / 100,
|
||||
(float)systray.brightness / 100);
|
||||
systray.alpha / 100.0,
|
||||
systray.saturation / 100.0,
|
||||
systray.brightness / 100.0);
|
||||
imlib_image_put_back_data(data);
|
||||
|
||||
systray_render_icon_from_image(traywin);
|
||||
@@ -1427,23 +1367,6 @@ void systray_render_icon_composited(void *t)
|
||||
if (error)
|
||||
goto on_error;
|
||||
|
||||
if (traywin->empty != empty) {
|
||||
traywin->empty = empty;
|
||||
systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows);
|
||||
// print_icons();
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw\n" RESET,
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
systray.area.resize_needed = 1;
|
||||
schedule_redraw(&systray.area);
|
||||
panel->area.resize_needed = 1;
|
||||
panel_refresh = TRUE;
|
||||
refresh_systray = 1;
|
||||
}
|
||||
panel_refresh = TRUE;
|
||||
|
||||
if (systray_profile)
|
||||
@@ -1459,7 +1382,7 @@ void systray_render_icon_composited(void *t)
|
||||
|
||||
on_error:
|
||||
fprintf(stderr,
|
||||
RED "systray %d: rendering error for icon %lu (%s) pid %d\n" RESET,
|
||||
RED "systray %d: rendering error for icon %lu (%s) pid %d" RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -1469,7 +1392,7 @@ on_error:
|
||||
on_systray_error:
|
||||
fprintf(stderr,
|
||||
RED "systray %d: rendering error for icon %lu (%s) pid %d. "
|
||||
"Disabling compositing and restarting systray...\n" RESET,
|
||||
"Disabling compositing and restarting systray..." RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -1494,7 +1417,7 @@ void systray_render_icon(void *t)
|
||||
if (!traywin->reparented || !traywin->embedded) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1532,7 +1455,7 @@ void systray_render_icon(void *t)
|
||||
systray_render_icon_from_image(traywin);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1554,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);
|
||||
}
|
||||
@@ -1568,21 +1491,18 @@ void systray_render_icon(void *t)
|
||||
void refresh_systray_icons()
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
TrayWindow *traywin;
|
||||
GSList *l;
|
||||
for (l = systray.list_icons; l; l = l->next) {
|
||||
traywin = (TrayWindow *)l->data;
|
||||
if (traywin->hide)
|
||||
continue;
|
||||
systray_render_icon(traywin);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean systray_on_monitor(int i_monitor, int num_panelss)
|
||||
gboolean systray_on_monitor(int i_monitor, int num_panels)
|
||||
{
|
||||
return (i_monitor == systray_monitor) ||
|
||||
(i_monitor == 0 && (systray_monitor >= num_panelss || systray_monitor < 0));
|
||||
return (i_monitor == systray_monitor) || (i_monitor == 0 && (systray_monitor >= num_panels || systray_monitor < 0));
|
||||
}
|
||||
|
||||
TrayWindow *systray_find_icon(Window win)
|
||||
|
||||
@@ -35,35 +35,41 @@ typedef struct {
|
||||
SystraySortMethod sort;
|
||||
int alpha, saturation, brightness;
|
||||
int icon_size, icons_per_column, icons_per_row, margin;
|
||||
} Systraybar;
|
||||
} Systray;
|
||||
|
||||
typedef struct {
|
||||
Window parent;
|
||||
// The actual tray icon window (created by the application)
|
||||
Window win;
|
||||
// The parent window created by tint2 to embed the icon
|
||||
Window parent;
|
||||
int x, y;
|
||||
int width, height;
|
||||
// TODO: manage icon's show/hide
|
||||
gboolean hide;
|
||||
int depth;
|
||||
Damage damage;
|
||||
timeout *render_timeout;
|
||||
gboolean empty;
|
||||
int pid;
|
||||
int chrono;
|
||||
struct timespec time_last_render;
|
||||
int num_fast_renders;
|
||||
gboolean reparented;
|
||||
gboolean embedded;
|
||||
int bad_size_counter;
|
||||
timeout *resize_timeout;
|
||||
struct timespec time_last_resize;
|
||||
// Process PID or zero.
|
||||
int pid;
|
||||
// A number that is incremented for each new icon, used to sort them by the order in which they were created.
|
||||
int chrono;
|
||||
// Name of the tray icon window.
|
||||
char *name;
|
||||
// Members used for rendering
|
||||
struct timespec time_last_render;
|
||||
int num_fast_renders;
|
||||
timeout *render_timeout;
|
||||
// Members used for resizing
|
||||
int bad_size_counter;
|
||||
struct timespec time_last_resize;
|
||||
timeout *resize_timeout;
|
||||
// Icon contents if we are compositing the icon, otherwise null
|
||||
Imlib_Image image;
|
||||
// XDamage
|
||||
Damage damage;
|
||||
} TrayWindow;
|
||||
|
||||
// net_sel_win != None when protocol started
|
||||
extern Window net_sel_win;
|
||||
extern Systraybar systray;
|
||||
extern Systray systray;
|
||||
extern gboolean refresh_systray;
|
||||
extern gboolean systray_enabled;
|
||||
extern int systray_max_icon_size;
|
||||
@@ -83,7 +89,7 @@ void init_systray_panel(void *p);
|
||||
void draw_systray(void *obj, cairo_t *c);
|
||||
gboolean resize_systray(void *obj);
|
||||
void on_change_systray(void *obj);
|
||||
gboolean systray_on_monitor(int i_monitor, int num_panelss);
|
||||
gboolean systray_on_monitor(int i_monitor, int num_panels);
|
||||
|
||||
// systray protocol
|
||||
// many tray icon doesn't manage stop/restart of the systray manager
|
||||
|
||||
@@ -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;
|
||||
@@ -65,8 +67,11 @@ Task *add_task(Window win)
|
||||
|
||||
Task task_template;
|
||||
memset(&task_template, 0, sizeof(task_template));
|
||||
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);
|
||||
task_template.area.panel = &panels[monitor];
|
||||
@@ -81,8 +86,14 @@ 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");
|
||||
|
||||
// fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task_template.title ? task_template.title : "??");
|
||||
// fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task_template.title ?
|
||||
// task_template.title : "??");
|
||||
// fprintf(stderr, "new task %s win %u: desktop %d, monitor %d\n", new_task.title, win, new_task.desktop, monitor);
|
||||
|
||||
GPtrArray *task_buttons = g_ptr_array_new();
|
||||
@@ -95,6 +106,8 @@ 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;
|
||||
task_instance->win_x = task_template.win_x;
|
||||
@@ -124,20 +137,20 @@ Task *add_task(Window win)
|
||||
*key = task_template.win;
|
||||
g_hash_table_insert(win_to_task, key, task_buttons);
|
||||
|
||||
set_task_state((Task*)g_ptr_array_index(task_buttons, 0), task_template.current_state);
|
||||
set_task_state((Task *)g_ptr_array_index(task_buttons, 0), task_template.current_state);
|
||||
|
||||
sort_taskbar_for_win(win);
|
||||
|
||||
if (taskbar_mode == MULTI_DESKTOP) {
|
||||
Panel *panel = (Panel*)task_template.area.panel;
|
||||
Panel *panel = (Panel *)task_template.area.panel;
|
||||
panel->area.resize_needed = TRUE;
|
||||
}
|
||||
|
||||
if (window_is_urgent(win)) {
|
||||
add_urgent((Task*)g_ptr_array_index(task_buttons, 0));
|
||||
add_urgent((Task *)g_ptr_array_index(task_buttons, 0));
|
||||
}
|
||||
|
||||
return (Task*)g_ptr_array_index(task_buttons, 0);
|
||||
return (Task *)g_ptr_array_index(task_buttons, 0);
|
||||
}
|
||||
|
||||
void remove_task(Task *task)
|
||||
@@ -145,7 +158,8 @@ void remove_task(Task *task)
|
||||
if (!task)
|
||||
return;
|
||||
|
||||
// fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, task->win, task->title ? task->title : "??");
|
||||
// fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, task->win, task->title ? task->title :
|
||||
// "??");
|
||||
|
||||
if (taskbar_mode == MULTI_DESKTOP) {
|
||||
Panel *panel = task->area.panel;
|
||||
@@ -262,15 +276,10 @@ void task_update_icon(Task *task)
|
||||
gulong *tmp_data;
|
||||
|
||||
tmp_data = get_best_icon(data, get_icon_count(data, i), i, &w, &h, panel->g_task.icon_size1);
|
||||
#ifdef __x86_64__
|
||||
DATA32 icon_data[w * h];
|
||||
int length = w * h;
|
||||
for (int j = 0; j < length; ++j)
|
||||
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);
|
||||
#else
|
||||
img = imlib_create_image_using_data(w, h, (DATA32 *)tmp_data);
|
||||
#endif
|
||||
XFree(data);
|
||||
} else {
|
||||
// get Pixmap icon
|
||||
@@ -302,7 +311,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);
|
||||
@@ -316,22 +325,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],
|
||||
(float)panel->g_task.saturation[k] / 100,
|
||||
(float)panel->g_task.brightness[k] / 100);
|
||||
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);
|
||||
@@ -360,15 +369,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 = panel->g_task.area.paddingxlr + task->area.bg->border.width;
|
||||
task->_icon_x = left_border_width(&task->area) + task->area.paddingxlr;
|
||||
}
|
||||
|
||||
// Render
|
||||
@@ -387,7 +395,8 @@ void draw_task_icon(Task *task, int text_width)
|
||||
}
|
||||
|
||||
imlib_context_set_image(image);
|
||||
render_image(task->area.pix, pos_x, panel->g_task.icon_posy);
|
||||
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)
|
||||
@@ -395,7 +404,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);
|
||||
@@ -411,18 +420,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)
|
||||
@@ -432,13 +464,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)
|
||||
@@ -571,7 +603,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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -147,8 +147,10 @@ void init_taskbar_panel(void *p)
|
||||
|
||||
// taskbar name
|
||||
panel->g_taskbar.area_name.panel = panel;
|
||||
snprintf(panel->g_taskbar.area_name.name, sizeof(panel->g_taskbar.area_name.name), "Taskbarname");
|
||||
panel->g_taskbar.area_name.size_mode = LAYOUT_FIXED;
|
||||
panel->g_taskbar.area_name._resize = resize_taskbarname;
|
||||
panel->g_taskbar.area_name._is_under_mouse = full_width_area_is_under_mouse;
|
||||
panel->g_taskbar.area_name._draw_foreground = draw_taskbarname;
|
||||
panel->g_taskbar.area_name._on_change_layout = 0;
|
||||
panel->g_taskbar.area_name.resize_needed = 1;
|
||||
@@ -157,25 +159,30 @@ void init_taskbar_panel(void *p)
|
||||
// taskbar
|
||||
panel->g_taskbar.area.parent = panel;
|
||||
panel->g_taskbar.area.panel = panel;
|
||||
snprintf(panel->g_taskbar.area.name, sizeof(panel->g_taskbar.area.name), "Taskbar");
|
||||
panel->g_taskbar.area.size_mode = LAYOUT_DYNAMIC;
|
||||
panel->g_taskbar.area.alignment = taskbar_alignment;
|
||||
panel->g_taskbar.area._resize = resize_taskbar;
|
||||
panel->g_taskbar.area._is_under_mouse = full_width_area_is_under_mouse;
|
||||
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;
|
||||
}
|
||||
|
||||
// task
|
||||
panel->g_task.area.panel = panel;
|
||||
snprintf(panel->g_task.area.name, sizeof(panel->g_task.area.name), "Task");
|
||||
panel->g_task.area.size_mode = LAYOUT_DYNAMIC;
|
||||
panel->g_task.area._draw_foreground = draw_task;
|
||||
panel->g_task.area._on_change_layout = on_change_task;
|
||||
@@ -218,16 +225,26 @@ void init_taskbar_panel(void *p)
|
||||
if ((panel->g_task.config_background_mask & (1 << TASK_URGENT)) == 0)
|
||||
panel->g_task.background[TASK_URGENT] = panel->g_task.background[TASK_ACTIVE];
|
||||
|
||||
if (!panel->g_task.maximum_width)
|
||||
panel->g_task.maximum_width = server.monitors[panel->monitor].width;
|
||||
if (!panel->g_task.maximum_height)
|
||||
panel->g_task.maximum_height = server.monitors[panel->monitor].height;
|
||||
|
||||
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;
|
||||
panel->g_task.area.height = panel->area.height - (2 * panel->g_task.area.posy);
|
||||
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->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;
|
||||
}
|
||||
|
||||
@@ -236,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;
|
||||
@@ -246,28 +263,37 @@ 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);
|
||||
|
||||
if (!panel->g_task.maximum_width && panel_horizontal)
|
||||
panel->g_task.maximum_width = server.monitors[panel->monitor].width;
|
||||
|
||||
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 = panel->g_task.area.height - (2 * panel->g_task.area.paddingy);
|
||||
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);
|
||||
}
|
||||
// printf("monitor %d, task_maximum_width %d\n", panel->monitor, panel->g_task.maximum_width);
|
||||
|
||||
Taskbar *taskbar;
|
||||
panel->num_desktops = server.num_desktops;
|
||||
@@ -393,13 +419,13 @@ 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;
|
||||
}
|
||||
@@ -422,7 +448,7 @@ void set_taskbar_state(Taskbar *taskbar, TaskbarState state)
|
||||
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;
|
||||
@@ -466,7 +492,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;
|
||||
|
||||
@@ -89,4 +89,6 @@ void sort_taskbar_for_win(Window win);
|
||||
|
||||
void sort_tasks(Taskbar *taskbar);
|
||||
|
||||
gboolean taskbar_is_under_mouse(void *obj, int x, int y);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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;
|
||||
|
||||
256
src/tint.c
@@ -135,37 +135,66 @@ void write_string(int fd, const char *s)
|
||||
const char *signal_name(int sig)
|
||||
{
|
||||
switch (sig) {
|
||||
case SIGHUP: return "SIGHUP: Hangup (POSIX).";
|
||||
case SIGINT: return "SIGINT: Interrupt (ANSI).";
|
||||
case SIGQUIT: return "SIGQUIT: Quit (POSIX).";
|
||||
case SIGILL: return "SIGILL: Illegal instruction (ANSI).";
|
||||
case SIGTRAP: return "SIGTRAP: Trace trap (POSIX).";
|
||||
case SIGABRT: return "SIGABRT/SIGIOT: Abort (ANSI) / IOT trap (4.2 BSD).";
|
||||
case SIGBUS: return "SIGBUS: BUS error (4.2 BSD).";
|
||||
case SIGFPE: return "SIGFPE: Floating-point exception (ANSI).";
|
||||
case SIGKILL: return "SIGKILL: Kill, unblockable (POSIX).";
|
||||
case SIGUSR1: return "SIGUSR1: User-defined signal 1 (POSIX).";
|
||||
case SIGSEGV: return "SIGSEGV: Segmentation violation (ANSI).";
|
||||
case SIGUSR2: return "SIGUSR2: User-defined signal 2 (POSIX).";
|
||||
case SIGPIPE: return "SIGPIPE: Broken pipe (POSIX).";
|
||||
case SIGALRM: return "SIGALRM: Alarm clock (POSIX).";
|
||||
case SIGTERM: return "SIGTERM: Termination (ANSI).";
|
||||
//case SIGSTKFLT: return "SIGSTKFLT: Stack fault.";
|
||||
case SIGCHLD: return "SIGCHLD: Child status has changed (POSIX).";
|
||||
case SIGCONT: return "SIGCONT: Continue (POSIX).";
|
||||
case SIGSTOP: return "SIGSTOP: Stop, unblockable (POSIX).";
|
||||
case SIGTSTP: return "SIGTSTP: Keyboard stop (POSIX).";
|
||||
case SIGTTIN: return "SIGTTIN: Background read from tty (POSIX).";
|
||||
case SIGTTOU: return "SIGTTOU: Background write to tty (POSIX).";
|
||||
case SIGURG: return "SIGURG: Urgent condition on socket (4.2 BSD).";
|
||||
case SIGXCPU: return "SIGXCPU: CPU limit exceeded (4.2 BSD).";
|
||||
case SIGXFSZ: return "SIGXFSZ: File size limit exceeded (4.2 BSD).";
|
||||
case SIGVTALRM: return "SIGVTALRM: Virtual alarm clock (4.2 BSD).";
|
||||
case SIGPROF: return "SIGPROF: Profiling alarm clock (4.2 BSD).";
|
||||
case SIGWINCH: return "SIGWINCH: Window size change (4.3 BSD, Sun).";
|
||||
case SIGIO: return "SIGIO: Pollable event occurred (System V) / I/O now possible (4.2 BSD).";
|
||||
//case SIGPWR: return "SIGPWR: Power failure restart (System V).";
|
||||
case SIGSYS: return "SIGSYS: Bad system call.";
|
||||
case SIGHUP:
|
||||
return "SIGHUP: Hangup (POSIX).";
|
||||
case SIGINT:
|
||||
return "SIGINT: Interrupt (ANSI).";
|
||||
case SIGQUIT:
|
||||
return "SIGQUIT: Quit (POSIX).";
|
||||
case SIGILL:
|
||||
return "SIGILL: Illegal instruction (ANSI).";
|
||||
case SIGTRAP:
|
||||
return "SIGTRAP: Trace trap (POSIX).";
|
||||
case SIGABRT:
|
||||
return "SIGABRT/SIGIOT: Abort (ANSI) / IOT trap (4.2 BSD).";
|
||||
case SIGBUS:
|
||||
return "SIGBUS: BUS error (4.2 BSD).";
|
||||
case SIGFPE:
|
||||
return "SIGFPE: Floating-point exception (ANSI).";
|
||||
case SIGKILL:
|
||||
return "SIGKILL: Kill, unblockable (POSIX).";
|
||||
case SIGUSR1:
|
||||
return "SIGUSR1: User-defined signal 1 (POSIX).";
|
||||
case SIGSEGV:
|
||||
return "SIGSEGV: Segmentation violation (ANSI).";
|
||||
case SIGUSR2:
|
||||
return "SIGUSR2: User-defined signal 2 (POSIX).";
|
||||
case SIGPIPE:
|
||||
return "SIGPIPE: Broken pipe (POSIX).";
|
||||
case SIGALRM:
|
||||
return "SIGALRM: Alarm clock (POSIX).";
|
||||
case SIGTERM:
|
||||
return "SIGTERM: Termination (ANSI).";
|
||||
// case SIGSTKFLT: return "SIGSTKFLT: Stack fault.";
|
||||
case SIGCHLD:
|
||||
return "SIGCHLD: Child status has changed (POSIX).";
|
||||
case SIGCONT:
|
||||
return "SIGCONT: Continue (POSIX).";
|
||||
case SIGSTOP:
|
||||
return "SIGSTOP: Stop, unblockable (POSIX).";
|
||||
case SIGTSTP:
|
||||
return "SIGTSTP: Keyboard stop (POSIX).";
|
||||
case SIGTTIN:
|
||||
return "SIGTTIN: Background read from tty (POSIX).";
|
||||
case SIGTTOU:
|
||||
return "SIGTTOU: Background write to tty (POSIX).";
|
||||
case SIGURG:
|
||||
return "SIGURG: Urgent condition on socket (4.2 BSD).";
|
||||
case SIGXCPU:
|
||||
return "SIGXCPU: CPU limit exceeded (4.2 BSD).";
|
||||
case SIGXFSZ:
|
||||
return "SIGXFSZ: File size limit exceeded (4.2 BSD).";
|
||||
case SIGVTALRM:
|
||||
return "SIGVTALRM: Virtual alarm clock (4.2 BSD).";
|
||||
case SIGPROF:
|
||||
return "SIGPROF: Profiling alarm clock (4.2 BSD).";
|
||||
case SIGWINCH:
|
||||
return "SIGWINCH: Window size change (4.3 BSD, Sun).";
|
||||
case SIGIO:
|
||||
return "SIGIO: Pollable event occurred (System V) / I/O now possible (4.2 BSD).";
|
||||
// case SIGPWR: return "SIGPWR: Power failure restart (System V).";
|
||||
case SIGSYS:
|
||||
return "SIGSYS: Bad system call.";
|
||||
}
|
||||
static char s[64];
|
||||
sprintf(s, "SIG=%d: Unknown", sig);
|
||||
@@ -191,7 +220,8 @@ const char *get_home_dir()
|
||||
|
||||
void dump_backtrace(int log_fd)
|
||||
{
|
||||
log_string(log_fd, YELLOW "\nBacktrace:\n");
|
||||
#ifndef DISABLE_BACKTRACE
|
||||
log_string(log_fd, "\n" YELLOW "Backtrace:" RESET "\n");
|
||||
|
||||
#ifdef ENABLE_LIBUNWIND
|
||||
unw_cursor_t cursor;
|
||||
@@ -203,7 +233,7 @@ void dump_backtrace(int log_fd)
|
||||
unw_word_t offset;
|
||||
char fname[128];
|
||||
fname[0] = '\0';
|
||||
(void) unw_get_proc_name(&cursor, fname, sizeof(fname), &offset);
|
||||
(void)unw_get_proc_name(&cursor, fname, sizeof(fname), &offset);
|
||||
log_string(log_fd, fname);
|
||||
log_string(log_fd, "\n");
|
||||
}
|
||||
@@ -220,13 +250,9 @@ void dump_backtrace(int log_fd)
|
||||
}
|
||||
|
||||
free(strings);
|
||||
#else
|
||||
#ifdef DISABLE_BACKTRACE
|
||||
log_string(log_fd, "Backtrace support disabled at compile time.\n");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
log_string(log_fd, RESET);
|
||||
#endif // ENABLE_EXECINFO
|
||||
#endif // ENABLE_LIBUNWIND
|
||||
#endif // DISABLE_BACKTRACE
|
||||
}
|
||||
|
||||
// sleep() returns early when signals arrive. This function does not.
|
||||
@@ -243,16 +269,17 @@ void safe_sleep(int seconds)
|
||||
|
||||
void handle_crash(const char *reason)
|
||||
{
|
||||
// We are going to crash, so restart the panel
|
||||
#ifndef DISABLE_BACKTRACE
|
||||
char path[4096];
|
||||
sprintf(path, "%s/.tint2-crash.log", get_home_dir());
|
||||
int log_fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0600);
|
||||
int log_fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
||||
log_string(log_fd, RED "tint2 crashed, reason: ");
|
||||
log_string(log_fd, reason);
|
||||
log_string(log_fd, RESET "\n");
|
||||
dump_backtrace(log_fd);
|
||||
log_string(log_fd, RED "Please create a bug report with this log output.\n" RESET);
|
||||
log_string(log_fd, RED "Please create a bug report with this log output." RESET "\n");
|
||||
close(log_fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef BACKTRACE_ON_SIGNAL
|
||||
@@ -345,6 +372,8 @@ 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;
|
||||
@@ -478,6 +507,11 @@ void init_X11_post_config()
|
||||
default_icon = imlib_load_image(path);
|
||||
g_free(path);
|
||||
}
|
||||
if (!default_icon) {
|
||||
fprintf(stderr,
|
||||
RED "Could not load default_icon.png. Please check that tint2 has been installed correctly!" RESET
|
||||
"\n");
|
||||
}
|
||||
}
|
||||
|
||||
void cleanup()
|
||||
@@ -529,21 +563,49 @@ void get_snapshot(const char *path)
|
||||
if (panel->area.width > server.monitors[0].width)
|
||||
panel->area.width = server.monitors[0].width;
|
||||
|
||||
panel->temp_pmap = XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth);
|
||||
panel->temp_pmap =
|
||||
XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth);
|
||||
render_panel(panel);
|
||||
|
||||
Imlib_Image img = NULL;
|
||||
imlib_context_set_drawable(panel->temp_pmap);
|
||||
img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 0);
|
||||
XSync(server.display, False);
|
||||
|
||||
imlib_context_set_image(img);
|
||||
if (!panel_horizontal) {
|
||||
// rotate 90° vertical panel
|
||||
imlib_image_flip_horizontal();
|
||||
imlib_image_flip_diagonal();
|
||||
imlib_context_set_drawable(panel->temp_pmap);
|
||||
Imlib_Image img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 1);
|
||||
|
||||
if (!img) {
|
||||
XImage *ximg =
|
||||
XGetImage(server.display, panel->temp_pmap, 0, 0, panel->area.width, panel->area.height, AllPlanes, ZPixmap);
|
||||
|
||||
if (ximg) {
|
||||
DATA32 *pixels = calloc(panel->area.width * panel->area.height, sizeof(DATA32));
|
||||
for (int x = 0; x < panel->area.width; x++) {
|
||||
for (int y = 0; y < panel->area.height; y++) {
|
||||
DATA32 xpixel = XGetPixel(ximg, x, y);
|
||||
|
||||
DATA32 r = (xpixel >> 16) & 0xff;
|
||||
DATA32 g = (xpixel >> 8) & 0xff;
|
||||
DATA32 b = (xpixel >> 0) & 0xff;
|
||||
DATA32 a = 0x0;
|
||||
|
||||
DATA32 argb = (a << 24) | (r << 16) | (g << 8) | b;
|
||||
pixels[y * panel->area.width + x] = argb;
|
||||
}
|
||||
}
|
||||
XDestroyImage(ximg);
|
||||
img = imlib_create_image_using_data(panel->area.width, panel->area.height, pixels);
|
||||
}
|
||||
}
|
||||
|
||||
if (img) {
|
||||
imlib_context_set_image(img);
|
||||
if (!panel_horizontal) {
|
||||
// rotate 90° vertical panel
|
||||
imlib_image_flip_horizontal();
|
||||
imlib_image_flip_diagonal();
|
||||
}
|
||||
imlib_save_image(path);
|
||||
imlib_free_image();
|
||||
}
|
||||
imlib_save_image(path);
|
||||
imlib_free_image();
|
||||
}
|
||||
|
||||
void window_action(Task *task, MouseAction action)
|
||||
@@ -808,7 +870,7 @@ void event_button_release(XEvent *e)
|
||||
|
||||
Execp *execp = click_execp(panel, e->xbutton.x, e->xbutton.y);
|
||||
if (execp) {
|
||||
execp_action(execp, e->xbutton.button);
|
||||
execp_action(execp, e->xbutton.button, e->xbutton.x - execp->area.posx, e->xbutton.y - execp->area.posy);
|
||||
if (panel_layer == BOTTOM_LAYER)
|
||||
XLowerWindow(server.display, panel->main_win);
|
||||
task_drag = 0;
|
||||
@@ -843,7 +905,8 @@ void event_button_release(XEvent *e)
|
||||
// switch desktop
|
||||
if (taskbar_mode == MULTI_DESKTOP) {
|
||||
gboolean diff_desktop = FALSE;
|
||||
if (taskbar->desktop != server.desktop && action != CLOSE && action != DESKTOP_LEFT && action != DESKTOP_RIGHT) {
|
||||
if (taskbar->desktop != server.desktop && action != CLOSE && action != DESKTOP_LEFT &&
|
||||
action != DESKTOP_RIGHT) {
|
||||
diff_desktop = TRUE;
|
||||
change_desktop(taskbar->desktop);
|
||||
}
|
||||
@@ -920,6 +983,14 @@ void event_property_notify(XEvent *e)
|
||||
|
||||
if (xsettings_client)
|
||||
xsettings_client_process_event(xsettings_client, e);
|
||||
for (int i = 0; i < num_panels; i++) {
|
||||
Panel *p = &panels[i];
|
||||
if (win == p->main_win) {
|
||||
if (at == server.atom._NET_WM_DESKTOP && get_window_desktop(p->main_win) != ALL_DESKTOPS)
|
||||
replace_panel_all_desktops(p);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (win == server.root_win) {
|
||||
if (!server.got_root_win) {
|
||||
XSelectInput(server.display, server.root_win, PropertyChangeMask | StructureNotifyMask);
|
||||
@@ -933,10 +1004,8 @@ void event_property_notify(XEvent *e)
|
||||
update_desktop_names();
|
||||
}
|
||||
// Change desktops
|
||||
else if (at == server.atom._NET_NUMBER_OF_DESKTOPS ||
|
||||
at == server.atom._NET_DESKTOP_GEOMETRY ||
|
||||
at == server.atom._NET_DESKTOP_VIEWPORT ||
|
||||
at == server.atom._NET_WORKAREA ||
|
||||
else if (at == server.atom._NET_NUMBER_OF_DESKTOPS || at == server.atom._NET_DESKTOP_GEOMETRY ||
|
||||
at == server.atom._NET_DESKTOP_VIEWPORT || at == server.atom._NET_WORKAREA ||
|
||||
at == server.atom._NET_CURRENT_DESKTOP) {
|
||||
if (debug)
|
||||
fprintf(stderr, "%s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__);
|
||||
@@ -1055,7 +1124,13 @@ void event_property_notify(XEvent *e)
|
||||
Task *task = get_task(win);
|
||||
if (debug) {
|
||||
char *atom_name = XGetAtomName(server.display, at);
|
||||
fprintf(stderr, "%s %d: win = %ld, task = %s, atom = %s\n", __FUNCTION__, __LINE__, win, task ? (task->title ? task->title : "??") : "null", atom_name);
|
||||
fprintf(stderr,
|
||||
"%s %d: win = %ld, task = %s, atom = %s\n",
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
win,
|
||||
task ? (task->title ? task->title : "??") : "null",
|
||||
atom_name);
|
||||
XFree(atom_name);
|
||||
}
|
||||
if (!task) {
|
||||
@@ -1156,12 +1231,20 @@ void event_configure_notify(XEvent *e)
|
||||
|
||||
if (0) {
|
||||
Task *task = get_task(win);
|
||||
fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task ? (task->title ? task->title : "??") : "null");
|
||||
fprintf(stderr,
|
||||
"%s %d: win = %ld, task = %s\n",
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
win,
|
||||
task ? (task->title ? task->title : "??") : "null");
|
||||
}
|
||||
|
||||
// change in root window (xrandr)
|
||||
if (win == server.root_win) {
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr,
|
||||
YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window" RESET "\n",
|
||||
__FILE__,
|
||||
__LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
return;
|
||||
}
|
||||
@@ -1440,8 +1523,9 @@ start:
|
||||
init_X11_pre_config();
|
||||
|
||||
if (!config_read()) {
|
||||
fprintf(stderr, "Could not read config file.\n"
|
||||
"Usage: tint2 [[-c] <config_file>]\n");
|
||||
fprintf(stderr,
|
||||
"Could not read config file.\n"
|
||||
"Usage: tint2 [[-c] <config_file>]\n");
|
||||
cleanup();
|
||||
exit(1);
|
||||
}
|
||||
@@ -1477,7 +1561,11 @@ start:
|
||||
while (1) {
|
||||
if (panel_refresh) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d redrawing panel\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d redrawing panel" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
panel_refresh = FALSE;
|
||||
|
||||
for (int i = 0; i < num_panels; i++) {
|
||||
@@ -1485,7 +1573,11 @@ start:
|
||||
|
||||
if (panel->is_hidden) {
|
||||
if (!panel->hidden_pixmap) {
|
||||
panel->hidden_pixmap = XCreatePixmap(server.display, server.root_win, panel->hidden_width, panel->hidden_height, server.depth);
|
||||
panel->hidden_pixmap = XCreatePixmap(server.display,
|
||||
server.root_win,
|
||||
panel->hidden_width,
|
||||
panel->hidden_height,
|
||||
server.depth);
|
||||
int xoff = 0, yoff = 0;
|
||||
if (panel_horizontal && panel_position & BOTTOM)
|
||||
yoff = panel->area.height - panel->hidden_height;
|
||||
@@ -1516,8 +1608,11 @@ start:
|
||||
} else {
|
||||
if (panel->temp_pmap)
|
||||
XFreePixmap(server.display, panel->temp_pmap);
|
||||
panel->temp_pmap =
|
||||
XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth);
|
||||
panel->temp_pmap = XCreatePixmap(server.display,
|
||||
server.root_win,
|
||||
panel->area.width,
|
||||
panel->area.height,
|
||||
server.depth);
|
||||
render_panel(panel);
|
||||
if (panel == (Panel *)systray.area.panel) {
|
||||
if (refresh_systray && panel && !panel->is_hidden) {
|
||||
@@ -1617,7 +1712,7 @@ start:
|
||||
case ButtonPress: {
|
||||
tooltip_hide(0);
|
||||
event_button_press(&e);
|
||||
Area *area = click_area(panel, e.xbutton.x, e.xbutton.y);
|
||||
Area *area = find_area_under_mouse(panel, e.xbutton.x, e.xbutton.y);
|
||||
if (panel_config.mouse_effects)
|
||||
mouse_over(area, 1);
|
||||
break;
|
||||
@@ -1625,7 +1720,7 @@ start:
|
||||
|
||||
case ButtonRelease: {
|
||||
event_button_release(&e);
|
||||
Area *area = click_area(panel, e.xbutton.x, e.xbutton.y);
|
||||
Area *area = find_area_under_mouse(panel, e.xbutton.x, e.xbutton.y);
|
||||
if (panel_config.mouse_effects)
|
||||
mouse_over(area, 0);
|
||||
break;
|
||||
@@ -1636,7 +1731,7 @@ start:
|
||||
if (e.xmotion.state & button_mask)
|
||||
event_button_motion_notify(&e);
|
||||
|
||||
Area *area = click_area(panel, e.xmotion.x, e.xmotion.y);
|
||||
Area *area = find_area_under_mouse(panel, e.xmotion.x, e.xmotion.y);
|
||||
if (area->_get_tooltip_text)
|
||||
tooltip_trigger_show(area, panel, &e);
|
||||
else
|
||||
@@ -1704,7 +1799,10 @@ start:
|
||||
case DestroyNotify:
|
||||
if (e.xany.window == server.composite_manager) {
|
||||
// Stop real_transparency
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to compositor shutdown\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr,
|
||||
YELLOW "%s %d: triggering tint2 restart due to compositor shutdown" RESET "\n",
|
||||
__FILE__,
|
||||
__LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
break;
|
||||
}
|
||||
@@ -1723,11 +1821,17 @@ start:
|
||||
if (ev->data.l[1] == server.atom._NET_WM_CM_S0) {
|
||||
if (ev->data.l[2] == None) {
|
||||
// Stop real_transparency
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr,
|
||||
YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n",
|
||||
__FILE__,
|
||||
__LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
} else {
|
||||
// Start real_transparency
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr,
|
||||
YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n",
|
||||
__FILE__,
|
||||
__LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
}
|
||||
}
|
||||
@@ -1881,7 +1985,7 @@ start:
|
||||
if (signal_pending) {
|
||||
cleanup();
|
||||
if (signal_pending == SIGUSR1) {
|
||||
fprintf(stderr, YELLOW "%s %d: restarting tint2...\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr, YELLOW "%s %d: restarting tint2..." RESET "\n", __FILE__, __LINE__);
|
||||
// restart tint2
|
||||
// SIGUSR1 used when : user's signal, composite manager stop/start or xrandr
|
||||
goto start;
|
||||
|
||||
@@ -20,8 +20,9 @@ include_directories( ../util
|
||||
${RSVG_INCLUDE_DIRS} )
|
||||
|
||||
set(SOURCES ../util/common.c
|
||||
../util/strnatcmp.c
|
||||
../config.c
|
||||
../util/strnatcmp.c
|
||||
../util/cache.c
|
||||
../config.c
|
||||
../server.c
|
||||
../launcher/apps-common.c
|
||||
../launcher/icon-theme-common.c
|
||||
|
||||
@@ -16,4 +16,6 @@
|
||||
|
||||
#define SNAPSHOT_TICK 190
|
||||
gboolean update_snapshot();
|
||||
void menuApply();
|
||||
void menuApply();
|
||||
void refresh_current_theme();
|
||||
extern GtkWidget *g_window;
|
||||
|
||||
2224
src/tint2conf/po/ru.po
Normal file
@@ -17,6 +17,9 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**************************************************************************/
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "properties.h"
|
||||
#include "properties_rw.h"
|
||||
@@ -144,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);
|
||||
@@ -161,7 +168,7 @@ void current_background_changed(GtkWidget *widget, gpointer data);
|
||||
void background_combo_changed(GtkWidget *widget, gpointer data);
|
||||
void create_panel(GtkWidget *parent);
|
||||
void create_panel_items(GtkWidget *parent);
|
||||
void create_launcher(GtkWidget *parent);
|
||||
void create_launcher(GtkWidget *parent, GtkWindow *window);
|
||||
gchar *get_default_theme_name();
|
||||
void icon_theme_changed();
|
||||
void load_icons(GtkListStore *apps);
|
||||
@@ -205,20 +212,20 @@ const gchar *get_default_font()
|
||||
|
||||
void applyClicked(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
gchar *file = get_current_theme_file_name();
|
||||
if (file) {
|
||||
if (config_is_manual(file)) {
|
||||
gchar *backup_path = g_strdup_printf("%s.backup.%ld", file, time(NULL));
|
||||
copy_file(file, backup_path);
|
||||
gchar *filepath = get_current_theme_path();
|
||||
if (filepath) {
|
||||
if (config_is_manual(filepath)) {
|
||||
gchar *backup_path = g_strdup_printf("%s.backup.%ld", filepath, time(NULL));
|
||||
copy_file(filepath, backup_path);
|
||||
g_free(backup_path);
|
||||
}
|
||||
|
||||
config_save_file(file);
|
||||
config_save_file(filepath);
|
||||
}
|
||||
int unused = system("killall -SIGUSR1 tint2 || pkill -SIGUSR1 -x tint2");
|
||||
(void)unused;
|
||||
g_free(file);
|
||||
g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL);
|
||||
g_free(filepath);
|
||||
refresh_current_theme();
|
||||
}
|
||||
|
||||
void cancelClicked(GtkWidget *widget, gpointer data)
|
||||
@@ -333,7 +340,7 @@ GtkWidget *create_properties()
|
||||
gtk_container_set_border_width(GTK_CONTAINER(page_launcher), 10);
|
||||
gtk_widget_show(page_launcher);
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_launcher), label);
|
||||
create_launcher(page_launcher);
|
||||
create_launcher(page_launcher, GTK_WINDOW(view));
|
||||
|
||||
label = gtk_label_new(_("Clock"));
|
||||
gtk_widget_show(label);
|
||||
@@ -500,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;
|
||||
@@ -656,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);
|
||||
@@ -665,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);
|
||||
}
|
||||
@@ -699,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;
|
||||
@@ -732,6 +779,7 @@ void background_create_new()
|
||||
bgColBorderOpacity, borderOpacity,
|
||||
bgColBorderWidth, b,
|
||||
bgColCornerRadius, r,
|
||||
bgColText, "",
|
||||
bgColFillColorOver, &fillColorOver,
|
||||
bgColFillOpacityOver, fillOpacityOver,
|
||||
bgColBorderColorOver, &borderColorOver,
|
||||
@@ -740,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);
|
||||
@@ -765,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;
|
||||
@@ -793,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);
|
||||
@@ -802,6 +861,7 @@ void background_duplicate(GtkWidget *widget, gpointer data)
|
||||
bgColFillOpacity, fillOpacity,
|
||||
bgColBorderColor, borderColor,
|
||||
bgColBorderOpacity, borderOpacity,
|
||||
bgColText, "",
|
||||
bgColFillColorOver, fillColorOver,
|
||||
bgColFillOpacityOver, fillOpacityOver,
|
||||
bgColBorderColorOver, borderColorOver,
|
||||
@@ -812,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);
|
||||
@@ -927,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;
|
||||
@@ -942,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;
|
||||
@@ -988,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);
|
||||
}
|
||||
@@ -998,6 +1074,8 @@ void current_background_changed(GtkWidget *widget, gpointer data)
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
background_updates_disabled = TRUE;
|
||||
|
||||
GtkTreePath *path;
|
||||
GtkTreeIter iter;
|
||||
|
||||
@@ -1007,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;
|
||||
@@ -1036,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);
|
||||
@@ -1062,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)
|
||||
@@ -2077,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);
|
||||
@@ -2204,8 +2300,11 @@ void set_current_icon_theme(const char *theme)
|
||||
}
|
||||
}
|
||||
|
||||
void icon_theme_changed()
|
||||
void icon_theme_changed(gpointer data)
|
||||
{
|
||||
create_please_wait(GTK_WINDOW(data));
|
||||
process_events();
|
||||
|
||||
if (icon_theme)
|
||||
free_themes(icon_theme);
|
||||
|
||||
@@ -2219,15 +2318,20 @@ void icon_theme_changed()
|
||||
|
||||
load_icons(launcher_apps);
|
||||
load_icons(all_apps);
|
||||
save_icon_cache(icon_theme);
|
||||
|
||||
destroy_please_wait();
|
||||
}
|
||||
|
||||
void launcher_icon_theme_changed(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
icon_theme_changed();
|
||||
icon_theme_changed(data);
|
||||
}
|
||||
|
||||
GdkPixbuf *load_icon(const gchar *name)
|
||||
{
|
||||
process_events();
|
||||
|
||||
int size = 22;
|
||||
char *path = get_icon_path(icon_theme, name, size);
|
||||
GdkPixbuf *pixbuf = path ? gdk_pixbuf_new_from_file_at_size(path, size, size, NULL) : NULL;
|
||||
@@ -2265,46 +2369,92 @@ void load_icons(GtkListStore *apps)
|
||||
|
||||
void load_desktop_file(const char *file, gboolean selected)
|
||||
{
|
||||
DesktopEntry entry;
|
||||
if (read_desktop_file(file, &entry)) {
|
||||
GdkPixbuf *pixbuf = load_icon(entry.icon);
|
||||
char *file_contracted = contract_tilde(file);
|
||||
|
||||
GtkListStore *store = selected ? launcher_apps : all_apps;
|
||||
gboolean duplicate = FALSE;
|
||||
for (int index = 0; ; index++) {
|
||||
GtkTreePath *path = gtk_tree_path_new_from_indices(index, -1);
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(selected ? launcher_apps : all_apps, &iter);
|
||||
gtk_list_store_set(selected ? launcher_apps :all_apps, &iter,
|
||||
appsColIcon, pixbuf,
|
||||
appsColText, g_strdup(entry.name),
|
||||
appsColPath, g_strdup(file),
|
||||
appsColIconName, g_strdup(entry.icon),
|
||||
-1);
|
||||
if (pixbuf)
|
||||
g_object_unref(pixbuf);
|
||||
} else {
|
||||
printf("Could not load %s\n", file);
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(selected ? launcher_apps : all_apps, &iter);
|
||||
gtk_list_store_set(selected ? launcher_apps :all_apps, &iter,
|
||||
appsColIcon, NULL,
|
||||
appsColText, g_strdup(file),
|
||||
appsColPath, g_strdup(file),
|
||||
appsColIconName, g_strdup(""),
|
||||
-1);
|
||||
gboolean found = gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, path);
|
||||
gtk_tree_path_free(path);
|
||||
if (!found)
|
||||
break;
|
||||
|
||||
gchar *app_path;
|
||||
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, appsColPath, &app_path, -1);
|
||||
char *contracted = contract_tilde(app_path);
|
||||
if (strcmp(contracted, file_contracted) == 0) {
|
||||
duplicate = TRUE;
|
||||
break;
|
||||
}
|
||||
free(contracted);
|
||||
g_free(app_path);
|
||||
}
|
||||
free_desktop_entry(&entry);
|
||||
|
||||
if (!duplicate) {
|
||||
DesktopEntry entry;
|
||||
if (read_desktop_file(file, &entry)) {
|
||||
int index;
|
||||
gboolean stop = FALSE;
|
||||
for (index = 0; !stop || selected; index++) {
|
||||
GtkTreePath *path = gtk_tree_path_new_from_indices(index, -1);
|
||||
GtkTreeIter iter;
|
||||
gboolean found = gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, path);
|
||||
gtk_tree_path_free(path);
|
||||
if (!found)
|
||||
break;
|
||||
|
||||
gchar *app_name;
|
||||
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, appsColText, &app_name, -1);
|
||||
if (strnatcasecmp(app_name, entry.name) >= 0)
|
||||
stop = TRUE;
|
||||
g_free(app_name);
|
||||
}
|
||||
|
||||
GdkPixbuf *pixbuf = load_icon(entry.icon);
|
||||
GtkTreeIter iter;
|
||||
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),
|
||||
-1);
|
||||
if (pixbuf)
|
||||
g_object_unref(pixbuf);
|
||||
} else {
|
||||
printf("Could not load %s\n", file);
|
||||
GdkPixbuf *pixbuf = load_icon(DEFAULT_ICON);
|
||||
GtkTreeIter iter;
|
||||
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),
|
||||
-1);
|
||||
if (pixbuf)
|
||||
g_object_unref(pixbuf);
|
||||
}
|
||||
free_desktop_entry(&entry);
|
||||
}
|
||||
|
||||
free(file_contracted);
|
||||
}
|
||||
|
||||
void populate_from_entries(GList *entries, gboolean selected)
|
||||
{
|
||||
GList *l;
|
||||
for (l = entries; l; l = l->next) {
|
||||
for (GList *l = entries; l; l = l->next) {
|
||||
DesktopEntry *entry = (DesktopEntry *)l->data;
|
||||
GdkPixbuf *pixbuf = load_icon(entry->icon);
|
||||
GtkTreeIter iter;
|
||||
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);
|
||||
@@ -2318,9 +2468,15 @@ static gint compare_entries(gconstpointer a, gconstpointer b)
|
||||
|
||||
void load_desktop_entry(const char *file, GList **entries)
|
||||
{
|
||||
process_events();
|
||||
|
||||
DesktopEntry *entry = calloc(1, sizeof(DesktopEntry));
|
||||
if (!read_desktop_file(file, entry))
|
||||
printf("Could not load %s\n", file);
|
||||
if (entry->hidden_from_menus) {
|
||||
free(entry);
|
||||
return;
|
||||
}
|
||||
if (!entry->name)
|
||||
entry->name = strdup(file);
|
||||
if (!entry->icon)
|
||||
@@ -2330,6 +2486,8 @@ void load_desktop_entry(const char *file, GList **entries)
|
||||
|
||||
void load_desktop_entries(const char *path, GList **entries)
|
||||
{
|
||||
process_events();
|
||||
|
||||
GList *subdirs = NULL;
|
||||
GList *files = NULL;
|
||||
|
||||
@@ -2367,9 +2525,19 @@ void load_desktop_entries(const char *path, GList **entries)
|
||||
g_list_free(files);
|
||||
}
|
||||
|
||||
void load_theme_file(const char *file_name, const char *theme)
|
||||
static gint compare_themes(gconstpointer a, gconstpointer b)
|
||||
{
|
||||
if (!file_name || !theme) {
|
||||
gint result = strnatcasecmp(((IconTheme*)a)->description, ((IconTheme*)b)->description);
|
||||
if (result)
|
||||
return result;
|
||||
return strnatcasecmp(((IconTheme*)a)->name, ((IconTheme*)b)->name);
|
||||
}
|
||||
|
||||
void load_theme_file(const char *file_name, const char *theme_name, GList **themes)
|
||||
{
|
||||
process_events();
|
||||
|
||||
if (!file_name || !theme_name) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2397,13 +2565,11 @@ void load_theme_file(const char *file_name, const char *theme)
|
||||
|
||||
if (parse_theme_line(line, &key, &value)) {
|
||||
if (strcmp(key, "Name") == 0) {
|
||||
// value is like Tango
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(icon_themes, &iter);
|
||||
gtk_list_store_set(icon_themes, &iter,
|
||||
iconsColName, g_strdup(theme),
|
||||
iconsColDescr, g_strdup(value),
|
||||
-1);
|
||||
IconTheme *theme = calloc(1, sizeof(IconTheme));
|
||||
theme->name = strdup(theme_name);
|
||||
theme->description = strdup(value);
|
||||
*themes = g_list_append(*themes, theme);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2415,8 +2581,10 @@ void load_theme_file(const char *file_name, const char *theme)
|
||||
free(line);
|
||||
}
|
||||
|
||||
void load_icon_themes(const gchar *path, const gchar *parent)
|
||||
void load_icon_themes(const gchar *path, const gchar *parent, GList **themes)
|
||||
{
|
||||
process_events();
|
||||
|
||||
GDir *d = g_dir_open(path, 0, NULL);
|
||||
if (!d)
|
||||
return;
|
||||
@@ -2426,9 +2594,22 @@ void load_icon_themes(const gchar *path, const gchar *parent)
|
||||
if (parent &&
|
||||
g_file_test(file, G_FILE_TEST_IS_REGULAR) &&
|
||||
g_str_equal(name, "index.theme")) {
|
||||
load_theme_file(file, parent);
|
||||
load_theme_file(file, parent, themes);
|
||||
} else if (g_file_test(file, G_FILE_TEST_IS_DIR)) {
|
||||
load_icon_themes(file, name);
|
||||
gboolean duplicate = FALSE;
|
||||
if (g_file_test(file, G_FILE_TEST_IS_SYMLINK)) {
|
||||
#ifdef PATH_MAX
|
||||
char real_path[PATH_MAX];
|
||||
#else
|
||||
char real_path[65536];
|
||||
#endif
|
||||
if (realpath(file, real_path)) {
|
||||
if (strstr(real_path, path) == real_path)
|
||||
duplicate = TRUE;
|
||||
}
|
||||
}
|
||||
if (!duplicate)
|
||||
load_icon_themes(file, name, themes);
|
||||
}
|
||||
g_free(file);
|
||||
}
|
||||
@@ -2465,7 +2646,7 @@ GtkWidget *addScrollBarToWidget(GtkWidget *widget)
|
||||
return scrolled_window;
|
||||
}
|
||||
|
||||
void create_launcher(GtkWidget *parent)
|
||||
void create_launcher(GtkWidget *parent, GtkWindow *window)
|
||||
{
|
||||
GtkWidget *image;
|
||||
GtkTooltips *tooltips = gtk_tooltips_new();
|
||||
@@ -2753,7 +2934,7 @@ void create_launcher(GtkWidget *parent)
|
||||
GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
|
||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(launcher_icon_theme), renderer, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(launcher_icon_theme), renderer, "text", iconsColDescr, NULL);
|
||||
g_signal_connect(G_OBJECT(launcher_icon_theme), "changed", G_CALLBACK(launcher_icon_theme_changed), NULL);
|
||||
g_signal_connect(G_OBJECT(launcher_icon_theme), "changed", G_CALLBACK(launcher_icon_theme_changed), window);
|
||||
gtk_widget_show(launcher_icon_theme);
|
||||
gtk_table_attach(GTK_TABLE(table), launcher_icon_theme, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
@@ -2796,38 +2977,51 @@ void create_launcher(GtkWidget *parent)
|
||||
|
||||
change_paragraph(parent);
|
||||
|
||||
fprintf(stderr, "Loading icon themes\n");
|
||||
GList *themes = NULL;
|
||||
const GSList *location;
|
||||
for (location = get_icon_locations(); location; location = g_slist_next(location)) {
|
||||
const gchar *path = (gchar*) location->data;
|
||||
load_icon_themes(path, NULL, &themes);
|
||||
}
|
||||
themes = g_list_sort(themes, compare_themes);
|
||||
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(icon_themes, &iter);
|
||||
gtk_list_store_set(icon_themes, &iter,
|
||||
0, "",
|
||||
-1);
|
||||
|
||||
fprintf(stderr, "Loading icon themes\n");
|
||||
const GSList *location;
|
||||
for (location = get_icon_locations(); location; location = g_slist_next(location)) {
|
||||
const gchar *path = (gchar*) location->data;
|
||||
load_icon_themes(path, NULL);
|
||||
for (GList *l = themes; l; l = l->next) {
|
||||
IconTheme *theme = (IconTheme*)l->data;
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(icon_themes, &iter);
|
||||
gtk_list_store_set(icon_themes, &iter,
|
||||
iconsColName, g_strdup(theme->name),
|
||||
iconsColDescr, g_strdup(theme->description),
|
||||
-1);
|
||||
}
|
||||
|
||||
for (GList *l = themes; l; l = l->next) {
|
||||
free_icon_theme((IconTheme*)l->data);
|
||||
}
|
||||
g_list_free(themes);
|
||||
fprintf(stderr, "Icon themes loaded\n");
|
||||
|
||||
fprintf(stderr, "Loading .desktop files\n");
|
||||
GList *entries = NULL;
|
||||
load_desktop_entries("/usr/share/applications", &entries);
|
||||
load_desktop_entries("/usr/local/share/applications", &entries);
|
||||
gchar *path = g_build_filename(g_get_home_dir(), ".local/share/applications", NULL);
|
||||
load_desktop_entries(path, &entries);
|
||||
for (location = get_apps_locations(); location; location = g_slist_next(location)) {
|
||||
const gchar *path = (gchar*) location->data;
|
||||
load_desktop_entries(path, &entries);
|
||||
}
|
||||
entries = g_list_sort(entries, compare_entries);
|
||||
populate_from_entries(entries, FALSE);
|
||||
|
||||
GList *l;
|
||||
for (l = entries; l; l = l->next) {
|
||||
for (GList *l = entries; l; l = l->next) {
|
||||
free_desktop_entry((DesktopEntry*)l->data);
|
||||
}
|
||||
g_list_free(entries);
|
||||
|
||||
g_free(path);
|
||||
|
||||
icon_theme_changed();
|
||||
icon_theme_changed(window);
|
||||
load_icons(launcher_apps);
|
||||
load_icons(all_apps);
|
||||
fprintf(stderr, "Desktop files loaded\n");
|
||||
@@ -3839,7 +4033,7 @@ void create_clock(GtkWidget *parent)
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, clock_format_line1,
|
||||
_("Specifies the format used to display the first line of the clock text. "
|
||||
"See 'man strftime' for all the available options."), NULL);
|
||||
"See 'man date' for all the available options."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Second line format"));
|
||||
@@ -3855,7 +4049,7 @@ void create_clock(GtkWidget *parent)
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, clock_format_line2,
|
||||
_("Specifies the format used to display the second line of the clock text. "
|
||||
"See 'man strftime' for all the available options."), NULL);
|
||||
"See 'man date' for all the available options."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("First line timezone"));
|
||||
@@ -4126,7 +4320,7 @@ void create_clock(GtkWidget *parent)
|
||||
gtk_table_attach(GTK_TABLE(table), clock_format_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, clock_format_tooltip, _("Specifies the format used to display the clock tooltip. "
|
||||
"See 'man strftime' for the available options."), NULL);
|
||||
"See 'man date' for the available options."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Timezone"));
|
||||
@@ -5188,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);
|
||||
@@ -5281,3 +5475,44 @@ void create_tooltip(GtkWidget *parent)
|
||||
|
||||
change_paragraph(parent);
|
||||
}
|
||||
|
||||
static GtkWidget *please_wait_dialog = NULL;
|
||||
void create_please_wait(GtkWindow *parent)
|
||||
{
|
||||
if (please_wait_dialog)
|
||||
return;
|
||||
|
||||
please_wait_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title(GTK_WINDOW(please_wait_dialog), "Center");
|
||||
gtk_window_set_default_size(GTK_WINDOW(please_wait_dialog), 300, 150);
|
||||
gtk_window_set_position(GTK_WINDOW(please_wait_dialog), GTK_WIN_POS_CENTER);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(please_wait_dialog), 15);
|
||||
gtk_window_set_title(GTK_WINDOW(please_wait_dialog), _("Please wait..."));
|
||||
gtk_window_set_deletable(GTK_WINDOW(please_wait_dialog), FALSE);
|
||||
|
||||
GtkWidget *label = gtk_label_new(_("Loading..."));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
||||
|
||||
GtkWidget *halign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||
gtk_container_add(GTK_CONTAINER(halign), label);
|
||||
gtk_container_add(GTK_CONTAINER(please_wait_dialog), halign);
|
||||
|
||||
gtk_widget_show_all(please_wait_dialog);
|
||||
gtk_window_set_modal(GTK_WINDOW(please_wait_dialog), TRUE);
|
||||
// gtk_window_set_keep_above(GTK_WINDOW(please_wait_dialog), TRUE);
|
||||
gtk_window_set_transient_for(GTK_WINDOW(please_wait_dialog), parent);
|
||||
}
|
||||
|
||||
void process_events()
|
||||
{
|
||||
while (gtk_events_pending())
|
||||
gtk_main_iteration_do(FALSE);
|
||||
}
|
||||
|
||||
void destroy_please_wait()
|
||||
{
|
||||
if (!please_wait_dialog)
|
||||
return;
|
||||
gtk_widget_destroy(please_wait_dialog);
|
||||
please_wait_dialog = NULL;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
@@ -204,4 +212,8 @@ Executor *execp_get_last();
|
||||
void execp_remove(int i);
|
||||
void execp_update_indices();
|
||||
|
||||
void create_please_wait(GtkWindow *parent);
|
||||
void process_events();
|
||||
void destroy_please_wait();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
char *get_current_theme_file_name();
|
||||
char *get_current_theme_path();
|
||||
gboolean config_is_manual(const char *path);
|
||||
void config_read_file (const char *path);
|
||||
void config_save_file(const char *path);
|
||||
|
||||
@@ -17,76 +17,77 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include "main.h"
|
||||
#include "properties.h"
|
||||
#include "strnatcmp.h"
|
||||
#include "theme_view.h"
|
||||
#include "common.h"
|
||||
|
||||
// The data columns that we export via the tree model interface
|
||||
GtkWidget *g_theme_view;
|
||||
GtkListStore *g_store;
|
||||
GtkListStore *theme_list_store;
|
||||
int g_width_list, g_height_list;
|
||||
GtkCellRenderer *g_renderer;
|
||||
|
||||
gint theme_name_compare(GtkTreeModel *model,
|
||||
GtkTreeIter *a,
|
||||
GtkTreeIter *b,
|
||||
gpointer user_data);
|
||||
gint theme_name_compare(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data);
|
||||
|
||||
GtkWidget *create_view()
|
||||
{
|
||||
GtkTreeViewColumn *col;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkWidget *view;
|
||||
|
||||
g_store = gtk_list_store_new(NB_COL, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF);
|
||||
theme_list_store =
|
||||
gtk_list_store_new(NB_COL, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
|
||||
|
||||
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(g_store));
|
||||
GtkWidget *view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(theme_list_store));
|
||||
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
|
||||
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
|
||||
|
||||
g_object_unref(g_store); // destroy store automatically with view
|
||||
g_object_unref(theme_list_store); // destroy store automatically with view
|
||||
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
col = gtk_tree_view_column_new();
|
||||
gtk_tree_view_column_pack_start(col, renderer, TRUE);
|
||||
gtk_tree_view_column_add_attribute(col, renderer, "text", COL_THEME_FILE);
|
||||
gtk_tree_view_column_set_visible(col, FALSE);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(view),col);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
col = gtk_tree_view_column_new();
|
||||
gtk_tree_view_column_pack_start(col, renderer, TRUE);
|
||||
gtk_tree_view_column_add_attribute(col, renderer, "text", COL_THEME_NAME);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(view),col);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
|
||||
|
||||
g_width_list = 200;
|
||||
g_height_list = 30;
|
||||
g_renderer = gtk_cell_renderer_pixbuf_new();
|
||||
g_object_set(g_renderer, "xalign", 0.0, NULL);
|
||||
gtk_cell_renderer_set_fixed_size(g_renderer, g_width_list, g_height_list);
|
||||
// specific to gtk-2.18 or higher
|
||||
//gtk_cell_renderer_set_padding(g_renderer, 5, 5);
|
||||
gtk_cell_renderer_set_fixed_size(g_renderer, 200, 30);
|
||||
col = gtk_tree_view_column_new();
|
||||
gtk_tree_view_column_pack_start(col, g_renderer, TRUE);
|
||||
gtk_tree_view_column_add_attribute(col, g_renderer, "pixbuf", COL_SNAPSHOT);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(view),col);
|
||||
gtk_tree_view_column_add_attribute(col, g_renderer, "width", COL_WIDTH);
|
||||
gtk_tree_view_column_add_attribute(col, g_renderer, "height", COL_HEIGHT);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
|
||||
|
||||
GtkTreeSortable *sortable;
|
||||
sortable = GTK_TREE_SORTABLE(g_store);
|
||||
GtkTreeSortable *sortable = GTK_TREE_SORTABLE(theme_list_store);
|
||||
gtk_tree_sortable_set_sort_column_id(sortable, COL_THEME_FILE, GTK_SORT_ASCENDING);
|
||||
gtk_tree_sortable_set_sort_func(sortable, COL_THEME_FILE, theme_name_compare, NULL, NULL);
|
||||
return view;
|
||||
}
|
||||
|
||||
gint theme_name_compare(GtkTreeModel *model,
|
||||
GtkTreeIter *a,
|
||||
GtkTreeIter *b,
|
||||
gpointer user_data)
|
||||
gint theme_name_compare(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data)
|
||||
{
|
||||
gchar *path_a, *path_b;
|
||||
gtk_tree_model_get(model, a, COL_THEME_FILE, &path_a, -1);
|
||||
gtk_tree_model_get(model, b, COL_THEME_FILE, &path_b, -1);
|
||||
|
||||
gboolean home_a = strstr(path_a, g_get_user_config_dir()) == path_a;
|
||||
gboolean home_b = strstr(path_b, g_get_user_config_dir()) == path_b;
|
||||
|
||||
if (home_a && !home_b)
|
||||
return -1;
|
||||
if (!home_a && home_b)
|
||||
return 1;
|
||||
|
||||
gchar *name_a = path_a;
|
||||
gchar *p;
|
||||
for (p = name_a; *p; p++) {
|
||||
@@ -110,44 +111,92 @@ gint theme_name_compare(GtkTreeModel *model,
|
||||
return result;
|
||||
}
|
||||
|
||||
void custom_list_append(const gchar *path)
|
||||
gboolean theme_list_contains(const char *given_path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_list_store_append(g_store, &iter);
|
||||
gtk_list_store_set(g_store, &iter, COL_THEME_FILE, path, -1);
|
||||
|
||||
gchar *name = g_strdup(strrchr(path, '/') + 1);
|
||||
gtk_list_store_set(g_store, &iter, COL_THEME_NAME, name, -1);
|
||||
gboolean have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
||||
while (have_iter) {
|
||||
gchar *filepath;
|
||||
gtk_tree_model_get(model, &iter, COL_THEME_FILE, &filepath, -1);
|
||||
if (g_str_equal(filepath, given_path)) {
|
||||
gtk_list_store_set(theme_list_store, &iter, COL_SNAPSHOT, NULL, -1);
|
||||
g_free(filepath);
|
||||
return TRUE;
|
||||
}
|
||||
g_free(filepath);
|
||||
have_iter = gtk_tree_model_iter_next(model, &iter);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void theme_list_append(const gchar *path)
|
||||
{
|
||||
if (theme_list_contains(path))
|
||||
return;
|
||||
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(theme_list_store, &iter);
|
||||
|
||||
gchar *name = strrchr(path, '/') + 1;
|
||||
|
||||
gchar *dir = g_strdup(path);
|
||||
strrchr(dir, '/')[0] = 0;
|
||||
char *suffix = contract_tilde(dir);
|
||||
g_free(dir);
|
||||
|
||||
gchar *display_name = g_strdup_printf("%s\n(%s)", name, suffix);
|
||||
gtk_list_store_set(theme_list_store, &iter, COL_THEME_FILE, path, COL_THEME_NAME, display_name, -1);
|
||||
g_free(display_name);
|
||||
g_free(suffix);
|
||||
}
|
||||
|
||||
gboolean update_snapshot()
|
||||
{
|
||||
GtkTreeModel *model;
|
||||
const gint PADDING = 20;
|
||||
|
||||
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
||||
|
||||
GtkTreeIter iter;
|
||||
GdkPixbuf *icon;
|
||||
gboolean have_iter;
|
||||
|
||||
gint pixWidth = 200, pixHeight = 30;
|
||||
|
||||
model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
||||
int num_updates = 0;
|
||||
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
||||
while (have_iter) {
|
||||
gtk_tree_model_get(model, &iter, COL_SNAPSHOT, &icon, -1);
|
||||
if (icon != NULL) {
|
||||
g_object_unref(icon);
|
||||
GdkPixbuf *pixbuf;
|
||||
gtk_tree_model_get(model, &iter, COL_SNAPSHOT, &pixbuf, -1);
|
||||
if (pixbuf)
|
||||
g_object_unref(pixbuf);
|
||||
else
|
||||
num_updates++;
|
||||
have_iter = gtk_tree_model_iter_next(model, &iter);
|
||||
}
|
||||
gboolean need_pls_wait = num_updates > 3;
|
||||
if (need_pls_wait)
|
||||
create_please_wait(GTK_WINDOW(g_window));
|
||||
|
||||
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
||||
while (have_iter) {
|
||||
GdkPixbuf *pixbuf;
|
||||
gtk_tree_model_get(model, &iter, COL_SNAPSHOT, &pixbuf, -1);
|
||||
if (pixbuf) {
|
||||
g_object_unref(pixbuf);
|
||||
have_iter = gtk_tree_model_iter_next(model, &iter);
|
||||
continue;
|
||||
}
|
||||
|
||||
// build panel's snapshot
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
gchar *name, *snap, *cmd;
|
||||
gchar *path;
|
||||
gtk_tree_model_get(model, &iter, COL_THEME_FILE, &path, -1);
|
||||
|
||||
snap = g_build_filename(g_get_user_config_dir(), "tint2", "snap.jpg", NULL);
|
||||
char fname[128];
|
||||
sprintf(fname, "tint2-%d.jpg", (int)getpid());
|
||||
|
||||
gchar *snap = g_build_filename(g_get_tmp_dir(), fname, NULL);
|
||||
g_remove(snap);
|
||||
|
||||
gtk_tree_model_get(model, &iter, COL_THEME_FILE, &name, -1);
|
||||
cmd = g_strdup_printf("tint2 -c \'%s\' -s \'%s\'", name, snap);
|
||||
gchar *cmd = g_strdup_printf("tint2 -c \'%s\' -s \'%s\' 1>/dev/null 2>/dev/null", path, snap);
|
||||
if (system(cmd) == 0) {
|
||||
// load
|
||||
pixbuf = gdk_pixbuf_new_from_file(snap, NULL);
|
||||
@@ -155,25 +204,32 @@ gboolean update_snapshot()
|
||||
printf("snapshot NULL : %s\n", cmd);
|
||||
}
|
||||
}
|
||||
g_free(snap);
|
||||
g_free(cmd);
|
||||
g_free(name);
|
||||
|
||||
gint w, h;
|
||||
w = gdk_pixbuf_get_width(pixbuf);
|
||||
h = gdk_pixbuf_get_height(pixbuf);
|
||||
pixWidth = w > pixWidth ? w : pixWidth;
|
||||
pixHeight = h > pixHeight ? h : pixHeight;
|
||||
g_remove(snap);
|
||||
g_free(snap);
|
||||
g_free(path);
|
||||
|
||||
gtk_list_store_set(g_store, &iter, COL_SNAPSHOT, pixbuf, -1);
|
||||
gtk_list_store_set(theme_list_store,
|
||||
&iter,
|
||||
COL_SNAPSHOT,
|
||||
pixbuf,
|
||||
COL_WIDTH,
|
||||
gdk_pixbuf_get_width(pixbuf) + PADDING,
|
||||
COL_HEIGHT,
|
||||
gdk_pixbuf_get_height(pixbuf) + PADDING,
|
||||
-1);
|
||||
if (pixbuf)
|
||||
g_object_unref(pixbuf);
|
||||
|
||||
if (need_pls_wait)
|
||||
process_events();
|
||||
|
||||
have_iter = gtk_tree_model_iter_next(model, &iter);
|
||||
}
|
||||
|
||||
gtk_cell_renderer_set_fixed_size(g_renderer, pixWidth + 30, pixHeight + 30);
|
||||
if (need_pls_wait)
|
||||
destroy_please_wait();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
|
||||
#ifndef THEME_VIEW
|
||||
#define THEME_VIEW
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
extern GtkWidget *g_theme_view;
|
||||
extern GtkListStore *g_store;
|
||||
enum { COL_THEME_FILE = 0, COL_THEME_NAME, COL_SNAPSHOT, NB_COL, };
|
||||
extern GtkListStore *theme_list_store;
|
||||
enum { COL_THEME_FILE = 0,
|
||||
COL_THEME_NAME,
|
||||
COL_SNAPSHOT,
|
||||
COL_WIDTH,
|
||||
COL_HEIGHT,
|
||||
NB_COL, };
|
||||
|
||||
GtkWidget *create_view();
|
||||
|
||||
void custom_list_append(const gchar *path);
|
||||
void theme_list_append(const gchar *path);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Tint2 panel settings
|
||||
|
||||
Name=Tint2 Settings
|
||||
Name[am]=ፓነል አስተዳዳሪ
|
||||
Name[ar]=مدير الائحة :
|
||||
Name[ast]=Alministrador de panel
|
||||
@@ -17,7 +18,7 @@ Name[es]=Administrador de panel
|
||||
Name[et]=Paneelihaldur
|
||||
Name[eu]=Panel Kudeatzailea:
|
||||
Name[fi]=Paneelin hallinta
|
||||
Name[fr]=Gestionnaire de panneau
|
||||
Name[fr]=Gestionnaire du panneau tint2
|
||||
Name[gl]=Xestor de paneis
|
||||
Name[he]=מנהל הלוח
|
||||
Name[hu]=Panelkezelő
|
||||
@@ -37,7 +38,7 @@ Name[pl]=Ustawienia panelu
|
||||
Name[pt]=Gestor do Painel
|
||||
Name[pt_BR]=Gerenciador do painel
|
||||
Name[ro]=Manager de panouri
|
||||
Name[ru]=Диспетчер панелей
|
||||
Name[ru]=Настройки tint2
|
||||
Name[si]=පුවරු කළමණාකරු
|
||||
Name[sk]=Nastavenie panelu
|
||||
Name[sq]=Përgjegjës Panelesh
|
||||
@@ -45,14 +46,69 @@ Name[sv]=Panelhanterare
|
||||
Name[ta]=பலகை மேளாலர்:
|
||||
Name[tr]=Panel Yöneticisi
|
||||
Name[ug]=Panel باشقۇرغۇ
|
||||
Name[uk]=Менеджер панелей
|
||||
Name[uk]=Настройки tint2
|
||||
Name[ur]=پینل منیجر
|
||||
Name[ur_PK]=پینل منیجر
|
||||
Name[vi]=Quản lý panel
|
||||
Name[zh_CN]=面板管理器
|
||||
Name[zh_TW]=面板管理程式
|
||||
|
||||
GenericName=Panel configurator
|
||||
GenericName[am]=ፓነል አስተዳዳሪ
|
||||
GenericName[ar]=مدير الائحة :
|
||||
GenericName[ast]=Alministrador de panel
|
||||
GenericName[be]=Кіраўнік Панэляў
|
||||
GenericName[ca]=Gestor de quadres
|
||||
GenericName[cs]=Správce panelu
|
||||
GenericName[da]=Panelhåndtering
|
||||
GenericName[de]=Leistenverwaltung
|
||||
GenericName[dz]=པེ་ནཱལ་འཛིན་སྐྱོང་པ།
|
||||
GenericName[el]=Διαχειριστής ταμπλό
|
||||
GenericName[en_GB]=Panel Manager
|
||||
GenericName[eo]=Administrilo de Panelo
|
||||
GenericName[es]=Administrador de panel
|
||||
GenericName[et]=Paneelihaldur
|
||||
GenericName[eu]=Panel Kudeatzailea:
|
||||
GenericName[fi]=Paneelin hallinta
|
||||
GenericName[fr]=Gestionnaire de panneau
|
||||
GenericName[gl]=Xestor de paneis
|
||||
GenericName[he]=מנהל הלוח
|
||||
GenericName[hu]=Panelkezelő
|
||||
GenericName[id]=Manajer Panel
|
||||
GenericName[it]=Gestore dei pannelli
|
||||
GenericName[ja]=パネルマネージャ
|
||||
GenericName[kk]=Панель менеджері
|
||||
GenericName[ko]=패널 관리자
|
||||
GenericName[ku]=Gerinendeyê panelan
|
||||
GenericName[lv]=Paneļu pārvaldnieks
|
||||
GenericName[mk]=Менаџер за панели
|
||||
GenericName[nb]=Panelbehandler
|
||||
GenericName[nl]=Paneel Manager
|
||||
GenericName[nn]=Panelhandsamar
|
||||
GenericName[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
|
||||
GenericName[pl]=Ustawienia panelu
|
||||
GenericName[pt]=Gestor do Painel
|
||||
GenericName[pt_BR]=Gerenciador do painel
|
||||
GenericName[ro]=Manager de panouri
|
||||
GenericName[ru]=Настройки панелей
|
||||
GenericName[si]=පුවරු කළමණාකරු
|
||||
GenericName[sk]=Nastavenie panelu
|
||||
GenericName[sq]=Përgjegjës Panelesh
|
||||
GenericName[sv]=Panelhanterare
|
||||
GenericName[ta]=பலகை மேளாலர்:
|
||||
GenericName[tr]=Panel Yöneticisi
|
||||
GenericName[ug]=Panel باشقۇرغۇ
|
||||
GenericName[uk]=Настройки панелi
|
||||
GenericName[ur]=پینل منیجر
|
||||
GenericName[ur_PK]=پینل منیجر
|
||||
GenericName[vi]=Quản lý panel
|
||||
GenericName[zh_CN]=面板管理器
|
||||
GenericName[zh_TW]=面板管理程式
|
||||
|
||||
Comment=Tool to configure the tint2 panel
|
||||
Comment[ru]=Инструмент конфигурирования панели tint2
|
||||
|
||||
Exec=tint2conf
|
||||
Icon=tint2conf
|
||||
Terminal=false
|
||||
Categories=Settings;DesktopSettings;
|
||||
|
||||
|
||||
@@ -110,7 +110,6 @@ void tooltip_default_font_changed()
|
||||
tooltip_update();
|
||||
}
|
||||
|
||||
|
||||
void tooltip_trigger_show(Area *area, Panel *p, XEvent *e)
|
||||
{
|
||||
// Position the tooltip in the center of the area
|
||||
@@ -132,7 +131,7 @@ void tooltip_show(void *arg)
|
||||
int mx, my;
|
||||
Window w;
|
||||
XTranslateCoordinates(server.display, server.root_win, g_tooltip.panel->main_win, x, y, &mx, &my, &w);
|
||||
Area *area = click_area(g_tooltip.panel, mx, my);
|
||||
Area *area = find_area_under_mouse(g_tooltip.panel, mx, my);
|
||||
if (!g_tooltip.mapped && area->_get_tooltip_text) {
|
||||
tooltip_copy_text(area);
|
||||
g_tooltip.mapped = True;
|
||||
@@ -161,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;
|
||||
@@ -276,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);
|
||||
|
||||
411
src/util/area.c
@@ -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);
|
||||
@@ -70,17 +71,15 @@ void relayout_fixed(Area *a)
|
||||
relayout_fixed(l->data);
|
||||
|
||||
// Recalculate size
|
||||
a->_changed = 0;
|
||||
a->_changed = FALSE;
|
||||
if (a->resize_needed && a->size_mode == LAYOUT_FIXED) {
|
||||
a->resize_needed = 0;
|
||||
a->resize_needed = FALSE;
|
||||
|
||||
if (a->_resize) {
|
||||
if (a->_resize(a)) {
|
||||
// The size hash changed => resize needed for the parent
|
||||
if (a->parent)
|
||||
((Area *)a->parent)->resize_needed = 1;
|
||||
a->_changed = 1;
|
||||
}
|
||||
if (a->_resize && a->_resize(a)) {
|
||||
// The size has changed => resize needed for the parent
|
||||
if (a->parent)
|
||||
((Area *)a->parent)->resize_needed = TRUE;
|
||||
a->_changed = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,10 +91,11 @@ void relayout_dynamic(Area *a, int level)
|
||||
|
||||
// Area is resized before its children
|
||||
if (a->resize_needed && a->size_mode == LAYOUT_DYNAMIC) {
|
||||
a->resize_needed = 0;
|
||||
a->resize_needed = FALSE;
|
||||
|
||||
if (a->_resize) {
|
||||
a->_resize(a);
|
||||
if (a->_resize(a))
|
||||
a->_changed = TRUE;
|
||||
// resize children with LAYOUT_DYNAMIC
|
||||
for (GList *l = a->children; l; l = l->next) {
|
||||
Area *child = ((Area *)l->data);
|
||||
@@ -108,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);
|
||||
@@ -119,13 +120,13 @@ void relayout_dynamic(Area *a, int level)
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
} else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +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);
|
||||
@@ -147,13 +150,13 @@ void relayout_dynamic(Area *a, int level)
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
} else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
@@ -186,13 +190,13 @@ void relayout_dynamic(Area *a, int level)
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
} else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,12 +227,21 @@ void draw_tree(Area *a)
|
||||
return;
|
||||
|
||||
if (a->_redraw_needed) {
|
||||
a->_redraw_needed = 0;
|
||||
a->_redraw_needed = FALSE;
|
||||
draw(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);
|
||||
XCopyArea(server.display,
|
||||
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);
|
||||
@@ -241,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) {
|
||||
@@ -276,12 +289,12 @@ int relayout_with_constraint(Area *a, int maximum_size)
|
||||
modulo--;
|
||||
}
|
||||
if (child->width != old_width)
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
}
|
||||
} 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) {
|
||||
@@ -316,7 +329,7 @@ int relayout_with_constraint(Area *a, int maximum_size)
|
||||
modulo--;
|
||||
}
|
||||
if (child->height != old_height)
|
||||
child->_changed = 1;
|
||||
child->_changed = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -351,7 +364,7 @@ void hide(Area *a)
|
||||
|
||||
a->on_screen = FALSE;
|
||||
if (parent)
|
||||
parent->resize_needed = 1;
|
||||
parent->resize_needed = TRUE;
|
||||
if (panel_horizontal)
|
||||
a->width = 0;
|
||||
else
|
||||
@@ -364,12 +377,27 @@ void show(Area *a)
|
||||
|
||||
a->on_screen = TRUE;
|
||||
if (parent)
|
||||
parent->resize_needed = 1;
|
||||
a->resize_needed = 1;
|
||||
parent->resize_needed = TRUE;
|
||||
a->resize_needed = TRUE;
|
||||
}
|
||||
|
||||
void draw(Area *a)
|
||||
{
|
||||
if (a->_changed) {
|
||||
// On resize/move, invalidate cached pixmaps
|
||||
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
||||
XFreePixmap(server.display, a->pix_by_state[i]);
|
||||
if (a->pix == a->pix_by_state[i]) {
|
||||
a->pix = None;
|
||||
}
|
||||
a->pix_by_state[i] = None;
|
||||
}
|
||||
if (a->pix) {
|
||||
XFreePixmap(server.display, a->pix);
|
||||
a->pix = None;
|
||||
}
|
||||
}
|
||||
|
||||
if (a->pix) {
|
||||
XFreePixmap(server.display, a->pix);
|
||||
if (a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] != a->pix)
|
||||
@@ -378,12 +406,20 @@ void draw(Area *a)
|
||||
a->pix = XCreatePixmap(server.display, server.root_win, a->width, a->height, server.depth);
|
||||
a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix;
|
||||
|
||||
// Add layer of root pixmap (or clear pixmap if real_transparency==true)
|
||||
if (!a->_clear) {
|
||||
clear_pixmap(a->pix, 0, 0, a->width, a->height);
|
||||
if (!server.real_transparency) {
|
||||
XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0);
|
||||
}
|
||||
// Add layer of root pixmap (or clear pixmap if real_transparency==true)
|
||||
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);
|
||||
} else {
|
||||
a->_clear(a);
|
||||
}
|
||||
@@ -403,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);
|
||||
}
|
||||
|
||||
@@ -437,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);
|
||||
}
|
||||
@@ -532,11 +571,8 @@ void mouse_over(Area *area, int pressed)
|
||||
if (!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;
|
||||
new_state =
|
||||
area->has_mouse_press_effect ? MOUSE_DOWN : area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,7 +584,8 @@ void mouse_over(Area *area, int pressed)
|
||||
mouse_over_area = area;
|
||||
|
||||
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 =
|
||||
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;
|
||||
@@ -559,9 +596,221 @@ void mouse_out()
|
||||
if (!mouse_over_area)
|
||||
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 =
|
||||
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;
|
||||
mouse_over_area = NULL;
|
||||
}
|
||||
|
||||
gboolean area_is_first(void *obj)
|
||||
{
|
||||
Area *a = obj;
|
||||
if (!a->on_screen)
|
||||
return FALSE;
|
||||
|
||||
Panel *panel = a->panel;
|
||||
|
||||
Area *node = &panel->area;
|
||||
|
||||
while (node) {
|
||||
if (!node->on_screen || node->width == 0 || node->height == 0)
|
||||
return FALSE;
|
||||
if (node == a)
|
||||
return TRUE;
|
||||
|
||||
GList *l = node->children;
|
||||
node = NULL;
|
||||
for (; l; l = l->next) {
|
||||
Area *child = l->data;
|
||||
if (!child->on_screen || child->width == 0 || child->height == 0)
|
||||
continue;
|
||||
node = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean area_is_last(void *obj)
|
||||
{
|
||||
Area *a = obj;
|
||||
if (!a->on_screen)
|
||||
return FALSE;
|
||||
|
||||
Panel *panel = a->panel;
|
||||
|
||||
Area *node = &panel->area;
|
||||
|
||||
while (node) {
|
||||
if (!node->on_screen || node->width == 0 || node->height == 0)
|
||||
return FALSE;
|
||||
if (node == a)
|
||||
return TRUE;
|
||||
|
||||
GList *l = node->children;
|
||||
node = NULL;
|
||||
for (; l; l = l->next) {
|
||||
Area *child = l->data;
|
||||
if (!child->on_screen || child->width == 0 || child->height == 0)
|
||||
continue;
|
||||
node = child;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean area_is_under_mouse(void *obj, int x, int y)
|
||||
{
|
||||
Area *a = obj;
|
||||
if (!a->on_screen || a->width == 0 || a->height == 0)
|
||||
return FALSE;
|
||||
|
||||
if (a->_is_under_mouse)
|
||||
return a->_is_under_mouse(a, x, y);
|
||||
|
||||
return x >= a->posx && x <= (a->posx + a->width) && y >= a->posy && y <= (a->posy + a->height);
|
||||
}
|
||||
|
||||
gboolean full_width_area_is_under_mouse(void *obj, int x, int y)
|
||||
{
|
||||
Area *a = obj;
|
||||
if (!a->on_screen)
|
||||
return FALSE;
|
||||
|
||||
if (a->_is_under_mouse && a->_is_under_mouse != full_width_area_is_under_mouse)
|
||||
return a->_is_under_mouse(a, x, y);
|
||||
|
||||
if (panel_horizontal)
|
||||
return (x >= a->posx) && (x <= a->posx + a->width);
|
||||
else
|
||||
return (y >= a->posy) && (y <= a->posy + a->height);
|
||||
}
|
||||
|
||||
Area *find_area_under_mouse(void *root, int x, int y)
|
||||
{
|
||||
Area *result = root;
|
||||
Area *new_result = result;
|
||||
do {
|
||||
result = new_result;
|
||||
GList *it = result->children;
|
||||
while (it) {
|
||||
Area *a = (Area *)it->data;
|
||||
if (area_is_under_mouse(a, x, y)) {
|
||||
new_result = a;
|
||||
break;
|
||||
}
|
||||
it = it->next;
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
@@ -156,12 +167,7 @@ typedef enum Alignment {
|
||||
ALIGN_RIGHT = 2,
|
||||
} Alignment;
|
||||
|
||||
typedef enum MouseState {
|
||||
MOUSE_NORMAL = 0,
|
||||
MOUSE_OVER = 1,
|
||||
MOUSE_DOWN = 2,
|
||||
MOUSE_STATE_COUNT
|
||||
} MouseState;
|
||||
typedef enum MouseState { MOUSE_NORMAL = 0, MOUSE_OVER = 1, MOUSE_DOWN = 2, MOUSE_STATE_COUNT } MouseState;
|
||||
|
||||
struct Panel;
|
||||
|
||||
@@ -199,6 +205,7 @@ typedef struct Area {
|
||||
// This is the pixmap on which the Area is rendered. Render to it directly if needed.
|
||||
Pixmap pix;
|
||||
Pixmap pix_by_state[MOUSE_STATE_COUNT];
|
||||
char name[32];
|
||||
|
||||
// Callbacks
|
||||
|
||||
@@ -219,6 +226,13 @@ typedef struct Area {
|
||||
// Returns a copy of the tooltip to be displayed for this widget.
|
||||
// The caller takes ownership of the pointer.
|
||||
char *(*_get_tooltip_text)(void *obj);
|
||||
|
||||
// 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
|
||||
@@ -266,7 +294,22 @@ void add_area(Area *a, Area *parent);
|
||||
void remove_area(Area *a);
|
||||
void free_area(Area *a);
|
||||
|
||||
// Mouse move events
|
||||
// Mouse events
|
||||
|
||||
// Returns the area under the mouse for the given x, y mouse coordinates relative to the window.
|
||||
// If no area is found, returns the root.
|
||||
Area *find_area_under_mouse(void *root, int x, int y);
|
||||
|
||||
// Returns true if the Area handles a mouse event at the given x, y coordinates relative to the window.
|
||||
gboolean area_is_under_mouse(void *obj, int x, int y);
|
||||
|
||||
// Returns true if the Area handles a mouse event at the given x, y coordinates relative to the window.
|
||||
// The Area will also handle clicks on the border of its ancestors, including the panel.
|
||||
// Useful so that a click at the edge of the screen is still handled by task buttons etc., even if technically
|
||||
// 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();
|
||||
|
||||
158
src/util/cache.c
Normal file
@@ -0,0 +1,158 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Tint2 : cache
|
||||
*
|
||||
* Copyright (C) 2016 @o9000
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**************************************************************************/
|
||||
|
||||
#include "cache.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void init_cache(Cache *cache)
|
||||
{
|
||||
if (cache->_table)
|
||||
free_cache(cache);
|
||||
cache->_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
|
||||
cache->dirty = FALSE;
|
||||
cache->loaded = FALSE;
|
||||
}
|
||||
|
||||
void free_cache(Cache *cache)
|
||||
{
|
||||
if (cache->_table)
|
||||
g_hash_table_destroy(cache->_table);
|
||||
cache->_table = NULL;
|
||||
cache->dirty = FALSE;
|
||||
cache->loaded = FALSE;
|
||||
}
|
||||
|
||||
void load_cache(Cache *cache, const gchar *cache_path)
|
||||
{
|
||||
init_cache(cache);
|
||||
|
||||
cache->loaded = TRUE;
|
||||
|
||||
int fd = open(cache_path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return;
|
||||
flock(fd, LOCK_SH);
|
||||
|
||||
FILE *f = fopen(cache_path, "rt");
|
||||
if (!f)
|
||||
goto unlock;
|
||||
|
||||
char *line = NULL;
|
||||
size_t line_size;
|
||||
|
||||
while (getline(&line, &line_size, f) >= 0) {
|
||||
char *key, *value;
|
||||
|
||||
size_t line_len = strlen(line);
|
||||
gboolean has_newline = FALSE;
|
||||
if (line_len >= 1) {
|
||||
if (line[line_len - 1] == '\n') {
|
||||
line[line_len - 1] = '\0';
|
||||
line_len--;
|
||||
has_newline = TRUE;
|
||||
}
|
||||
}
|
||||
if (!has_newline)
|
||||
break;
|
||||
|
||||
if (line_len == 0)
|
||||
continue;
|
||||
|
||||
if (parse_line(line, &key, &value)) {
|
||||
g_hash_table_insert(cache->_table, g_strdup(key), g_strdup(value));
|
||||
}
|
||||
}
|
||||
free(line);
|
||||
fclose(f);
|
||||
|
||||
unlock:
|
||||
flock(fd, LOCK_UN);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
void write_cache_line(gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
gchar *k = key;
|
||||
gchar *v = value;
|
||||
FILE *f = user_data;
|
||||
|
||||
fprintf(f, "%s=%s\n", k, v);
|
||||
}
|
||||
|
||||
void save_cache(Cache *cache, const gchar *cache_path)
|
||||
{
|
||||
int fd = open(cache_path, O_RDONLY | O_CREAT, 0600);
|
||||
if (fd == -1) {
|
||||
gchar *dir_path = g_path_get_dirname(cache_path);
|
||||
g_mkdir_with_parents(dir_path, 0700);
|
||||
g_free(dir_path);
|
||||
fd = open(cache_path, O_RDONLY | O_CREAT, 0600);
|
||||
}
|
||||
if (fd == -1) {
|
||||
fprintf(stderr, RED "Could not save icon theme cache!" RESET "\n");
|
||||
return;
|
||||
}
|
||||
flock(fd, LOCK_EX);
|
||||
|
||||
FILE *f = fopen(cache_path, "w");
|
||||
if (!f) {
|
||||
fprintf(stderr, RED "Could not save icon theme cache!" RESET "\n");
|
||||
goto unlock;
|
||||
}
|
||||
g_hash_table_foreach(cache->_table, write_cache_line, f);
|
||||
fclose(f);
|
||||
cache->dirty = FALSE;
|
||||
|
||||
unlock:
|
||||
flock(fd, LOCK_UN);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
const gchar *get_from_cache(Cache *cache, const gchar *key)
|
||||
{
|
||||
if (!cache->_table)
|
||||
return NULL;
|
||||
return g_hash_table_lookup(cache->_table, key);
|
||||
}
|
||||
|
||||
void add_to_cache(Cache *cache, const gchar *key, const gchar *value)
|
||||
{
|
||||
if (!cache->_table)
|
||||
init_cache(cache);
|
||||
|
||||
if (!key || !value)
|
||||
return;
|
||||
|
||||
gchar *old_value = g_hash_table_lookup(cache->_table, key);
|
||||
if (old_value && g_str_equal(old_value, value))
|
||||
return;
|
||||
|
||||
g_hash_table_insert(cache->_table, g_strdup(key), g_strdup(value));
|
||||
cache->dirty = TRUE;
|
||||
}
|
||||
39
src/util/cache.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef CACHE_H
|
||||
#define CACHE_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
// A cache with string keys and values, backed by a file.
|
||||
// The strings must not be NULL and are stripped of any whitespace at start and end.
|
||||
typedef struct Cache {
|
||||
gboolean dirty;
|
||||
gboolean loaded;
|
||||
GHashTable *_table;
|
||||
} Cache;
|
||||
|
||||
// Initializes the cache. You can also call load_cache directly if you set the memory contents to zero first.
|
||||
void init_cache(Cache *cache);
|
||||
|
||||
// Clears the cache contents and releases all memory, but not the object.
|
||||
// You can use init_cache or load_cache afterwards.
|
||||
void free_cache(Cache *cache);
|
||||
|
||||
// Clears the cache contents and loads new contents from a file.
|
||||
// Sets the loaded flag to TRUE.
|
||||
void load_cache(Cache *cache, const gchar *cache_path);
|
||||
|
||||
// Saves the cache contents to a file.
|
||||
// Clears the dirty flag.
|
||||
void save_cache(Cache *cache, const gchar *cache_path);
|
||||
|
||||
// Returns a pointer to the value in the cache, or NULL if not found.
|
||||
// Do not free the returned value!
|
||||
const gchar *get_from_cache(Cache *cache, const gchar *key);
|
||||
|
||||
// Adds a key-value pair to the cache. NULL keys or values are not allowed.
|
||||
// If the key already exists, the old value is and replaced with the new value.
|
||||
// Does not take ownership of the pointers (neither key, nor value); instead it makes copies.
|
||||
// Sets the dirty flag to TRUE.
|
||||
void add_to_cache(Cache *cache, const gchar *key, const gchar *value);
|
||||
|
||||
#endif
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -36,9 +37,8 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <errno.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifdef HAVE_RSVG
|
||||
#include <librsvg/rsvg.h>
|
||||
@@ -113,7 +113,7 @@ void tint_exec(const char *command)
|
||||
}
|
||||
}
|
||||
|
||||
char *expand_tilde(char *s)
|
||||
char *expand_tilde(const char *s)
|
||||
{
|
||||
const gchar *home = g_get_home_dir();
|
||||
if (home && (strcmp(s, "~") == 0 || strstr(s, "~/") == s)) {
|
||||
@@ -126,7 +126,7 @@ char *expand_tilde(char *s)
|
||||
}
|
||||
}
|
||||
|
||||
char *contract_tilde(char *s)
|
||||
char *contract_tilde(const char *s)
|
||||
{
|
||||
const gchar *home = g_get_home_dir();
|
||||
if (!home)
|
||||
@@ -238,119 +238,110 @@ void extract_values(const char *value, char **value1, char **value2, char **valu
|
||||
}
|
||||
}
|
||||
|
||||
void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright)
|
||||
void adjust_asb(DATA32 *data, int w, int h, float alpha_adjust, float satur_adjust, float bright_adjust)
|
||||
{
|
||||
unsigned int x, y;
|
||||
unsigned int a, r, g, b, argb;
|
||||
unsigned long id;
|
||||
int cmax, cmin;
|
||||
float h2, f, p, q, t;
|
||||
float hue, saturation, brightness;
|
||||
float redc, greenc, bluec;
|
||||
for (int id = 0; id < w * h; id++) {
|
||||
unsigned int argb = data[id];
|
||||
int a = (argb >> 24) & 0xff;
|
||||
// transparent => nothing to do.
|
||||
if (a == 0)
|
||||
continue;
|
||||
int r = (argb >> 16) & 0xff;
|
||||
int g = (argb >> 8) & 0xff;
|
||||
int b = (argb)&0xff;
|
||||
|
||||
for (y = 0; y < h; y++) {
|
||||
for (id = y * w, x = 0; x < w; x++, id++) {
|
||||
argb = data[id];
|
||||
a = (argb >> 24) & 0xff;
|
||||
// transparent => nothing to do.
|
||||
if (a == 0)
|
||||
continue;
|
||||
r = (argb >> 16) & 0xff;
|
||||
g = (argb >> 8) & 0xff;
|
||||
b = (argb)&0xff;
|
||||
|
||||
// convert RGB to HSB
|
||||
cmax = (r > g) ? r : g;
|
||||
if (b > cmax)
|
||||
cmax = b;
|
||||
cmin = (r < g) ? r : g;
|
||||
if (b < cmin)
|
||||
cmin = b;
|
||||
brightness = ((float)cmax) / 255.0f;
|
||||
if (cmax != 0)
|
||||
saturation = ((float)(cmax - cmin)) / ((float)cmax);
|
||||
// Convert RGB to HSV
|
||||
int cmax = MAX3(r, g, b);
|
||||
int cmin = MIN3(r, g, b);
|
||||
int delta = cmax - cmin;
|
||||
float brightness = cmax / 255.0f;
|
||||
float saturation;
|
||||
if (cmax != 0)
|
||||
saturation = delta / (float)cmax;
|
||||
else
|
||||
saturation = 0;
|
||||
float hue;
|
||||
if (saturation == 0) {
|
||||
hue = 0;
|
||||
} else {
|
||||
float redc = (cmax - r) / (float)delta;
|
||||
float greenc = (cmax - g) / (float)delta;
|
||||
float bluec = (cmax - b) / (float)delta;
|
||||
if (r == cmax)
|
||||
hue = bluec - greenc;
|
||||
else if (g == cmax)
|
||||
hue = 2.0f + redc - bluec;
|
||||
else
|
||||
saturation = 0;
|
||||
if (saturation == 0)
|
||||
hue = 0;
|
||||
else {
|
||||
redc = ((float)(cmax - r)) / ((float)(cmax - cmin));
|
||||
greenc = ((float)(cmax - g)) / ((float)(cmax - cmin));
|
||||
bluec = ((float)(cmax - b)) / ((float)(cmax - cmin));
|
||||
if (r == cmax)
|
||||
hue = bluec - greenc;
|
||||
else if (g == cmax)
|
||||
hue = 2.0f + redc - bluec;
|
||||
else
|
||||
hue = 4.0f + greenc - redc;
|
||||
hue = hue / 6.0f;
|
||||
if (hue < 0)
|
||||
hue = hue + 1.0f;
|
||||
}
|
||||
|
||||
// adjust
|
||||
saturation += satur;
|
||||
if (saturation < 0.0)
|
||||
saturation = 0.0;
|
||||
if (saturation > 1.0)
|
||||
saturation = 1.0;
|
||||
brightness += bright;
|
||||
if (brightness < 0.0)
|
||||
brightness = 0.0;
|
||||
if (brightness > 1.0)
|
||||
brightness = 1.0;
|
||||
if (alpha != 100)
|
||||
a = (a * alpha) / 100;
|
||||
|
||||
// convert HSB to RGB
|
||||
if (saturation == 0) {
|
||||
r = g = b = (int)(brightness * 255.0f + 0.5f);
|
||||
} else {
|
||||
h2 = (hue - (int)hue) * 6.0f;
|
||||
f = h2 - (int)(h2);
|
||||
p = brightness * (1.0f - saturation);
|
||||
q = brightness * (1.0f - saturation * f);
|
||||
t = brightness * (1.0f - (saturation * (1.0f - f)));
|
||||
switch ((int)h2) {
|
||||
case 0:
|
||||
r = (int)(brightness * 255.0f + 0.5f);
|
||||
g = (int)(t * 255.0f + 0.5f);
|
||||
b = (int)(p * 255.0f + 0.5f);
|
||||
break;
|
||||
case 1:
|
||||
r = (int)(q * 255.0f + 0.5f);
|
||||
g = (int)(brightness * 255.0f + 0.5f);
|
||||
b = (int)(p * 255.0f + 0.5f);
|
||||
break;
|
||||
case 2:
|
||||
r = (int)(p * 255.0f + 0.5f);
|
||||
g = (int)(brightness * 255.0f + 0.5f);
|
||||
b = (int)(t * 255.0f + 0.5f);
|
||||
break;
|
||||
case 3:
|
||||
r = (int)(p * 255.0f + 0.5f);
|
||||
g = (int)(q * 255.0f + 0.5f);
|
||||
b = (int)(brightness * 255.0f + 0.5f);
|
||||
break;
|
||||
case 4:
|
||||
r = (int)(t * 255.0f + 0.5f);
|
||||
g = (int)(p * 255.0f + 0.5f);
|
||||
b = (int)(brightness * 255.0f + 0.5f);
|
||||
break;
|
||||
case 5:
|
||||
r = (int)(brightness * 255.0f + 0.5f);
|
||||
g = (int)(p * 255.0f + 0.5f);
|
||||
b = (int)(q * 255.0f + 0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
argb = a;
|
||||
argb = (argb << 8) + r;
|
||||
argb = (argb << 8) + g;
|
||||
argb = (argb << 8) + b;
|
||||
data[id] = argb;
|
||||
hue = 4.0f + greenc - redc;
|
||||
hue = hue / 6.0f;
|
||||
if (hue < 0)
|
||||
hue = hue + 1.0f;
|
||||
}
|
||||
|
||||
// Adjust H, S
|
||||
saturation += satur_adjust;
|
||||
saturation = CLAMP(saturation, 0.0, 1.0);
|
||||
|
||||
a *= alpha_adjust;
|
||||
a = CLAMP(a, 0, 255);
|
||||
|
||||
// Convert HSV to RGB
|
||||
if (saturation == 0) {
|
||||
r = g = b = (int)(brightness * 255.0f + 0.5f);
|
||||
} else {
|
||||
float h2 = (hue - (int)hue) * 6.0f;
|
||||
float f = h2 - (int)(h2);
|
||||
float p = brightness * (1.0f - saturation);
|
||||
float q = brightness * (1.0f - saturation * f);
|
||||
float t = brightness * (1.0f - (saturation * (1.0f - f)));
|
||||
|
||||
switch ((int)h2) {
|
||||
case 0:
|
||||
r = (int)(brightness * 255.0f + 0.5f);
|
||||
g = (int)(t * 255.0f + 0.5f);
|
||||
b = (int)(p * 255.0f + 0.5f);
|
||||
break;
|
||||
case 1:
|
||||
r = (int)(q * 255.0f + 0.5f);
|
||||
g = (int)(brightness * 255.0f + 0.5f);
|
||||
b = (int)(p * 255.0f + 0.5f);
|
||||
break;
|
||||
case 2:
|
||||
r = (int)(p * 255.0f + 0.5f);
|
||||
g = (int)(brightness * 255.0f + 0.5f);
|
||||
b = (int)(t * 255.0f + 0.5f);
|
||||
break;
|
||||
case 3:
|
||||
r = (int)(p * 255.0f + 0.5f);
|
||||
g = (int)(q * 255.0f + 0.5f);
|
||||
b = (int)(brightness * 255.0f + 0.5f);
|
||||
break;
|
||||
case 4:
|
||||
r = (int)(t * 255.0f + 0.5f);
|
||||
g = (int)(p * 255.0f + 0.5f);
|
||||
b = (int)(brightness * 255.0f + 0.5f);
|
||||
break;
|
||||
case 5:
|
||||
r = (int)(brightness * 255.0f + 0.5f);
|
||||
g = (int)(p * 255.0f + 0.5f);
|
||||
b = (int)(q * 255.0f + 0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
r += bright_adjust * 255;
|
||||
g += bright_adjust * 255;
|
||||
b += bright_adjust * 255;
|
||||
|
||||
r = CLAMP(r, 0, 255);
|
||||
g = CLAMP(g, 0, 255);
|
||||
b = CLAMP(b, 0, 255);
|
||||
|
||||
argb = a;
|
||||
argb = (argb << 8) + r;
|
||||
argb = (argb << 8) + g;
|
||||
argb = (argb << 8) + b;
|
||||
data[id] = argb;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,41 +371,6 @@ void create_heuristic_mask(DATA32 *data, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
int pixel_empty(DATA32 argb)
|
||||
{
|
||||
|
||||
DATA32 a = (argb >> 24) & 0xff;
|
||||
if (a == 0)
|
||||
return 1;
|
||||
|
||||
DATA32 rgb = argb & 0xffFFff;
|
||||
return rgb == 0;
|
||||
}
|
||||
|
||||
int image_empty(DATA32 *data, int w, int h)
|
||||
{
|
||||
if (w > 0 && h > 0) {
|
||||
int x = w / 2;
|
||||
int y = h / 2;
|
||||
if (!pixel_empty(data[y * w + x])) {
|
||||
// fprintf(stderr, "Non-empty pixel: [%u, %u] = %x\n", x, y, data[y * w + x]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = 0; y < h; y++) {
|
||||
for (int x = 0; x < w; x++) {
|
||||
if (!pixel_empty(data[y * w + x])) {
|
||||
// fprintf(stderr, "Non-empty pixel: [%u, %u] = %x\n", x, y, data[y * w + x]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fprintf(stderr, "All pixels are empty\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
void render_image(Drawable d, int x, int y)
|
||||
{
|
||||
if (!server.real_transparency) {
|
||||
@@ -436,9 +392,15 @@ void render_image(Drawable d, int x, int y)
|
||||
imlib_context_set_blend(0);
|
||||
imlib_render_image_on_drawable(0, 0);
|
||||
|
||||
Picture pict = XRenderCreatePicture(server.display, pixmap, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0);
|
||||
Picture pict_drawable = XRenderCreatePicture(server.display, d, XRenderFindVisualFormat(server.display, server.visual), 0, 0);
|
||||
Picture pict_mask = XRenderCreatePicture(server.display, mask, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0);
|
||||
Picture pict = XRenderCreatePicture(server.display,
|
||||
pixmap,
|
||||
XRenderFindStandardFormat(server.display, PictStandardARGB32),
|
||||
0,
|
||||
0);
|
||||
Picture pict_drawable =
|
||||
XRenderCreatePicture(server.display, d, XRenderFindVisualFormat(server.display, server.visual), 0, 0);
|
||||
Picture pict_mask =
|
||||
XRenderCreatePicture(server.display, mask, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0);
|
||||
XRenderComposite(server.display, PictOpOver, pict, pict_mask, pict_drawable, 0, 0, 0, 0, x, y, w, h);
|
||||
|
||||
XRenderFreePicture(server.display, pict_mask);
|
||||
@@ -461,8 +423,8 @@ void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color
|
||||
0.0,
|
||||
0.0,
|
||||
1.0 -
|
||||
(1.0 - shadow_edge_alpha) *
|
||||
sqrt((i * i + j * j) / (double)(shadow_size * shadow_size)));
|
||||
(1.0 - shadow_edge_alpha) *
|
||||
sqrt((i * i + j * j) / (double)(shadow_size * shadow_size)));
|
||||
pango_cairo_update_layout(c, layout);
|
||||
cairo_move_to(c, posx + i, posy + j);
|
||||
pango_cairo_show_layout(c, layout);
|
||||
@@ -485,31 +447,31 @@ Imlib_Image load_image(const char *path, int cached)
|
||||
image = imlib_load_image_immediately_without_cache(path);
|
||||
}
|
||||
if (!image && g_str_has_suffix(path, ".svg")) {
|
||||
char suffix[128];
|
||||
sprintf(suffix, "tmpimage-%d.png", getpid());
|
||||
// We fork here because librsvg allocates memory like crazy
|
||||
pid_t pid = fork();
|
||||
if (pid == 0) {
|
||||
// Child
|
||||
GError *err = NULL;
|
||||
RsvgHandle *svg = rsvg_handle_new_from_file(path, &err);
|
||||
char tmp_filename[128];
|
||||
sprintf(tmp_filename, "/tmp/tint2-%d-XXXXXX.png", (int)getpid());
|
||||
int fd = mkstemps(tmp_filename, 4);
|
||||
if (fd) {
|
||||
// We fork here because librsvg allocates memory like crazy
|
||||
pid_t pid = fork();
|
||||
if (pid == 0) {
|
||||
// Child
|
||||
GError *err = NULL;
|
||||
RsvgHandle *svg = rsvg_handle_new_from_file(path, &err);
|
||||
|
||||
if (err != NULL) {
|
||||
fprintf(stderr, "Could not load svg image!: %s", err->message);
|
||||
g_error_free(err);
|
||||
if (err != NULL) {
|
||||
fprintf(stderr, "Could not load svg image!: %s", err->message);
|
||||
g_error_free(err);
|
||||
} else {
|
||||
GdkPixbuf *pixbuf = rsvg_handle_get_pixbuf(svg);
|
||||
gdk_pixbuf_save(pixbuf, tmp_filename, "png", NULL, NULL);
|
||||
}
|
||||
exit(0);
|
||||
} else {
|
||||
gchar *name = g_build_filename(g_get_user_config_dir(), "tint2", suffix, NULL);
|
||||
GdkPixbuf *pixbuf = rsvg_handle_get_pixbuf(svg);
|
||||
gdk_pixbuf_save(pixbuf, name, "png", NULL, NULL);
|
||||
// Parent
|
||||
waitpid(pid, 0, 0);
|
||||
image = imlib_load_image_immediately_without_cache(tmp_filename);
|
||||
unlink(tmp_filename);
|
||||
}
|
||||
exit(0);
|
||||
} else {
|
||||
// Parent
|
||||
waitpid(pid, 0, 0);
|
||||
gchar *name = g_build_filename(g_get_user_config_dir(), "tint2", suffix, NULL);
|
||||
image = imlib_load_image_immediately_without_cache(name);
|
||||
g_remove(name);
|
||||
g_free(name);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
@@ -537,34 +499,76 @@ Imlib_Image adjust_icon(Imlib_Image original, int alpha, int saturation, int bri
|
||||
adjust_asb(data,
|
||||
imlib_image_get_width(),
|
||||
imlib_image_get_height(),
|
||||
alpha,
|
||||
(float)saturation / 100,
|
||||
(float)brightness / 100);
|
||||
alpha / 100.0,
|
||||
saturation / 100.0,
|
||||
brightness / 100.0);
|
||||
imlib_image_put_back_data(data);
|
||||
return copy;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Picture pict = XRenderCreatePicture(server.display, p, XRenderFindVisualFormat(server.display, server.visual), 0, 0);
|
||||
Picture pict =
|
||||
XRenderCreatePicture(server.display, p, XRenderFindVisualFormat(server.display, server.visual), 0, 0);
|
||||
XRenderColor col;
|
||||
col.red = col.green = col.blue = col.alpha = 0;
|
||||
XRenderFillRectangle(server.display, PictOpSrc, pict, &col, x, y, w, h);
|
||||
@@ -613,7 +617,7 @@ void get_text_size2(PangoFontDescription *font,
|
||||
XFreePixmap(server.display, pmap);
|
||||
}
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 33, 4)
|
||||
#if !GLIB_CHECK_VERSION(2, 33, 4)
|
||||
GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data)
|
||||
{
|
||||
list = g_list_copy(list);
|
||||
@@ -628,111 +632,44 @@ GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
// Based loosely on close_allv from
|
||||
// https://git.gnome.org/browse/glib/tree/gio/libasyncns/asyncns.c?h=2.21.0#n205
|
||||
// license: LGPL version 2.1
|
||||
// but with all the junk removed
|
||||
// and
|
||||
// https://opensource.apple.com/source/sudo/sudo-46/src/closefrom.c
|
||||
// license: BSD
|
||||
void close_all_fds()
|
||||
GSList *load_locations_from_env(GSList *locations, const char *var, ...)
|
||||
{
|
||||
const int from_fd = 3;
|
||||
|
||||
#ifdef __linux__
|
||||
DIR *d = opendir("/proc/self/fd");
|
||||
if (d) {
|
||||
for (struct dirent *de = readdir(d); de; de = readdir(d)) {
|
||||
if (de->d_name[0] == '.')
|
||||
continue;
|
||||
int fd = atoi(de->d_name);
|
||||
if (fd < from_fd)
|
||||
continue;
|
||||
if (fd == dirfd(d))
|
||||
continue;
|
||||
close(fd);
|
||||
char *value = getenv(var);
|
||||
if (value) {
|
||||
value = strdup(value);
|
||||
char *p = value;
|
||||
for (char *token = strsep(&value, ":"); token; token = strsep(&value, ":")) {
|
||||
va_list ap;
|
||||
va_start(ap, var);
|
||||
for (const char *suffix = va_arg(ap, const char *); suffix; suffix = va_arg(ap, const char *)) {
|
||||
locations = g_slist_append(locations, g_build_filename(token, suffix, NULL));
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
closedir(d);
|
||||
return;
|
||||
free(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
||||
closefrom(from_fd);
|
||||
return;
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
fcntl(from_fd, F_CLOSEM, 0);
|
||||
#endif
|
||||
|
||||
// Worst case scenario: iterate over all possible fds
|
||||
int max_fd = sysconf(_SC_OPEN_MAX);
|
||||
for (int fd = from_fd; fd < max_fd; fd++) {
|
||||
close(fd);
|
||||
}
|
||||
|
||||
return;
|
||||
return locations;
|
||||
}
|
||||
|
||||
char* get_own_path()
|
||||
GSList *slist_remove_duplicates(GSList *list, GCompareFunc eq, GDestroyNotify fr)
|
||||
{
|
||||
const int buf_size = 4096;
|
||||
char *buf = calloc(buf_size, 1);
|
||||
GSList *new_list = NULL;
|
||||
|
||||
#ifdef __linux__
|
||||
if (readlink("/proc/self/exe", buf, buf_size) > 0)
|
||||
return buf;
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
int mib[4] = {
|
||||
CTL_KERN,
|
||||
KERN_PROC,
|
||||
KERN_PROC_PATHNAME,
|
||||
getpid()
|
||||
};
|
||||
|
||||
size_t max_len = buf_size;
|
||||
if (sysctl(mib, 4, buf, &max_len, NULL, 0) == 0)
|
||||
return buf;
|
||||
#endif
|
||||
|
||||
#if defined(__DragonFly__)
|
||||
if (readlink("/proc/curproc/file", buf, buf_size) > 0)
|
||||
return buf;
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
if (readlink("/proc/curproc/exe", buf, buf_size) > 0)
|
||||
return buf;
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__)
|
||||
int mib[4] = {
|
||||
CTL_KERN,
|
||||
KERN_PROC_ARGS,
|
||||
getpid(),
|
||||
KERN_PROC_ARGV
|
||||
};
|
||||
|
||||
char *path = NULL;
|
||||
size_t len;
|
||||
if (sysctl(mib, 4, NULL, &len, NULL, 0) == 0 && len > 0) {
|
||||
char **argv = malloc(len);
|
||||
if (argv) {
|
||||
if (sysctl(mib, 4, argv, &len, NULL, 0) == 0) {
|
||||
path = realpath(argv[0], NULL);
|
||||
for (GSList *l1 = list; l1; l1 = g_slist_next(l1)) {
|
||||
gboolean duplicate = FALSE;
|
||||
for (GSList *l2 = new_list; l2; l2 = g_slist_next(l2)) {
|
||||
if (eq(l1->data, l2->data)) {
|
||||
duplicate = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(argv);
|
||||
if (!duplicate) {
|
||||
new_list = g_slist_append(new_list, l1->data);
|
||||
l1->data = NULL;
|
||||
}
|
||||
}
|
||||
if (path) {
|
||||
free(buf);
|
||||
return path;
|
||||
}
|
||||
#endif
|
||||
|
||||
sprintf(buf, "tint2");
|
||||
return buf;
|
||||
g_slist_free_full(list, fr);
|
||||
|
||||
return new_list;
|
||||
}
|
||||
|
||||
@@ -8,15 +8,19 @@
|
||||
|
||||
#define WM_CLASS_TINT "panel"
|
||||
|
||||
#include <glib.h>
|
||||
#include <Imlib2.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include "area.h"
|
||||
|
||||
#define GREEN "\033[1;32m"
|
||||
#define GREEN "\033[1;32m"
|
||||
#define YELLOW "\033[1;33m"
|
||||
#define RED "\033[1;31m"
|
||||
#define BLUE "\033[1;34m"
|
||||
#define RESET "\033[0m"
|
||||
#define RED "\033[1;31m"
|
||||
#define BLUE "\033[1;34m"
|
||||
#define RESET "\033[0m"
|
||||
|
||||
#define MAX3(a, b, c) MAX(MAX(a, b), c)
|
||||
#define MIN3(a, b, c) MIN(MIN(a, b), c)
|
||||
|
||||
// mouse actions
|
||||
typedef enum MouseAction {
|
||||
@@ -35,7 +39,7 @@ typedef enum MouseAction {
|
||||
PREV_TASK
|
||||
} MouseAction;
|
||||
|
||||
#define ALL_DESKTOPS 0xFFFFFFFF
|
||||
#define ALL_DESKTOPS 0xFFFFFFFF
|
||||
|
||||
// Copies a file to another path
|
||||
void copy_file(const char *path_src, const char *path_dest);
|
||||
@@ -53,11 +57,11 @@ void tint_exec(const char *command);
|
||||
|
||||
// Returns a copy of s in which "~" is expanded to the path to the user's home directory.
|
||||
// The caller takes ownership of the string.
|
||||
char *expand_tilde(char *s);
|
||||
char *expand_tilde(const char *s);
|
||||
|
||||
// The opposite of expand_tilde: replaces the path to the user's home directory with "~".
|
||||
// The caller takes ownership of the string.
|
||||
char *contract_tilde(char *s);
|
||||
char *contract_tilde(const char *s);
|
||||
|
||||
// Color
|
||||
int hex_char_to_int(char c);
|
||||
@@ -67,14 +71,24 @@ void get_color(char *hex, double *rgb);
|
||||
Imlib_Image load_image(const char *path, int cached);
|
||||
|
||||
// Adjusts the alpha/saturation/brightness on an ARGB image.
|
||||
// Parameters: alpha from 0 to 100, satur from 0 to 1, bright from 0 to 1.
|
||||
void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright);
|
||||
// Parameters:
|
||||
// * alpha_adjust: multiplicative:
|
||||
// * 0 = full transparency
|
||||
// * 1 = no adjustment
|
||||
// * 2 = twice the current opacity
|
||||
// * satur_adjust: additive:
|
||||
// * -1 = full grayscale
|
||||
// * 0 = no adjustment
|
||||
// * 1 = full color
|
||||
// * bright_adjust: additive:
|
||||
// * -1 = black
|
||||
// * 0 = no adjustment
|
||||
// * 1 = white
|
||||
void adjust_asb(DATA32 *data, int w, int h, float alpha_adjust, float satur_adjust, float bright_adjust);
|
||||
Imlib_Image adjust_icon(Imlib_Image original, int alpha, int saturation, int brightness);
|
||||
|
||||
void create_heuristic_mask(DATA32 *data, int w, int h);
|
||||
|
||||
int image_empty(DATA32 *data, int w, int h);
|
||||
|
||||
// Renders the current Imlib image to a drawable. Wrapper around imlib_render_image_on_drawable.
|
||||
void render_image(Drawable d, int x, int y);
|
||||
|
||||
@@ -94,22 +108,30 @@ 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);
|
||||
|
||||
#define free_and_null(p) { free(p); p = NULL; }
|
||||
// Appends to the list locations all the directories contained in the environment variable var (split by ":").
|
||||
// Optional suffixes are added to each directory. The suffix arguments MUST end with NULL.
|
||||
// Returns the new value of the list.
|
||||
GSList *load_locations_from_env(GSList *locations, const char *var, ...);
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 33, 4)
|
||||
GSList *slist_remove_duplicates(GSList *list, GCompareFunc eq, GDestroyNotify fr);
|
||||
|
||||
#define free_and_null(p) \
|
||||
{ \
|
||||
free(p); \
|
||||
p = NULL; \
|
||||
}
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 33, 4)
|
||||
GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data);
|
||||
#endif
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 38, 0)
|
||||
#if !GLIB_CHECK_VERSION(2, 38, 0)
|
||||
#define g_assert_null(expr) g_assert((expr) == NULL)
|
||||
#endif
|
||||
|
||||
void close_all_fds();
|
||||
|
||||
char* get_own_path();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,37 +36,21 @@
|
||||
|
||||
#include "strnatcmp.h"
|
||||
|
||||
/* These are defined as macros to make it easier to adapt this code to
|
||||
* different characters types or comparison functions. */
|
||||
static inline int nat_isdigit(nat_char a)
|
||||
{
|
||||
return isdigit((unsigned char)a);
|
||||
}
|
||||
|
||||
static inline int nat_isspace(nat_char a)
|
||||
{
|
||||
return isspace((unsigned char)a);
|
||||
}
|
||||
|
||||
static inline nat_char nat_toupper(nat_char a)
|
||||
{
|
||||
return toupper((unsigned char)a);
|
||||
}
|
||||
|
||||
static int compare_right(nat_char const *a, nat_char const *b)
|
||||
// Compare two right-aligned numbers:
|
||||
// The longest run of digits wins. That aside, the greatest
|
||||
// value wins, but we can't know that it will until we've scanned
|
||||
// both numbers to know that they have the same magnitude, so we
|
||||
// remember it in BIAS.
|
||||
static int compare_right(char const *a, char const *b)
|
||||
{
|
||||
int bias = 0;
|
||||
|
||||
/* The longest run of digits wins. That aside, the greatest
|
||||
* value wins, but we can't know that it will until we've scanned
|
||||
* both numbers to know that they have the same magnitude, so we
|
||||
* remember it in BIAS. */
|
||||
for (;; a++, b++) {
|
||||
if (!nat_isdigit(*a) && !nat_isdigit(*b))
|
||||
if (!isdigit(*a) && !isdigit(*b))
|
||||
return bias;
|
||||
else if (!nat_isdigit(*a))
|
||||
else if (!isdigit(*a))
|
||||
return -1;
|
||||
else if (!nat_isdigit(*b))
|
||||
else if (!isdigit(*b))
|
||||
return +1;
|
||||
else if (*a < *b) {
|
||||
if (!bias)
|
||||
@@ -81,15 +65,16 @@ static int compare_right(nat_char const *a, nat_char const *b)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compare_left(nat_char const *a, nat_char const *b)
|
||||
// Compare two left-aligned numbers:
|
||||
// The first to have a different value wins.
|
||||
static int compare_left(char const *a, char const *b)
|
||||
{
|
||||
/* Compare two left-aligned numbers: the first to have a different value wins. */
|
||||
for (;; a++, b++) {
|
||||
if (!nat_isdigit(*a) && !nat_isdigit(*b))
|
||||
if (!isdigit(*a) && !isdigit(*b))
|
||||
return 0;
|
||||
else if (!nat_isdigit(*a))
|
||||
else if (!isdigit(*a))
|
||||
return -1;
|
||||
else if (!nat_isdigit(*b))
|
||||
else if (!isdigit(*b))
|
||||
return +1;
|
||||
else if (*a < *b)
|
||||
return -1;
|
||||
@@ -100,46 +85,50 @@ static int compare_left(nat_char const *a, nat_char const *b)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int strnatcmp0(nat_char const *a, nat_char const *b, int fold_case)
|
||||
static int strnatcmp0(char const *a, char const *b, int ignore_case)
|
||||
{
|
||||
int ai, bi;
|
||||
nat_char ca, cb;
|
||||
int fractional, result;
|
||||
|
||||
assert(a && b);
|
||||
|
||||
int ai, bi;
|
||||
ai = bi = 0;
|
||||
while (1) {
|
||||
ca = a[ai];
|
||||
cb = b[bi];
|
||||
char ca = a[ai];
|
||||
char cb = b[bi];
|
||||
|
||||
/* skip over leading spaces or zeros */
|
||||
while (nat_isspace(ca))
|
||||
ca = a[++ai];
|
||||
// Skip over leading spaces
|
||||
while (isspace(ca)) {
|
||||
ai++;
|
||||
ca = a[ai];
|
||||
}
|
||||
|
||||
while (nat_isspace(cb))
|
||||
cb = b[++bi];
|
||||
while (isspace(cb)) {
|
||||
bi++;
|
||||
cb = b[bi];
|
||||
}
|
||||
|
||||
/* process run of digits */
|
||||
if (nat_isdigit(ca) && nat_isdigit(cb)) {
|
||||
fractional = (ca == '0' || cb == '0');
|
||||
// Process run of digits
|
||||
if (isdigit(ca) && isdigit(cb)) {
|
||||
int fractional = (ca == '0' || cb == '0');
|
||||
|
||||
if (fractional) {
|
||||
if ((result = compare_left(a + ai, b + bi)) != 0)
|
||||
int result = compare_left(a + ai, b + bi);
|
||||
if (result)
|
||||
return result;
|
||||
} else {
|
||||
if ((result = compare_right(a + ai, b + bi)) != 0)
|
||||
int result = compare_right(a + ai, b + bi);
|
||||
if (result)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ca && !cb) {
|
||||
/* The strings compare the same. Perhaps the caller will want to call strcmp to break the tie. */
|
||||
// The strings compare the same. Perhaps the caller will want to call strcmp to break the tie.
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fold_case) {
|
||||
ca = nat_toupper(ca);
|
||||
cb = nat_toupper(cb);
|
||||
if (ignore_case) {
|
||||
ca = toupper(ca);
|
||||
cb = toupper(cb);
|
||||
}
|
||||
|
||||
if (ca < cb)
|
||||
@@ -147,18 +136,17 @@ static int strnatcmp0(nat_char const *a, nat_char const *b, int fold_case)
|
||||
else if (ca > cb)
|
||||
return +1;
|
||||
|
||||
++ai;
|
||||
++bi;
|
||||
ai++;
|
||||
bi++;
|
||||
}
|
||||
}
|
||||
|
||||
int strnatcmp(nat_char const *a, nat_char const *b)
|
||||
int strnatcmp(char const *a, char const *b)
|
||||
{
|
||||
return strnatcmp0(a, b, 0);
|
||||
}
|
||||
|
||||
/* Compare, recognizing numeric string and ignoring case. */
|
||||
int strnatcasecmp(nat_char const *a, nat_char const *b)
|
||||
int strnatcasecmp(char const *a, char const *b)
|
||||
{
|
||||
return strnatcmp0(a, b, 1);
|
||||
}
|
||||
|
||||
@@ -20,11 +20,8 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* CUSTOMIZATION SECTION
|
||||
*
|
||||
* You can change this typedef, but must then also change the inline
|
||||
* functions in strnatcmp.c */
|
||||
typedef char nat_char;
|
||||
// Compare, recognizing numeric strings. Case sensitive.
|
||||
int strnatcmp(char const *a, char const *b);
|
||||
|
||||
int strnatcmp(nat_char const *a, nat_char const *b);
|
||||
int strnatcasecmp(nat_char const *a, nat_char const *b);
|
||||
// Compare, recognizing numeric strings. Case insensitive.
|
||||
int strnatcasecmp(char const *a, char const *b);
|
||||
|
||||
@@ -199,7 +199,7 @@ void add_timeout_intern(int value_msec, int interval_msec, void (*_callback)(),
|
||||
|
||||
gint compare_timeouts(gconstpointer t1, gconstpointer t2)
|
||||
{
|
||||
return compare_timespecs(&((const timeout *)t1)->timeout_expires, &((const timeout *)t2)->timeout_expires);
|
||||
return compare_timespecs(&((const timeout *)t1)->timeout_expires, &((const timeout *)t2)->timeout_expires);
|
||||
}
|
||||
|
||||
gint compare_timespecs(const struct timespec *t1, const struct timespec *t2)
|
||||
@@ -257,7 +257,7 @@ int align_with_existing_timeouts(timeout *t)
|
||||
timeout *t2 = it->data;
|
||||
if (t2->interval_msec > 0) {
|
||||
if (t->interval_msec % t2->interval_msec == 0 || t2->interval_msec % t->interval_msec == 0) {
|
||||
if (!multi_timeouts)
|
||||
if (!multi_timeouts)
|
||||
multi_timeouts = g_hash_table_new(0, 0);
|
||||
if (!t->multi_timeout && !t2->multi_timeout) {
|
||||
// both timeouts can be aligned, but there is no multi timeout for them
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
enum uevent_action {
|
||||
UEVENT_UNKNOWN = 0x01,
|
||||
UEVENT_ADD = 0x02,
|
||||
UEVENT_REMOVE = 0x04,
|
||||
UEVENT_CHANGE = 0x08,
|
||||
UEVENT_ADD = 0x02,
|
||||
UEVENT_REMOVE = 0x04,
|
||||
UEVENT_CHANGE = 0x08,
|
||||
};
|
||||
|
||||
struct uevent_parameter {
|
||||
@@ -41,7 +41,7 @@ struct uevent {
|
||||
};
|
||||
|
||||
struct uevent_notify {
|
||||
int action; /* bitfield */
|
||||
int action; /* bitfield */
|
||||
char *subsystem; /* NULL => any */
|
||||
void *userdata;
|
||||
|
||||
@@ -56,15 +56,26 @@ void uevent_handler();
|
||||
void uevent_register_notifier(struct uevent_notify *nb);
|
||||
void uevent_unregister_notifier(struct uevent_notify *nb);
|
||||
#else
|
||||
static inline int uevent_init() {
|
||||
static inline int uevent_init()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline void uevent_cleanup() { }
|
||||
static inline void uevent_handler() { }
|
||||
static inline void uevent_cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
static inline void uevent_register_notifier(struct uevent_notify *nb) { }
|
||||
static inline void uevent_unregister_notifier(struct uevent_notify *nb) { }
|
||||
static inline void uevent_handler()
|
||||
{
|
||||
}
|
||||
|
||||
static inline void uevent_register_notifier(struct uevent_notify *nb)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void uevent_unregister_notifier(struct uevent_notify *nb)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -108,20 +108,24 @@ gboolean window_is_hidden(Window win)
|
||||
|
||||
int get_window_desktop(Window win)
|
||||
{
|
||||
int desktop = get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL);
|
||||
if (desktop == ALL_DESKTOPS)
|
||||
return desktop;
|
||||
if (!server.viewports)
|
||||
return get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL);
|
||||
return CLAMP(desktop, 0, server.num_desktops - 1);
|
||||
|
||||
int x, y, w, h;
|
||||
get_window_coordinates(win, &x, &y, &w, &h);
|
||||
|
||||
int desktop = MIN(get_current_desktop(), server.num_desktops - 1);
|
||||
desktop = get_current_desktop();
|
||||
// Window coordinates are relative to the current viewport, make them absolute
|
||||
x += server.viewports[desktop].x;
|
||||
y += server.viewports[desktop].y;
|
||||
|
||||
if (x < 0 || y < 0) {
|
||||
int num_results;
|
||||
long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
|
||||
long *x_screen_size =
|
||||
server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results);
|
||||
if (!x_screen_size)
|
||||
return 0;
|
||||
int x_screen_width = x_screen_size[0];
|
||||
@@ -153,7 +157,8 @@ int get_window_desktop(Window win)
|
||||
|
||||
if (best_match < 0)
|
||||
best_match = 0;
|
||||
//fprintf(stderr, "window %lx %s : viewport %d, (%d, %d)\n", win, get_task(win) ? get_task(win)->title : "??", best_match+1, x, y);
|
||||
// fprintf(stderr, "window %lx %s : viewport %d, (%d, %d)\n", win, get_task(win) ? get_task(win)->title : "??",
|
||||
// best_match+1, x, y);
|
||||
return best_match;
|
||||
}
|
||||
|
||||
@@ -180,7 +185,8 @@ int get_window_monitor(Window win)
|
||||
|
||||
if (best_match < 0)
|
||||
best_match = 0;
|
||||
//fprintf(stderr, "desktop %d, window %lx %s : monitor %d, (%d, %d)\n", 1 + get_current_desktop(), win, get_task(win) ? get_task(win)->title : "??", best_match+1, x, y);
|
||||
// fprintf(stderr, "desktop %d, window %lx %s : monitor %d, (%d, %d)\n", 1 + get_current_desktop(), win,
|
||||
// get_task(win) ? get_task(win)->title : "??", best_match+1, x, y);
|
||||
return best_match;
|
||||
}
|
||||
|
||||
@@ -314,3 +320,32 @@ gulong *get_best_icon(gulong *data, int icon_count, int num, int *iw, int *ih, i
|
||||
*ih = height[icon_num];
|
||||
return icon_data[icon_num];
|
||||
}
|
||||
|
||||
// Thanks zcodes!
|
||||
char *get_window_name(Window win)
|
||||
{
|
||||
XTextProperty text_property;
|
||||
Status status = XGetWMName(server.display, win, &text_property);
|
||||
if (!status || !text_property.value || !text_property.nitems) {
|
||||
return strdup("");
|
||||
}
|
||||
|
||||
char **name_list;
|
||||
int count;
|
||||
status = Xutf8TextPropertyToTextList(server.display, &text_property, &name_list, &count);
|
||||
if (status < Success || !count) {
|
||||
XFree(text_property.value);
|
||||
return strdup("");
|
||||
}
|
||||
|
||||
if (!name_list[0]) {
|
||||
XFreeStringList(name_list);
|
||||
XFree(text_property.value);
|
||||
return strdup("");
|
||||
}
|
||||
|
||||
char *result = strdup(name_list[0]);
|
||||
XFreeStringList(name_list);
|
||||
XFree(text_property.value);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -33,4 +33,6 @@ void change_window_desktop(Window win, int desktop);
|
||||
int get_icon_count(gulong *data, int num);
|
||||
gulong *get_best_icon(gulong *data, int icon_count, int num, int *iw, int *ih, int best_icon_size);
|
||||
|
||||
char *get_window_name(Window win);
|
||||
|
||||
#endif
|
||||
|
||||
48
test/workspaces-stress.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# List normal windows
|
||||
# wmctrl -l | awk '{if ($4 != "Desktop") print $1}'
|
||||
#
|
||||
# Change the number of desktops
|
||||
# xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 2
|
||||
#
|
||||
# Move window to desktop
|
||||
# xprop -id 0x03600007 -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP 0
|
||||
#
|
||||
# Move window to all desktops
|
||||
# xprop -id 0x03600007 -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP 4294967295
|
||||
|
||||
while true
|
||||
do
|
||||
# change the number of desktops to a random value
|
||||
num_desktops=$(( $RANDOM % 8 + 1 ))
|
||||
xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS $num_desktops
|
||||
max_desktop=$(( $num_desktops - 1 ))
|
||||
desktops=$(echo 4294967295; seq 0 $max_desktop)
|
||||
for run in 1 2 3
|
||||
do
|
||||
# start and stop calculators
|
||||
if (( $RANDOM % 5 == 0 ))
|
||||
then
|
||||
killall gnome-calculator 1>/dev/null 2>/dev/null
|
||||
sleep 0.1
|
||||
else
|
||||
(gnome-calculator 1>/dev/null 2>/dev/null &)
|
||||
fi
|
||||
# change the current desktop to a random value
|
||||
for change in 1 2 3
|
||||
do
|
||||
desktop=$(shuf -n 1 -e $(seq 0 $max_desktop))
|
||||
xprop -root -f _NET_CURRENT_DESKTOP 32c -set _NET_CURRENT_DESKTOP $desktop
|
||||
sleep 0.1
|
||||
done
|
||||
# move windows around
|
||||
for win in $(wmctrl -l | awk '!/Terminal/ {if ($4 != "Desktop") print $1}')
|
||||
do
|
||||
desktop=$(shuf -n 1 -e $desktops)
|
||||
xprop -id $win -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP $desktop
|
||||
done
|
||||
sleep 0.1
|
||||
done
|
||||
sleep 0.1
|
||||
done
|
||||
2
themes/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
file( GLOB EXTRATHEMEFILES *.tint2rc )
|
||||
install( FILES ${EXTRATHEMEFILES} DESTINATION ${DATADIR}/tint2 )
|
||||
@@ -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
|
||||
@@ -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
|
||||