Compare commits
136 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc300c0215 | ||
|
|
257df4ef22 | ||
|
|
3a2a734b86 | ||
|
|
5a526c9328 | ||
|
|
70210fafc7 | ||
|
|
86d5872408 | ||
|
|
419f3f5c21 | ||
|
|
bdd56bc813 | ||
|
|
84c58ce9af | ||
|
|
184703998b | ||
|
|
e345c0ddcd | ||
|
|
c874e76343 | ||
|
|
687f5f2a1b | ||
|
|
c7aa70f078 | ||
|
|
690fe3f4d8 | ||
|
|
c1d0a42bed | ||
|
|
e5cd73f4a7 | ||
|
|
7ffc220891 | ||
|
|
2799fe9346 | ||
|
|
e2023b7172 | ||
|
|
9224971407 | ||
|
|
d492f80468 | ||
|
|
78bc330448 | ||
|
|
3805adc9f3 | ||
|
|
4e3989f9f5 | ||
|
|
9624b5d558 | ||
|
|
754d9187df | ||
|
|
a4996c9d3e | ||
|
|
b99c5c204b | ||
|
|
7162c5dea1 | ||
|
|
e3939a56e1 | ||
|
|
ceafe9b281 | ||
|
|
263d1ab15f | ||
|
|
e76202b355 | ||
|
|
f68eabcf35 | ||
|
|
e218b3fa96 | ||
|
|
50e21b4077 | ||
|
|
b6a1a1c0f6 | ||
|
|
15e12142ca | ||
|
|
b8c1c29df2 | ||
|
|
4a1880ead0 | ||
|
|
57b878d5e4 | ||
|
|
46aab61bf6 | ||
|
|
227dc8e48a | ||
|
|
68c3205b53 | ||
|
|
61f0a4ec85 | ||
|
|
c606a1a35a | ||
|
|
9933399dc4 | ||
|
|
5ce8023ef7 | ||
|
|
6438c75faf | ||
|
|
712097ba45 | ||
|
|
9a5cb749ed | ||
|
|
d730f23027 | ||
|
|
9f161f2baf | ||
|
|
2570ae2cf6 | ||
|
|
8d5c2d8cbb | ||
|
|
28bf0a437c | ||
|
|
fd78e6d886 | ||
|
|
e84d963ab6 | ||
|
|
c4fbc2962e | ||
|
|
a0af851d9d | ||
|
|
477d08b5da | ||
|
|
50a07df5d2 | ||
|
|
b3cdde78b1 | ||
|
|
8207b16598 | ||
|
|
f61f2af2f4 | ||
|
|
90805cb526 | ||
|
|
04fe80b498 | ||
|
|
60657c9809 | ||
|
|
3150b91f80 | ||
|
|
7b854d49e3 | ||
|
|
81a48b8f79 | ||
|
|
655ea6f06f | ||
|
|
efe9aadb39 | ||
|
|
c0e1709d57 | ||
|
|
ea8a4fbb1e | ||
|
|
093963dadd | ||
|
|
df429e8c34 | ||
|
|
d3c45adf34 | ||
|
|
043a0f7ab3 | ||
|
|
574b6bc214 | ||
|
|
89e4a5a460 | ||
|
|
2ebc75944e | ||
|
|
acedd48708 | ||
|
|
9fd9d51010 | ||
|
|
9f8423f2eb | ||
|
|
8242c969e3 | ||
|
|
7cd5c16fca | ||
|
|
290ddc1fea | ||
|
|
47a7013029 | ||
|
|
a4de005a54 | ||
|
|
7ace3a5956 | ||
|
|
5abbf168a9 | ||
|
|
4d69a0bc33 | ||
|
|
222eca4099 | ||
|
|
ea75558ac2 | ||
|
|
876cae8239 | ||
|
|
7c3951e3a0 | ||
|
|
552f060612 | ||
|
|
e7cfa35288 | ||
|
|
4326cd1380 | ||
|
|
19b40bc59e | ||
|
|
8c9a9a111e | ||
|
|
b13540123b | ||
|
|
f5b2de62b6 | ||
|
|
1ba023fc83 | ||
|
|
36e9e92df1 | ||
|
|
0f1dac50f1 | ||
|
|
eb0346e02a | ||
|
|
cae621918e | ||
|
|
f28983e5a7 | ||
|
|
b35cdb70df | ||
|
|
80361a121e | ||
|
|
b4ff007e42 | ||
|
|
ae379d865c | ||
|
|
0a3876dc8c | ||
|
|
e2d95acfa1 | ||
|
|
5ac1a6a653 | ||
|
|
481c409617 | ||
|
|
e8869b4d87 | ||
|
|
b1b95e086d | ||
|
|
df1f2d4e4b | ||
|
|
18b0ef2d1b | ||
|
|
860c100a04 | ||
|
|
9040764cf1 | ||
|
|
d8d4bc76cd | ||
|
|
fbcfa54061 | ||
|
|
b235f77f39 | ||
|
|
1b4b0a8d8d | ||
|
|
7ea0dc241c | ||
|
|
39e67df44d | ||
|
|
cb17e5a662 | ||
|
|
ea67f24051 | ||
| 7e2e1d5adf | |||
|
|
c49d231875 | ||
| d839d80c2e |
5
AUTHORS
5
AUTHORS
@@ -5,6 +5,8 @@ tint2 is developped by :
|
||||
- Euan Freeman <euan04@gmail.com> (tintwizard)
|
||||
- Christian Ruppert <Spooky85@gmail.com> (autotools build system)
|
||||
- Ovidiu M <mrovi9000 at gmail.com> : launcher, bug fixes
|
||||
- Mishael A Sibiryakov (death@junki.org) : freespace
|
||||
- Sebastian Reichel <sre@ring0.de> : battery, various fixes
|
||||
|
||||
tint2 is based on ttm source code (http://code.google.com/p/ttm/)
|
||||
- 2007-2008 Pål Staurland <staura@gmail.com>
|
||||
@@ -21,5 +23,4 @@ Contributors:
|
||||
Marcelo Vianna : taskbar sorting
|
||||
Xico Atelo : startup notifications
|
||||
Craig Oakes : WM flags, issue tracker organization
|
||||
|
||||
|
||||
Jeff Blake (https://gitlab.com/u/berkley4) : more mouse event handlers
|
||||
|
||||
@@ -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" OFF )
|
||||
option( ENABLE_EXAMPLES "Install additional tin2rc examples" ON )
|
||||
option( ENABLE_RSVG "Rsvg support (launcher only)" ON )
|
||||
option( ENABLE_SN "Startup notification support" ON )
|
||||
option( ENABLE_ASAN "Build tint2 with AddressSanitizer" OFF )
|
||||
@@ -23,7 +23,7 @@ pkg_check_modules( SN libstartup-notification-1.0>=0.12 )
|
||||
find_library( RT_LIBRARY rt )
|
||||
|
||||
if( NOT X11_FOUND OR NOT PANGOCAIRO_FOUND OR NOT PANGO_FOUND OR NOT CAIRO_FOUND OR NOT GLIB2_FOUND OR NOT GOBJECT2_FOUND OR NOT IMLIB2_FOUND )
|
||||
message( FATAL_ERROR "Not all dependencies fulfilled. See https://code.google.com/p/tint2/wiki/Install" )
|
||||
message( FATAL_ERROR "Not all dependencies fulfilled. See https://gitlab.com/o9000/tint2/wikis/Install" )
|
||||
endif( NOT X11_FOUND OR NOT PANGOCAIRO_FOUND OR NOT PANGO_FOUND OR NOT CAIRO_FOUND OR NOT GLIB2_FOUND OR NOT GOBJECT2_FOUND OR NOT IMLIB2_FOUND )
|
||||
|
||||
string( REPLACE ";" " " FLAGS_REPLACED "${IMLIB2_LDFLAGS}" )
|
||||
@@ -33,6 +33,8 @@ if( NOT IMLIB_BUILD_WITH_X )
|
||||
message( FATAL_ERROR "Imlib is not built with X support" )
|
||||
endif( NOT IMLIB_BUILD_WITH_X )
|
||||
|
||||
add_definitions( -D_GNU_SOURCE )
|
||||
|
||||
include_directories( ${PROJECT_BINARY_DIR}
|
||||
src
|
||||
src/battery
|
||||
@@ -42,6 +44,7 @@ include_directories( ${PROJECT_BINARY_DIR}
|
||||
src/launcher
|
||||
src/tooltip
|
||||
src/util
|
||||
src/freespace
|
||||
${X11_INCLUDE_DIRS}
|
||||
${PANGOCAIRO_INCLUDE_DIRS}
|
||||
${PANGO_INCLUDE_DIRS}
|
||||
@@ -67,6 +70,7 @@ set( SOURCES src/config.c
|
||||
src/taskbar/taskbar.c
|
||||
src/taskbar/taskbarname.c
|
||||
src/tooltip/tooltip.c
|
||||
src/freespace/freespace.c
|
||||
src/util/area.c
|
||||
src/util/common.c
|
||||
src/util/strnatcmp.c
|
||||
@@ -154,5 +158,5 @@ install( FILES AUTHORS ChangeLog README.md DESTINATION ${DOCDIR} )
|
||||
install( FILES doc/tint2.1 DESTINATION ${MANDIR}/man1 )
|
||||
if( ENABLE_EXAMPLES )
|
||||
file( GLOB SAMPLEFILES sample/*.tint2rc )
|
||||
install( FILES ${SAMPLEFILES} DESTINATION ${DOCDIR}/examples )
|
||||
install( FILES ${SAMPLEFILES} DESTINATION ${DATADIR}/tint2 )
|
||||
endif( ENABLE_EXAMPLES )
|
||||
|
||||
65
ChangeLog
65
ChangeLog
@@ -1,8 +1,33 @@
|
||||
2015-05-23 master
|
||||
2015-08-11 0.12.2
|
||||
- Fixes:
|
||||
- Systray: do not move empty icons to the side, as it breaks GTK2 StatusIcon blinking (issue #515)
|
||||
- tint2conf: Fix read of panel_monitor (issue #520)
|
||||
- Fix command line argument processing (issue #516)
|
||||
- Fix battery option parsing
|
||||
2015-08-01 0.12.1
|
||||
- Fixes:
|
||||
- Config:
|
||||
- Read config correctly when panel_items is at the end of the config file (issue #511)
|
||||
- Panel:
|
||||
- Do not use nested event loops (related: issue #509)
|
||||
- System tray:
|
||||
- Set _NET_SYSTEM_TRAY_ICON_SIZE and _NET_SYSTEM_TRAY_PADDING
|
||||
- Throttle repeated resizes (workaround for issue #509)
|
||||
- Taskbar:
|
||||
- Use consistent visibility for sticky (all desktop) windows (related: issue #279)
|
||||
- Compute monitor correctly for windows when Openbox animations are enabled (issue #511)
|
||||
- tint2conf:
|
||||
- Bad read of option panel_margin
|
||||
- New config options:
|
||||
- Battery mouse actions and clock middle click and wheel actions (thanks to Jeff Blake)
|
||||
2015-07-12 0.12
|
||||
- Note: the changes listed here are based on the previous release tint2 0.11, however some distributions (e.g. Debian)
|
||||
offered packages using newer commits and/or patches; thus from the user's perspective some of these features are
|
||||
already present. They are marked with '(already released by distros)'.
|
||||
- Major changes:
|
||||
- Panel:
|
||||
- Checks if a compositor is launched during the first 30 seconds after startup and if found, restarts the panel with
|
||||
transparency enabled.
|
||||
- Launcher:
|
||||
- The launcher is now considered stable
|
||||
- Enhancement: SVG icon support
|
||||
@@ -12,7 +37,9 @@
|
||||
- Icons (system tray, task buttons, launcher):
|
||||
- Changed rendering method to fix icon corruptions (please report any problems)
|
||||
- System tray:
|
||||
- Workaround for misbehaving applications leaving empty tray icons
|
||||
- Icon rendering is faster
|
||||
- Several kinds of graphical corruptions have been fixed
|
||||
- Added workaround for misbehaving applications leaving empty tray icons
|
||||
- Many bugfixes
|
||||
- New config options (see https://gitlab.com/o9000/tint2/wikis/Configure):
|
||||
- Panel:
|
||||
@@ -25,6 +52,7 @@
|
||||
- taskbar_hide_inactive_tasks
|
||||
- taskbar_sort_order
|
||||
- taskbar_name (already released by distros)
|
||||
- task_align (already released by distros)
|
||||
- Launcher:
|
||||
- launcher* (already released by distros)
|
||||
- launcher_apps_dir (previously patched in by some distros)
|
||||
@@ -32,6 +60,7 @@
|
||||
- launcher_icon_theme_override
|
||||
- System tray:
|
||||
- systray_monitor
|
||||
- Freespace (already released by distros)
|
||||
- Config options with changed behavior:
|
||||
- Panel:
|
||||
- panel_dock: previously, 'panel_dock = 1' was actually not placing the panel into the dock. This option now
|
||||
@@ -46,8 +75,40 @@
|
||||
Reason for change: legibility improved for transparent panels.
|
||||
- Launcher:
|
||||
- launcher_item_app: now it expands leading ~ to the path to the user's home directory.
|
||||
- Known issues:
|
||||
- tint2 might close unexpectedly and/or cause X to freeze on certain ATI graphics cards.
|
||||
Workaround: set 'disable_transparency = 1' in the config.
|
||||
Reference: https://gitlab.com/o9000/tint2/issues/497
|
||||
- Project hosting:
|
||||
- Migrated from https://code.google.com/p/tint2 to https://gitlab.com/o9000/tint2 and switched from svn to git
|
||||
- Bugfixes:
|
||||
- task switching from tint2 using the mouse wheel (mouse_scroll_up = prev_task and mouse_scroll_down = next_task) with
|
||||
multiple desktops and taskbar_mode = multi_desktop when hovering over the first/last window in the taskbar was broken;
|
||||
also when a window is set to appear on all desktops;
|
||||
- the launcher was not loading an icon if the icon theme was not providing it in a size close to the value of launcher_icon_size;
|
||||
- the launcher was not loading an icon if the extension was incorrect (e.g. file contents were PNG but the file name
|
||||
had extension SVG);
|
||||
- some launcher icons (PNG files saved with an indexed colormap and alpha mask) were sometimes rendered with white instead of
|
||||
transparency;
|
||||
- icons looked washed out when the panel was very transparent;
|
||||
- the panel border was rendered in the background of every systray icon; sometimes systray icons were rendered in the
|
||||
background of other icons;
|
||||
- a crash caused by a change that prevents Google Chrome (and possibly other misbehaving applications) from leaving a large
|
||||
number of empty icons in the system tray;
|
||||
- a crash caused by the system tray code on computers with ATI cards;
|
||||
- the panel window had a shadow;
|
||||
- some ATI drivers return an extra monitor with size zero which should be ignored when using panel_monitor = all;
|
||||
- the battery applet was sometimes working incorrectly with certain laptop models (the battery applet stopped updating after
|
||||
suspend with the battery unplugged);
|
||||
- crashed caused by incomplete or malformed config files;
|
||||
- with the fvwm window manager, the window title was sometimes not displayed correctly if it changed right after an
|
||||
application was started;
|
||||
- seconds were not updating in the clock;
|
||||
- tint2 hang triggered when an application started from the launcher was closed and startup notifications were enabled;
|
||||
- tint2 may fail to process X events for a few seconds when a new icon is added to the system tray;
|
||||
- the code that loads SVG icons was using a lot of memory;
|
||||
- fixed occasional race at startup in detecting screen resolution changes;
|
||||
- modified timer code to prevent some rare double-frees or duplicate timers.
|
||||
|
||||
2010-06-26
|
||||
- unhide tint2 panel when dragging something
|
||||
|
||||
@@ -7,5 +7,4 @@ cmake -DCMAKE_INSTALL_PREFIX=/usr ../
|
||||
make
|
||||
sudo make install
|
||||
|
||||
To see additional options you can do after the cmake step a 'cmake -L ../'
|
||||
|
||||
To see additional options you can set at the 'cmake' step, run 'cmake -L ../'
|
||||
|
||||
26
README.md
26
README.md
@@ -1,15 +1,13 @@
|
||||
### New unstable release: 0.12-rc5
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/master/ChangeLog
|
||||
### New stable release: 0.12.2
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/0.12.2/ChangeLog
|
||||
|
||||
Documentation: https://gitlab.com/o9000/tint2/wikis/home
|
||||
|
||||
Try it out with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)):
|
||||
```
|
||||
mkdir tint2-0.12-rc5
|
||||
cd tint2-0.12-rc5
|
||||
wget 'https://gitlab.com/o9000/tint2/repository/archive.tar.gz?ref=v0.12-rc5' --output-document tint2-0.12-rc5.tar.gz
|
||||
tar -xzf tint2-0.12-rc5.tar.gz
|
||||
cd tint2.git
|
||||
git clone https://gitlab.com/o9000/tint2.git
|
||||
cd tint2
|
||||
git checkout 0.12.2
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
@@ -17,8 +15,17 @@ make -j4
|
||||
./tint2 &
|
||||
./src/tint2conf/tint2conf &
|
||||
```
|
||||
|
||||
To install from source, also run (as root):
|
||||
```
|
||||
make install
|
||||
```
|
||||
|
||||
Please report any problems to https://gitlab.com/o9000/tint2/issues. Your feedback is much appreciated.
|
||||
|
||||
Known issues:
|
||||
* [System tray resize loop with GTK applications](https://gitlab.com/o9000/tint2/issues/509), see also the [GTK bug report](https://bugzilla.gnome.org/show_bug.cgi?id=710375). Fix landed in 0.12.1, if there are still problems please let me know.
|
||||
|
||||
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?
|
||||
@@ -49,7 +56,7 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
|
||||
* [Configure](https://gitlab.com/o9000/tint2/wikis/Configure)
|
||||
* [Add applet not supported by tint2](https://gitlab.com/o9000/tint2/wikis/ThirdPartyApplets)
|
||||
* [Other frequently asked questions](https://gitlab.com/o9000/tint2/wikis/FAQ)
|
||||
* [Debug](https://gitlab.com/o9000/tint2/wikis/Debug)
|
||||
* [Debug](https://gitlab.com/o9000/tint2/wikis/Debug)
|
||||
|
||||
### How can I help out?
|
||||
|
||||
@@ -64,8 +71,7 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
|
||||
* Old project location (inactive): https://code.google.com/p/tint2
|
||||
|
||||
### Releases
|
||||
* Latest stable release: tint2 0.11 (June 2010)
|
||||
* Next release: planned for mid 2015
|
||||
* Latest stable release: tint2 0.12.2 (August 2015)
|
||||
|
||||
### Screenshots
|
||||

|
||||
@@ -1,4 +1,3 @@
|
||||
DEPENDENCIES:
|
||||
cairo (whit X support), pango, glib2, libX11, libXinerama, libXrandr, libXrender, libXcomposite, libXdamage imlib2 (with X support)
|
||||
you might need -dev packages on debian
|
||||
|
||||
cairo (with X support), pango, glib2, libX11, libXinerama, libXrandr, libXrender, libXcomposite, libXdamage, imlib2 (with X support)
|
||||
you might need -dev packages on Debian
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
.\" 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 "2009-01-17"
|
||||
.TH TINT2 1 "2015-07-05"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@@ -37,7 +37,7 @@ compliance with freedesktop specifications.
|
||||
.PP
|
||||
On the first startup tint2 creates a config file in $HOME/.config/tint2/tint2rc.
|
||||
.PP
|
||||
See wiki page on http://code.google.com/p/tint2/wiki/Welcome for more information.
|
||||
See the wiki page at https://gitlab.com/o9000/tint2/wikis/home for more information.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-c config-file
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
MAJOR=0.12
|
||||
DIRTY=""
|
||||
|
||||
git update-index -q --ignore-submodules --refresh
|
||||
@@ -29,7 +30,8 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
VERSION=$(git describe --exact-match 2>/dev/null || echo "0.11-git$(git show -s --pretty=format:%cI.%h | tr -d ':' | tr -d '-' | tr '.' '-' | sed 's/T[0-9\+]*//g')")$DIRTY
|
||||
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
|
||||
echo $VERSION
|
||||
|
||||
@@ -121,8 +121,12 @@ launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
|
||||
@@ -121,8 +121,12 @@ launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
|
||||
@@ -127,8 +127,12 @@ launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
|
||||
176
sample/horizontal-light-transparent.tint2rc
Normal file
176
sample/horizontal-light-transparent.tint2rc
Normal file
@@ -0,0 +1,176 @@
|
||||
#---- Generated by tint2conf e324 ----
|
||||
# See https://gitlab.com/o9000/tint2/wikis/Configure for
|
||||
# full documentation of the configuration options.
|
||||
#-------------------------------------
|
||||
# Backgrounds
|
||||
# Background 1
|
||||
rounded = 0
|
||||
border_width = 1
|
||||
background_color = #eeeeee 0
|
||||
border_color = #bbbbbb 10
|
||||
|
||||
# Background 2
|
||||
rounded = 5
|
||||
border_width = 0
|
||||
background_color = #eeeeee 4
|
||||
border_color = #cccccc 100
|
||||
|
||||
# Background 3
|
||||
rounded = 5
|
||||
border_width = 1
|
||||
background_color = #dddddd 4
|
||||
border_color = #999999 100
|
||||
|
||||
# Background 4
|
||||
rounded = 5
|
||||
border_width = 1
|
||||
background_color = #aa4400 100
|
||||
border_color = #aa7733 100
|
||||
|
||||
# Background 5
|
||||
rounded = 2
|
||||
border_width = 1
|
||||
background_color = #ffffaa 100
|
||||
border_color = #999999 100
|
||||
|
||||
# Background 6
|
||||
rounded = 2
|
||||
border_width = 1
|
||||
background_color = #eeeeee 4
|
||||
border_color = #cccccc 100
|
||||
|
||||
# Background 7
|
||||
rounded = 2
|
||||
border_width = 1
|
||||
background_color = #dddddd 3
|
||||
border_color = #999999 100
|
||||
|
||||
# Background 8
|
||||
rounded = 3
|
||||
border_width = 0
|
||||
background_color = #999999 4
|
||||
border_color = #cccccc 100
|
||||
|
||||
#-------------------------------------
|
||||
# Panel
|
||||
panel_items = LTSC
|
||||
panel_size = 100% 32
|
||||
panel_margin = 0 0
|
||||
panel_padding = 4 2 4
|
||||
panel_background_id = 1
|
||||
wm_menu = 1
|
||||
panel_dock = 0
|
||||
panel_position = bottom center horizontal
|
||||
panel_layer = normal
|
||||
panel_monitor = all
|
||||
autohide = 0
|
||||
autohide_show_timeout = 0
|
||||
autohide_hide_timeout = 0.5
|
||||
autohide_height = 2
|
||||
strut_policy = follow_size
|
||||
panel_window_name = tint2
|
||||
disable_transparency = 0
|
||||
font_shadow = 0
|
||||
|
||||
#-------------------------------------
|
||||
# Taskbar
|
||||
taskbar_mode = single_desktop
|
||||
taskbar_padding = 0 0 2
|
||||
taskbar_background_id = 0
|
||||
taskbar_active_background_id = 0
|
||||
taskbar_name = 1
|
||||
taskbar_hide_inactive_tasks = 0
|
||||
taskbar_hide_different_monitor = 0
|
||||
taskbar_name_padding = 6 3
|
||||
taskbar_name_background_id = 6
|
||||
taskbar_name_active_background_id = 7
|
||||
taskbar_name_font = sans bold 9
|
||||
taskbar_name_font_color = #ffffff 100
|
||||
taskbar_name_active_font_color = #ffffff 100
|
||||
taskbar_distribute_size = 1
|
||||
taskbar_sort_order = none
|
||||
task_align = left
|
||||
|
||||
#-------------------------------------
|
||||
# Task
|
||||
task_text = 1
|
||||
task_icon = 1
|
||||
task_centered = 1
|
||||
urgent_nb_of_blink = 100000
|
||||
task_maximum_size = 140 35
|
||||
task_padding = 4 3 4
|
||||
task_font = sans 8
|
||||
task_tooltip = 1
|
||||
task_font_color = #ffffff 100
|
||||
task_icon_asb = 100 0 0
|
||||
task_background_id = 2
|
||||
task_active_background_id = 3
|
||||
task_urgent_background_id = 4
|
||||
task_iconified_background_id = 2
|
||||
mouse_left = toggle_iconify
|
||||
mouse_middle = none
|
||||
mouse_right = close
|
||||
mouse_scroll_up = prev_task
|
||||
mouse_scroll_down = next_task
|
||||
|
||||
#-------------------------------------
|
||||
# System tray (notification area)
|
||||
systray_padding = 4 0 2
|
||||
systray_background_id = 0
|
||||
systray_sort = ascending
|
||||
systray_icon_size = 22
|
||||
systray_icon_asb = 100 0 0
|
||||
systray_monitor = 1
|
||||
|
||||
#-------------------------------------
|
||||
# Launcher
|
||||
launcher_padding = 0 0 2
|
||||
launcher_background_id = 0
|
||||
launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
launcher_icon_theme_override = 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
time1_format = %H:%M
|
||||
time2_format = %A %d %B
|
||||
time1_font = sans bold 8
|
||||
time1_timezone =
|
||||
time2_timezone =
|
||||
time2_font = sans 7
|
||||
clock_font_color = #ffffff 100
|
||||
clock_padding = 1 0
|
||||
clock_background_id = 0
|
||||
clock_tooltip =
|
||||
clock_tooltip_timezone =
|
||||
clock_lclick_command = zenity --calendar --text ""
|
||||
clock_rclick_command = orage
|
||||
|
||||
#-------------------------------------
|
||||
# Battery
|
||||
battery_low_status = 10
|
||||
battery_low_cmd = notify-send "battery low"
|
||||
bat1_font = sans 8
|
||||
bat2_font = sans 6
|
||||
battery_font_color = #ffffff 100
|
||||
battery_padding = 1 0
|
||||
battery_background_id = 0
|
||||
battery_hide = 101
|
||||
|
||||
#-------------------------------------
|
||||
# Tooltip
|
||||
tooltip_show_timeout = 0.5
|
||||
tooltip_hide_timeout = 0.1
|
||||
tooltip_padding = 2 2
|
||||
tooltip_background_id = 5
|
||||
tooltip_font_color = #222222 100
|
||||
tooltip_font = sans 9
|
||||
|
||||
@@ -59,8 +59,12 @@ launcher_icon_size = 18
|
||||
launcher_icon_asb = 100 0 0
|
||||
launcher_tooltip = 1
|
||||
startup_notifications = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
# Taskbar
|
||||
taskbar_mode = single_desktop
|
||||
@@ -85,7 +89,7 @@ urgent_nb_of_blink = 100000
|
||||
task_icon_asb = 100 0 0
|
||||
task_active_icon_asb = 100 0 0
|
||||
task_urgent_icon_asb = 100 0 0
|
||||
task_iconified_icon_asb = 70 0 0
|
||||
task_iconified_icon_asb = 100 0 0
|
||||
|
||||
# Fonts
|
||||
task_font = sans 8
|
||||
@@ -113,7 +117,7 @@ time1_format = %H:%M
|
||||
time1_font = sans 8
|
||||
time2_format = %A %d %B
|
||||
time2_font = sans 7
|
||||
clock_font_color = #FFFFFF 90
|
||||
clock_font_color = #FFFFFF 100
|
||||
clock_padding = 1 0
|
||||
clock_background_id = 0
|
||||
clock_rclick_command = orage
|
||||
@@ -132,7 +136,7 @@ battery_low_cmd = notify-send "battery low"
|
||||
battery_hide = 101
|
||||
bat1_font = sans 8
|
||||
bat2_font = sans 6
|
||||
battery_font_color = #FFFFFF 94
|
||||
battery_font_color = #FFFFFF 100
|
||||
battery_padding = 1 0
|
||||
battery_background_id = 0
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#---- Generated by tint2conf c113 ----
|
||||
#---- Generated by tint2conf 258e ----
|
||||
# See https://gitlab.com/o9000/tint2/wikis/Configure for
|
||||
# full documentation of the configuration options.
|
||||
#-------------------------------------
|
||||
# Backgrounds
|
||||
# Background 1
|
||||
@@ -81,6 +83,7 @@ taskbar_name_font_color = #dddddd 100
|
||||
taskbar_name_active_font_color = #dddddd 100
|
||||
taskbar_distribute_size = 1
|
||||
taskbar_sort_order = none
|
||||
task_align = left
|
||||
|
||||
#-------------------------------------
|
||||
# Task
|
||||
@@ -119,10 +122,15 @@ launcher_padding = 0 0 2
|
||||
launcher_background_id = 0
|
||||
launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
launcher_icon_theme_override = 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
|
||||
@@ -121,8 +121,12 @@ launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
|
||||
@@ -127,8 +127,12 @@ launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
|
||||
176
sample/vertical-light-transparent.tint2rc
Normal file
176
sample/vertical-light-transparent.tint2rc
Normal file
@@ -0,0 +1,176 @@
|
||||
#---- Generated by tint2conf e324 ----
|
||||
# See https://gitlab.com/o9000/tint2/wikis/Configure for
|
||||
# full documentation of the configuration options.
|
||||
#-------------------------------------
|
||||
# Backgrounds
|
||||
# Background 1
|
||||
rounded = 0
|
||||
border_width = 1
|
||||
background_color = #eeeeee 0
|
||||
border_color = #bbbbbb 10
|
||||
|
||||
# Background 2
|
||||
rounded = 5
|
||||
border_width = 0
|
||||
background_color = #eeeeee 4
|
||||
border_color = #cccccc 100
|
||||
|
||||
# Background 3
|
||||
rounded = 5
|
||||
border_width = 1
|
||||
background_color = #dddddd 4
|
||||
border_color = #999999 100
|
||||
|
||||
# Background 4
|
||||
rounded = 5
|
||||
border_width = 1
|
||||
background_color = #aa4400 100
|
||||
border_color = #aa7733 100
|
||||
|
||||
# Background 5
|
||||
rounded = 2
|
||||
border_width = 1
|
||||
background_color = #ffffaa 100
|
||||
border_color = #999999 100
|
||||
|
||||
# Background 6
|
||||
rounded = 2
|
||||
border_width = 1
|
||||
background_color = #eeeeee 4
|
||||
border_color = #cccccc 100
|
||||
|
||||
# Background 7
|
||||
rounded = 2
|
||||
border_width = 1
|
||||
background_color = #dddddd 3
|
||||
border_color = #999999 100
|
||||
|
||||
# Background 8
|
||||
rounded = 3
|
||||
border_width = 0
|
||||
background_color = #999999 4
|
||||
border_color = #cccccc 100
|
||||
|
||||
#-------------------------------------
|
||||
# Panel
|
||||
panel_items = CSTL
|
||||
panel_size = 100% 152
|
||||
panel_margin = 0 0
|
||||
panel_padding = 2 2 2
|
||||
panel_background_id = 1
|
||||
wm_menu = 1
|
||||
panel_dock = 0
|
||||
panel_position = bottom left vertical
|
||||
panel_layer = normal
|
||||
panel_monitor = all
|
||||
autohide = 0
|
||||
autohide_show_timeout = 0
|
||||
autohide_hide_timeout = 0.5
|
||||
autohide_height = 2
|
||||
strut_policy = follow_size
|
||||
panel_window_name = tint2
|
||||
disable_transparency = 0
|
||||
font_shadow = 0
|
||||
|
||||
#-------------------------------------
|
||||
# Taskbar
|
||||
taskbar_mode = multi_desktop
|
||||
taskbar_padding = 0 0 2
|
||||
taskbar_background_id = 0
|
||||
taskbar_active_background_id = 0
|
||||
taskbar_name = 1
|
||||
taskbar_hide_inactive_tasks = 0
|
||||
taskbar_hide_different_monitor = 0
|
||||
taskbar_name_padding = 6 3
|
||||
taskbar_name_background_id = 6
|
||||
taskbar_name_active_background_id = 7
|
||||
taskbar_name_font = sans bold 9
|
||||
taskbar_name_font_color = #ffffff 100
|
||||
taskbar_name_active_font_color = #ffffff 100
|
||||
taskbar_distribute_size = 1
|
||||
taskbar_sort_order = none
|
||||
task_align = left
|
||||
|
||||
#-------------------------------------
|
||||
# Task
|
||||
task_text = 1
|
||||
task_icon = 1
|
||||
task_centered = 0
|
||||
urgent_nb_of_blink = 100000
|
||||
task_maximum_size = 152 35
|
||||
task_padding = 4 3 4
|
||||
task_font = sans 8
|
||||
task_tooltip = 1
|
||||
task_font_color = #ffffff 100
|
||||
task_icon_asb = 100 0 0
|
||||
task_background_id = 2
|
||||
task_active_background_id = 3
|
||||
task_urgent_background_id = 4
|
||||
task_iconified_background_id = 2
|
||||
mouse_left = toggle_iconify
|
||||
mouse_middle = none
|
||||
mouse_right = close
|
||||
mouse_scroll_up = prev_task
|
||||
mouse_scroll_down = next_task
|
||||
|
||||
#-------------------------------------
|
||||
# System tray (notification area)
|
||||
systray_padding = 0 0 2
|
||||
systray_background_id = 0
|
||||
systray_sort = ascending
|
||||
systray_icon_size = 22
|
||||
systray_icon_asb = 100 0 0
|
||||
systray_monitor = 1
|
||||
|
||||
#-------------------------------------
|
||||
# Launcher
|
||||
launcher_padding = 0 0 2
|
||||
launcher_background_id = 0
|
||||
launcher_icon_size = 22
|
||||
launcher_icon_asb = 100 0 0
|
||||
launcher_icon_theme_override = 0
|
||||
startup_notifications = 1
|
||||
launcher_tooltip = 1
|
||||
launcher_item_app = /usr/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
|
||||
launcher_item_app = /usr/share/applications/firefox.desktop
|
||||
launcher_item_app = /usr/share/applications/iceweasel.desktop
|
||||
launcher_item_app = /usr/share/applications/chromium-browser.desktop
|
||||
launcher_item_app = /usr/share/applications/google-chrome.desktop
|
||||
|
||||
#-------------------------------------
|
||||
# Clock
|
||||
time1_format = %H:%M
|
||||
time2_format = %A %d %B
|
||||
time1_font = sans bold 9
|
||||
time1_timezone =
|
||||
time2_timezone =
|
||||
time2_font = sans 9
|
||||
clock_font_color = #ffffff 100
|
||||
clock_padding = 1 0
|
||||
clock_background_id = 0
|
||||
clock_tooltip =
|
||||
clock_tooltip_timezone =
|
||||
clock_lclick_command = zenity --calendar --text ""
|
||||
clock_rclick_command = orage
|
||||
|
||||
#-------------------------------------
|
||||
# Battery
|
||||
battery_low_status = 10
|
||||
battery_low_cmd = notify-send "battery low"
|
||||
bat1_font = sans 8
|
||||
bat2_font = sans 6
|
||||
battery_font_color = #ffffff 100
|
||||
battery_padding = 1 0
|
||||
battery_background_id = 0
|
||||
battery_hide = 101
|
||||
|
||||
#-------------------------------------
|
||||
# Tooltip
|
||||
tooltip_show_timeout = 0.5
|
||||
tooltip_hide_timeout = 0.1
|
||||
tooltip_padding = 2 2
|
||||
tooltip_background_id = 5
|
||||
tooltip_font_color = #222222 100
|
||||
tooltip_font = sans 9
|
||||
|
||||
@@ -56,6 +56,11 @@ static char buf_bat_time[20];
|
||||
int8_t battery_low_status;
|
||||
unsigned char battery_low_cmd_sent;
|
||||
char *battery_low_cmd;
|
||||
char *battery_lclick_command;
|
||||
char *battery_mclick_command;
|
||||
char *battery_rclick_command;
|
||||
char *battery_uwheel_command;
|
||||
char *battery_dwheel_command;
|
||||
gchar *path_energy_now;
|
||||
gchar *path_energy_full;
|
||||
gchar *path_current_now;
|
||||
@@ -141,6 +146,11 @@ void default_battery()
|
||||
bat1_font_desc = NULL;
|
||||
bat2_font_desc = NULL;
|
||||
battery_low_cmd = NULL;
|
||||
battery_lclick_command = NULL;
|
||||
battery_mclick_command = NULL;
|
||||
battery_rclick_command = NULL;
|
||||
battery_uwheel_command = NULL;
|
||||
battery_dwheel_command = NULL;
|
||||
path_energy_now = NULL;
|
||||
path_energy_full = NULL;
|
||||
path_current_now = NULL;
|
||||
@@ -171,6 +181,16 @@ void cleanup_battery()
|
||||
path_status = NULL;
|
||||
free(battery_low_cmd);
|
||||
battery_low_cmd = NULL;
|
||||
free(battery_lclick_command);
|
||||
battery_lclick_command = NULL;
|
||||
free(battery_mclick_command);
|
||||
battery_mclick_command = NULL;
|
||||
free(battery_rclick_command);
|
||||
battery_rclick_command = NULL;
|
||||
free(battery_uwheel_command);
|
||||
battery_uwheel_command = NULL;
|
||||
free(battery_dwheel_command);
|
||||
battery_dwheel_command = NULL;
|
||||
stop_timeout(battery_timeout);
|
||||
battery_timeout = NULL;
|
||||
battery_found = 0;
|
||||
@@ -574,3 +594,26 @@ int resize_battery(void *obj)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void battery_action(int button)
|
||||
{
|
||||
char *command = 0;
|
||||
switch (button) {
|
||||
case 1:
|
||||
command = battery_lclick_command;
|
||||
break;
|
||||
case 2:
|
||||
command = battery_mclick_command;
|
||||
break;
|
||||
case 3:
|
||||
command = battery_rclick_command;
|
||||
break;
|
||||
case 4:
|
||||
command = battery_uwheel_command;
|
||||
break;
|
||||
case 5:
|
||||
command = battery_dwheel_command;
|
||||
break;
|
||||
}
|
||||
tint_exec(command);
|
||||
}
|
||||
@@ -56,6 +56,12 @@ extern int percentage_hide;
|
||||
extern int8_t battery_low_status;
|
||||
extern char *battery_low_cmd;
|
||||
|
||||
extern char *battery_lclick_command;
|
||||
extern char *battery_mclick_command;
|
||||
extern char *battery_rclick_command;
|
||||
extern char *battery_uwheel_command;
|
||||
extern char *battery_dwheel_command;
|
||||
|
||||
// default global data
|
||||
void default_battery();
|
||||
|
||||
@@ -71,4 +77,6 @@ void draw_battery(void *obj, cairo_t *c);
|
||||
|
||||
int resize_battery(void *obj);
|
||||
|
||||
void battery_action(int button);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,7 +39,10 @@ char *time2_timezone;
|
||||
char *time_tooltip_format;
|
||||
char *time_tooltip_timezone;
|
||||
char *clock_lclick_command;
|
||||
char *clock_mclick_command;
|
||||
char *clock_rclick_command;
|
||||
char *clock_uwheel_command;
|
||||
char *clock_dwheel_command;
|
||||
struct timeval time_clock;
|
||||
PangoFontDescription *time1_font_desc;
|
||||
PangoFontDescription *time2_font_desc;
|
||||
@@ -61,7 +64,10 @@ void default_clock()
|
||||
time_tooltip_format = NULL;
|
||||
time_tooltip_timezone = NULL;
|
||||
clock_lclick_command = NULL;
|
||||
clock_mclick_command = NULL;
|
||||
clock_rclick_command = NULL;
|
||||
clock_uwheel_command = NULL;
|
||||
clock_dwheel_command = NULL;
|
||||
time1_font_desc = NULL;
|
||||
time2_font_desc = NULL;
|
||||
}
|
||||
@@ -86,8 +92,14 @@ void cleanup_clock()
|
||||
time_tooltip_timezone = NULL;
|
||||
free(clock_lclick_command);
|
||||
clock_lclick_command = NULL;
|
||||
free(clock_mclick_command);
|
||||
clock_mclick_command = NULL;
|
||||
free(clock_rclick_command);
|
||||
clock_rclick_command = NULL;
|
||||
free(clock_uwheel_command);
|
||||
clock_uwheel_command = NULL;
|
||||
free(clock_dwheel_command);
|
||||
clock_dwheel_command = NULL;
|
||||
stop_timeout(clock_timeout);
|
||||
clock_timeout = NULL;
|
||||
}
|
||||
@@ -277,9 +289,18 @@ void clock_action(int button)
|
||||
case 1:
|
||||
command = clock_lclick_command;
|
||||
break;
|
||||
case 2:
|
||||
command = clock_mclick_command;
|
||||
break;
|
||||
case 3:
|
||||
command = clock_rclick_command;
|
||||
break;
|
||||
case 4:
|
||||
command = clock_uwheel_command;
|
||||
break;
|
||||
case 5:
|
||||
command = clock_dwheel_command;
|
||||
break;
|
||||
}
|
||||
tint_exec(command);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,10 @@ extern char *time_tooltip_timezone;
|
||||
extern PangoFontDescription *time1_font_desc;
|
||||
extern PangoFontDescription *time2_font_desc;
|
||||
extern char *clock_lclick_command;
|
||||
extern char *clock_mclick_command;
|
||||
extern char *clock_rclick_command;
|
||||
extern char *clock_uwheel_command;
|
||||
extern char *clock_dwheel_command;
|
||||
extern int clock_enabled;
|
||||
|
||||
|
||||
|
||||
98
src/config.c
98
src/config.c
@@ -41,6 +41,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "server.h"
|
||||
#include "strnatcmp.h"
|
||||
#include "panel.h"
|
||||
#include "task.h"
|
||||
#include "taskbar.h"
|
||||
@@ -153,23 +154,48 @@ int config_get_monitor(char* monitor)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static gint compare_strings(gconstpointer a, gconstpointer b)
|
||||
{
|
||||
return strnatcasecmp((const char*)a, (const char*)b);
|
||||
}
|
||||
|
||||
void load_launcher_app_dir(const char *path)
|
||||
{
|
||||
GDir *d = g_dir_open(path, 0, NULL);
|
||||
GList *subdirs = NULL;
|
||||
GList *files = NULL;
|
||||
|
||||
GDir *d = g_dir_open(path, 0, NULL);
|
||||
if (d) {
|
||||
const gchar *name;
|
||||
while ((name = g_dir_read_name(d))) {
|
||||
gchar *file = g_build_filename(path, name, NULL);
|
||||
if (!g_file_test(file, G_FILE_TEST_IS_DIR) &&
|
||||
g_str_has_suffix(file, ".desktop")) {
|
||||
panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, strdup(file));
|
||||
if (!g_file_test(file, G_FILE_TEST_IS_DIR) && g_str_has_suffix(file, ".desktop")) {
|
||||
files = g_list_append(files, file);
|
||||
} else if (g_file_test(file, G_FILE_TEST_IS_DIR)) {
|
||||
load_launcher_app_dir(file);
|
||||
}
|
||||
g_free(file);
|
||||
subdirs = g_list_append(subdirs, file);
|
||||
} else {
|
||||
g_free(file);
|
||||
}
|
||||
}
|
||||
g_dir_close(d);
|
||||
}
|
||||
|
||||
subdirs = g_list_sort(subdirs, compare_strings);
|
||||
GList *l;
|
||||
for (l = subdirs; l; l = g_list_next(l)) {
|
||||
gchar *dir = (gchar *)l->data;
|
||||
load_launcher_app_dir(dir);
|
||||
g_free(dir);
|
||||
}
|
||||
g_list_free(subdirs);
|
||||
|
||||
files = g_list_sort(files, compare_strings);
|
||||
for (l = files; l; l = g_list_next(l)) {
|
||||
gchar *file = (gchar *)l->data;
|
||||
panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, strdup(file));
|
||||
g_free(file);
|
||||
}
|
||||
g_list_free(files);
|
||||
}
|
||||
|
||||
void add_entry (char *key, char *value)
|
||||
@@ -232,6 +258,13 @@ void add_entry (char *key, char *value)
|
||||
new_config_file = 1;
|
||||
panel_items_order = strdup(value);
|
||||
int j;
|
||||
systray_enabled = 0;
|
||||
launcher_enabled = 0;
|
||||
#ifdef ENABLE_BATTERY
|
||||
battery_enabled = 0;
|
||||
#endif
|
||||
clock_enabled = 0;
|
||||
taskbar_enabled = 0;
|
||||
for (j=0 ; j < strlen(panel_items_order) ; j++) {
|
||||
if (panel_items_order[j] == 'L')
|
||||
launcher_enabled = 1;
|
||||
@@ -323,6 +356,36 @@ void add_entry (char *key, char *value)
|
||||
battery_low_status = atoi(value);
|
||||
if(battery_low_status < 0 || battery_low_status > 100)
|
||||
battery_low_status = 0;
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_lclick_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_lclick_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_mclick_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_mclick_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_rclick_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_rclick_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_uwheel_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_uwheel_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_dwheel_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_dwheel_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp (key, "battery_low_cmd") == 0) {
|
||||
@@ -437,10 +500,22 @@ void add_entry (char *key, char *value)
|
||||
if (strlen(value) > 0)
|
||||
clock_lclick_command = strdup(value);
|
||||
}
|
||||
else if (strcmp(key, "clock_mclick_command") == 0) {
|
||||
if (strlen(value) > 0)
|
||||
clock_mclick_command = strdup(value);
|
||||
}
|
||||
else if (strcmp(key, "clock_rclick_command") == 0) {
|
||||
if (strlen(value) > 0)
|
||||
clock_rclick_command = strdup(value);
|
||||
}
|
||||
else if (strcmp(key, "clock_uwheel_command") == 0) {
|
||||
if (strlen(value) > 0)
|
||||
clock_uwheel_command = strdup(value);
|
||||
}
|
||||
else if (strcmp(key, "clock_dwheel_command") == 0) {
|
||||
if (strlen(value) > 0)
|
||||
clock_dwheel_command = strdup(value);
|
||||
}
|
||||
|
||||
/* Taskbar */
|
||||
else if (strcmp (key, "taskbar_mode") == 0) {
|
||||
@@ -518,6 +593,15 @@ void add_entry (char *key, char *value)
|
||||
taskbar_sort_method = TASKBAR_NOSORT;
|
||||
}
|
||||
}
|
||||
else if (strcmp (key, "task_align") == 0) {
|
||||
if (strcmp(value, "center") == 0) {
|
||||
taskbar_alignment = ALIGN_CENTER;
|
||||
} else if (strcmp(value, "right") == 0) {
|
||||
taskbar_alignment = ALIGN_RIGHT;
|
||||
} else {
|
||||
taskbar_alignment = ALIGN_LEFT;
|
||||
}
|
||||
}
|
||||
|
||||
/* Task */
|
||||
else if (strcmp (key, "task_text") == 0)
|
||||
|
||||
93
src/freespace/freespace.c
Normal file
93
src/freespace/freespace.c
Normal file
@@ -0,0 +1,93 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Tint2 : freespace
|
||||
*
|
||||
* Copyright (C) 2011 Mishael A Sibiryakov (death@junki.org)
|
||||
*
|
||||
* 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 <string.h>
|
||||
#include <stdio.h>
|
||||
#include <cairo.h>
|
||||
#include <cairo-xlib.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "window.h"
|
||||
#include "server.h"
|
||||
#include "panel.h"
|
||||
#include "freespace.h"
|
||||
#include "common.h"
|
||||
|
||||
void init_freespace_panel(void *p)
|
||||
{
|
||||
Panel *panel = (Panel*)p;
|
||||
FreeSpace *freespace = &panel->freespace;
|
||||
|
||||
if (freespace->area.bg == 0)
|
||||
freespace->area.bg = &g_array_index(backgrounds, Background, 0);
|
||||
freespace->area.parent = p;
|
||||
freespace->area.panel = p;
|
||||
freespace->area.size_mode = SIZE_BY_CONTENT;
|
||||
freespace->area.resize = 1;
|
||||
freespace->area.on_screen = 1;
|
||||
freespace->area._resize = resize_freespace;
|
||||
}
|
||||
|
||||
int freespace_get_max_size(Panel *p) {
|
||||
// Get space used by every element except the freespace
|
||||
GList *walk;
|
||||
int size = 0;
|
||||
for (walk = p->area.list; walk; walk = g_list_next(walk)) {
|
||||
Area *a = (Area *)walk->data;
|
||||
|
||||
if (a->_resize == resize_freespace || !a->on_screen)
|
||||
continue;
|
||||
|
||||
if (panel_horizontal)
|
||||
size += a->width + (a->bg->border.width * 2) + p->area.paddingx;
|
||||
else
|
||||
size += a->height + (a->bg->border.width * 2) + p->area.paddingy;
|
||||
}
|
||||
|
||||
if (panel_horizontal)
|
||||
size = p->area.width - size - (p->area.bg->border.width * 2) - p->area.paddingxlr;
|
||||
else
|
||||
size = p->area.height - size - (p->area.bg->border.width * 2) - p->area.paddingxlr;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
int resize_freespace(void *obj) {
|
||||
FreeSpace *freespace = (FreeSpace*)obj;
|
||||
Panel *panel = (Panel*)freespace->area.panel;
|
||||
if (!freespace->area.on_screen)
|
||||
return 0;
|
||||
|
||||
int old_size = panel_horizontal ? freespace->area.width : freespace->area.height;
|
||||
int size = freespace_get_max_size(panel);
|
||||
if (old_size == size)
|
||||
return 0;
|
||||
|
||||
if (panel_horizontal) {
|
||||
freespace->area.width = size;
|
||||
} else {
|
||||
freespace->area.height = size;
|
||||
}
|
||||
|
||||
freespace->area.redraw = 1;
|
||||
panel_refresh = 1;
|
||||
return 1;
|
||||
}
|
||||
20
src/freespace/freespace.h
Normal file
20
src/freespace/freespace.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C) 2011 Mishael A Sibiryakov (death@junki.org)
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef FREESPACE_H
|
||||
#define FREESPACE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "area.h"
|
||||
|
||||
typedef struct FreeSpace {
|
||||
Area area;
|
||||
} FreeSpace;
|
||||
|
||||
void cleanup_freespace();
|
||||
void init_freespace_panel(void *panel);
|
||||
|
||||
int resize_freespace(void *obj);
|
||||
|
||||
#endif
|
||||
@@ -105,6 +105,7 @@ int read_desktop_file(const char *path, DesktopEntry *entry)
|
||||
char *key, *value;
|
||||
int i;
|
||||
|
||||
entry->path = strdup(path);
|
||||
entry->name = entry->icon = entry->exec = NULL;
|
||||
|
||||
if ((fp = fopen(path, "rt")) == NULL) {
|
||||
@@ -174,7 +175,8 @@ void free_desktop_entry(DesktopEntry *entry)
|
||||
free(entry->name);
|
||||
free(entry->icon);
|
||||
free(entry->exec);
|
||||
entry->name = entry->icon = entry->exec = NULL;
|
||||
free(entry->path);
|
||||
entry->name = entry->icon = entry->exec = entry->path = NULL;
|
||||
}
|
||||
|
||||
void test_read_desktop_file()
|
||||
|
||||
@@ -11,6 +11,7 @@ typedef struct DesktopEntry {
|
||||
char *name;
|
||||
char *exec;
|
||||
char *icon;
|
||||
char *path;
|
||||
} DesktopEntry;
|
||||
|
||||
// Parses a line of the form "key = value". Modifies the line.
|
||||
|
||||
@@ -359,13 +359,7 @@ void draw_launcher_icon(void *obj, cairo_t *c)
|
||||
|
||||
// Render
|
||||
imlib_context_set_image(launcherIcon->image);
|
||||
if (server.real_transparency) {
|
||||
render_image(launcherIcon->area.pix, 0, 0);
|
||||
} else {
|
||||
imlib_context_set_blend(1);
|
||||
imlib_context_set_drawable(launcherIcon->area.pix);
|
||||
imlib_render_image_on_drawable(0, 0);
|
||||
}
|
||||
render_image(launcherIcon->area.pix, 0, 0);
|
||||
}
|
||||
|
||||
Imlib_Image scale_icon(Imlib_Image original, int icon_size)
|
||||
|
||||
51
src/panel.c
51
src/panel.c
@@ -204,6 +204,8 @@ void init_panel()
|
||||
}
|
||||
if (panel_items_order[k] == 'C')
|
||||
init_clock_panel(p);
|
||||
if (panel_items_order[k] == 'F' && !strstr(panel_items_order, "T"))
|
||||
init_freespace_panel(p);
|
||||
}
|
||||
set_panel_items_order(p);
|
||||
|
||||
@@ -322,13 +324,13 @@ void init_panel_size_and_position(Panel *panel)
|
||||
|
||||
int resize_panel(void *obj)
|
||||
{
|
||||
resize_by_layout(obj, 0);
|
||||
Panel *panel = (Panel*)obj;
|
||||
resize_by_layout(panel, 0);
|
||||
|
||||
//printf("resize_panel\n");
|
||||
if (panel_mode != MULTI_DESKTOP && taskbar_enabled) {
|
||||
// propagate width/height on hidden taskbar
|
||||
int i, width, height;
|
||||
Panel *panel = (Panel*)obj;
|
||||
width = panel->taskbar[server.desktop].area.width;
|
||||
height = panel->taskbar[server.desktop].area.height;
|
||||
for (i=0 ; i < panel->nb_desktop ; i++) {
|
||||
@@ -339,7 +341,6 @@ int resize_panel(void *obj)
|
||||
}
|
||||
if (panel_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) {
|
||||
// Distribute the available space between taskbars
|
||||
Panel *panel = (Panel*)obj;
|
||||
|
||||
// Compute the total available size, and the total size requested by the taskbars
|
||||
int total_size = 0;
|
||||
@@ -354,7 +355,7 @@ int resize_panel(void *obj)
|
||||
}
|
||||
|
||||
Taskbar *taskbar = &panel->taskbar[i];
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = taskbar->area.list; l; l = l->next) {
|
||||
Area *child = l->data;
|
||||
if (!child->on_screen)
|
||||
@@ -389,7 +390,7 @@ int resize_panel(void *obj)
|
||||
|
||||
int requested_size = (2 * taskbar->area.bg->border.width) + (2 * taskbar->area.paddingxlr);
|
||||
int items = 0;
|
||||
GSList *l = taskbar->area.list;
|
||||
GList *l = taskbar->area.list;
|
||||
if (taskbarname_enabled)
|
||||
l = l->next;
|
||||
for (; l; l = l->next) {
|
||||
@@ -418,6 +419,8 @@ int resize_panel(void *obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (panel->freespace.area.on_screen)
|
||||
resize_freespace(&panel->freespace);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -482,29 +485,31 @@ void set_panel_items_order(Panel *p)
|
||||
int k, j;
|
||||
|
||||
if (p->area.list) {
|
||||
g_slist_free(p->area.list);
|
||||
g_list_free(p->area.list);
|
||||
p->area.list = 0;
|
||||
}
|
||||
|
||||
for (k=0 ; k < strlen(panel_items_order) ; k++) {
|
||||
if (panel_items_order[k] == 'L') {
|
||||
p->area.list = g_slist_append(p->area.list, &p->launcher);
|
||||
p->area.list = g_list_append(p->area.list, &p->launcher);
|
||||
p->launcher.area.resize = 1;
|
||||
}
|
||||
if (panel_items_order[k] == 'T') {
|
||||
for (j=0 ; j < p->nb_desktop ; j++)
|
||||
p->area.list = g_slist_append(p->area.list, &p->taskbar[j]);
|
||||
p->area.list = g_list_append(p->area.list, &p->taskbar[j]);
|
||||
}
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (panel_items_order[k] == 'B')
|
||||
p->area.list = g_slist_append(p->area.list, &p->battery);
|
||||
p->area.list = g_list_append(p->area.list, &p->battery);
|
||||
#endif
|
||||
int i = p - panel1;
|
||||
if (panel_items_order[k] == 'S' && systray_on_monitor(i, nb_panel)) {
|
||||
p->area.list = g_slist_append(p->area.list, &systray);
|
||||
p->area.list = g_list_append(p->area.list, &systray);
|
||||
}
|
||||
if (panel_items_order[k] == 'C')
|
||||
p->area.list = g_slist_append(p->area.list, &p->clock);
|
||||
p->area.list = g_list_append(p->area.list, &p->clock);
|
||||
if (panel_items_order[k] == 'F')
|
||||
p->area.list = g_list_append(p->area.list, &p->freespace);
|
||||
}
|
||||
init_rendering(&p->area, 0);
|
||||
}
|
||||
@@ -544,7 +549,7 @@ void set_panel_properties(Panel *p)
|
||||
memset(&wmhints, 0, sizeof(wmhints));
|
||||
if (panel_dock) {
|
||||
// Necessary for placing the panel into the dock on Openbox and Fluxbox.
|
||||
// See https://code.google.com/p/tint2/issues/detail?id=465
|
||||
// See https://gitlab.com/o9000/tint2/issues/465
|
||||
wmhints.icon_window = wmhints.window_group = p->main_win;
|
||||
wmhints.flags = StateHint | IconWindowHint;
|
||||
wmhints.initial_state = WithdrawnState;
|
||||
@@ -629,7 +634,7 @@ void set_panel_background(Panel *p)
|
||||
}
|
||||
|
||||
// redraw panel's object
|
||||
GSList *l0;
|
||||
GList *l0;
|
||||
Area *a;
|
||||
for (l0 = p->area.list; l0 ; l0 = l0->next) {
|
||||
a = l0->data;
|
||||
@@ -695,7 +700,7 @@ Taskbar *click_taskbar (Panel *panel, int x, int y)
|
||||
|
||||
Task *click_task (Panel *panel, int x, int y)
|
||||
{
|
||||
GSList *l0;
|
||||
GList *l0;
|
||||
Taskbar *tskbar;
|
||||
|
||||
if ( (tskbar = click_taskbar(panel, x, y)) ) {
|
||||
@@ -791,13 +796,29 @@ int click_clock(Panel *panel, int x, int y)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
int 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;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Area* click_area(Panel *panel, int x, int y)
|
||||
{
|
||||
Area* result = &panel->area;
|
||||
Area* new_result = result;
|
||||
do {
|
||||
result = new_result;
|
||||
GSList* it = result->list;
|
||||
GList* it = result->list;
|
||||
while (it) {
|
||||
Area* a = it->data;
|
||||
if (a->on_screen && x >= a->posx && x <= (a->posx + a->width)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "taskbar.h"
|
||||
#include "systraybar.h"
|
||||
#include "launcher.h"
|
||||
#include "freespace.h"
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
#include "battery.h"
|
||||
@@ -116,6 +117,8 @@ typedef struct {
|
||||
|
||||
Launcher launcher;
|
||||
|
||||
FreeSpace freespace;
|
||||
|
||||
// autohide
|
||||
int is_hidden;
|
||||
int hidden_width, hidden_height;
|
||||
@@ -157,6 +160,11 @@ Launcher *click_launcher (Panel *panel, int x, int y);
|
||||
LauncherIcon *click_launcher_icon (Panel *panel, int x, int y);
|
||||
int click_padding(Panel *panel, int x, int y);
|
||||
int click_clock(Panel *panel, int x, int y);
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
int click_battery(Panel *panel, int x, int y);
|
||||
#endif
|
||||
|
||||
Area* click_area(Panel *panel, int x, int y);
|
||||
|
||||
void autohide_show(void* p);
|
||||
|
||||
18
src/server.c
18
src/server.c
@@ -96,6 +96,8 @@ void server_init_atoms ()
|
||||
server.atom.MANAGER = XInternAtom(server.dsp, "MANAGER", False);
|
||||
server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_MESSAGE_DATA", False);
|
||||
server.atom._NET_SYSTEM_TRAY_ORIENTATION = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_ORIENTATION", False);
|
||||
server.atom._NET_SYSTEM_TRAY_ICON_SIZE = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_ICON_SIZE", False);
|
||||
server.atom._NET_SYSTEM_TRAY_PADDING = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_PADDING", False);
|
||||
server.atom._XEMBED = XInternAtom(server.dsp, "_XEMBED", False);
|
||||
server.atom._XEMBED_INFO = XInternAtom(server.dsp, "_XEMBED_INFO", False);
|
||||
server.atom._NET_WM_PID = XInternAtom(server.dsp, "_NET_WM_PID", True);
|
||||
@@ -284,7 +286,7 @@ void get_monitors()
|
||||
if (res && res->ncrtc >= nbmonitor) {
|
||||
// use xrandr to identify monitors (does not work with proprietery nvidia drivers)
|
||||
|
||||
// Workaround for issue https://code.google.com/p/tint2/issues/detail?id=353
|
||||
// Workaround for issue https://gitlab.com/o9000/tint2/issues/353
|
||||
// on some recent configs, XRRGetScreenResourcesCurrent returns a fantom monitor at last position
|
||||
{
|
||||
int i = res->ncrtc - 1;
|
||||
@@ -362,6 +364,20 @@ next:
|
||||
}
|
||||
}
|
||||
|
||||
void print_monitors()
|
||||
{
|
||||
fprintf(stderr, "Number of monitors: %d\n", server.nb_monitor);
|
||||
int i;
|
||||
for (i = 0; i < server.nb_monitor; i++) {
|
||||
fprintf(stderr, "Monitor %d: x = %d, y = %d, w = %d, h = %d\n",
|
||||
i+1,
|
||||
server.monitor[i].x,
|
||||
server.monitor[i].y,
|
||||
server.monitor[i].width,
|
||||
server.monitor[i].height);
|
||||
}
|
||||
}
|
||||
|
||||
int server_get_number_of_desktops()
|
||||
{
|
||||
return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
|
||||
|
||||
@@ -71,6 +71,8 @@ typedef struct Global_atom
|
||||
Atom MANAGER;
|
||||
Atom _NET_SYSTEM_TRAY_MESSAGE_DATA;
|
||||
Atom _NET_SYSTEM_TRAY_ORIENTATION;
|
||||
Atom _NET_SYSTEM_TRAY_ICON_SIZE;
|
||||
Atom _NET_SYSTEM_TRAY_PADDING;
|
||||
Atom _XEMBED;
|
||||
Atom _XEMBED_INFO;
|
||||
Atom _NET_WM_PID;
|
||||
@@ -151,7 +153,8 @@ void get_root_pixmap();
|
||||
|
||||
// detect monitors and desktops
|
||||
void get_monitors();
|
||||
void print_monitors();
|
||||
void get_desktops();
|
||||
int server_get_number_of_desktops();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,8 +35,8 @@ typedef struct {
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Window id;
|
||||
Window tray_id;
|
||||
Window parent;
|
||||
Window win;
|
||||
int x, y;
|
||||
int width, height;
|
||||
// TODO: manage icon's show/hide
|
||||
@@ -47,6 +47,15 @@ typedef struct
|
||||
int empty;
|
||||
int pid;
|
||||
int chrono;
|
||||
struct timespec time_last_render;
|
||||
int num_fast_renders;
|
||||
int reparented;
|
||||
int embedded;
|
||||
int bad_size_counter;
|
||||
timeout* resize_timeout;
|
||||
struct timespec time_last_resize;
|
||||
char *name;
|
||||
Imlib_Image image;
|
||||
} TrayWindow;
|
||||
|
||||
|
||||
@@ -57,6 +66,7 @@ extern int refresh_systray;
|
||||
extern int systray_enabled;
|
||||
extern int systray_max_icon_size;
|
||||
extern int systray_monitor;
|
||||
extern int systray_profile;
|
||||
|
||||
// default global data
|
||||
void default_systray();
|
||||
@@ -80,10 +90,17 @@ void stop_net();
|
||||
void net_message(XClientMessageEvent *e);
|
||||
|
||||
gboolean add_icon(Window id);
|
||||
gboolean reparent_icon(TrayWindow *traywin);
|
||||
gboolean embed_icon(TrayWindow *traywin);
|
||||
void remove_icon(TrayWindow *traywin);
|
||||
|
||||
void refresh_systray_icon();
|
||||
void systray_render_icon(TrayWindow* traywin);
|
||||
void refresh_systray_icons();
|
||||
void systray_render_icon(void *t);
|
||||
gboolean request_embed_icon(TrayWindow *traywin);
|
||||
void systray_resize_request_event(TrayWindow *traywin, XEvent *e);
|
||||
gboolean request_embed_icon(TrayWindow *traywin);
|
||||
void systray_reconfigure_event(TrayWindow *traywin, XEvent *e);
|
||||
void systray_destroy_event(TrayWindow *traywin);
|
||||
void kde_update_icons();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -111,7 +111,7 @@ Task *add_task (Window win)
|
||||
}
|
||||
new_tsk2->icon_width = new_tsk.icon_width;
|
||||
new_tsk2->icon_height = new_tsk.icon_height;
|
||||
tskbar->area.list = g_slist_append(tskbar->area.list, new_tsk2);
|
||||
tskbar->area.list = g_list_append(tskbar->area.list, new_tsk2);
|
||||
tskbar->area.resize = 1;
|
||||
g_ptr_array_add(task_group, new_tsk2);
|
||||
//printf("add_task panel %d, desktop %d, task %s\n", i, j, new_tsk2->title);
|
||||
@@ -169,7 +169,7 @@ void remove_task (Task *tsk)
|
||||
for (i=0; i<task_group->len; ++i) {
|
||||
tsk2 = g_ptr_array_index(task_group, i);
|
||||
tskbar = tsk2->area.parent;
|
||||
tskbar->area.list = g_slist_remove(tskbar->area.list, tsk2);
|
||||
tskbar->area.list = g_list_remove(tskbar->area.list, tsk2);
|
||||
tskbar->area.resize = 1;
|
||||
if (tsk2 == task_active) task_active = 0;
|
||||
if (tsk2 == task_drag) task_drag = 0;
|
||||
@@ -350,13 +350,7 @@ void draw_task_icon (Task *tsk, int text_width)
|
||||
|
||||
// Render
|
||||
imlib_context_set_image (tsk->icon[tsk->current_state]);
|
||||
if (server.real_transparency) {
|
||||
render_image(tsk->area.pix, pos_x, panel->g_task.icon_posy);
|
||||
} else {
|
||||
imlib_context_set_blend(1);
|
||||
imlib_context_set_drawable(tsk->area.pix);
|
||||
imlib_render_image_on_drawable(pos_x, panel->g_task.icon_posy);
|
||||
}
|
||||
render_image(tsk->area.pix, pos_x, panel->g_task.icon_posy);
|
||||
}
|
||||
|
||||
|
||||
@@ -424,15 +418,13 @@ Task *find_active_task(Task *current_task, Task *active_task)
|
||||
if (active_task == NULL)
|
||||
return current_task;
|
||||
|
||||
GSList *l0;
|
||||
Task *tsk;
|
||||
Taskbar* tskbar = current_task->area.parent;
|
||||
|
||||
l0 = tskbar->area.list;
|
||||
GList *l0 = tskbar->area.list;
|
||||
if (taskbarname_enabled)
|
||||
l0 = l0->next;
|
||||
for (; l0 ; l0 = l0->next) {
|
||||
tsk = l0->data;
|
||||
Task *tsk = l0->data;
|
||||
if (tsk->win == active_task->win)
|
||||
return tsk;
|
||||
}
|
||||
@@ -445,15 +437,13 @@ Task *next_task(Task *tsk)
|
||||
if (tsk == 0)
|
||||
return 0;
|
||||
|
||||
GSList *l0, *lfirst_tsk;
|
||||
Task *tsk1;
|
||||
Taskbar* tskbar = tsk->area.parent;
|
||||
|
||||
l0 = tskbar->area.list;
|
||||
GList *l0 = tskbar->area.list;
|
||||
if (taskbarname_enabled) l0 = l0->next;
|
||||
lfirst_tsk = l0;
|
||||
GList *lfirst_tsk = l0;
|
||||
for (; l0 ; l0 = l0->next) {
|
||||
tsk1 = l0->data;
|
||||
Task *tsk1 = l0->data;
|
||||
if (tsk1 == tsk) {
|
||||
if (l0->next == 0) l0 = lfirst_tsk;
|
||||
else l0 = l0->next;
|
||||
@@ -469,19 +459,18 @@ Task *prev_task(Task *tsk)
|
||||
if (tsk == 0)
|
||||
return 0;
|
||||
|
||||
GSList *l0, *lfirst_tsk;
|
||||
Task *tsk1, *tsk2;
|
||||
Taskbar* tskbar = tsk->area.parent;
|
||||
|
||||
tsk2 = 0;
|
||||
l0 = tskbar->area.list;
|
||||
GList *l0 = tskbar->area.list;
|
||||
if (taskbarname_enabled) l0 = l0->next;
|
||||
lfirst_tsk = l0;
|
||||
GList *lfirst_tsk = l0;
|
||||
for (; l0 ; l0 = l0->next) {
|
||||
tsk1 = l0->data;
|
||||
if (tsk1 == tsk) {
|
||||
if (l0 == lfirst_tsk) {
|
||||
l0 = g_slist_last ( l0 );
|
||||
l0 = g_list_last ( l0 );
|
||||
tsk2 = l0->data;
|
||||
}
|
||||
return tsk2;
|
||||
@@ -532,9 +521,14 @@ void set_task_state(Task *tsk, int state)
|
||||
tsk1->area.redraw = 1;
|
||||
if (state == TASK_ACTIVE && g_slist_find(urgent_list, tsk1))
|
||||
del_urgent(tsk1);
|
||||
// Show only the active task
|
||||
int hide = 0;
|
||||
Taskbar *taskbar = (Taskbar *)tsk1->area.parent;
|
||||
if (tsk->desktop == ALLDESKTOP && server.desktop != taskbar->desktop) {
|
||||
// Hide ALLDESKTOP task on non-current desktop
|
||||
hide = 1;
|
||||
}
|
||||
if (hide_inactive_tasks) {
|
||||
// Show only the active task
|
||||
if (state != TASK_ACTIVE) {
|
||||
hide = 1;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ int taskbar_distribute_size;
|
||||
int hide_inactive_tasks;
|
||||
int hide_task_diff_monitor;
|
||||
int taskbar_sort_method;
|
||||
int taskbar_alignment;
|
||||
|
||||
guint win_hash(gconstpointer key) { return (guint)*((Window*)key); }
|
||||
gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); }
|
||||
@@ -63,6 +64,7 @@ void default_taskbar()
|
||||
hide_inactive_tasks = 0;
|
||||
hide_task_diff_monitor = 0;
|
||||
taskbar_sort_method = TASKBAR_NOSORT;
|
||||
taskbar_alignment = ALIGN_LEFT;
|
||||
default_taskbarname();
|
||||
}
|
||||
|
||||
@@ -97,7 +99,7 @@ void cleanup_taskbar()
|
||||
}
|
||||
free_area(&tskbar->area);
|
||||
// remove taskbar from the panel
|
||||
panel->area.list = g_slist_remove(panel->area.list, tskbar);
|
||||
panel->area.list = g_list_remove(panel->area.list, tskbar);
|
||||
}
|
||||
if (panel->taskbar) {
|
||||
free(panel->taskbar);
|
||||
@@ -153,6 +155,7 @@ void init_taskbar_panel(void *p)
|
||||
panel->g_taskbar.area.parent = panel;
|
||||
panel->g_taskbar.area.panel = panel;
|
||||
panel->g_taskbar.area.size_mode = SIZE_BY_LAYOUT;
|
||||
panel->g_taskbar.area.alignment = taskbar_alignment;
|
||||
panel->g_taskbar.area._resize = resize_taskbar;
|
||||
panel->g_taskbar.area._draw_foreground = draw_taskbar;
|
||||
panel->g_taskbar.area._on_change_layout = on_change_taskbar;
|
||||
@@ -334,7 +337,7 @@ int resize_taskbar(void *obj)
|
||||
resize_by_layout(obj, panel->g_task.maximum_width);
|
||||
|
||||
text_width = panel->g_task.maximum_width;
|
||||
GSList *l = taskbar->area.list;
|
||||
GList *l = taskbar->area.list;
|
||||
if (taskbarname_enabled) l = l->next;
|
||||
for (; l != NULL; l = l->next) {
|
||||
if (((Task *)l->data)->area.on_screen) {
|
||||
@@ -388,7 +391,7 @@ void set_taskbar_state(Taskbar *tskbar, int state)
|
||||
if (taskbarname_enabled && tskbar->bar_name.state_pix[state] == 0)
|
||||
tskbar->bar_name.area.redraw = 1;
|
||||
if (panel_mode == MULTI_DESKTOP && panel1[0].g_taskbar.background[TASKBAR_NORMAL] != panel1[0].g_taskbar.background[TASKBAR_ACTIVE]) {
|
||||
GSList *l = tskbar->area.list;
|
||||
GList *l = tskbar->area.list;
|
||||
if (taskbarname_enabled) l = l->next;
|
||||
for ( ; l ; l = l->next)
|
||||
set_task_redraw(l->data);
|
||||
@@ -511,7 +514,7 @@ int taskbar_needs_sort(Taskbar *taskbar)
|
||||
if (taskbar_sort_method == TASKBAR_NOSORT)
|
||||
return 0;
|
||||
|
||||
GSList *i, *j;
|
||||
GList *i, *j;
|
||||
for (i = taskbar->area.list, j = i ? i->next : NULL; i && j; i = i->next, j = j->next) {
|
||||
if (compare_tasks(i->data, j->data, taskbar) > 0) {
|
||||
return 1;
|
||||
@@ -528,7 +531,7 @@ void sort_tasks(Taskbar *taskbar)
|
||||
if (!taskbar_needs_sort(taskbar)) {
|
||||
return;
|
||||
}
|
||||
taskbar->area.list = g_slist_sort_with_data(taskbar->area.list, (GCompareDataFunc)compare_tasks, taskbar);
|
||||
taskbar->area.list = g_list_sort_with_data(taskbar->area.list, (GCompareDataFunc)compare_tasks, taskbar);
|
||||
taskbar->area.resize = 1;
|
||||
panel_refresh = 1;
|
||||
((Panel*)taskbar->area.panel)->area.resize = 1;
|
||||
|
||||
@@ -21,6 +21,7 @@ extern int hide_inactive_tasks;
|
||||
extern int hide_task_diff_monitor;
|
||||
enum { TASKBAR_NOSORT, TASKBAR_SORT_CENTER, TASKBAR_SORT_TITLE };
|
||||
extern int taskbar_sort_method;
|
||||
extern int taskbar_alignment;
|
||||
|
||||
typedef struct {
|
||||
// always start with area
|
||||
|
||||
@@ -76,7 +76,7 @@ void init_taskbarname_panel(void *p)
|
||||
tskbar->bar_name.name = g_strdup_printf("%d", j+1);
|
||||
|
||||
// append the name at the beginning of taskbar
|
||||
tskbar->area.list = g_slist_append(tskbar->area.list, &tskbar->bar_name);
|
||||
tskbar->area.list = g_list_append(tskbar->area.list, &tskbar->bar_name);
|
||||
}
|
||||
|
||||
for (l=list ; l ; l = l->next)
|
||||
@@ -103,7 +103,7 @@ void cleanup_taskbarname()
|
||||
XFreePixmap(server.dsp, tskbar->bar_name.state_pix[k]);
|
||||
tskbar->bar_name.state_pix[k] = 0;
|
||||
}
|
||||
tskbar->area.list = g_slist_remove(tskbar->area.list, &tskbar->bar_name);
|
||||
tskbar->area.list = g_list_remove(tskbar->area.list, &tskbar->bar_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
817
src/tint.c
817
src/tint.c
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@ include_directories( ../util
|
||||
${RSVG_INCLUDE_DIRS} )
|
||||
|
||||
set(SOURCES ../util/common.c
|
||||
../util/strnatcmp.c
|
||||
../config.c
|
||||
../server.c
|
||||
../launcher/apps-common.c
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_VERSION_H
|
||||
#include "version.h"
|
||||
@@ -65,6 +66,7 @@ static void menuImportDefault();
|
||||
static void menuSaveAs();
|
||||
static void menuDelete();
|
||||
static void edit_current_theme();
|
||||
static void set_current_theme();
|
||||
static void refresh_current_theme();
|
||||
static void menuAbout();
|
||||
static gboolean view_onPopupMenu(GtkWidget *treeview, gpointer userdata);
|
||||
@@ -110,6 +112,7 @@ static const char *global_ui =
|
||||
" </menubar>"
|
||||
" <toolbar name='ToolBar'>"
|
||||
" <toolitem action='ThemeProperties'/>"
|
||||
" <toolitem action='ThemeSelect'/>"
|
||||
" </toolbar>"
|
||||
" <popup name='ThemePopup'>"
|
||||
" <menuitem action='ThemeProperties'/>"
|
||||
@@ -129,7 +132,10 @@ int main(int argc, char **argv)
|
||||
GtkActionGroup *actionGroup;
|
||||
|
||||
gtk_init(&argc, &argv);
|
||||
g_thread_init((NULL));
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 31, 0)
|
||||
g_thread_init(NULL);
|
||||
#endif
|
||||
|
||||
{
|
||||
gchar *tint2_config_dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL);
|
||||
@@ -162,6 +168,7 @@ int main(int argc, char **argv)
|
||||
{"ThemeSaveAs", GTK_STOCK_SAVE_AS, _("_Save as..."), NULL, _("Save theme as"), G_CALLBACK(menuSaveAs)},
|
||||
{"ThemeDelete", GTK_STOCK_DELETE, _("_Delete"), NULL, _("Delete theme"), G_CALLBACK(menuDelete)},
|
||||
{"ThemeProperties", GTK_STOCK_PROPERTIES, _("_Edit theme..."), NULL, _("Edit selected theme"), G_CALLBACK(edit_current_theme)},
|
||||
{"ThemeSelect", GTK_STOCK_APPLY, _("_Make default"), NULL, _("Replace the default theme with the selected one"), G_CALLBACK(set_current_theme)},
|
||||
{"ThemeQuit", GTK_STOCK_QUIT, _("_Quit"), "<control>Q", _("Quit"), G_CALLBACK(gtk_main_quit)},
|
||||
{"EditMenu", NULL, _("Edit"), NULL, NULL, NULL},
|
||||
{"EditRefresh", GTK_STOCK_REFRESH, _("Refresh"), NULL, _("Refresh"), G_CALLBACK(refresh_current_theme)},
|
||||
@@ -482,6 +489,33 @@ static void edit_current_theme()
|
||||
}
|
||||
}
|
||||
|
||||
static void set_current_theme()
|
||||
{
|
||||
GtkTreeSelection *sel;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
gchar *file;
|
||||
|
||||
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view));
|
||||
if (gtk_tree_selection_get_selected(GTK_TREE_SELECTION(sel), &model, &iter)) {
|
||||
gtk_tree_model_get(model, &iter, COL_THEME_FILE, &file, -1);
|
||||
// config_read_file(file);
|
||||
|
||||
gchar *main_file = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL);
|
||||
{
|
||||
gchar *backup_path = g_strdup_printf("%s.backup.%ld", main_file, time(NULL));
|
||||
copy_file(main_file, backup_path);
|
||||
g_free(backup_path);
|
||||
}
|
||||
copy_file(file, main_file);
|
||||
int unused = system("killall -SIGUSR1 tint2 || pkill -SIGUSR1 -x tint2");
|
||||
(void)unused;
|
||||
g_free(file);
|
||||
select_first_theme();
|
||||
refresh_current_theme();
|
||||
}
|
||||
}
|
||||
|
||||
static void viewRowActivated(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
|
||||
{
|
||||
edit_current_theme();
|
||||
@@ -489,8 +523,56 @@ static void viewRowActivated(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeV
|
||||
|
||||
// ====== Theme load/reload ======
|
||||
|
||||
static void copy_default_themes()
|
||||
{
|
||||
gchar *path_home = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL);
|
||||
if (!g_file_test(path_home, G_FILE_TEST_EXISTS)) {
|
||||
const gchar * const * system_dirs = g_get_system_config_dirs();
|
||||
int i;
|
||||
for (i = 0; system_dirs[i]; i++) {
|
||||
gchar *path = g_build_filename(system_dirs[i], "tint2", "tint2rc", NULL);
|
||||
if (g_file_test(path, G_FILE_TEST_EXISTS)) {
|
||||
copy_file(path, path_home);
|
||||
}
|
||||
g_free(path);
|
||||
}
|
||||
}
|
||||
g_free(path_home);
|
||||
|
||||
const gchar * const * data_dirs = g_get_system_data_dirs();
|
||||
int i;
|
||||
for (i = 0; data_dirs[i]; i++) {
|
||||
gchar *path_tint2 = g_build_filename(data_dirs[i], "tint2", NULL);
|
||||
fprintf(stderr, "%s\n", path_tint2);
|
||||
GDir *dir = g_dir_open(path_tint2, 0, NULL);
|
||||
if (dir) {
|
||||
const gchar *file_name;
|
||||
while ((file_name = g_dir_read_name(dir))) {
|
||||
if (!g_file_test(file_name, G_FILE_TEST_IS_DIR) &&
|
||||
!strstr(file_name, "backup") &&
|
||||
!strstr(file_name, "copy") &&
|
||||
!strstr(file_name, "~") &&
|
||||
(endswith(file_name, "tint2rc") ||
|
||||
endswith(file_name, ".conf"))) {
|
||||
gchar *path_home = g_build_filename(g_get_user_config_dir(), "tint2", file_name, NULL);
|
||||
if (!g_file_test(path_home, G_FILE_TEST_EXISTS)) {
|
||||
gchar *path_usr = g_build_filename(path_tint2, file_name, NULL);
|
||||
copy_file(path_usr, path_home);
|
||||
g_free(path_usr);
|
||||
}
|
||||
g_free(path_home);
|
||||
}
|
||||
}
|
||||
g_dir_close(dir);
|
||||
}
|
||||
g_free(path_tint2);
|
||||
}
|
||||
}
|
||||
|
||||
static void load_all_themes()
|
||||
{
|
||||
copy_default_themes();
|
||||
|
||||
gtk_list_store_clear(GTK_LIST_STORE(g_store));
|
||||
|
||||
gchar *tint2_config_dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL);
|
||||
@@ -500,6 +582,7 @@ static void load_all_themes()
|
||||
return;
|
||||
}
|
||||
gboolean found_theme = FALSE;
|
||||
|
||||
const gchar *file_name;
|
||||
while ((file_name = g_dir_read_name(dir))) {
|
||||
if (!g_file_test(file_name, G_FILE_TEST_IS_DIR) &&
|
||||
@@ -515,12 +598,7 @@ static void load_all_themes()
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_theme) {
|
||||
gchar *path_tint2rc = g_build_filename (g_get_user_config_dir(), "tint2", "tint2rc", NULL);
|
||||
copy_file(get_default_config_path(), path_tint2rc);
|
||||
g_free(path_tint2rc);
|
||||
load_all_themes();
|
||||
} else {
|
||||
if (found_theme) {
|
||||
select_first_theme();
|
||||
|
||||
GtkTreeIter iter;
|
||||
|
||||
1720
src/tint2conf/po/bs.po
Normal file
1720
src/tint2conf/po/bs.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1720
src/tint2conf/po/hr.po
Normal file
1720
src/tint2conf/po/hr.po
Normal file
File diff suppressed because it is too large
Load Diff
1739
src/tint2conf/po/pl.po
Normal file
1739
src/tint2conf/po/pl.po
Normal file
File diff suppressed because it is too large
Load Diff
11
src/tint2conf/po/readme.txt
Normal file
11
src/tint2conf/po/readme.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Updating pot file:
|
||||
|
||||
find .. -name '*.c' | xargs xgettext --keyword=_ --language=C --output=updated.pot -
|
||||
|
||||
Followed by manual editing of updated.pot to make sure the header is OK. Then:
|
||||
|
||||
cat updated.pot > tint2conf.pot && rm -f updated.pot
|
||||
|
||||
Then update the po files:
|
||||
|
||||
for f in *.po ; do lang=$(basename $f .po); echo $lang ; msgmerge -i -o $lang.pox $lang.po tint2conf.pot ; cat ${lang}.pox > ${lang}.po ; rm ${lang}.pox ; done
|
||||
1719
src/tint2conf/po/sr.po
Normal file
1719
src/tint2conf/po/sr.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@
|
||||
#include "../launcher/apps-common.h"
|
||||
#include "../launcher/icon-theme-common.h"
|
||||
#include "../util/common.h"
|
||||
#include "strnatcmp.h"
|
||||
|
||||
#define ROW_SPACING 10
|
||||
#define COL_SPACING 8
|
||||
@@ -47,7 +48,7 @@ GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor;
|
||||
GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font;
|
||||
GtkWidget *taskbar_active_background, *taskbar_inactive_background;
|
||||
GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
|
||||
GtkWidget *taskbar_distribute_size, *taskbar_sort_order;
|
||||
GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment;
|
||||
|
||||
// task
|
||||
GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
|
||||
@@ -83,6 +84,7 @@ GtkWidget *task_iconified_color, *task_iconified_color_set,
|
||||
// clock
|
||||
GtkWidget *clock_format_line1, *clock_format_line2, *clock_tmz_line1, *clock_tmz_line2;
|
||||
GtkWidget *clock_left_command, *clock_right_command;
|
||||
GtkWidget *clock_mclick_command, *clock_rclick_command, *clock_uwheel_command, *clock_dwheel_command;
|
||||
GtkWidget *clock_padding_x, *clock_padding_y, *clock_font_line1, *clock_font_line2, *clock_font_color;
|
||||
GtkWidget *clock_background;
|
||||
|
||||
@@ -90,6 +92,7 @@ GtkWidget *clock_background;
|
||||
GtkWidget *battery_hide_if_higher, *battery_alert_if_lower, *battery_alert_cmd;
|
||||
GtkWidget *battery_padding_x, *battery_padding_y, *battery_font_line1, *battery_font_line2, *battery_font_color;
|
||||
GtkWidget *battery_background;
|
||||
GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command;
|
||||
|
||||
// systray
|
||||
GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing;
|
||||
@@ -1263,6 +1266,11 @@ void create_panel_items(GtkWidget *parent)
|
||||
itemsColName, _("Launcher"),
|
||||
itemsColValue, "L",
|
||||
-1);
|
||||
gtk_list_store_append(all_items, &iter);
|
||||
gtk_list_store_set(all_items, &iter,
|
||||
itemsColName, _("Free space"),
|
||||
itemsColValue, "F",
|
||||
-1);
|
||||
|
||||
panel_items_view = gtk_tree_view_new();
|
||||
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(panel_items_view),
|
||||
@@ -1441,6 +1449,9 @@ void set_panel_items(const char *items)
|
||||
} else if (v == 'L') {
|
||||
value = "L";
|
||||
name = _("Launcher");
|
||||
} else if (v == 'F') {
|
||||
value = "F";
|
||||
name = _("Free space");
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
@@ -1761,23 +1772,84 @@ void load_desktop_file(const char *file, gboolean selected)
|
||||
free_desktop_entry(&entry);
|
||||
}
|
||||
|
||||
void load_desktop_files(const gchar *path)
|
||||
void populate_from_entries(GList *entries, gboolean selected)
|
||||
{
|
||||
GList *l;
|
||||
for (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,
|
||||
appsColText, g_strdup(entry->name),
|
||||
appsColPath, g_strdup(entry->path),
|
||||
appsColIconName, g_strdup(entry->icon),
|
||||
-1);
|
||||
if (pixbuf)
|
||||
g_object_unref(pixbuf);
|
||||
}
|
||||
}
|
||||
|
||||
static gint compare_entries(gconstpointer a, gconstpointer b)
|
||||
{
|
||||
return strnatcasecmp(((DesktopEntry*)a)->name, ((DesktopEntry*)b)->name);
|
||||
}
|
||||
|
||||
void load_desktop_entry(const char *file, GList **entries)
|
||||
{
|
||||
DesktopEntry *entry = calloc(1, sizeof(DesktopEntry));
|
||||
if (!read_desktop_file(file, entry))
|
||||
printf("Could not load %s\n", file);
|
||||
if (!entry->name)
|
||||
entry->name = strdup(file);
|
||||
if (!entry->icon)
|
||||
entry->icon = strdup("");
|
||||
*entries = g_list_append(*entries, entry);
|
||||
}
|
||||
|
||||
static gint compare_strings(gconstpointer a, gconstpointer b)
|
||||
{
|
||||
return strnatcasecmp((const char*)a, (const char*)b);
|
||||
}
|
||||
|
||||
void load_desktop_entries(const char *path, GList **entries)
|
||||
{
|
||||
GList *subdirs = NULL;
|
||||
GList *files = NULL;
|
||||
|
||||
GDir *d = g_dir_open(path, 0, NULL);
|
||||
if (!d)
|
||||
return;
|
||||
const gchar *name;
|
||||
while ((name = g_dir_read_name(d))) {
|
||||
gchar *file = g_build_filename(path, name, NULL);
|
||||
if (!g_file_test(file, G_FILE_TEST_IS_DIR) &&
|
||||
g_str_has_suffix(file, ".desktop")) {
|
||||
load_desktop_file(file, FALSE);
|
||||
} else if (g_file_test(file, G_FILE_TEST_IS_DIR)) {
|
||||
load_desktop_files(file);
|
||||
if (d) {
|
||||
const gchar *name;
|
||||
while ((name = g_dir_read_name(d))) {
|
||||
gchar *file = g_build_filename(path, name, NULL);
|
||||
if (!g_file_test(file, G_FILE_TEST_IS_DIR) && g_str_has_suffix(file, ".desktop")) {
|
||||
files = g_list_append(files, file);
|
||||
} else if (g_file_test(file, G_FILE_TEST_IS_DIR)) {
|
||||
subdirs = g_list_append(subdirs, file);
|
||||
} else {
|
||||
g_free(file);
|
||||
}
|
||||
}
|
||||
g_dir_close(d);
|
||||
}
|
||||
|
||||
subdirs = g_list_sort(subdirs, compare_strings);
|
||||
GList *l;
|
||||
for (l = subdirs; l; l = g_list_next(l)) {
|
||||
gchar *dir = (gchar *)l->data;
|
||||
load_desktop_entries(dir, entries);
|
||||
g_free(dir);
|
||||
}
|
||||
g_list_free(subdirs);
|
||||
|
||||
files = g_list_sort(files, compare_strings);
|
||||
for (l = files; l; l = g_list_next(l)) {
|
||||
gchar *file = (gchar *)l->data;
|
||||
load_desktop_entry(file, entries);
|
||||
g_free(file);
|
||||
}
|
||||
g_dir_close(d);
|
||||
g_list_free(files);
|
||||
}
|
||||
|
||||
void load_theme_file(const char *file_name, const char *theme)
|
||||
@@ -2207,10 +2279,20 @@ void create_launcher(GtkWidget *parent)
|
||||
fprintf(stderr, "Icon themes loaded\n");
|
||||
|
||||
fprintf(stderr, "Loading .desktop files\n");
|
||||
load_desktop_files("/usr/share/applications");
|
||||
load_desktop_files("/usr/local/share/applications");
|
||||
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_files(path);
|
||||
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) {
|
||||
free_desktop_entry((DesktopEntry*)l->data);
|
||||
}
|
||||
g_list_free(entries);
|
||||
|
||||
g_free(path);
|
||||
|
||||
icon_theme_changed();
|
||||
@@ -2317,6 +2399,24 @@ void create_taskbar(GtkWidget *parent)
|
||||
"'By title' means that tasks are sorted by their window titles. \n"
|
||||
"'By center' means that tasks are sorted geometrically by their window centers."), NULL);
|
||||
|
||||
row++;
|
||||
col = 2;
|
||||
label = gtk_label_new(_("Task alignment"));
|
||||
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++;
|
||||
|
||||
taskbar_alignment = gtk_combo_box_new_text();
|
||||
gtk_widget_show(taskbar_alignment);
|
||||
gtk_table_attach(GTK_TABLE(table), taskbar_alignment, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_alignment), _("Left"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_alignment), _("Center"));
|
||||
gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_alignment), _("Right"));
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_alignment), 0);
|
||||
gtk_tooltips_set_tip(tooltips, taskbar_alignment, _("Specifies how tasks should be positioned on the taskbar."), NULL);
|
||||
|
||||
change_paragraph(parent);
|
||||
|
||||
label = gtk_label_new(_("<b>Appearance</b>"));
|
||||
@@ -3218,7 +3318,7 @@ void create_clock(GtkWidget *parent)
|
||||
gtk_widget_show(label);
|
||||
gtk_box_pack_start(GTK_BOX(parent), label, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new(2, 10, FALSE);
|
||||
table = gtk_table_new(5, 10, FALSE);
|
||||
gtk_widget_show(table);
|
||||
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
|
||||
@@ -3254,6 +3354,51 @@ void create_clock(GtkWidget *parent)
|
||||
gtk_tooltips_set_tip(tooltips, clock_right_command,
|
||||
_("Specifies a command that will be executed when the clock receives a right click."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Middle click command"));
|
||||
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++;
|
||||
|
||||
clock_mclick_command = gtk_entry_new();
|
||||
gtk_widget_show(clock_mclick_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(clock_mclick_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), clock_mclick_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, clock_mclick_command,
|
||||
_("Specifies a command that will be executed when the clock receives a middle click."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Wheel scroll up command"));
|
||||
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++;
|
||||
|
||||
clock_uwheel_command = gtk_entry_new();
|
||||
gtk_widget_show(clock_uwheel_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(clock_uwheel_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), clock_uwheel_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, clock_uwheel_command,
|
||||
_("Specifies a command that will be executed when the clock receives a mouse scroll up."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Wheel scroll down command"));
|
||||
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++;
|
||||
|
||||
clock_dwheel_command = gtk_entry_new();
|
||||
gtk_widget_show(clock_dwheel_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(clock_dwheel_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), clock_dwheel_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, clock_dwheel_command,
|
||||
_("Specifies a command that will be executed when the clock receives a mouse scroll down."), NULL);
|
||||
|
||||
change_paragraph(parent);
|
||||
|
||||
label = gtk_label_new(_("<b>Appearance</b>"));
|
||||
@@ -3671,6 +3816,95 @@ void create_battery(GtkWidget *parent)
|
||||
|
||||
change_paragraph(parent);
|
||||
|
||||
label = gtk_label_new(_("<b>Mouse events</b>"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
||||
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
|
||||
gtk_widget_show(label);
|
||||
gtk_box_pack_start(GTK_BOX(parent), label, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new(5, 10, FALSE);
|
||||
gtk_widget_show(table);
|
||||
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING);
|
||||
row = 0, col = 2;
|
||||
|
||||
label = gtk_label_new(_("Left click command"));
|
||||
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++;
|
||||
|
||||
battery_left_command = gtk_entry_new();
|
||||
gtk_widget_show(battery_left_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(battery_left_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), battery_left_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, battery_left_command,
|
||||
_("Specifies a command that will be executed when the battery receives a left click."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Right click command"));
|
||||
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++;
|
||||
|
||||
battery_right_command = gtk_entry_new();
|
||||
gtk_widget_show(battery_right_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(battery_right_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), battery_right_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, battery_right_command,
|
||||
_("Specifies a command that will be executed when the battery receives a right click."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Middle click command"));
|
||||
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++;
|
||||
|
||||
battery_mclick_command = gtk_entry_new();
|
||||
gtk_widget_show(battery_mclick_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(battery_mclick_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), battery_mclick_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, battery_mclick_command,
|
||||
_("Specifies a command that will be executed when the battery receives a middle click."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Wheel scroll up command"));
|
||||
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++;
|
||||
|
||||
battery_uwheel_command = gtk_entry_new();
|
||||
gtk_widget_show(battery_uwheel_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(battery_uwheel_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), battery_uwheel_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, battery_uwheel_command,
|
||||
_("Specifies a command that will be executed when the battery receives a mouse scroll up."), NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Wheel scroll down command"));
|
||||
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++;
|
||||
|
||||
battery_dwheel_command = gtk_entry_new();
|
||||
gtk_widget_show(battery_dwheel_command);
|
||||
gtk_entry_set_width_chars(GTK_ENTRY(battery_dwheel_command), 50);
|
||||
gtk_table_attach(GTK_TABLE(table), battery_dwheel_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_tooltips_set_tip(tooltips, battery_dwheel_command,
|
||||
_("Specifies a command that will be executed when the battery receives a mouse scroll down."), NULL);
|
||||
|
||||
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);
|
||||
|
||||
@@ -51,7 +51,7 @@ extern GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor;
|
||||
extern GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font;
|
||||
extern GtkWidget *taskbar_active_background, *taskbar_inactive_background;
|
||||
extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
|
||||
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order;
|
||||
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment;
|
||||
|
||||
// task
|
||||
extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
|
||||
@@ -87,6 +87,7 @@ extern GtkWidget *task_iconified_color, *task_iconified_color_set,
|
||||
// clock
|
||||
extern GtkWidget *clock_format_line1, *clock_format_line2, *clock_tmz_line1, *clock_tmz_line2;
|
||||
extern GtkWidget *clock_left_command, *clock_right_command;
|
||||
extern GtkWidget *clock_mclick_command, *clock_rclick_command, *clock_uwheel_command, *clock_dwheel_command;
|
||||
extern GtkWidget *clock_padding_x, *clock_padding_y, *clock_font_line1, *clock_font_line2, *clock_font_color;
|
||||
extern GtkWidget *clock_background;
|
||||
|
||||
@@ -94,6 +95,7 @@ extern GtkWidget *clock_background;
|
||||
extern GtkWidget *battery_hide_if_higher, *battery_alert_if_lower, *battery_alert_cmd;
|
||||
extern GtkWidget *battery_padding_x, *battery_padding_y, *battery_font_line1, *battery_font_line2, *battery_font_color;
|
||||
extern GtkWidget *battery_background;
|
||||
extern GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command;
|
||||
|
||||
// systray
|
||||
extern GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing;
|
||||
|
||||
@@ -272,6 +272,16 @@ void config_write_taskbar(FILE *fp)
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(fp, "task_align = ");
|
||||
if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_alignment)) <= 0) {
|
||||
fprintf(fp, "left");
|
||||
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_alignment)) == 1) {
|
||||
fprintf(fp, "center");
|
||||
} else {
|
||||
fprintf(fp, "right");
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
|
||||
@@ -501,7 +511,7 @@ void config_write_launcher(FILE *fp)
|
||||
g_strstrip(dir);
|
||||
if (strlen(dir) > 0) {
|
||||
char *contracted = contract_tilde(dir);
|
||||
fprintf(fp, "launcher_item_app = %s\n", contracted);
|
||||
fprintf(fp, "launcher_apps_dir = %s\n", contracted);
|
||||
free(contracted);
|
||||
}
|
||||
}
|
||||
@@ -538,6 +548,9 @@ void config_write_clock(FILE *fp)
|
||||
fprintf(fp, "clock_tooltip_timezone = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_tmz_tooltip)));
|
||||
fprintf(fp, "clock_lclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_left_command)));
|
||||
fprintf(fp, "clock_rclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_right_command)));
|
||||
fprintf(fp, "clock_mclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_mclick_command)));
|
||||
fprintf(fp, "clock_uwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_uwheel_command)));
|
||||
fprintf(fp, "clock_dwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_dwheel_command)));
|
||||
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
@@ -563,6 +576,11 @@ void config_write_battery(FILE *fp)
|
||||
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(battery_padding_y)));
|
||||
fprintf(fp, "battery_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(battery_background)));
|
||||
fprintf(fp, "battery_hide = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(battery_hide_if_higher)));
|
||||
fprintf(fp, "battery_lclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_left_command)));
|
||||
fprintf(fp, "battery_rclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_right_command)));
|
||||
fprintf(fp, "battery_mclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_mclick_command)));
|
||||
fprintf(fp, "battery_uwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_uwheel_command)));
|
||||
fprintf(fp, "battery_dwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_dwheel_command)));
|
||||
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
@@ -737,7 +755,7 @@ void add_entry(char *key, char *value)
|
||||
else if (strcmp(key, "panel_margin") == 0) {
|
||||
extract_values(value, &value1, &value2, &value3);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_margin_x), atoi(value1));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_margin_y), atoi(value1));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_margin_y), atoi(value2));
|
||||
}
|
||||
else if (strcmp(key, "panel_padding") == 0) {
|
||||
extract_values(value, &value1, &value2, &value3);
|
||||
@@ -838,20 +856,18 @@ void add_entry(char *key, char *value)
|
||||
else if (strcmp(key, "panel_monitor") == 0) {
|
||||
if (strcmp(value, "all") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 0);
|
||||
else if (strcmp(value, "0") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 1);
|
||||
else if (strcmp(value, "1") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 2);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 1);
|
||||
else if (strcmp(value, "2") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 3);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 2);
|
||||
else if (strcmp(value, "3") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 4);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 3);
|
||||
else if (strcmp(value, "4") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 5);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 4);
|
||||
else if (strcmp(value, "5") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 6);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 5);
|
||||
else if (strcmp(value, "6") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 7);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 6);
|
||||
}
|
||||
|
||||
/* autohide options */
|
||||
@@ -882,7 +898,7 @@ void add_entry(char *key, char *value)
|
||||
}
|
||||
|
||||
/* Battery */
|
||||
else if (strcmp(key, "systray") == 0) {
|
||||
else if (strcmp(key, "battery") == 0) {
|
||||
// Obsolete option
|
||||
config_has_battery = 1;
|
||||
config_battery_enabled = atoi(value);
|
||||
@@ -925,6 +941,21 @@ void add_entry(char *key, char *value)
|
||||
else
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(battery_hide_if_higher), atoi(value));
|
||||
}
|
||||
else if (strcmp(key, "battery_lclick_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(battery_left_command), value);
|
||||
}
|
||||
else if (strcmp(key, "battery_rclick_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(battery_right_command), value);
|
||||
}
|
||||
else if (strcmp(key, "battery_mclick_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(battery_mclick_command), value);
|
||||
}
|
||||
else if (strcmp(key, "battery_uwheel_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(battery_uwheel_command), value);
|
||||
}
|
||||
else if (strcmp(key, "battery_dwheel_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(battery_dwheel_command), value);
|
||||
}
|
||||
|
||||
/* Clock */
|
||||
else if (strcmp(key, "time1_format") == 0) {
|
||||
@@ -977,6 +1008,15 @@ void add_entry(char *key, char *value)
|
||||
else if (strcmp(key, "clock_rclick_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(clock_right_command), value);
|
||||
}
|
||||
else if (strcmp(key, "clock_mclick_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(clock_mclick_command), value);
|
||||
}
|
||||
else if (strcmp(key, "clock_uwheel_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(clock_uwheel_command), value);
|
||||
}
|
||||
else if (strcmp(key, "clock_dwheel_command") == 0) {
|
||||
gtk_entry_set_text(GTK_ENTRY(clock_dwheel_command), value);
|
||||
}
|
||||
|
||||
/* Taskbar */
|
||||
else if (strcmp(key, "taskbar_mode") == 0) {
|
||||
@@ -998,6 +1038,16 @@ void add_entry(char *key, char *value)
|
||||
else
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
|
||||
}
|
||||
else if (strcmp(key, "task_align") == 0) {
|
||||
if (strcmp(value, "left") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_alignment), 0);
|
||||
else if (strcmp(value, "center") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_alignment), 1);
|
||||
else if (strcmp(value, "right") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_alignment), 2);
|
||||
else
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_alignment), 0);
|
||||
}
|
||||
else if (strcmp(key, "taskbar_padding") == 0) {
|
||||
extract_values(value, &value1, &value2, &value3);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_padding_x), atoi(value1));
|
||||
@@ -1414,4 +1464,4 @@ char *get_action(GtkWidget *combo)
|
||||
if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 10)
|
||||
return "prev_task";
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
|
||||
#include "main.h"
|
||||
#include "strnatcmp.h"
|
||||
#include "theme_view.h"
|
||||
|
||||
// The data columns that we export via the tree model interface
|
||||
@@ -27,6 +28,11 @@ GtkListStore *g_store;
|
||||
int g_width_list, g_height_list;
|
||||
GtkCellRenderer *g_renderer;
|
||||
|
||||
gint theme_name_compare(GtkTreeModel *model,
|
||||
GtkTreeIter *a,
|
||||
GtkTreeIter *b,
|
||||
gpointer user_data);
|
||||
|
||||
GtkWidget *create_view()
|
||||
{
|
||||
GtkTreeViewColumn *col;
|
||||
@@ -69,21 +75,50 @@ GtkWidget *create_view()
|
||||
GtkTreeSortable *sortable;
|
||||
sortable = GTK_TREE_SORTABLE(g_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)
|
||||
{
|
||||
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);
|
||||
gchar *name_a = path_a;
|
||||
gchar *p;
|
||||
for (p = name_a; *p; p++) {
|
||||
if (*p == '/')
|
||||
name_a = p + 1;
|
||||
}
|
||||
gchar *name_b = path_b;
|
||||
for (p = name_b; *p; p++) {
|
||||
if (*p == '/')
|
||||
name_b = p + 1;
|
||||
}
|
||||
if (g_str_equal(name_a, name_b))
|
||||
return 0;
|
||||
if (g_str_equal(name_a, "tint2rc"))
|
||||
return -1;
|
||||
if (g_str_equal(name_b, "tint2rc"))
|
||||
return 1;
|
||||
gint result = strnatcasecmp(name_a, name_b);
|
||||
g_free(path_a);
|
||||
g_free(path_b);
|
||||
return result;
|
||||
}
|
||||
|
||||
void custom_list_append(const gchar *name)
|
||||
void custom_list_append(const gchar *path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_list_store_append(g_store, &iter);
|
||||
gtk_list_store_set(g_store, &iter, COL_THEME_FILE, name, -1);
|
||||
gtk_list_store_set(g_store, &iter, COL_THEME_FILE, path, -1);
|
||||
|
||||
gchar *b, *n;
|
||||
b = strrchr(name, '/');
|
||||
n = g_strdup(b+1);
|
||||
gtk_list_store_set(g_store, &iter, COL_THEME_NAME, n, -1);
|
||||
gchar *name = g_strdup(strrchr(path, '/') + 1);
|
||||
gtk_list_store_set(g_store, &iter, COL_THEME_NAME, name, -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ enum { COL_THEME_FILE = 0, COL_THEME_NAME, COL_SNAPSHOT, NB_COL, };
|
||||
|
||||
GtkWidget *create_view();
|
||||
|
||||
void custom_list_append(const gchar *name);
|
||||
void custom_list_append(const gchar *path);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Name[nb]=Panelbehandler
|
||||
Name[nl]=Paneel Manager
|
||||
Name[nn]=Panelhandsamar
|
||||
Name[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
|
||||
Name[pl]=Panel
|
||||
Name[pl]=Ustawienia panelu
|
||||
Name[pt]=Gestor do Painel
|
||||
Name[pt_BR]=Gerenciador do painel
|
||||
Name[ro]=Manager de panouri
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -259,7 +259,7 @@ void tooltip_update()
|
||||
}
|
||||
|
||||
|
||||
void tooltip_trigger_hide(Tooltip* tooltip)
|
||||
void tooltip_trigger_hide()
|
||||
{
|
||||
if (g_tooltip.mapped) {
|
||||
tooltip_copy_text(0);
|
||||
|
||||
165
src/util/area.c
165
src/util/area.c
@@ -76,7 +76,7 @@ void init_rendering(void *obj, int pos)
|
||||
Area *a = (Area*)obj;
|
||||
|
||||
// initialize fixed position/size
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = a->list; l ; l = l->next) {
|
||||
Area *child = ((Area*)l->data);
|
||||
if (panel_horizontal) {
|
||||
@@ -102,7 +102,7 @@ void rendering(void *obj)
|
||||
Panel *panel = (Panel*)obj;
|
||||
|
||||
size_by_content(&panel->area);
|
||||
size_by_layout(&panel->area, 0, 1);
|
||||
size_by_layout(&panel->area, 1);
|
||||
|
||||
refresh(&panel->area);
|
||||
}
|
||||
@@ -111,10 +111,11 @@ void rendering(void *obj)
|
||||
void size_by_content (Area *a)
|
||||
{
|
||||
// don't resize hiden objects
|
||||
if (!a->on_screen) return;
|
||||
if (!a->on_screen)
|
||||
return;
|
||||
|
||||
// children node are resized before its parent
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = a->list; l ; l = l->next)
|
||||
size_by_content(l->data);
|
||||
|
||||
@@ -134,14 +135,15 @@ void size_by_content (Area *a)
|
||||
}
|
||||
|
||||
|
||||
void size_by_layout (Area *a, int pos, int level)
|
||||
void size_by_layout (Area *a, int level)
|
||||
{
|
||||
// don't resize hiden objects
|
||||
if (!a->on_screen) return;
|
||||
if (!a->on_screen)
|
||||
return;
|
||||
|
||||
// parent node is resized before its children
|
||||
// calculate area's size
|
||||
GSList *l;
|
||||
GList *l;
|
||||
if (a->resize && a->size_mode == SIZE_BY_LAYOUT) {
|
||||
a->resize = 0;
|
||||
|
||||
@@ -156,40 +158,103 @@ void size_by_layout (Area *a, int pos, int level)
|
||||
}
|
||||
}
|
||||
|
||||
// update position of childs
|
||||
pos += a->paddingxlr + a->bg->border.width;
|
||||
int i=0;
|
||||
for (l = a->list; l ; l = l->next) {
|
||||
Area *child = ((Area*)l->data);
|
||||
if (!child->on_screen) continue;
|
||||
i++;
|
||||
|
||||
if (panel_horizontal) {
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->on_changed = 1;
|
||||
// update position of children
|
||||
if (a->list) {
|
||||
if (a->alignment == ALIGN_LEFT) {
|
||||
int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr;
|
||||
|
||||
for (l = a->list; l ; l = l->next) {
|
||||
Area *child = ((Area*)l->data);
|
||||
if (!child->on_screen)
|
||||
continue;
|
||||
|
||||
if (panel_horizontal) {
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
} else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
size_by_layout(child, level+1);
|
||||
|
||||
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;
|
||||
|
||||
for (l = g_list_last(a->list); l ; l = l->prev) {
|
||||
Area *child = ((Area*)l->data);
|
||||
if (!child->on_screen)
|
||||
continue;
|
||||
|
||||
pos -= panel_horizontal ? child->width : child->height;
|
||||
|
||||
if (panel_horizontal) {
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
} else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
size_by_layout(child, level+1);
|
||||
|
||||
pos -= a->paddingx;
|
||||
}
|
||||
} else if (a->alignment == ALIGN_CENTER) {
|
||||
|
||||
int children_size = 0;
|
||||
|
||||
for (l = a->list; l ; l = l->next) {
|
||||
Area *child = ((Area*)l->data);
|
||||
if (!child->on_screen)
|
||||
continue;
|
||||
|
||||
children_size += panel_horizontal ? child->width : child->height;
|
||||
children_size += (l == a->list) ? 0 : a->paddingx;
|
||||
}
|
||||
|
||||
int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr;
|
||||
pos += ((panel_horizontal ? a->width : a->height) - children_size) / 2;
|
||||
|
||||
for (l = a->list; l ; l = l->next) {
|
||||
Area *child = ((Area*)l->data);
|
||||
if (!child->on_screen)
|
||||
continue;
|
||||
|
||||
if (panel_horizontal) {
|
||||
if (pos != child->posx) {
|
||||
// pos changed => redraw
|
||||
child->posx = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
} else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
size_by_layout(child, level+1);
|
||||
|
||||
pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pos != child->posy) {
|
||||
// pos changed => redraw
|
||||
child->posy = pos;
|
||||
child->on_changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*// position of each visible object
|
||||
int k;
|
||||
for (k=0 ; k < level ; k++) printf(" ");
|
||||
printf("tree level %d, object %d, pos %d, %s\n", level, i, pos, (child->size_mode == SIZE_BY_LAYOUT) ? "SIZE_BY_LAYOUT" : "SIZE_BY_CONTENT");*/
|
||||
size_by_layout(child, pos, level+1);
|
||||
|
||||
if (panel_horizontal)
|
||||
pos += child->width + a->paddingx;
|
||||
else
|
||||
pos += child->height + a->paddingx;
|
||||
}
|
||||
}
|
||||
|
||||
if (a->on_changed) {
|
||||
// pos/size changed
|
||||
@@ -209,7 +274,7 @@ void refresh (Area *a)
|
||||
if (a->redraw) {
|
||||
a->redraw = 0;
|
||||
// force redraw of child
|
||||
//GSList *l;
|
||||
//GList *l;
|
||||
//for (l = a->list ; l ; l = l->next)
|
||||
//((Area*)l->data)->redraw = 1;
|
||||
|
||||
@@ -222,7 +287,7 @@ void refresh (Area *a)
|
||||
XCopyArea (server.dsp, a->pix, ((Panel *)a->panel)->temp_pmap, server.gc, 0, 0, a->width, a->height, a->posx, a->posy);
|
||||
|
||||
// and then refresh child object
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = a->list; l ; l = l->next)
|
||||
refresh(l->data);
|
||||
}
|
||||
@@ -236,7 +301,7 @@ int resize_by_layout(void *obj, int maximum_size)
|
||||
if (panel_horizontal) {
|
||||
// detect free size for SIZE_BY_LAYOUT's Area
|
||||
size = a->width - (2 * (a->paddingxlr + a->bg->border.width));
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = a->list ; l ; l = l->next) {
|
||||
child = (Area*)l->data;
|
||||
if (child->on_screen && child->size_mode == SIZE_BY_CONTENT) {
|
||||
@@ -278,7 +343,7 @@ int resize_by_layout(void *obj, int maximum_size)
|
||||
else {
|
||||
// detect free size for SIZE_BY_LAYOUT's Area
|
||||
size = a->height - (2 * (a->paddingxlr + a->bg->border.width));
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = a->list ; l ; l = l->next) {
|
||||
child = (Area*)l->data;
|
||||
if (child->on_screen && child->size_mode == SIZE_BY_CONTENT) {
|
||||
@@ -291,7 +356,7 @@ int resize_by_layout(void *obj, int maximum_size)
|
||||
if (nb_by_content+nb_by_layout)
|
||||
size -= ((nb_by_content+nb_by_layout-1) * a->paddingx);
|
||||
|
||||
int height=0, modulo=0, old_height;
|
||||
int height=0, modulo=0;
|
||||
if (nb_by_layout) {
|
||||
height = size / nb_by_layout;
|
||||
modulo = size % nb_by_layout;
|
||||
@@ -305,7 +370,7 @@ int resize_by_layout(void *obj, int maximum_size)
|
||||
for (l = a->list ; l ; l = l->next) {
|
||||
child = (Area*)l->data;
|
||||
if (child->on_screen && child->size_mode == SIZE_BY_LAYOUT) {
|
||||
old_height = child->height;
|
||||
int old_height = child->height;
|
||||
child->height = height;
|
||||
if (modulo) {
|
||||
child->height++;
|
||||
@@ -324,7 +389,7 @@ void set_redraw (Area *a)
|
||||
{
|
||||
a->redraw = 1;
|
||||
|
||||
GSList *l;
|
||||
GList *l;
|
||||
for (l = a->list ; l ; l = l->next)
|
||||
set_redraw(l->data);
|
||||
}
|
||||
@@ -438,7 +503,7 @@ void remove_area (Area *a)
|
||||
{
|
||||
Area *parent = (Area*)a->parent;
|
||||
|
||||
parent->list = g_slist_remove(parent->list, a);
|
||||
parent->list = g_list_remove(parent->list, a);
|
||||
set_redraw (parent);
|
||||
|
||||
}
|
||||
@@ -448,7 +513,7 @@ void add_area (Area *a)
|
||||
{
|
||||
Area *parent = (Area*)a->parent;
|
||||
|
||||
parent->list = g_slist_append(parent->list, a);
|
||||
parent->list = g_list_append(parent->list, a);
|
||||
set_redraw (parent);
|
||||
|
||||
}
|
||||
@@ -459,12 +524,12 @@ void free_area (Area *a)
|
||||
if (!a)
|
||||
return;
|
||||
|
||||
GSList *l0;
|
||||
GList *l0;
|
||||
for (l0 = a->list; l0 ; l0 = l0->next)
|
||||
free_area (l0->data);
|
||||
|
||||
if (a->list) {
|
||||
g_slist_free(a->list);
|
||||
g_list_free(a->list);
|
||||
a->list = 0;
|
||||
}
|
||||
if (a->pix) {
|
||||
|
||||
@@ -51,6 +51,7 @@ typedef struct
|
||||
// SIZE_BY_LAYOUT objects : taskbar and task
|
||||
// SIZE_BY_CONTENT objects : clock, battery, launcher, systray
|
||||
enum { SIZE_BY_LAYOUT, SIZE_BY_CONTENT };
|
||||
enum { ALIGN_LEFT = 0, ALIGN_CENTER = 1, ALIGN_RIGHT = 2 };
|
||||
|
||||
typedef struct {
|
||||
// coordinate relative to panel window
|
||||
@@ -61,13 +62,15 @@ typedef struct {
|
||||
Background *bg;
|
||||
|
||||
// list of child : Area object
|
||||
GSList *list;
|
||||
GList *list;
|
||||
|
||||
// object visible on screen.
|
||||
// An object (like systray) could be enabled but hidden (because no tray icon).
|
||||
int on_screen;
|
||||
// way to calculate the size (SIZE_BY_CONTENT or SIZE_BY_LAYOUT)
|
||||
int size_mode;
|
||||
|
||||
int alignment;
|
||||
// need to calculate position and width
|
||||
int resize;
|
||||
// need redraw Pixmap
|
||||
@@ -96,7 +99,7 @@ void init_rendering(void *obj, int pos);
|
||||
|
||||
void rendering(void *obj);
|
||||
void size_by_content (Area *a);
|
||||
void size_by_layout (Area *a, int pos, int level);
|
||||
void size_by_layout (Area *a, int level);
|
||||
// draw background and foreground
|
||||
void refresh (Area *a);
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
|
||||
void copy_file(const char *pathSrc, const char *pathDest)
|
||||
{
|
||||
if (g_str_equal(pathSrc, pathDest))
|
||||
return;
|
||||
|
||||
FILE *fileSrc, *fileDest;
|
||||
char buffer[100];
|
||||
int nb;
|
||||
@@ -117,13 +120,13 @@ char *contract_tilde(char *s)
|
||||
if (!home)
|
||||
return strdup(s);
|
||||
|
||||
char *home_slash = calloc(strlen(home) + 1, 1);
|
||||
char *home_slash = calloc(strlen(home) + 2, 1);
|
||||
strcat(home_slash, home);
|
||||
strcat(home_slash, "/");
|
||||
|
||||
if ((strcmp(s, home) == 0 ||
|
||||
strstr(s, home_slash) == s)) {
|
||||
char *result = calloc(strlen(s) - strlen(home) + 1, 1);
|
||||
char *result = calloc(strlen(s) - strlen(home) + 2, 1);
|
||||
strcat(result, "~");
|
||||
strcat(result, s + strlen(home));
|
||||
free(home_slash);
|
||||
@@ -362,9 +365,52 @@ void createHeuristicMask(DATA32* data, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
int pixelEmpty(DATA32 argb)
|
||||
{
|
||||
|
||||
DATA32 a = (argb >> 24) & 0xff;
|
||||
if (a == 0)
|
||||
return 1;
|
||||
|
||||
DATA32 rgb = argb & 0xffFFff;
|
||||
return rgb == 0;
|
||||
}
|
||||
|
||||
int imageEmpty(DATA32* data, int w, int h)
|
||||
{
|
||||
unsigned int x, y;
|
||||
|
||||
if (w > 0 && h > 0) {
|
||||
x = w / 2;
|
||||
y = h / 2;
|
||||
if (!pixelEmpty(data[y * w + x])) {
|
||||
//fprintf(stderr, "Non-empty pixel: [%u, %u] = %x\n", x, y, data[y * w + x]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (y = 0; y < h; y++) {
|
||||
for (x = 0; x < w; x++) {
|
||||
if (!pixelEmpty(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) {
|
||||
imlib_context_set_blend(1);
|
||||
imlib_context_set_drawable(d);
|
||||
imlib_render_image_on_drawable(x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
int w = imlib_image_get_width(), h = imlib_image_get_height();
|
||||
|
||||
Pixmap pixmap = XCreatePixmap(server.dsp, server.root_win, w, h, 32);
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
#include <pango/pangocairo.h>
|
||||
#include "area.h"
|
||||
|
||||
#define GREEN "\033[1;32m"
|
||||
#define YELLOW "\033[1;33m"
|
||||
#define RED "\033[31m"
|
||||
#define BLUE "\033[1;34m"
|
||||
#define RESET "\033[0m"
|
||||
|
||||
/*
|
||||
void fxfree(void** ptr){
|
||||
if(*ptr){
|
||||
@@ -62,6 +68,7 @@ void extract_values (const char *value, char **value1, char **value2, char **val
|
||||
// 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);
|
||||
void createHeuristicMask(DATA32* data, int w, int h);
|
||||
int imageEmpty(DATA32* data, int w, int h);
|
||||
|
||||
void render_image(Drawable d, int x, int y);
|
||||
|
||||
|
||||
@@ -49,9 +49,7 @@ struct _timeout {
|
||||
|
||||
void add_timeout_intern(int value_msec, int interval_msec, void(*_callback)(void*), void* arg, timeout* t);
|
||||
gint compare_timeouts(gconstpointer t1, gconstpointer t2);
|
||||
gint compare_timespecs(const struct timespec* t1, const struct timespec* t2);
|
||||
int timespec_subtract(struct timespec* result, struct timespec* x, struct timespec* y);
|
||||
struct timespec add_msec_to_timespec(struct timespec ts, int msec);
|
||||
|
||||
|
||||
int align_with_existing_timeouts(timeout* t);
|
||||
@@ -395,8 +393,13 @@ void callback_multi_timeout(void* arg)
|
||||
timeout* t = it->data;
|
||||
if (++t->multi_timeout->current_count >= t->multi_timeout->count_to_expiration) {
|
||||
t->_callback(t->arg);
|
||||
t->multi_timeout->current_count = 0;
|
||||
t->timeout_expires = add_msec_to_timespec(cur_time, t->interval_msec);
|
||||
if (multi_timeouts && g_hash_table_lookup(multi_timeouts, t)) {
|
||||
// Timer still exists
|
||||
t->multi_timeout->current_count = 0;
|
||||
t->timeout_expires = add_msec_to_timespec(cur_time, t->interval_msec);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
it = it->next;
|
||||
}
|
||||
@@ -447,3 +450,16 @@ void stop_multi_timeout(timeout* t)
|
||||
}
|
||||
free(mth);
|
||||
}
|
||||
|
||||
double profiling_get_time_old_time = 0;
|
||||
double profiling_get_time()
|
||||
{
|
||||
struct timespec cur_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &cur_time);
|
||||
double t = cur_time.tv_sec + cur_time.tv_nsec * 1.0e-9;
|
||||
if (profiling_get_time_old_time == 0)
|
||||
profiling_get_time_old_time = t;
|
||||
double delta = t - profiling_get_time_old_time;
|
||||
profiling_get_time_old_time = t;
|
||||
return delta;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#define TIMER_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
extern struct timeval next_timeout;
|
||||
|
||||
@@ -66,4 +68,14 @@ void update_next_timeout();
|
||||
/** Callback of all expired timeouts **/
|
||||
void callback_timeout_expired();
|
||||
|
||||
/** Returns -1 if t1 < t2, 0 if t1 == t2, 1 if t1 > t2 **/
|
||||
gint compare_timespecs(const struct timespec* t1, const struct timespec* t2);
|
||||
|
||||
struct timespec add_msec_to_timespec(struct timespec ts, int msec);
|
||||
|
||||
/** Returns the time difference in seconds between the current time and the last time this function was called.
|
||||
* At the first call returns zero.
|
||||
**/
|
||||
double profiling_get_time();
|
||||
|
||||
#endif // TIMER_H
|
||||
|
||||
@@ -131,17 +131,28 @@ int window_get_monitor (Window win)
|
||||
Window src;
|
||||
|
||||
XTranslateCoordinates(server.dsp, win, server.root_win, 0, 0, &x, &y, &src);
|
||||
x += 2;
|
||||
y += 2;
|
||||
int best_match = -1;
|
||||
int match_right = 0;
|
||||
int match_bottom = 0;
|
||||
// There is an ambiguity when a window is right on the edge between screens.
|
||||
// In that case, prefer the monitor which is on the right and bottom of the window's top-left corner.
|
||||
for (i = 0; i < server.nb_monitor; i++) {
|
||||
if (x >= server.monitor[i].x && x <= (server.monitor[i].x + server.monitor[i].width))
|
||||
if (y >= server.monitor[i].y && y <= (server.monitor[i].y + server.monitor[i].height))
|
||||
break;
|
||||
if (y >= server.monitor[i].y && y <= (server.monitor[i].y + server.monitor[i].height)) {
|
||||
int current_right = x < (server.monitor[i].x + server.monitor[i].width);
|
||||
int current_bottom = y < (server.monitor[i].y + server.monitor[i].height);
|
||||
if (best_match < 0 ||
|
||||
(!match_right && current_right) ||
|
||||
(!match_bottom && current_bottom)) {
|
||||
best_match = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//printf("window %lx : ecran %d, (%d, %d)\n", win, i, x, y);
|
||||
if (i == server.nb_monitor) return 0;
|
||||
else return i;
|
||||
if (best_match < 0)
|
||||
best_match = 0;
|
||||
// printf("window %lx : ecran %d, (%d, %d)\n", win, best_match+1, x, y);
|
||||
return best_match;
|
||||
}
|
||||
|
||||
void window_get_coordinates (Window win, int *x, int *y, int *w, int *h)
|
||||
|
||||
4
tint2.config
Normal file
4
tint2.config
Normal file
@@ -0,0 +1,4 @@
|
||||
// ADD PREDEFINED MACROS HERE!
|
||||
#define HAVE_RSVG 1
|
||||
#define HAVE_SN 1
|
||||
#define ENABLE_BATTERY 1
|
||||
1
tint2.creator
Normal file
1
tint2.creator
Normal file
@@ -0,0 +1 @@
|
||||
[General]
|
||||
@@ -2,7 +2,7 @@
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=Tint2 panel
|
||||
Name[am]=ፓነል tint2
|
||||
Name[am]=ፓነል tint2
|
||||
Name[ar]=الشريط tint2
|
||||
Name[ast]=Panel tint2
|
||||
Name[be]=Панэль tint2
|
||||
@@ -12,7 +12,7 @@ Name[da]=Panel tint2
|
||||
Name[de]=Leiste tint2
|
||||
Name[dz]=པེ་ནཱལ། tint2
|
||||
Name[el]=Ταμπλό tint2
|
||||
Name[en_GB]=Panel tint2
|
||||
Name[en]=Tint2 panel
|
||||
Name[eo]=Panelo tint2
|
||||
Name[es]=Panel tint2
|
||||
Name[et]=Ääreriba tint2
|
||||
@@ -36,7 +36,6 @@ Name[nn]=Panel tint2
|
||||
Name[pa]=ਪੈਨਲ tint2
|
||||
Name[pl]=Panel tint2
|
||||
Name[pt]=Painel tint2
|
||||
Name[pt_BR]=Painel tint2
|
||||
Name[ro]=Panou tint2
|
||||
Name[ru]=Панель tint2
|
||||
Name[si]=පුවරුව tint2
|
||||
@@ -48,12 +47,11 @@ Name[tr]=Panel tint2
|
||||
Name[ug]=panel tint2
|
||||
Name[uk]=Панель tint2
|
||||
Name[ur]=پینل tint2
|
||||
Name[ur_PK]=پینل tint2
|
||||
Name[vi]=Panel tint2
|
||||
Name[zh_CN]=面板 tint2
|
||||
Name[zh_TW]=面板 tint2
|
||||
Name[zh]=面板 tint2
|
||||
Comment=Lightweight panel
|
||||
Comment[fr_FR]=Panel léger
|
||||
Comment[fr]=Panel léger
|
||||
Comment[pl]=Lekki panel
|
||||
Exec=tint2
|
||||
Icon=taskbar
|
||||
Terminal=false
|
||||
|
||||
153
tint2.files
Normal file
153
tint2.files
Normal file
@@ -0,0 +1,153 @@
|
||||
doc/tint2.1
|
||||
sample/icon_and_text_1.tint2rc
|
||||
sample/icon_and_text_2.tint2rc
|
||||
sample/icon_and_text_3.tint2rc
|
||||
sample/icon_and_text_4.tint2rc
|
||||
sample/icon_only_1.tint2rc
|
||||
sample/icon_only_2.tint2rc
|
||||
sample/icon_only_3.tint2rc
|
||||
sample/icon_only_4.tint2rc
|
||||
sample/icon_only_6.tint2rc
|
||||
sample/icon_only_7.tint2rc
|
||||
sample/text_only_1.tint2rc
|
||||
sample/text_only_2.tint2rc
|
||||
sample/text_only_3.tint2rc
|
||||
sample/text_only_4.tint2rc
|
||||
sample/text_only_5.tint2rc
|
||||
sample/text_only_6.tint2rc
|
||||
sample/tint2rc
|
||||
src/battery/battery.c
|
||||
src/battery/battery.h
|
||||
src/clock/clock.c
|
||||
src/clock/clock.h
|
||||
src/execplugin/execplugin.c
|
||||
src/execplugin/execplugin.h
|
||||
src/launcher/launcher.c
|
||||
src/launcher/launcher.h
|
||||
src/launcher/xsettings-client.c
|
||||
src/launcher/xsettings-client.h
|
||||
src/launcher/xsettings-common.c
|
||||
src/launcher/xsettings-common.h
|
||||
src/sysmon/sysmon.c
|
||||
src/sysmon/sysmon.h
|
||||
src/systray/systraybar.c
|
||||
src/systray/systraybar.h
|
||||
src/taskbar/task.c
|
||||
src/taskbar/task.h
|
||||
src/taskbar/taskbar.c
|
||||
src/taskbar/taskbar.h
|
||||
src/taskbar/taskbarname.c
|
||||
src/taskbar/taskbarname.h
|
||||
src/tint2conf/CMakeLists.txt
|
||||
src/tint2conf/main.c
|
||||
src/tint2conf/main.h
|
||||
src/tint2conf/properties.c
|
||||
src/tint2conf/properties.h
|
||||
src/tint2conf/properties_rw.c
|
||||
src/tint2conf/properties_rw.h
|
||||
src/tint2conf/taskbar.svg
|
||||
src/tint2conf/theme_view.c
|
||||
src/tint2conf/theme_view.h
|
||||
src/tint2conf/tint2conf.desktop
|
||||
src/tint2conf/tintwizard.py
|
||||
src/tooltip/tooltip.c
|
||||
src/tooltip/tooltip.h
|
||||
src/util/area.c
|
||||
src/util/area.h
|
||||
src/util/blur.c
|
||||
src/util/blur.h
|
||||
src/util/common.c
|
||||
src/util/common.h
|
||||
src/util/timer.c
|
||||
src/util/timer.h
|
||||
src/util/window.c
|
||||
src/util/window.h
|
||||
src/config.c
|
||||
src/config.h
|
||||
src/panel.c
|
||||
src/panel.h
|
||||
src/server.c
|
||||
src/server.h
|
||||
src/tint.c
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
CMakeLists.txt
|
||||
COPYING
|
||||
default_icon.png
|
||||
get_svnrev.sh
|
||||
INSTALL.txt
|
||||
make_release.sh
|
||||
README
|
||||
README.source
|
||||
src/launcher/apps-common.c
|
||||
src/launcher/apps-common.h
|
||||
src/launcher/icon-theme-common.c
|
||||
src/launcher/icon-theme-common.h
|
||||
src/util/strnatcmp.c
|
||||
src/util/strnatcmp.h
|
||||
get_version.sh
|
||||
src/battery/battery.c
|
||||
src/battery/battery.h
|
||||
src/clock/clock.c
|
||||
src/clock/clock.h
|
||||
src/launcher/apps-common.c
|
||||
src/launcher/apps-common.h
|
||||
src/launcher/icon-theme-common.c
|
||||
src/launcher/icon-theme-common.h
|
||||
src/launcher/launcher.c
|
||||
src/launcher/launcher.h
|
||||
src/launcher/xsettings-client.c
|
||||
src/launcher/xsettings-client.h
|
||||
src/launcher/xsettings-common.c
|
||||
src/launcher/xsettings-common.h
|
||||
src/systray/systraybar.c
|
||||
src/systray/systraybar.h
|
||||
src/taskbar/task.c
|
||||
src/taskbar/task.h
|
||||
src/taskbar/taskbar.c
|
||||
src/taskbar/taskbar.h
|
||||
src/taskbar/taskbarname.c
|
||||
src/taskbar/taskbarname.h
|
||||
src/tint2conf/CMakeLists.txt
|
||||
src/tint2conf/main.c
|
||||
src/tint2conf/main.h
|
||||
src/tint2conf/properties.c
|
||||
src/tint2conf/properties.h
|
||||
src/tint2conf/properties_rw.c
|
||||
src/tint2conf/properties_rw.h
|
||||
src/tint2conf/theme_view.c
|
||||
src/tint2conf/theme_view.h
|
||||
src/tint2conf/tint2conf.desktop
|
||||
src/tint2conf/tint2conf.svg
|
||||
src/tint2conf/tintwizard.py
|
||||
src/tooltip/tooltip.c
|
||||
src/tooltip/tooltip.h
|
||||
src/util/area.c
|
||||
src/util/area.h
|
||||
src/util/common.c
|
||||
src/util/common.h
|
||||
src/util/strnatcmp.c
|
||||
src/util/strnatcmp.h
|
||||
src/util/timer.c
|
||||
src/util/timer.h
|
||||
src/util/window.c
|
||||
src/util/window.h
|
||||
src/config.c
|
||||
src/config.h
|
||||
src/panel.c
|
||||
src/panel.h
|
||||
src/server.c
|
||||
src/server.h
|
||||
src/tint.c
|
||||
po/CMakeLists.txt
|
||||
po/LINGUAS
|
||||
po/POTFILES.in
|
||||
src/tint2conf/po/CMakeLists.txt
|
||||
src/tint2conf/po/CMakeLists.txt
|
||||
src/tint2conf/po/fr.po
|
||||
src/tint2conf/po/tint2conf.pot
|
||||
src/tint2conf/po/pl.po
|
||||
src/tint2conf/po/tint2conf.pot
|
||||
src/freespace/freespace.c
|
||||
src/freespace/freespace.h
|
||||
src/tint2conf/po/readme.txt
|
||||
22
tint2.includes
Normal file
22
tint2.includes
Normal file
@@ -0,0 +1,22 @@
|
||||
.
|
||||
./src
|
||||
./src/battery
|
||||
./src/clock
|
||||
./src/execplugin
|
||||
./src/launcher
|
||||
./src/sysmon
|
||||
./src/systray
|
||||
./src/taskbar
|
||||
./src/tint2conf
|
||||
./src/tooltip
|
||||
./src/util
|
||||
/usr/include
|
||||
/usr/include/gtk-2.0
|
||||
/usr/include/glib-2.0
|
||||
/usr/include/gdk-pixbuf-2.0
|
||||
/usr/include/cairo
|
||||
/usr/include/pango-1.0
|
||||
/usr/include/startup-notification-1.0
|
||||
po
|
||||
src/tint2conf/po
|
||||
src/freespace
|
||||
Reference in New Issue
Block a user