pax_global_header00006660000000000000000000000064126527614100014516gustar00rootroot0000000000000052 comment=107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/000077500000000000000000000000001265276141000204525ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/.clang-format000066400000000000000000000037521265276141000230340ustar00rootroot00000000000000# works with clang-format-3.7 # # Most controversial fields are UseTab, IndentWidth, ContinuationIndentWidth, ColumnLimit, BreakBeforeBraces #BasedOnStyle: Google AccessModifierOffset: 0 AlignAfterOpenBracket: true AlignConsecutiveAssignments: false #AlignConsecutiveDeclarations: false AlignEscapedNewlinesLeft: true AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: false BinPackArguments: false BinPackParameters: false BreakBeforeBinaryOperators: None BreakBeforeBraces: Linux BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false ColumnLimit: 120 CommentPragmas: '' ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 0 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DerivePointerBinding: false DisableFormat: false ForEachMacros: ['foreach'] IndentCaseLabels: false IndentFunctionDeclarationAfterType: false IndentWidth: 4 IndentWrappedFunctionNames: false Language: Cpp MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: true PenaltyBreakBeforeFirstCallParameter: 1000 PenaltyBreakComment: 100 PenaltyBreakFirstLessLess: 0 PenaltyBreakString: 100 PenaltyExcessCharacter: 100 PenaltyReturnTypeOnItsOwnLine: 2000 PointerAlignment: Right SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInCStyleCastParentheses: false SpacesInContainerLiterals: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 4 UseTab: ForIndentation tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/.gitignore000066400000000000000000000000151265276141000224360ustar00rootroot00000000000000build *.user tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/AUTHORS000066400000000000000000000026721265276141000215310ustar00rootroot00000000000000tint2 is developped by : - Thierry Lorthiois from Omega distribution - Andreas Fink - Euan Freeman (tintwizard) - Christian Ruppert (autotools build system) - Ovidiu M : launcher, bug fixes - Mishael A Sibiryakov (death@junki.org) : freespace - Sebastian Reichel : battery, various fixes, debian package maintainer tint2 is based on the ttm source code (http://code.google.com/p/ttm/) - 2007-2008 Pål Staurland Contributors: Kwaku Yeboah : wiki page Daniel Moerner : man page and debian package Doug Barton : freebsd package James Buren : Frugalware package Pierre-Emmanuel Andre : openbsd port Redroar : arch package Rene Garcia : launcher SVG support 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 Translations: Bosnian: Dino Duratović Croatian: Dino Duratović French: Jocelyn The Bento team Wagner Polish: Daniel Napora Serbian: Dino Duratović tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/CMakeLists.txt000066400000000000000000000221131265276141000232110ustar00rootroot00000000000000project( tint2 ) cmake_minimum_required( VERSION 2.6 ) option( ENABLE_BATTERY "Enable battery status plugin" ON ) option( ENABLE_TINT2CONF "Enable tint2conf build, a GTK+2 theme configurator for tint2" ON ) option( ENABLE_EXAMPLES "Install additional tin2rc examples" ON ) option( ENABLE_RSVG "Rsvg support (launcher only)" ON ) option( ENABLE_SN "Startup notification support" ON ) option( ENABLE_ASAN "Build tint2 with AddressSanitizer" OFF ) option( ENABLE_BACKTRACE "Dump a backtrace in case of fatal errors (e.g. X11 I/O error)" OFF ) option( ENABLE_BACKTRACE_ON_SIGNAL "Dump a backtrace also when receiving signals such as SIGSEGV" OFF ) if( CMAKE_SYSTEM_NAME STREQUAL "Linux" ) option( ENABLE_UEVENT "Kernel event handling support" ON ) endif( CMAKE_SYSTEM_NAME STREQUAL "Linux" ) include( FindPkgConfig ) include( CheckLibraryExists ) include( CheckCSourceCompiles ) pkg_check_modules( X11 REQUIRED x11 xcomposite xdamage xinerama xrender xrandr>=1.3 ) pkg_check_modules( PANGOCAIRO REQUIRED pangocairo ) pkg_check_modules( PANGO REQUIRED pango ) pkg_check_modules( CAIRO REQUIRED cairo ) pkg_check_modules( GLIB2 REQUIRED glib-2.0 ) pkg_check_modules( GOBJECT2 REQUIRED gobject-2.0 ) pkg_check_modules( IMLIB2 REQUIRED imlib2>=1.4.2 ) if(ENABLE_BACKTRACE) check_c_source_compiles( "#include \n#include \nint main () { backtrace(NULL, 0); }" BACKTRACE_LIBC) if(BACKTRACE_LIBC) set(BACKTRACE_LIBC_FOUND TRUE) set(BACKTRACE_L_FLAGS "-rdynamic") else() pkg_check_modules( UNWIND libunwind ) find_library(EXECINFO_LIBRARIES NAMES execinfo) if(EXECINFO_LIBRARIES OR EXECINFO_LIBRARIES_FOUND) set(EXECINFO_FOUND TRUE) set(EXECINFO_LIBRARIES "-lexecinfo") set(BACKTRACE_L_FLAGS "-rdynamic") else() set(EXECINFO_LIBRARIES "") set(BACKTRACE_L_FLAGS "") endif() endif() if( NOT BACKTRACE_LIBC_FOUND AND NOT UNWIND_FOUND AND NOT EXECINFO_FOUND ) message( WARNING "Backtrace support not available. You can enable it by installing libexecinfo or libunwind." ) endif() else() set(EXECINFO_LIBRARIES "") set(BACKTRACE_L_FLAGS "") endif() if( ENABLE_RSVG ) pkg_check_modules( RSVG librsvg-2.0>=2.14.0 ) endif( ENABLE_RSVG ) if( ENABLE_SN ) pkg_check_modules( SN libstartup-notification-1.0>=0.12 ) endif(ENABLE_SN) 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://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}" ) set( CMAKE_REQUIRED_FLAGS "${FLAGS_REPLACED}" ) check_library_exists( "${IMLIB2_LIBRARIES}" "imlib_context_set_display" "${IMLIB2_LIBRARY_DIRS}" IMLIB_BUILD_WITH_X ) 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 src/clock src/systray src/taskbar src/launcher src/tooltip src/util src/execplugin src/freespace ${X11_INCLUDE_DIRS} ${PANGOCAIRO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${GOBJECT2_INCLUDE_DIRS} ${IMLIB2_INCLUDE_DIRS} ${RSVG_INCLUDE_DIRS} ${SN_INCLUDE_DIRS} ) set( SOURCES src/config.c src/panel.c src/server.c src/tint.c src/clock/clock.c src/systray/systraybar.c src/launcher/launcher.c src/launcher/apps-common.c src/launcher/icon-theme-common.c src/launcher/xsettings-client.c src/launcher/xsettings-common.c src/taskbar/task.c src/taskbar/taskbar.c src/taskbar/taskbarname.c src/tooltip/tooltip.c src/execplugin/execplugin.c src/freespace/freespace.c src/util/area.c src/util/common.c src/util/strnatcmp.c src/util/timer.c src/util/window.c ) if( ENABLE_BATTERY ) set( SOURCES ${SOURCES} src/battery/battery.c) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set( SOURCES ${SOURCES} src/battery/linux.c) elseif(CMAKE_SYSTEM_NAME STREQUAL "DragonFly") set( SOURCES ${SOURCES} src/battery/freebsd.c) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set( SOURCES ${SOURCES} src/battery/freebsd.c) elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set( SOURCES ${SOURCES} src/battery/openbsd.c) elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") set( SOURCES ${SOURCES} src/battery/openbsd.c) else(CMAKE_SYSTEM_NAME STREQUAL "Linux") set( SOURCES ${SOURCES} src/battery/dummy.c) endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") add_definitions( -DENABLE_BATTERY ) endif( ENABLE_BATTERY ) if( ENABLE_RSVG ) if( RSVG_FOUND ) add_definitions( -DHAVE_RSVG ) else() message( FATAL_ERROR "SVG support enabled yet dependency not fulfilled: librsvg-2.0" ) endif( RSVG_FOUND ) endif( ENABLE_RSVG ) if( ENABLE_SN ) if( SN_FOUND ) add_definitions( -DHAVE_SN -DSN_API_NOT_YET_FROZEN ) else() message( FATAL_ERROR "Startup notification support enabled yet dependency not fulfilled: libstartup-notification-1.0" ) endif( SN_FOUND ) endif( ENABLE_SN) if( ENABLE_UEVENT ) add_definitions( -DENABLE_UEVENT ) set( SOURCES ${SOURCES} src/util/uevent.c) endif( ENABLE_UEVENT ) if(ENABLE_BACKTRACE) if(BACKTRACE_LIBC_FOUND) add_definitions( -DENABLE_EXECINFO ) endif() if( UNWIND_FOUND ) add_definitions( -DENABLE_LIBUNWIND ) endif( UNWIND_FOUND ) if( EXECINFO_FOUND ) add_definitions( -DENABLE_EXECINFO ) endif( EXECINFO_FOUND ) if(ENABLE_BACKTRACE_ON_SIGNAL) add_definitions( -DBACKTRACE_ON_SIGNAL ) endif() else() add_definitions( -DDISABLE_BACKTRACE ) endif() if( ENABLE_TINT2CONF ) add_definitions( -DHAVE_VERSION_H ) add_subdirectory( src/tint2conf ) add_dependencies( tint2conf version ) endif( ENABLE_TINT2CONF ) if( ENABLE_ASAN ) SET(ASAN_C_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic -Wshadow") SET(ASAN_L_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic ") else() SET(ASAN_C_FLAGS "") SET(ASAN_L_FLAGS "") endif() set( MANDIR share/man CACHE PATH "Directory for man pages" ) set( DATADIR share CACHE PATH "Directory for shared data" ) set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" ) set( DOCDIR share/doc/tint2 CACHE PATH "Directory for documentation files" ) add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" ) link_directories( ${X11_LIBRARY_DIRS} ${PANGOCAIRO_LIBRARY_DIRS} ${PANGO_LIBRARY_DIRS} ${CAIRO_LIBRARY_DIRS} ${GLIB2_LIBRARY_DIRS} ${GOBJECT2_LIBRARY_DIRS} ${IMLIB2_LIBRARY_DIRS} ${RSVG_LIBRARY_DIRS} ${SN_LIBRARY_DIRS} ) add_executable(tint2 ${SOURCES}) target_link_libraries( tint2 ${X11_LIBRARIES} ${PANGOCAIRO_LIBRARIES} ${PANGO_LIBRARIES} ${CAIRO_LIBRARIES} ${GLIB2_LIBRARIES} ${GOBJECT2_LIBRARIES} ${IMLIB2_LIBRARIES} ${UNWIND_LIBRARIES} ${EXECINFO_LIBRARIES} ) if( ENABLE_RSVG ) target_link_libraries( tint2 ${RSVG_LIBRARIES} ) endif( ENABLE_RSVG ) if( ENABLE_SN ) target_link_libraries( tint2 ${SN_LIBRARIES} ) endif( ENABLE_SN ) if( RT_LIBRARY ) target_link_libraries( tint2 ${RT_LIBRARY} ) endif( RT_LIBRARY ) target_link_libraries( tint2 m ) add_dependencies( tint2 version ) set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -Wpointer-arith -fno-strict-aliasing -pthread -std=c99 ${ASAN_C_FLAGS}" ) set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread -fno-strict-aliasing ${ASAN_L_FLAGS} ${BACKTRACE_L_FLAGS}" ) install( TARGETS tint2 DESTINATION bin ) install( FILES tint2.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps ) install( FILES tint2.desktop DESTINATION ${DATADIR}/applications ) install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" ) install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 ) install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 ) 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 ${DATADIR}/tint2 ) endif( ENABLE_EXAMPLES ) tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/COPYING000066400000000000000000000431101265276141000215040ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/ChangeLog000066400000000000000000000653641265276141000222420ustar00rootroot000000000000002016-01-29 0.12.7 - Fixes: - Fix crash caused by race when reading inconsistent values for _NET_CURRENT_DESKTOP and _NET_NUMBER_OF_DESKTOPS - Fix regression (all desktop tasks not working) - Fix small memory leak in launcher 2016-01-25 0.12.6 - Fixes: - Fix crash on 32-bit systems (issue #546) - Fix compilation on Slackware (issue #547) - Terminal color reset code moved to the same line to prevent interference with logging (issue #545) - Enhancements: - Executor now sends click coordinates via environment variables (issue #544) 2016-01-24 0.12.5 - Fixes: - Fix rendering corruption triggered occasionally when the compositor is disabled (regression in 0.12.4) 2016-01-23 0.12.4 - Enhancements: - Support for NETWM viewports (as used by Compiz or Unity) (issue #94) - The default desktop font (Gtk/FontName from XSettings) is used when a font is not specified in the config file - When no fonts are specified in the config, tint2 picks up the default font of the desktop environment via XSettings - Tint2 is now able to dump a stack trace to stderr and ~/.tint2-crash.log in case of a crash. If the cmake flag ENABLE_BACKTRACE is set, stack traces are dumped on X11 I/O errors. If the cmake flag ENABLE_BACKTRACE_ON_SIGNAL is set, stack traces are dumped also on signals such as SIGSEGV. Both ENABLE_BACKTRACE and ENABLE_BACKTRACE_ON_SIGNAL are disabled by default. - Pixmaps are cached instead of always redrawn between different button states when mouse effects are enabled, to improve performance - Tooltips are no longer very wide - Default config looks nicer - New config options: - Executor: new plugin that displays the output of a command in the panel (issue #161) - New taskbar sort order options: least-recently-used (lru), most-recently-used (mru) (issue #532) - Place the primary monitor before all the other monitors (primary_monitor_first, issue #538) - taskbar_always_show_all_desktop_tasks (issue #279) - Config options with changed behavior: - Mouse effects are enabled by default - Fixes: - Battery changes visibility correctly (issue #531) - Fixed rendering corruption (issue #543) - Reverted the window flags back to the value in 0.11 to make sure the window manager detects that tint2 is a panel (affected kwin, bspwm; fixes issue #537, breaks issue #455) - Fixed a rare crash caused by the system tray code - The system tray now reorders icons correctly when the icon name changes and the sorting order is configured as ascending or descending (affected GTK icons, which sometimes set their name late after creating the icon) - Tint2conf no longer copies sample themes to ~/.config - New optional dependencies: - libexecinfo on the *BSDs (only if the cmake flag ENABLE_BACKTRACE is set) 2015-11-12 0.12.3 - Enhancements: - Battery: Multiple batteries are now supported under Linux (issue #139; thanks to Sebastian Reichel) - Battery: The time left for charging/discharging the battery is now estimated when the system is not able to read current data from sensors (issue #522; thanks to Sebastian Reichel) - Battery: Reacts to plug/unplug events (thanks to Sebastian Reichel) - tint2conf: Backgrounds now have a text label showing which panel component uses them, to make them easier to identify; the label is saved as a comment in the config file (issue #521) - New config options: - Mouse over effects (mouse_effects, background_color_hover, border_color_hover) - Launcher icon background (launcher_icon_background_id) - Enable/disable battery tooltips (battery_tooltip_enabled) - Fixes: - Updated French translation - The correct icon is now used in tint2.desktop (issue #523) - The font setting for the desktop name is no longer lost on tint2 restart 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 - Enhancement: more thorough search for icons - Configuration GUI: tint2conf - Experimental, testing/feedback needed - Icons (system tray, task buttons, launcher): - Changed rendering method to fix icon corruptions (please report any problems) - System tray: - 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: - panel_window_name - panel_items (already released by distros) - disable_transparency - Taskbar: - taskbar_distribute_size - taskbar_hide_different_monitor - 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) - startup_notifications - 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 functions correctly. Due to the fact that OpenBox forcefully draws a border around dock windows, you might want to set it to zero (or change the border color/style to match tint2). If you set it to zero, make sure you do not have reserved space at the edge of the screen in the OpenBox config. Reason for change: issues 257, 394, 461, 465, 481. - panel_layer: previously, 'panel_layer = normal' was not functioning correctly. Now it does (it requires panel_dock = 0). Note that in this case some compositors will draw shadows of other windows behind tint2. This can be avoided in compton using the option shadow-exclude-reg = "x35+0-0" where 35 should be replaced with the size of the panel. - font_shadow: shadows are thicker and softer, and are now applied to all text elements, not just the taskbar. 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 - battery FreeBSD uses the new ACPI API (thx to yamagi.burmeister) 2010-06-16 - Set _NET_WM_ICON_GEOMETRY for every task 2010-06-12 - strut_policy=minimum is possible even if autohide is disabled 2010-06-11 - Added icons and a *.desktop file for tint2conf - BSD fixes 2010-06-09 - Add cmake build system 2010-06-08 - Xrandr and Nvidia problems fixed 2010-05-17 - Fix installation of examples 2010-05-15 - added panel theme switcher 'tint2conf' with preview of each theme based on current config (size of monitor, task opened, ...) - include tintwizard : theme editor - autodetect composite manager and switch to real or fake transparency this feature needed a patch to xcompmgr see FAQ http://code.google.com/p/tint2/wiki/FAQ#How_to_configure_real_transparency_(xcompmgr) - added 'strut_policy = none' - drag n drop task re-ordering 2010-01-28 - Battery hide option - bugfixes in task redrawing - traywindow and autohide bugfix 2010-01-13 - calculate right struts for multiple monitors - New timer implementation (works for *BSD too) - Changed behaviour for forwarding clicks to the window manager - Tint2 sets a class name, such that it can be identified by window managers - better omnipresent task handling - clock timezone support - real transparency - adjustable systray icons - systray: several icons in one line - autohide - more task states (active/urgent/iconified) - and some minor bugfixes which nobody recognized yet ;) 2009-12-16 - Scrolling through tasks by schattenprinz (added action next_task and prev_task) - Andreas : *add* setting tooltip on clock with 'clock_tooltip = format' - Andreas : *add* changed everything to kernel timer for easier integration with new timer - Andreas : *add* multiple tasks can be urgent now - Thierry : panel snapshot - patch for FULL battery by peter.ebden - Thierry : work on tint2conf. not ready for release yet. - Thierry : killall -SIGUSR1 tint2 will reload config file cleanly - Thierry : improved multi-monitor detection - Thierry : added left2right and right2left value to systray_sort option - Andreas : *add* option for ascending/descending/unsorted systray - Thierry : EWMH non-resizable panel - less disturbing omnipresent task by dmitry medvinsky - Thierry : lower cpu use with icon. replace HUE by ALPHA on icon (see task_icon_asb) - Thierry : add default icon on task - Andreas : *add* tooltips - Andreas : added possibility to put tint2 into the windowmanagers dock - Andreas : Drag n drop over Task bring Focus - Andreas : support skip_taskbar - Thierry : detect pid of process owning the systray - Andreas : added possibility to put tint2 into the windowmanagers dock 2009-09-08 - Drag n drop over Task bring Focus by Andreas.Fink85 2009-09-07 - fixed issue 117 : support skip_taskbar by Andreas.Fink85 - cleanup : switch space to tab 2009-09-01 - fixed segfault 2009-08-30 - detect pid of process owning the systray 2009-08-30 - added taskbar_active_background_id to change current desktop background. warning : this feature have a price on cpu (tint2 redraw all task) when you switch desktop. comment out taskbar_active_background_id if you don't want it. 2009-08-30 - fixed issue 130 by maato ordered systray icon with config "systray_sort = asc/desc" 2009-08-29 - fixed issue 134 2009-08-29 - cleanup and add desktop_right/desktop_left action on task (by jackp) 2009-08-29 - adjust saturation/brightness on task icon 2009-08-29 - merge change described in issue 122 (by jackp) made right click easier 2009-08-28 - add some HSB config 2009-08-09 - add mouse action : maximize_restore - fixed issue 125 2009-07-28 - some tint2conf code 2009-07-26 - fixed icon on 64 bit system by benjaminfranzke 2009-07-19 - fixed systray crash by mart1987 2009-07-14 - play with some tint2conf code 2009-07-04 - fixed 'defunct' process after fork ---------------------------------------------------------------- 2009-06-30 thilor77 released tint-0.7 2009-06-29 - fixed bug when active window draged to another desktop 2009-06-29 - fixed issue 110 and issue 107 2009-06-25 - improve user's message when compiled with --disable-battery - replace 'task_width = width' by 'task_maximum_size = width height' width will be used in horizontal panel height will be used in vertical panel 2009-06-24 - vertical panel done user's parameters : 1) add 'vertical' to panel_position (panel_position = center left vertical) 2) use 'task_width' to define the task height (task_width = 30) 3) adjust paddingy on task and systray wiil define the size of icons all others parameters are automatically converted by tint2 (x padding become y padding, width become height ...) so user's change between horizontal and vertical are minimised. 2009-06-23 - play with vertical panel check sample file tintrc05 and tintrc06 more change to come... 2009-06-21 - play with some code for vertical panel 2009-06-20 - remove flickering on systray 2009-06-20 - 'urgent_nb_of_blink' allow to choose the number of blink 2009-06-19 - change systray code. fixed issue 91. 2009-06-18 - patch by Christian Ruppert, configure option for battery 2009-06-14 - revert r78, fixed issue 100 2009-06-13 - fixed background refresh on systray 2009-06-09 - fixed issue 98 2009-06-08 - fixed issue 97 and issue 95 2009-06-08 - allow 'taskbar_mode = multi_desktop' config with 'panel_monitor = all' 2009-06-07 - merge autotool build system by Christian Ruppert 2009-06-06 - fixed issue 56 : with windowmaker bug in windowmaker : send unecessary 'desktop changed' each time focus changed 2009-06-06 - add 'wm_menu' config option to disable window manager's menu if you don't specify "wm_menu = ", the default value will show WM menu. 2009-06-06 - fixed issue 90 and issue 81 : window manager's menu in panel padding works on openbox, pekwm, fluxbox, icewm. doesn't work on xfce, windowmaker ? tint2 send mouse event to your window manager on left/right padding and on top/bottom panel padding. 2009-06-05 - fixed issue 46 and 59 : urgent task limitation : just one urgent task at a time 2009-06-04 - patch by dmitry.medvinsky : right/left clic command 2009-06-02 - Systray Temp_Fix from keshto not yet perfect, but a first step 2009-05-31 - fixed issue 71 : time format %T %r 2009-05-31 - fixed issue 86 : padding bug 2009-05-31 - fixed issue 87 and 88 : battery detection 2009-05-26 - fixed memory leak and battery detection 2009-05-20 - merge patch from yarin.kaul (fixed issue 52) 2009-05-15 - merge battery applet from Sebastian Reichel 2009-03-14 - add systray option when convert tint-0.6 config file but you need to stop other systemtray program 2009-03-07 - fixed segfault when time1_format empty - fixed systray : when clock change size - fixed systray segfault when xrandr change size 2009-03-01 - fixed segfault on tray application due to tint2 2009-03-01 - cleanup code - basic systray with some bugs - update documentation and tintrc sample for systray 2009-02-27 - fixed issue 49 : patch from Daniel Moerner - some systray code (doesn't work) - cleanup code 2009-02-25 - fixed issue 48 : tint2 does't create config file on first start 2009-02-14 - fixed issue 45 : segfault without clock 2009-02-13 - improved object oriented layout - tint2 looks good for me. if you see bugs, report it. 2009-02-12 - fixed issue 14 : no icons 2009-02-11 - fixed bug with number of desktop changed - fixed clock resize when date changed 2009-02-08 - backward compatibility with tint-0.6 (convert config file) feature freeze until next release. need bug correction. 2009-02-07 - better multi-monitor capability : -> panel_monitor = all : tint2 draw one panel per monitor -> panel_size = 90% 30 : panel_size accept percentage or pixel - change notation : MULTI_MONITOR changed to SINGLE_MONITOR in SINGLE_MONITOR mode, tint2 draw one taskbar with tasks from current monitor - removed sleep mode (replaced by panel_monitor = all) - update documentation and sample config file 2009-02-03 - better fixed for Robert Escriva problem : set_panel_properties -> Reserved space - fixed issue 13 with background detection - fixed bug with disconnected monitor (in multi monitor mode) - removed capability to show Window magager's menu it's a feature I would like, but implementation was buggy 2009-01-29 - use panel_margin parameter even with full_width - multi_monitor mode : monitor number are ordered according to coordinate so taskbar on the left show task in the left monitor 2009-01-20 - change config file format : add another padding parameter - update documentation and sample config file 2009-01-19 - patch from Robert Escriva, fixed tint2 on multi-monitor - fixed bug between MULTI_MONITOR mode and 'task on all desktop' 2009-01-18 - update documentation for new config format - fixed memory corruption - fixed bug with "task on all desktop" (issue 39) 2009-01-17 - fixed drawing of active task (with new layout) 2009-01-05 - fixed decorated window with compiz 2008-12-30 - fixed bug : segfault on ConfigureNotify event 2008-11-12 - fixed bug : segfault with icon - panel's left and right padding feel like WM background (right click open window managers's menu, ...) 2008-11-02 - fixed bugs with new design - panel.area manage the tree of visible objects 2008-10-28 - fixed issue : "untitled task", "task button did not update", "window don't shade", "error if I don't do 'make install'", "Makefile error" 2008-09-24 - change tintrc format user can define a list of background and border at the beginning of tintrc and each object (panel, taskbar, task, clock, systray) get a background number. the background number 0 is reserved by tint2 for full transparency. user's background start with number 1, 2, ... 2008-09-22 - better control on icon opacity icon opacity use the same value as text opacity 2008-09-21 - new parameter task_text = 0 or 1 so you can show task's icon without text - remove task_icon_size parameter because icon_size is calculate with task->padding_y 2008-09-19 - improve clock drawing on 2 lines - new design : object oriented clock inherit Area (with draw_background) - rename parameter 'panel_mode' in 'taskbar_mode' 2008-09-17 - change name from tint to tint2 because debian has already a package named tint - new design : object oriented tasks inherit Area taskbars inherit Area 2008-09-16 - new design : object oriented remove task_margin parameter, replaced by taskbar_padding fixed segfault with new layout 2008-09-04 - new design : object oriented all objects inherit from Area : panel, taskbar, task, clock 2008-09-02 licence changed to GPL V2 > Hi Pål, > Since latest release (tint-0.6), I try to merge a systray in tint. > The code I would like to merge is under GPL V2 licence. > So are you agree to change the licence of tint to GPL V2 ? Pål Staurland answer : Yeah no problem::) 2008-08-17 patch from i...@noctus.net - fixed bug : "Task button titles do not update" 2008-08-12 - code cleanup : Taskbar use GSLIST from glib 2008-08-07 - add 1 space between task title and icon 2008-07-25 - fixed bug when (task_rounded > panel_height/2) ---------------------------------------------------------------- 2008-07-20 thil7 released tint-0.6 2008-07-19 - backward compatibility : save new config file 2008-07-18 - bug fixed with multi-monitor : memory leak, move task on the same monitor 2008-07-12 - multi_monitor : added window_get_monitor(win) 2008-07-05 - multi_monitor : changed taskbar allocation when add/remove a monitor - update documentation 2008-07-04 - changed in config file, panel_show_all_desktop replaced by panel_mode = single_desktop / multi_desktop / multi_monitor - with panel_mode = multi_monitor, tint show one taskbar by monitor 2008-07-02 - add xinerama dependency - read monitors configuration - tint will run in 'sleep_mode' if you specify 'panel_monitor' on an unplug monitor - tint 'wake up' when the monitor is detected or resolution changed 2008-06-30 patch from goo...@dougbarton.us - tint wait for window manager on startup 2008-06-29 - specify monitor with parameter 'panel_monitor' - panel_position is relative to your monitor panel_monitor = 1 panel_position = bottom center 2008-06-24 - fixed bug : show tint on all desktop with fluxbox 2008-06-23 - task_width = 0 to get full taskbar width - added documentation in /doc 2008-06-16 - renamed parameter panel_margin to panel_padding - added parameter panel_margin = vertical_margin horizontal_margin 2008-06-15 - fixed bug : icon position changed when clock adjust width - removed boolean parameter panel_background and task_background replaced with opacity (alpha) = 0 - removed task_active_border_width parameter identical to task_border_width - fixed bug : draw task below panel border 2008-06-11 - removed the need of desktop margin. tint specify margin to window magager (_NET_WM_STRUT) 2008-06-10 - fixed bug : time/date vertical and horizontal center 2008-06-10 patch from benjaminfranzke - fixed bug : draw icon on 64bit system. 2008-06-08 - fixed bug : in draw border and fill background 2008-06-04 - allow config file on the command line : tint -c ./tintrc2 - allow 2 value in config file : key = value1 value2 - panel_margin can get 2 values : vertical_margin horizontal_margin panel_margin = 8 4 2008-05-30 - put panel below other window - set locale LANG 2008-05-28 - clock_width adjust automatically - configure : time2_format see 'man strftime' 2008-05-27 - configure : time1_format see 'man strftime' - cleanup code : refresh_pos() 2008-05-26 - catch time event in main loop - draw clock fixed format %H:%M 2008-05-24 - removed boolean parameter task_icon task_icon_size = 0 replace task_icon = 0 - all colors parameters can get 2 values : color and opacity (alpha) font_color = #ffffff 70 2008-05-23 - cpu optimisation : limit call to visual_refresh() 2008-05-22 - configure clock : clock_font, clock_font_color ---------------------------------------------------------------- 2008-05-20 thil7 released tint-0.5 2008-05-19 - improve usability in mode 'show_all_desktop' -> don't switch desktop when close a task of another desktop -> allow to drag and drop task between desktop - change panel_position : you can now specify top or bottom. values : bottom left, bottom right, bottom center, top left, top right, top center keep compatibility with old tintrc files - change Makefile : add $PREFIX and $DESTDIR install default config file in /etc/xdg/tint/tintrc - on startup, tint copy $XDG_CONFIG_DIR/tint/tintrc in ~/.config/tint/tintrc so each user can customize tintrc - fixed : name of task in fluxbox - improve focus detection (TransientForHint) - cleanup code : send_event ---------------------------------------------------------------- 2008-05-14 thil7 released tint-0.4 2008-05-12 - boolean option 'show_all_desktop' 0 : tint panel show one taskbar (from current desktop) 1 : tint panel show all taskbars (from all desktops) - clic on a task switch to the desktop - clic on a taskbar (if empty) switch to the desktop - add layout for taskbar : panel -> taskbar -> task - cleanup code : state 'active' in Task replaced by task_active in Panel - hide some window : _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_STATE_MODAL - change project to 'MIT licence' because Pål Staurland put 'MIT licence' in all file source ---------------------------------------------------------------- 2008-05-10 thil7 released tint-0.3 2008-05-10 - manage events : 'send to desktop' and 'send to all desktop' - bug solved : 'close' action now send _NET_CLOSE_WINDOW so openoffice ask 'save document...' if needed - cpu optimisation : -> don't redraw panel background on all events. just when desktop change. -> don't remove/add all tasks when switch between desktop. remove 'task_new_desktop()'. - small bug on _NET_WM_STATE_SKIP_TASKBAR corrected - memory leak on g_build_filename ---------------------------------------------------------------- 2008-05-09 thil7 released tint-0.2 2008-05-08 - panel : add rounded and border (color and alpha) - remove option 'panel_tasks_centered' - user can configure mouse event on task (none, toggle, iconify, shade, close, toggle_iconify) 2008-05-07 - cpu optimisation : resize_tasks only when add/remove task, compute pos_y at startup 2008-05-04 - task width adjust when too many task 2008-05-01 - task : add rounded and border (color and alpha) - panel position (left, right, center) thank to ak47izatool - cleanup code : vertical position (icon and text), better refresh after delete task, memory leak *font - panel : changed panel_margin and task_margin 2008-04-22 - fork ttm projet from p://code.google.com/p/ttm/ (by Pål Staurland staura@gmail.com) while the projet is no longer in developpement, have not changed the name of 'tint'. tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/INSTALL.txt000066400000000000000000000003761265276141000223270ustar00rootroot00000000000000To build and install tint2 you need CMake. These steps should be enough for building tint2: mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr ../ make sudo make install To see additional options you can set at the 'cmake' step, run 'cmake -L ../' tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/README.md000066400000000000000000000060071265276141000217340ustar00rootroot00000000000000# New stable release: 0.12.7 Changes: https://gitlab.com/o9000/tint2/blob/0.12.7/ChangeLog Documentation: https://gitlab.com/o9000/tint2/wikis/Configure Try it out with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)): ``` git clone https://gitlab.com/o9000/tint2.git cd tint2 git checkout 0.12.7 mkdir build cd build cmake .. 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. P.S. GitLab is now the official location of the tint2 project, migrated from Google Code, which is shutting down. In case you are wondering why not GitHub, BitBucket etc., we chose GitLab because it is open source, it is mature and works well, looks cool and has a very nice team. # What is tint2? tint2 is a simple panel/taskbar made for modern X window managers. It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.). It is based on ttm http://code.google.com/p/ttm/. # Features * Panel with taskbar, system tray, clock and launcher icons; * Easy to customize: color/transparency on fonts, icons, borders and backgrounds; * Pager like capability: move tasks between workspaces (virtual desktops), switch between workspaces; * Multi-monitor capability: create one panel per monitor, showing only the tasks from the current monitor; * Customizable mouse events. # Goals * Be unintrusive and light (in terms of memory, CPU and aesthetic); * Follow the freedesktop.org specifications; * Make certain workflows, such as multi-desktop and multi-monitor, easy to use. # I want it! * [Install tint2](https://gitlab.com/o9000/tint2/wikis/Install) # How do I ... * [Install](https://gitlab.com/o9000/tint2/wikis/Install) * [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) * [Obtain a stack trace when tint2 crashes](https://gitlab.com/o9000/tint2/wikis/Debug) # How can I help out? * Report bugs and ask questions on the [issue tracker](https://gitlab.com/o9000/tint2/issues); * Contribute to the development by helping us fix bugs and suggesting new features. # Links * Home page: https://gitlab.com/o9000/tint2 * Git repository: https://gitlab.com/o9000/tint2.git * Documentation: https://gitlab.com/o9000/tint2/wikis/home * Downloads: https://gitlab.com/o9000/tint2-archive/tree/master or https://code.google.com/p/tint2/downloads/list * Old project location (inactive): https://code.google.com/p/tint2 # Screenshots ## Default config of the latest release: ![Screenshot_2016-01-23_14-42-57](https://gitlab.com/o9000/tint2/uploads/948fa74eca60864352a033580350b4c3/Screenshot_2016-01-23_14-42-57.png) ## Various configurations: ![screenshot](https://gitlab.com/o9000/tint2/wikis/screenshot.png) tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/README.source000066400000000000000000000002721265276141000226320ustar00rootroot00000000000000DEPENDENCIES: cairo (with X support), pango, glib2, libX11, libXinerama, libXrandr, libXrender, libXcomposite, libXdamage, imlib2 (with X support) you might need -dev packages on Debian tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/default_icon.png000066400000000000000000000027701265276141000236220ustar00rootroot00000000000000PNG  IHDR00WbKGD pHYs tIME*uIDAThYMoE}5;&b !bP8"'\@$p?'™BHEƱ;$&x^z鞮];8v$F{v3]իbq2 bdA> "@D@cd2)>ؾwinw~su5h/۟(6`gw\pڸ|y{05%ӹ$0t%Ce:{ x :rD,z# P@"D@йzM$gˁH$+ [ZQeN9뾽u;zªbO31gXp* 8(pk;ae%vC~*{AKD$ç_ @r?GQ6 )S&5oKcX%4UpЖ1_QGZjM1&Ge  'be5`RVz!h(rJXtzqQ)W+]Ho'e;F/ArBrk-dHO7*2 'N6jdS۲ι9E | 猀{3 ?s)Pӛ*R!cTu%}A0&LbSȋPdHga/{ Ƿ:4#H(ɚ.Td=jsԁ@-&%.rDk _fR R3{!҄}ogP%ҡK}mJ<^HC0vEEm[wfuPQM%n+՛-=Nԉ_K$q9W(һQ%h|V iVqU8֥)$$f CUz{+sJo qF;  "6Dj@nj O+`[ (0q@+Utr1kt<cgۻtOdfžYynϥo~?2 `0ҫfn-2!$$Xb o|y1-0zo !ϴ5M߸ ,JL0-zh8:|G:CGe~VFx󠹩| 9 ~n6>ߙLqHS,y> G2:'K~vKVdrrCY8e00000r,س s 8Fs` insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME tint2 \- lightweight panel/taskbar .SH SYNOPSIS .B tint2 .br .B tint2 .RI -c .IR /path_to_config_file .SH DESCRIPTION This manual page documents briefly the .B tint2 command. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBtint2\fP is a simple panel/taskbar intentionally made for openbox3, but should also work with other window managers. It's based on ttm code. The goal is to keep a clean and unintrusive look with code lightweight and compliance with freedesktop specifications. .PP On the first startup tint2 creates a config file in $HOME/.config/tint2/tint2rc. .PP See the wiki page at https://gitlab.com/o9000/tint2/wikis/home for more information. .SH OPTIONS .TP .B \-c config-file Specify which configuration file to use instead of the default. .SH AUTHOR tint2 was written by Thierry Lorthiois . It is based on ttm, originally written by Pål Staurland .PP This manual page was written by Daniel Moerner , for the Debian project (but may be used by others). It was adopted from the tint2 docs. tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/get_version.sh000077500000000000000000000020151265276141000233330ustar00rootroot00000000000000#!/bin/sh MAJOR=0.12 DIRTY="" git update-index -q --ignore-submodules --refresh # Disallow unstaged changes in the working tree if ! git diff-files --quiet --ignore-submodules -- then if [ "$1" = "--strict" ] then echo >&2 "Error: there are unstaged changes." git diff-files --name-status -r --ignore-submodules -- >&2 exit 1 else DIRTY="-dirty" fi fi # Disallow uncommitted changes in the index if ! git diff-index --cached --quiet HEAD --ignore-submodules -- then if [ "$1" = "--strict" ] then echo >&2 "Error: there are uncommitted changes." git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2 exit 1 else DIRTY="-dirty" fi fi VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%cI.%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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/make_release.sh000077500000000000000000000020021265276141000234200ustar00rootroot00000000000000#!/bin/bash # Usage: ./make_release.sh # Creates a tar.gz archive of the current tree. # # To bump the version number for the current commit (make sure you are in HEAD!), run manually: # # git tag -a v0.12 -m 'Version 0.12' # # To generate a release for an older tagged commit, first list the tags with: # # git tag # # then checkout the tagged commit with: # # git checkout tags/v0.1 # # Finally, to revert to HEAD: # # git checkout master # # See more at https://gitlab.com/o9000/tint2/wikis/Development VERSION=$(./get_version.sh --strict) if [ ! $? -eq 0 ] then echo >&2 "Error: get_version.sh failed!" exit 1 fi DIR=tint2-$VERSION ARCHIVE=$DIR.tar.gz echo "Making release $DIR" rm -rf $DIR $ARCHIVE git checkout-index --prefix=$DIR/ -a # Delete unneeded files rm -f $DIR/make_release.sh echo "echo \"#define VERSION_STRING \\\"$VERSION\\\"\" > version.h" > $DIR/get_version.sh # Create tarball and remove the exported directory tar -czf $ARCHIVE $DIR rm -rf $DIR sha1sum -b $ARCHIVE sha256sum -b $ARCHIVE tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/000077500000000000000000000000001265276141000217335ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/horizontal-dark-opaque.tint2rc000066400000000000000000000127111265276141000276440ustar00rootroot00000000000000#---- Generated by tint2conf bd50 ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 5 border_width = 1 background_color = #111111 100 border_color = #333333 100 background_color_hover = #111111 100 border_color_hover = #333333 100 background_color_pressed = #111111 100 border_color_pressed = #333333 100 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #111111 100 border_color = #222222 100 background_color_hover = #111111 100 border_color_hover = #555555 100 background_color_pressed = #333333 100 border_color_pressed = #555555 100 # Background 3: Active task rounded = 5 border_width = 1 background_color = #222222 100 border_color = #777777 100 background_color_hover = #222222 100 border_color_hover = #777777 100 background_color_pressed = #333333 100 border_color_pressed = #777777 100 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #111111 100 border_color = #222222 100 background_color_hover = #111111 100 border_color_hover = #555555 100 background_color_pressed = #333333 100 border_color_pressed = #555555 100 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #222222 100 border_color = #777777 100 background_color_hover = #222222 100 border_color_hover = #777777 100 background_color_pressed = #222222 100 border_color_pressed = #777777 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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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 = #dddddd 100 taskbar_name_active_font_color = #dddddd 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 = #eeeeee 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_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 = #eeeeee 100 clock_padding = 1 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = zenity --calendar --text "" clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #eeeeee 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/horizontal-dark-transparent.tint2rc000066400000000000000000000124411265276141000307130ustar00rootroot00000000000000#---- Generated by tint2conf ab72 ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 5 border_width = 1 background_color = #000000 80 border_color = #555555 80 background_color_hover = #000000 80 border_color_hover = #555555 80 background_color_pressed = #000000 80 border_color_pressed = #555555 80 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #777777 0 border_color = #777777 0 background_color_hover = #777777 4 border_color_hover = #cccccc 30 background_color_pressed = #333333 4 border_color_pressed = #777777 30 # Background 3: Active task rounded = 5 border_width = 1 background_color = #555555 10 border_color = #ffffff 60 background_color_hover = #cccccc 10 border_color_hover = #ffffff 60 background_color_pressed = #555555 10 border_color_pressed = #ffffff 60 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #777777 0 border_color = #777777 30 background_color_hover = #777777 4 border_color_hover = #cccccc 30 background_color_pressed = #777777 0 border_color_pressed = #777777 30 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #555555 10 border_color = #ffffff 60 background_color_hover = #555555 10 border_color_hover = #ffffff 60 background_color_pressed = #555555 10 border_color_pressed = #ffffff 60 #------------------------------------- # 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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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 = #dddddd 100 taskbar_name_active_font_color = #dddddd 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 = #eeeeee 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_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/firefox.desktop launcher_item_app = /usr/share/applications/iceweasel.desktop launcher_item_app = /usr/share/applications/google-chrome.desktop launcher_item_app = /usr/local/share/applications/tint2conf.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 = #eeeeee 100 clock_padding = 1 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = zenity --calendar --text "" clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #eeeeee 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/horizontal-light-opaque.tint2rc000066400000000000000000000127001265276141000300300ustar00rootroot00000000000000#---- Generated by tint2conf 079a ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 0 border_width = 1 background_color = #eeeeee 100 border_color = #bbbbbb 100 background_color_hover = #eeeeee 100 border_color_hover = #bbbbbb 100 background_color_pressed = #eeeeee 100 border_color_pressed = #bbbbbb 100 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #eeeeee 100 border_color = #eeeeee 100 background_color_hover = #eeeeee 100 border_color_hover = #cccccc 100 background_color_pressed = #cccccc 100 border_color_pressed = #cccccc 100 # Background 3: Active task rounded = 5 border_width = 1 background_color = #dddddd 100 border_color = #999999 100 background_color_hover = #eeeeee 100 border_color_hover = #aaaaaa 100 background_color_pressed = #cccccc 100 border_color_pressed = #999999 100 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #eeeeee 100 border_color = #cccccc 100 background_color_hover = #eeeeee 100 border_color_hover = #cccccc 100 background_color_pressed = #eeeeee 100 border_color_pressed = #cccccc 100 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #dddddd 100 border_color = #999999 100 background_color_hover = #dddddd 100 border_color_hover = #999999 100 background_color_pressed = #dddddd 100 border_color_pressed = #999999 100 # Background 8: Systray rounded = 3 border_width = 0 background_color = #dddddd 100 border_color = #cccccc 100 background_color_hover = #dddddd 100 border_color_hover = #cccccc 100 background_color_pressed = #dddddd 100 border_color_pressed = #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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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 = #222222 100 taskbar_name_active_font_color = #222222 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 = #222222 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 = 8 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_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/firefox.desktop launcher_item_app = /usr/share/applications/iceweasel.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 = #222222 100 clock_padding = 1 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = zenity --calendar --text "" clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #222222 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/horizontal-light-transparent.tint2rc000066400000000000000000000126501265276141000311030ustar00rootroot00000000000000#---- Generated by tint2conf 5b63 ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 0 border_width = 1 background_color = #eeeeee 0 border_color = #bbbbbb 10 background_color_hover = #eeeeee 0 border_color_hover = #bbbbbb 10 background_color_pressed = #eeeeee 0 border_color_pressed = #bbbbbb 10 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #eeeeee 4 border_color = #cccccc 44 background_color_hover = #eeeeee 22 border_color_hover = #eaeaea 44 background_color_pressed = #dddddd 4 border_color_pressed = #eaeaea 44 # Background 3: Active task rounded = 5 border_width = 1 background_color = #dddddd 4 border_color = #999999 100 background_color_hover = #eeeeee 22 border_color_hover = #999999 100 background_color_pressed = #dddddd 4 border_color_pressed = #999999 100 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #eeeeee 4 border_color = #cccccc 100 background_color_hover = #eeeeee 22 border_color_hover = #999999 100 background_color_pressed = #dddddd 4 border_color_pressed = #999999 100 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #dddddd 3 border_color = #999999 100 background_color_hover = #dddddd 3 border_color_hover = #999999 100 background_color_pressed = #dddddd 3 border_color_pressed = #999999 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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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_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 clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 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 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_and_text_1.tint2rc000066400000000000000000000045501265276141000263040ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 7 border_width = 2 background_color = #000000 60 border_color = #FFFFFF 17 # ID 2 rounded = 5 border_width = 0 background_color = #FFFFFF 40 border_color = #FFFFFF 49 # ID 3 rounded = 5 border_width = 0 background_color = #FFFFFF 17 border_color = #FFFFFF 69 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 94% 30 panel_margin = 0 0 panel_padding = 7 0 7 panel_dock = 0 wm_menu = 0 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.3 autohide_hide_timeout = 2 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = single_desktop taskbar_padding = 2 3 2 taskbar_background_id = 0 taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 8 task_icon = 1 task_text = 1 task_centered = 1 task_maximum_size = 140 35 task_padding = 6 2 task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 task_tooltip = 0 # Task Icons task_icon_asb = 70 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 70 0 0 # Fonts task_font = sans 7 task_font_color = #FFFFFF 69 task_active_font_color = #FFFFFF 84 task_urgent_font_color = #FFFFFF 84 task_iconified_font_color = #FFFFFF 69 font_shadow = 0 # System Tray systray = 1 systray_padding = 0 4 5 systray_sort = ascending systray_background_id = 0 systray_icon_size = 16 systray_icon_asb = 70 0 0 # Clock time1_format = %H:%M time1_font = sans 8 time2_format = %A %d %B time2_font = sans 6 clock_font_color = #FFFFFF 75 clock_padding = 1 0 clock_background_id = 0 clock_rclick_command = orage # Tooltips tooltip_padding = 2 2 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = sans 10 tooltip_font_color = #000000 80 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_hide = 98 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_and_text_2.tint2rc000066400000000000000000000045701265276141000263070ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 7 border_width = 1 background_color = #000000 60 border_color = #FFFFFF 17 # ID 2 rounded = 5 border_width = 0 background_color = #FFFFFF 40 border_color = #FFFFFF 49 # ID 3 rounded = 5 border_width = 0 background_color = #FFFFFF 17 border_color = #FFFFFF 69 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 98% 28 panel_margin = 0 5 panel_padding = 3 0 3 panel_dock = 0 wm_menu = 0 panel_layer = bottom panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = single_desktop taskbar_padding = 2 2 2 taskbar_background_id = 1 taskbar_active_background_id = 1 # Tasks urgent_nb_of_blink = 8 task_icon = 1 task_text = 1 task_centered = 1 task_maximum_size = 140 35 task_padding = 2 3 task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 task_tooltip = 0 # Task Icons task_icon_asb = 80 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 80 0 0 # Fonts task_font = Sawasdee Bold 8 task_font_color = #FFFFFF 89 task_active_font_color = #FFFFFF 100 task_urgent_font_color = #FFFFFF 100 task_iconified_font_color = #FFFFFF 89 font_shadow = 0 # System Tray systray = 1 systray_padding = 6 0 5 systray_sort = left2right systray_background_id = 1 systray_icon_size = 18 systray_icon_asb = 100 0 -10 # Clock time1_format = %H:%M time1_font = Sawasdee Bold 12 clock_font_color = #FFFFFF 89 clock_tooltip = %A %d %B clock_padding = 4 0 clock_background_id = 1 clock_rclick_command = gsimplecal # Tooltips tooltip_padding = 5 0 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = Sans 10 tooltip_font_color = #000000 80 # Mouse mouse_left = toggle_iconify mouse_middle = close mouse_right = none mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_hide = 95 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_and_text_3.tint2rc000066400000000000000000000047251265276141000263120ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 1 background_color = #EAEAEA 100 border_color = #BBBBBB 100 # ID 2 rounded = 2 border_width = 1 background_color = #E0EBE7 100 border_color = #BBBBBB 100 # ID 3 rounded = 2 border_width = 1 background_color = #FCFAFB 100 border_color = #BBBBBB 100 # ID 4 rounded = 2 border_width = 2 background_color = #E0EBE7 100 border_color = #F15A7D 80 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 100% 30 panel_margin = 0 0 panel_padding = 7 3 4 panel_dock = 0 wm_menu = 1 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = single_desktop taskbar_padding = 0 0 2 taskbar_background_id = 0 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 20 task_icon = 1 task_text = 1 task_centered = 1 task_maximum_size = 140 40 task_padding = 5 3 task_background_id = 2 task_active_background_id = 3 task_urgent_background_id = 4 task_iconified_background_id = 2 task_tooltip = 1 # Task Icons task_icon_asb = 80 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 80 0 0 # Fonts task_font = sans 10 task_font_color = #000000 100 task_active_font_color = #000000 100 task_urgent_font_color = #000000 100 task_iconified_font_color = #000000 100 font_shadow = 0 # System Tray systray = 1 systray_padding = 5 0 5 systray_sort = ascending systray_background_id = 2 systray_icon_size = 15 systray_icon_asb = 100 0 -10 # Clock time1_format = %F %l:%M %P time1_font = sans 10 clock_font_color = #000000 100 clock_tooltip = %A %d %B clock_padding = 1 1 clock_background_id = 0 clock_rclick_command = gsimplecal # Tooltips tooltip_padding = 5 0 tooltip_show_timeout = 1.2 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = Sans 9 tooltip_font_color = #5E5E5E 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 20 battery_low_cmd = notify-send "battery low" battery_hide = 95 bat1_font = Sans 9 bat2_font = Sans 8 battery_font_color = #000000 100 battery_padding = 1 1 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_and_text_4.tint2rc000066400000000000000000000046531265276141000263130ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 5 border_width = 0 background_color = #000000 60 border_color = #FFFFFF 20 # ID 2 rounded = 5 border_width = 1 background_color = #FFFFFF 0 border_color = #FFFFFF 20 # ID 3 rounded = 5 border_width = 0 background_color = #000000 29 border_color = #000000 0 # ID 4 rounded = 5 border_width = 1 background_color = #E80000 60 border_color = #FFFFFF 20 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 92% 28 panel_margin = 0 0 panel_padding = 7 0 7 panel_dock = 0 wm_menu = 1 panel_layer = top panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.0 autohide_hide_timeout = 0.0 autohide_height = 0 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 2 3 2 taskbar_background_id = 3 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 18 task_icon = 1 task_text = 1 task_centered = 1 task_maximum_size = 140 30 task_padding = 2 3 task_background_id = 2 task_active_background_id = 1 task_urgent_background_id = 4 task_iconified_background_id = 2 task_tooltip = 0 # Task Icons task_icon_asb = 100 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 100 0 0 # Fonts task_font = sans 7 task_font_color = #FFFFFF 69 task_active_font_color = #FFFFFF 84 task_urgent_font_color = #FFFFFF 84 task_iconified_font_color = #FFFFFF 69 font_shadow = 0 # System Tray systray = 1 systray_padding = 5 2 5 systray_sort = ascending systray_background_id = 1 systray_icon_size = 16 systray_icon_asb = 100 -10 -5 # Clock time1_format = %H:%M time1_font = sans 8 time2_format = %A %d %B time2_font = sans 6 clock_font_color = #FFFFFF 75 clock_padding = 4 4 clock_background_id = 1 # Tooltips tooltip_padding = 0 0 tooltip_show_timeout = 0 tooltip_hide_timeout = 0 tooltip_background_id = 0 tooltip_font = Sans 12 tooltip_font_color = #FFFFFF 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 95 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 1 0 battery_background_id = 1 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_only_1.tint2rc000066400000000000000000000052641265276141000254620ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 5 border_width = 1 background_color = #44475D 41 border_color = #44475D 100 # ID 2 rounded = 5 border_width = 1 background_color = #FFFFFF 20 border_color = #444444 66 # ID 3 rounded = 0 border_width = 1 background_color = #FFFFFF 20 border_color = #444444 20 # ID 4 rounded = 5 border_width = 1 background_color = #DBDBDB 49 border_color = #222222 74 # ID 5 rounded = 3 border_width = 0 background_color = #44475D 20 border_color = #222222 74 # ID 6 rounded = 3 border_width = 0 background_color = #DE1150 34 border_color = #222222 74 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 96% 37 panel_margin = 0 0 panel_padding = 9 3 9 panel_dock = 0 wm_menu = 1 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.3 autohide_hide_timeout = 1.7 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 0 0 0 taskbar_background_id = 2 taskbar_active_background_id = 4 # Tasks urgent_nb_of_blink = 16 task_icon = 1 task_text = 0 task_centered = 1 task_maximum_size = 40 20 task_padding = 0 2 task_background_id = 0 task_active_background_id = 5 task_urgent_background_id = 6 task_iconified_background_id = 0 task_tooltip = 1 # Task Icons task_icon_asb = 100 -25 -8 task_active_icon_asb = 100 0 -5 task_urgent_icon_asb = 100 0 -5 task_iconified_icon_asb = 100 -25 -8 # Fonts task_font = kiloji 10 task_font_color = #333333 80 task_active_font_color = #333333 100 task_urgent_font_color = #333333 100 task_iconified_font_color = #333333 80 font_shadow = 0 # System Tray systray = 1 systray_padding = 7 0 5 systray_sort = ascending systray_background_id = 2 systray_icon_size = 18 systray_icon_asb = 100 -20 -5 # Clock time1_format = %H:%M time1_font = sans 8 bold time2_format = %A %d %B time2_font = sans 7 clock_font_color = #FFFFFF 75 clock_tooltip = clock_padding = 2 0 clock_background_id = 0 clock_rclick_command = gsimplecal # Tooltips tooltip_padding = 5 3 tooltip_show_timeout = 0.8 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = Sans 8 tooltip_font_color = #FFFFFF 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 20 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 8 bold bat2_font = sans 7 battery_font_color = #FFFFFF 75 battery_padding = 2 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_only_2.tint2rc000066400000000000000000000050061265276141000254550ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 0 background_color = #000000 54 border_color = #9B9B9B 34 # ID 2 rounded = 2 border_width = 0 background_color = #000000 69 border_color = #9B9B9B 74 # ID 3 rounded = 1 border_width = 0 background_color = #000000 69 border_color = #FFFFFF 20 # ID 4 rounded = 0 border_width = 0 background_color = #BBBBBB 20 border_color = #BBBBBB 29 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 100% 37 panel_margin = 0 0 panel_padding = 5 2 3 panel_dock = 0 wm_menu = 1 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 0 0 0 taskbar_background_id = 0 taskbar_active_background_id = 2 # Tasks urgent_nb_of_blink = 21 task_icon = 1 task_text = 0 task_centered = 1 task_maximum_size = 50 35 task_padding = 4 2 task_background_id = 0 task_active_background_id = 3 task_urgent_background_id = 3 task_iconified_background_id = 0 task_tooltip = 1 # Task Icons task_icon_asb = 90 -100 -20 task_active_icon_asb = 100 -70 -10 task_urgent_icon_asb = 100 -70 -10 task_iconified_icon_asb = 90 -100 -20 # Fonts task_font = kiloji 8 task_font_color = #A0A0A0 100 task_active_font_color = #D4D4D4 100 task_urgent_font_color = #D4D4D4 100 task_iconified_font_color = #A0A0A0 100 font_shadow = 0 # System Tray systray = 1 systray_padding = 8 1 5 systray_sort = ascending systray_background_id = 2 systray_icon_size = 16 systray_icon_asb = 100 -90 -15 # Clock time1_format = %H:%M time1_font = sans 8 bold time2_format = %A %d %B time2_font = sans 7 clock_font_color = #FFFFFF 75 clock_tooltip = %A %d %B clock_padding = 2 0 clock_background_id = 0 clock_rclick_command = gsimplecal # Tooltips tooltip_padding = 2 2 tooltip_show_timeout = 0.9 tooltip_hide_timeout = 0.3 tooltip_background_id = 4 tooltip_font = sans 10 tooltip_font_color = #000000 80 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 1 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_only_3.tint2rc000066400000000000000000000044031265276141000254560ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 1 border_width = 0 background_color = #282828 49 border_color = #000000 0 # ID 2 rounded = 1 border_width = 1 background_color = #FFFFFF 29 border_color = #FFFFFF 60 # ID 3 rounded = 5 border_width = 0 background_color = #FFFFFF 17 border_color = #FFFFFF 69 # ID 4 rounded = 1 border_width = 0 background_color = #FFFFFF 29 border_color = #FFFFFF 60 # Panel panel_monitor = all panel_position = bottom left horizontal panel_size = 100% 38 panel_margin = 0 0 panel_padding = 7 3 7 panel_dock = 0 wm_menu = 0 panel_layer = bottom panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.3 autohide_hide_timeout = 2 autohide_height = 4 strut_policy = minimum # Taskbar taskbar_mode = multi_desktop taskbar_padding = 0 0 0 taskbar_background_id = 1 taskbar_active_background_id = 1 # Tasks urgent_nb_of_blink = 15 task_icon = 1 task_text = 0 task_centered = 1 task_maximum_size = 45 35 task_padding = 2 1 task_background_id = 0 task_active_background_id = 2 task_urgent_background_id = 4 task_iconified_background_id = 0 task_tooltip = 0 # Task Icons task_icon_asb = 70 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 70 0 0 task_iconified_icon_asb = 70 0 0 # Fonts task_font = sans bold 9 task_font_color = #FFFFFF 60 task_active_font_color = #FFFFFF 100 task_urgent_font_color = #FFFFFF 100 task_iconified_font_color = #FFFFFF 60 font_shadow = 0 # System Tray systray = 1 systray_padding = 0 4 5 systray_sort = left2right systray_background_id = 0 systray_icon_size = 20 systray_icon_asb = 100 0 0 # Tooltips tooltip_padding = 2 2 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = sans 10 tooltip_font_color = #000000 80 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = none mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_only_4.tint2rc000066400000000000000000000044261265276141000254640ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 1 background_color = #888888 29 border_color = #000000 29 # ID 2 rounded = 3 border_width = 1 background_color = #888888 69 border_color = #FFFFFF 49 # ID 3 rounded = 3 border_width = 1 background_color = #888888 29 border_color = #FFFFFF 20 # ID 4 rounded = 3 border_width = 1 background_color = #888888 29 border_color = #ED2323 60 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 100% 40 panel_margin = 0 0 panel_padding = 0 0 0 panel_dock = 0 wm_menu = 1 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 6 1 6 taskbar_background_id = 0 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 20 task_icon = 1 task_text = 0 task_centered = 1 task_maximum_size = 40 40 task_padding = 6 3 task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 4 task_iconified_background_id = 3 task_tooltip = 1 # Task Icons task_icon_asb = 90 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 90 0 0 # Fonts task_font = kroeger 06_55 6 task_font_color = #222222 100 task_active_font_color = #000000 100 task_urgent_font_color = #000000 100 task_iconified_font_color = #222222 100 font_shadow = 0 # System Tray systray = 1 systray_padding = 4 4 5 systray_sort = ascending systray_background_id = 0 systray_icon_size = 20 systray_icon_asb = 100 0 -10 # Tooltips tooltip_padding = 5 0 tooltip_show_timeout = 0.8 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = Sans 10 tooltip_font_color = #FFFFFF 80 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 20 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = Sans 12 bat2_font = Sans 12 battery_font_color = #FFFFFF 100 battery_padding = 0 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_only_6.tint2rc000066400000000000000000000047511265276141000254670ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 5 border_width = 0 background_color = #000000 49 border_color = #FFFFFF 40 # ID 2 rounded = 5 border_width = 0 background_color = #FFFFFF 60 border_color = #FFFFFF 49 # ID 3 rounded = 5 border_width = 0 background_color = #FFFFFF 24 border_color = #FFFFFF 69 # ID 4 rounded = 5 border_width = 0 background_color = #BDBDBD 80 border_color = #FFFFFF 69 # Panel panel_monitor = all panel_position = top left vertical panel_size = 75% 50 panel_margin = 0 0 panel_padding = 2 2 2 panel_dock = 0 wm_menu = 0 panel_layer = top panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.3 autohide_hide_timeout = 2 autohide_height = 4 strut_policy = minimum # Taskbar taskbar_mode = single_desktop taskbar_padding = 2 2 2 taskbar_background_id = 1 taskbar_active_background_id = 1 # Tasks urgent_nb_of_blink = 20 task_icon = 1 task_text = 0 task_centered = 1 task_maximum_size = 140 35 task_padding = 6 3 task_background_id = 3 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 3 task_tooltip = 1 # Task Icons task_icon_asb = 100 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 90 0 0 # Fonts task_font = sans 7 task_font_color = #FFFFFF 69 task_active_font_color = #FFFFFF 84 task_urgent_font_color = #EC9B9B 84 task_iconified_font_color = #FFFFFF 69 font_shadow = 1 # System Tray systray = 1 systray_padding = 4 4 5 systray_sort = left2right systray_background_id = 1 systray_icon_size = 16 systray_icon_asb = 100 0 0 # Clock time1_format = %H:%M time1_font = sans bold 8 time2_format = %h.%e time2_font = sans 6 clock_font_color = #FFFFFF 75 clock_tooltip = %A %d %B clock_padding = 4 2 clock_background_id = 1 clock_rclick_command = zenity --calendar # Tooltips tooltip_padding = 3 2 tooltip_show_timeout = 0.9 tooltip_hide_timeout = 0.3 tooltip_background_id = 4 tooltip_font = sans 8 tooltip_font_color = #000000 89 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_hide = 98 bat1_font = sans bold 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 4 2 battery_background_id = 1 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/icon_only_7.tint2rc000066400000000000000000000047321265276141000254670ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 1 border_width = 0 background_color = #282828 60 border_color = #000000 0 # ID 2 rounded = 1 border_width = 1 background_color = #CCCCCC 0 border_color = #CCCCCC 54 # ID 3 rounded = 1 border_width = 0 background_color = #CCCCCC 20 border_color = #CCCCCC 40 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 95% 30 panel_margin = 0 0 panel_padding = 7 3 7 panel_dock = 0 wm_menu = 1 panel_layer = top panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 0 0 0 taskbar_background_id = 2 taskbar_active_background_id = 2 # Tasks urgent_nb_of_blink = 7 task_icon = 1 task_text = 0 task_centered = 1 task_maximum_size = 34 34 task_padding = 2 3 task_background_id = 0 task_active_background_id = 3 task_urgent_background_id = 0 task_iconified_background_id = 0 task_tooltip = 1 # Task Icons task_icon_asb = 100 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 100 0 0 # Fonts task_font = sans 8 task_font_color = #FFFFFF 60 task_active_font_color = #FFFFFF 100 task_urgent_font_color = #FFFFFF 60 task_iconified_font_color = #FFFFFF 60 font_shadow = 0 # System Tray systray = 1 systray_padding = 0 0 5 systray_sort = ascending systray_background_id = 0 systray_icon_size = 16 systray_icon_asb = 100 0 0 # Clock time1_format = Paris %H:%M - %d/%m time1_font = sans 7 time2_format = Moscow %H:%M - %d/%m time2_font = sans 7 clock_font_color = #FFFFFF 100 clock_tooltip = clock_padding = 1 0 clock_background_id = 0 clock_rclick_command = gsimplecal time1_timezone = :Europe/Paris time2_timezone = :Europe/Moscow # Tooltips tooltip_padding = 5 4 tooltip_show_timeout = 0.8 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = Sans 7 tooltip_font_color = #FFFFFF 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 1 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 7 bat2_font = sans 7 battery_font_color = #FFFFFF 100 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/text_only_1.tint2rc000066400000000000000000000051461265276141000255150ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 1 background_color = #076073 100 border_color = #076073 100 # ID 2 rounded = 0 border_width = 0 background_color = #000000 100 border_color = #FFFFFF 8 # ID 3 rounded = 0 border_width = 0 background_color = #222222 100 border_color = #222222 8 # ID 4 rounded = 0 border_width = 0 background_color = #222222 100 border_color = #222222 8 # ID 5 rounded = 0 border_width = 0 background_color = #FFFFFF 100 border_color = #FFFFFF 8 # Panel panel_monitor = LVDS panel_position = bottom left horizontal panel_size = 100% 35 panel_margin = 0 0 panel_padding = 0 0 0 panel_dock = 0 wm_menu = 1 panel_layer = bottom panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 12 9 12 taskbar_background_id = 2 taskbar_active_background_id = 2 # Tasks urgent_nb_of_blink = 7 task_icon = 0 task_text = 1 task_centered = 1 task_maximum_size = 0 32 task_padding = 5 2 task_background_id = 4 task_active_background_id = 1 task_urgent_background_id = 0 task_iconified_background_id = 4 task_tooltip = 0 # Task Icons task_icon_asb = 100 -90 -15 task_active_icon_asb = 100 -70 0 task_urgent_icon_asb = 100 -90 -15 task_iconified_icon_asb = 100 -90 -15 # Fonts task_font = Aller 7.6 task_font_color = #D3CAAA 33 task_active_font_color = #FFFFFF 100 task_urgent_font_color = #FFFFFF 100 task_iconified_font_color = #D3CAAA 33 font_shadow = 0 # System Tray systray = 1 systray_padding = 5 5 5 systray_sort = ascending systray_background_id = 4 systray_icon_size = 18 systray_icon_asb = 100 -90 -15 # Clock time1_format = %H:%M time1_font = Diavlo 12 time2_format = %b %d time2_font = Diavlo 6 clock_font_color = #FFFFFF 100 clock_tooltip = %A %d %B clock_padding = 4 2 clock_background_id = 1 clock_rclick_command = gsimplecal # Tooltips tooltip_padding = 5 5 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 tooltip_background_id = 4 tooltip_font = Aller 8 tooltip_font_color = #D3CAAA 33 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 1 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = Diavlo 10 bat2_font = Aller 0 battery_font_color = #D3CAAA 48 battery_padding = 4 2 battery_background_id = 4 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/text_only_2.tint2rc000066400000000000000000000051461265276141000255160ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 1 background_color = #730A07 100 border_color = #730A07 100 # ID 2 rounded = 0 border_width = 0 background_color = #000000 100 border_color = #FFFFFF 8 # ID 3 rounded = 0 border_width = 0 background_color = #222222 100 border_color = #222222 8 # ID 4 rounded = 0 border_width = 0 background_color = #222222 100 border_color = #222222 8 # ID 5 rounded = 0 border_width = 0 background_color = #FFFFFF 100 border_color = #FFFFFF 8 # Panel panel_monitor = all panel_position = bottom left horizontal panel_size = 100% 42 panel_margin = 0 0 panel_padding = 0 0 0 panel_dock = 0 wm_menu = 1 panel_layer = bottom panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = multi_desktop taskbar_padding = 12 7 12 taskbar_background_id = 2 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 7 task_icon = 0 task_text = 1 task_centered = 1 task_maximum_size = 0 32 task_padding = 5 1 task_background_id = 4 task_active_background_id = 1 task_urgent_background_id = 0 task_iconified_background_id = 4 task_tooltip = 0 # Task Icons task_icon_asb = 100 -90 -15 task_active_icon_asb = 100 -70 0 task_urgent_icon_asb = 100 -90 -15 task_iconified_icon_asb = 100 -90 -15 # Fonts task_font = Aller 7.6 task_font_color = #D3CAAA 33 task_active_font_color = #FFFFFF 100 task_urgent_font_color = #FFFFFF 100 task_iconified_font_color = #D3CAAA 33 font_shadow = 0 # System Tray systray = 1 systray_padding = 5 5 5 systray_sort = ascending systray_background_id = 4 systray_icon_size = 18 systray_icon_asb = 100 -90 -15 # Clock time1_format = %H:%M time1_font = Diavlo 12 time2_format = %b %d time2_font = Diavlo 6 clock_font_color = #FFFFFF 100 clock_tooltip = %A %d %B clock_padding = 4 2 clock_background_id = 1 clock_rclick_command = gsimplecal # Tooltips tooltip_padding = 5 5 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 tooltip_background_id = 4 tooltip_font = Aller 8 tooltip_font_color = #D3CAAA 33 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 1 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = Diavlo 10 bat2_font = Aller 0 battery_font_color = #D3CAAA 48 battery_padding = 4 2 battery_background_id = 4 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/text_only_3.tint2rc000066400000000000000000000043251265276141000255150ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 1 border_width = 0 background_color = #282828 100 border_color = #000000 0 # ID 2 rounded = 1 border_width = 0 background_color = #F6B655 85 border_color = #CCCCCC 40 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 100% 22 panel_margin = 0 0 panel_padding = 3 0 3 panel_dock = 0 wm_menu = 1 panel_layer = bottom panel_background_id = 1 # Panel Autohide autohide = 0 autohide_show_timeout = 0.0 autohide_hide_timeout = 0.0 autohide_height = 0 strut_policy = follow_size # Taskbar taskbar_mode = single_desktop taskbar_padding = 0 0 0 taskbar_background_id = 0 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 7 task_icon = 0 task_text = 1 task_centered = 1 task_maximum_size = 200 32 task_padding = 5 0 task_background_id = 0 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 0 task_tooltip = 0 # Task Icons task_icon_asb = 100 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 100 0 0 # Fonts task_font = sans 7.5 task_font_color = #FFFFFF 60 task_active_font_color = #000000 100 task_urgent_font_color = #000000 100 task_iconified_font_color = #FFFFFF 60 font_shadow = 0 # System Tray systray = 1 systray_padding = 3 0 3 systray_sort = ascending systray_background_id = 0 systray_icon_size = 14 systray_icon_asb = 100 -90 -15 # Clock time1_format = %H:%M time1_font = sans 13 clock_font_color = #FFFFFF 85 clock_padding = 2 0 clock_background_id = 0 # Tooltips tooltip_padding = 2 2 tooltip_show_timeout = 0.5 tooltip_hide_timeout = 1.2 tooltip_background_id = 1 tooltip_font = Sans 9 tooltip_font_color = #FFFFFF 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 1 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 7 bat2_font = sans 6 battery_font_color = #FFFFFF 100 battery_padding = 2 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/text_only_4.tint2rc000066400000000000000000000041311265276141000255110ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 3 border_width = 1 background_color = #000000 40 border_color = #D1D1D1 30 # ID 2 rounded = 3 border_width = 1 background_color = #000000 51 border_color = #D1D1D1 40 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 97% 26 panel_margin = 0 0 panel_padding = 0 2 5 panel_dock = 0 wm_menu = 1 panel_layer = bottom panel_background_id = 0 # Panel Autohide autohide = 0 autohide_show_timeout = 0.0 autohide_hide_timeout = 0.0 autohide_height = 0 strut_policy = follow_size # Taskbar taskbar_mode = single_desktop taskbar_padding = 0 0 5 taskbar_background_id = 0 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 7 task_icon = 0 task_text = 1 task_centered = 1 task_maximum_size = 160 30 task_padding = 3 1 task_background_id = 1 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 1 task_tooltip = 0 # Task Icons task_icon_asb = 100 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 100 0 0 # Fonts task_font = sans bold 7.5 task_font_color = #FFFFFF 60 task_active_font_color = #FFFFFF 86 task_urgent_font_color = #FFFFFF 86 task_iconified_font_color = #FFFFFF 60 font_shadow = 0 # System Tray systray = 1 systray_padding = 6 2 6 systray_sort = ascending systray_background_id = 1 systray_icon_size = 16 systray_icon_asb = 100 -100 -15 # Tooltips tooltip_padding = 0 0 tooltip_show_timeout = 0 tooltip_hide_timeout = 0 tooltip_background_id = 0 tooltip_font = Sans 12 tooltip_font_color = #FFFFFF 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 7 bat2_font = sans 7 battery_font_color = #FFFFFF 100 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/text_only_5.tint2rc000066400000000000000000000045261265276141000255220ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 0 background_color = #FFFFFF 0 border_color = #FFFFFF 60 # ID 2 rounded = 0 border_width = 1 background_color = #333333 40 border_color = #FFFFFF 40 # ID 3 rounded = 0 border_width = 0 background_color = #EEEEEC 60 border_color = #FFFFFF 100 # Panel panel_monitor = all panel_position = bottom center horizontal panel_size = 99% 27 panel_margin = 0 0 panel_padding = 3 3 3 panel_dock = 0 wm_menu = 1 panel_layer = bottom panel_background_id = 3 # Panel Autohide autohide = 0 autohide_show_timeout = 0.2 autohide_hide_timeout = 1.6 autohide_height = 1 strut_policy = minimum # Taskbar taskbar_mode = multi_desktop taskbar_padding = 0 0 0 taskbar_background_id = 0 taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 7 task_icon = 0 task_text = 1 task_centered = 1 task_maximum_size = 200 30 task_padding = 5 0 task_background_id = 1 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 1 task_tooltip = 1 # Task Icons task_icon_asb = 50 0 0 task_active_icon_asb = 100 0 0 task_urgent_icon_asb = 100 0 0 task_iconified_icon_asb = 50 0 0 # Fonts task_font = AvantGardeLTMedium 8 task_font_color = #151515 60 task_active_font_color = #FFFFFF 60 task_urgent_font_color = #7E9659 89 task_iconified_font_color = #FFFFFF 69 font_shadow = 0 # System Tray systray = 1 systray_padding = 4 2 3 systray_sort = ascending systray_background_id = 0 systray_icon_size = 15 systray_icon_asb = 100 0 -10 # Clock time1_format = %H:%M / %a %d %b time1_font = AvantGardeLTMedium 8 clock_font_color = #151515 60 clock_padding = 4 0 clock_background_id = 0 # Tooltips tooltip_padding = 3 3 tooltip_show_timeout = 1.5 tooltip_hide_timeout = 0.3 tooltip_background_id = 1 tooltip_font = AvantGardeLTMedium 8 tooltip_font_color = #434141 100 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 7 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #151515 60 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/text_only_6.tint2rc000066400000000000000000000043021265276141000255130ustar00rootroot00000000000000# Tint2 config file # Generated by tintwizard (http://code.google.com/p/tintwizard/) # For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure # Background definitions # ID 1 rounded = 0 border_width = 0 background_color = #303030 89 border_color = #FFFFFF 17 # ID 2 rounded = 0 border_width = 0 background_color = #303030 89 border_color = #FFFFFF 49 # ID 3 rounded = 0 border_width = 0 background_color = #303030 49 border_color = #FFFFFF 69 # Panel panel_monitor = all panel_position = top center horizontal panel_size = 94% 38 panel_margin = 0 1 panel_padding = 10 6 6 panel_dock = 0 wm_menu = 1 panel_layer = bottom panel_background_id = 3 # Panel Autohide autohide = 0 autohide_show_timeout = 0.7 autohide_hide_timeout = 1.5 autohide_height = 2 strut_policy = follow_size # Taskbar taskbar_mode = single_desktop taskbar_padding = 0 0 6 taskbar_background_id = 0 #taskbar_active_background_id = 0 # Tasks urgent_nb_of_blink = 7 task_icon = 0 task_text = 1 task_centered = 1 task_maximum_size = 120 32 task_padding = 6 2 task_background_id = 2 task_active_background_id = 2 task_urgent_background_id = 2 task_iconified_background_id = 0 task_tooltip = 0 # Task Icons task_icon_asb = 100 -90 -15 task_active_icon_asb = 100 -70 0 task_urgent_icon_asb = 100 -90 -15 task_iconified_icon_asb = 100 -90 -15 # Fonts task_font = BasicDots 6 task_font_color = #FFFFFF 69 task_active_font_color = #7E9659 89 task_urgent_font_color = #7E9659 89 task_iconified_font_color = #FFFFFF 69 font_shadow = 0 # System Tray systray = 1 systray_padding = 6 3 0 systray_sort = ascending systray_background_id = 1 systray_icon_size = 18 systray_icon_asb = 100 -70 -15 # Tooltips tooltip_padding = 5 5 tooltip_show_timeout = 0.7 tooltip_hide_timeout = 0.3 tooltip_background_id = -1 tooltip_font = Aller 8 tooltip_font_color = #D3CAAA 33 # Mouse mouse_left = toggle_iconify mouse_middle = none mouse_right = close mouse_scroll_up = toggle mouse_scroll_down = iconify # Battery battery = 0 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_hide = 90 bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #FFFFFF 75 battery_padding = 1 0 battery_background_id = 0 # End of config tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/tint2rc000066400000000000000000000114061265276141000232450ustar00rootroot00000000000000#---- Generated by tint2conf 2641 ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 0 border_width = 0 background_color = #000000 60 border_color = #000000 30 background_color_hover = #000000 60 border_color_hover = #000000 30 background_color_pressed = #000000 60 border_color_pressed = #000000 30 # Background 2: Default task, Iconified task rounded = 4 border_width = 1 background_color = #777777 20 border_color = #777777 30 background_color_hover = #aaaaaa 22 border_color_hover = #eaeaea 44 background_color_pressed = #555555 4 border_color_pressed = #eaeaea 44 # Background 3: Active task rounded = 4 border_width = 1 background_color = #777777 20 border_color = #ffffff 40 background_color_hover = #aaaaaa 22 border_color_hover = #eaeaea 44 background_color_pressed = #555555 4 border_color_pressed = #eaeaea 44 # Background 4: Urgent task rounded = 4 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #cc7700 100 border_color_hover = #aa7733 100 background_color_pressed = #555555 4 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 1 border_width = 1 background_color = #ffffaa 100 border_color = #000000 100 background_color_hover = #ffffaa 100 border_color_hover = #000000 100 background_color_pressed = #ffffaa 100 border_color_pressed = #000000 100 #------------------------------------- # Panel panel_items = LTSC panel_size = 100% 30 panel_margin = 0 0 panel_padding = 2 0 2 panel_background_id = 1 wm_menu = 1 panel_dock = 0 panel_position = bottom center horizontal panel_layer = top panel_monitor = all primary_monitor_first = 0 autohide = 0 autohide_show_timeout = 0 autohide_hide_timeout = 0.5 autohide_height = 2 strut_policy = follow_size panel_window_name = tint2 disable_transparency = 1 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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_always_show_all_desktop_tasks = 0 taskbar_name_padding = 4 2 taskbar_name_background_id = 0 taskbar_name_active_background_id = 0 taskbar_name_font_color = #e3e3e3 100 taskbar_name_active_font_color = #ffffff 100 taskbar_distribute_size = 0 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 = 150 35 task_padding = 2 2 4 task_tooltip = 1 task_font_color = #ffffff 100 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 = toggle mouse_scroll_down = iconify #------------------------------------- # System tray (notification area) systray_padding = 0 4 2 systray_background_id = 0 systray_sort = ascending systray_icon_size = 24 systray_icon_asb = 100 0 0 systray_monitor = 1 #------------------------------------- # Launcher launcher_padding = 2 4 2 launcher_background_id = 0 launcher_icon_background_id = 0 launcher_icon_size = 24 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_timezone = time2_timezone = clock_font_color = #ffffff 100 clock_padding = 2 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" battery_font_color = #ffffff 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # Tooltip tooltip_show_timeout = 0.5 tooltip_hide_timeout = 0.1 tooltip_padding = 2 2 tooltip_background_id = 5 tooltip_font_color = #222222 100 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/vertical-dark-opaque.tint2rc000066400000000000000000000125031265276141000272630ustar00rootroot00000000000000#---- Generated by tint2conf 14e9 ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 5 border_width = 1 background_color = #111111 100 border_color = #333333 100 background_color_hover = #111111 100 border_color_hover = #333333 100 background_color_pressed = #111111 100 border_color_pressed = #333333 100 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #111111 100 border_color = #222222 100 background_color_hover = #111111 100 border_color_hover = #555555 100 background_color_pressed = #333333 100 border_color_pressed = #555555 100 # Background 3: Active task rounded = 5 border_width = 1 background_color = #222222 100 border_color = #777777 100 background_color_hover = #333333 100 border_color_hover = #777777 100 background_color_pressed = #555555 100 border_color_pressed = #777777 100 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #111111 100 border_color = #222222 100 background_color_hover = #111111 100 border_color_hover = #333333 100 background_color_pressed = #555555 100 border_color_pressed = #333333 100 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #222222 100 border_color = #777777 100 background_color_hover = #222222 100 border_color_hover = #777777 100 background_color_pressed = #222222 100 border_color_pressed = #777777 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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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 = #dddddd 100 taskbar_name_active_font_color = #dddddd 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 = #eeeeee 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_background_id = -1 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/firefox.desktop launcher_item_app = /usr/share/applications/iceweasel.desktop launcher_item_app = /usr/share/applications/google-chrome.desktop launcher_item_app = /usr/local/share/applications/tint2conf.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 = #eeeeee 100 clock_padding = 1 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = zenity --calendar --text "" clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #eeeeee 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/vertical-dark-transparent.tint2rc000066400000000000000000000124371265276141000303400ustar00rootroot00000000000000#---- Generated by tint2conf fc8e ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 5 border_width = 1 background_color = #000000 80 border_color = #555555 80 background_color_hover = #000000 80 border_color_hover = #555555 80 background_color_pressed = #000000 80 border_color_pressed = #555555 80 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #777777 0 border_color = #777777 10 background_color_hover = #777777 4 border_color_hover = #cccccc 30 background_color_pressed = #333333 4 border_color_pressed = #777777 30 # Background 3: Active task rounded = 5 border_width = 1 background_color = #555555 10 border_color = #ffffff 60 background_color_hover = #cccccc 10 border_color_hover = #ffffff 60 background_color_pressed = #555555 10 border_color_pressed = #ffffff 60 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #777777 0 border_color = #777777 30 background_color_hover = #777777 4 border_color_hover = #cccccc 30 background_color_pressed = #777777 0 border_color_pressed = #777777 30 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #555555 10 border_color = #ffffff 60 background_color_hover = #555555 10 border_color_hover = #ffffff 60 background_color_pressed = #555555 10 border_color_pressed = #ffffff 60 #------------------------------------- # 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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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 = #dddddd 100 taskbar_name_active_font_color = #dddddd 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 = #eeeeee 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_background_id = -1 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/firefox.desktop launcher_item_app = /usr/share/applications/iceweasel.desktop launcher_item_app = /usr/share/applications/google-chrome.desktop launcher_item_app = /usr/local/share/applications/tint2conf.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 = #eeeeee 100 clock_padding = 1 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = zenity --calendar --text "" clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #eeeeee 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/vertical-light-opaque.tint2rc000066400000000000000000000131021265276141000274450ustar00rootroot00000000000000#---- Generated by tint2conf 1f37 ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 0 border_width = 1 background_color = #eeeeee 100 border_color = #bbbbbb 100 background_color_hover = #eeeeee 100 border_color_hover = #bbbbbb 100 background_color_pressed = #eeeeee 100 border_color_pressed = #bbbbbb 100 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #eeeeee 100 border_color = #cccccc 100 background_color_hover = #fafafa 100 border_color_hover = #cccccc 100 background_color_pressed = #cccccc 100 border_color_pressed = #cccccc 100 # Background 3: Active task rounded = 5 border_width = 1 background_color = #dddddd 100 border_color = #999999 100 background_color_hover = #fafafa 100 border_color_hover = #aaaaaa 100 background_color_pressed = #cccccc 100 border_color_pressed = #999999 100 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #eeeeee 100 border_color = #cccccc 100 background_color_hover = #fafafa 100 border_color_hover = #cccccc 100 background_color_pressed = #eeeeee 100 border_color_pressed = #cccccc 100 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #dddddd 100 border_color = #999999 100 background_color_hover = #dddddd 100 border_color_hover = #999999 100 background_color_pressed = #dddddd 100 border_color_pressed = #999999 100 # Background 8: Systray rounded = 3 border_width = 0 background_color = #dddddd 100 border_color = #cccccc 100 background_color_hover = #cccccc 100 border_color_hover = #cccccc 100 background_color_pressed = #cccccc 100 border_color_pressed = #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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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 = #222222 100 taskbar_name_active_font_color = #222222 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 = #222222 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 = 8 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_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/firefox.desktop launcher_item_app = /usr/share/applications/iceweasel.desktop launcher_item_app = /usr/share/applications/google-chrome.desktop launcher_item_app = /usr/local/share/applications/tint2conf.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 = #222222 100 clock_padding = 1 0 clock_background_id = 0 clock_tooltip = clock_tooltip_timezone = clock_lclick_command = zenity --calendar --text "" clock_rclick_command = orage clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 battery_low_status = 10 battery_low_cmd = notify-send "battery low" bat1_font = sans 8 bat2_font = sans 6 battery_font_color = #222222 100 battery_padding = 1 0 battery_background_id = 0 battery_hide = 101 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/sample/vertical-light-transparent.tint2rc000066400000000000000000000126431265276141000305250ustar00rootroot00000000000000#---- Generated by tint2conf 812e ---- # See https://gitlab.com/o9000/tint2/wikis/Configure for # full documentation of the configuration options. #------------------------------------- # Backgrounds # Background 1: Panel rounded = 0 border_width = 1 background_color = #eeeeee 0 border_color = #bbbbbb 10 background_color_hover = #eeeeee 0 border_color_hover = #bbbbbb 10 background_color_pressed = #eeeeee 0 border_color_pressed = #bbbbbb 10 # Background 2: Default task, Iconified task rounded = 5 border_width = 1 background_color = #eeeeee 4 border_color = #eeeeee 0 background_color_hover = #eeeeee 22 border_color_hover = #eaeaea 44 background_color_pressed = #dddddd 4 border_color_pressed = #eaeaea 44 # Background 3: Active task rounded = 5 border_width = 1 background_color = #dddddd 4 border_color = #999999 100 background_color_hover = #eeeeee 22 border_color_hover = #999999 100 background_color_pressed = #dddddd 4 border_color_pressed = #999999 100 # Background 4: Urgent task rounded = 5 border_width = 1 background_color = #aa4400 100 border_color = #aa7733 100 background_color_hover = #aa4400 100 border_color_hover = #aa7733 100 background_color_pressed = #aa4400 100 border_color_pressed = #aa7733 100 # Background 5: Tooltip rounded = 2 border_width = 1 background_color = #ffffaa 100 border_color = #999999 100 background_color_hover = #ffffaa 100 border_color_hover = #999999 100 background_color_pressed = #ffffaa 100 border_color_pressed = #999999 100 # Background 6: Inactive desktop name rounded = 2 border_width = 1 background_color = #eeeeee 4 border_color = #999999 100 background_color_hover = #eeeeee 22 border_color_hover = #999999 100 background_color_pressed = #dddddd 4 border_color_pressed = #999999 100 # Background 7: Active desktop name rounded = 2 border_width = 1 background_color = #dddddd 3 border_color = #999999 100 background_color_hover = #dddddd 3 border_color_hover = #999999 100 background_color_pressed = #dddddd 3 border_color_pressed = #999999 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 mouse_effects = 1 font_shadow = 0 mouse_hover_icon_asb = 100 0 10 mouse_pressed_icon_asb = 100 0 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_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 clock_mclick_command = clock_uwheel_command = clock_dwheel_command = #------------------------------------- # Battery battery_tooltip = 1 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 battery_lclick_command = battery_rclick_command = battery_mclick_command = battery_uwheel_command = battery_dwheel_command = ac_connected_cmd = ac_disconnected_cmd = #------------------------------------- # 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/000077500000000000000000000000001265276141000212415ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/000077500000000000000000000000001265276141000227135ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/battery.c000066400000000000000000000272161265276141000245410ustar00rootroot00000000000000/************************************************************************** * * Tint2 : Generic battery * * Copyright (C) 2009-2015 Sebastian Reichel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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 #include #include #include #include #include #include "window.h" #include "server.h" #include "panel.h" #include "battery.h" #include "timer.h" #include "common.h" gboolean bat1_has_font; PangoFontDescription *bat1_font_desc; gboolean bat2_has_font; PangoFontDescription *bat2_font_desc; struct BatteryState battery_state; gboolean battery_enabled; gboolean battery_tooltip_enabled; int percentage_hide; static timeout *battery_timeout; static char buf_bat_percentage[10]; static char buf_bat_time[20]; int8_t battery_low_status; gboolean battery_low_cmd_sent; char *ac_connected_cmd; char *ac_disconnected_cmd; char *battery_low_cmd; char *battery_lclick_command; char *battery_mclick_command; char *battery_rclick_command; char *battery_uwheel_command; char *battery_dwheel_command; gboolean battery_found; void battery_init_fonts(); char *battery_get_tooltip(void *obj); void default_battery() { battery_enabled = FALSE; battery_tooltip_enabled = TRUE; battery_found = FALSE; percentage_hide = 101; battery_low_cmd_sent = FALSE; battery_timeout = NULL; bat1_has_font = FALSE; bat1_font_desc = NULL; bat2_has_font = FALSE; bat2_font_desc = NULL; ac_connected_cmd = NULL; ac_disconnected_cmd = 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; battery_state.percentage = 0; battery_state.time.hours = 0; battery_state.time.minutes = 0; battery_state.time.seconds = 0; battery_state.state = BATTERY_UNKNOWN; } void cleanup_battery() { pango_font_description_free(bat1_font_desc); bat1_font_desc = NULL; pango_font_description_free(bat2_font_desc); bat2_font_desc = 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; free(ac_connected_cmd); ac_connected_cmd = NULL; free(ac_disconnected_cmd); ac_disconnected_cmd = NULL; stop_timeout(battery_timeout); battery_timeout = NULL; battery_found = FALSE; battery_os_free(); } void init_battery() { if (!battery_enabled) return; battery_found = battery_os_init(); if (!battery_timeout) battery_timeout = add_timeout(10, 30000, update_battery_tick, 0, &battery_timeout); update_battery(); } void reinit_battery() { battery_os_free(); battery_found = battery_os_init(); update_battery(); } void init_battery_panel(void *p) { Panel *panel = (Panel *)p; Battery *battery = &panel->battery; if (!battery_enabled) return; battery_init_fonts(); if (!battery->area.bg) battery->area.bg = &g_array_index(backgrounds, Background, 0); battery->area.parent = p; battery->area.panel = p; battery->area._draw_foreground = draw_battery; battery->area.size_mode = LAYOUT_FIXED; battery->area._resize = resize_battery; battery->area.on_screen = TRUE; battery->area.resize_needed = 1; battery->area.has_mouse_over_effect = panel_config.mouse_effects && (battery_lclick_command || battery_mclick_command || battery_rclick_command || battery_uwheel_command || battery_dwheel_command); battery->area.has_mouse_press_effect = battery->area.has_mouse_over_effect; if (battery_tooltip_enabled) battery->area._get_tooltip_text = battery_get_tooltip; } void battery_init_fonts() { if (!bat1_font_desc) { bat1_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(bat1_font_desc, pango_font_description_get_size(bat1_font_desc) - PANGO_SCALE); } if (!bat2_font_desc) { bat2_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(bat2_font_desc, pango_font_description_get_size(bat2_font_desc) - PANGO_SCALE); } } void battery_default_font_changed() { if (!battery_enabled) return; if (bat1_has_font && bat2_has_font) return; if (!bat1_has_font) { pango_font_description_free(bat1_font_desc); bat1_font_desc = NULL; } if (!bat2_has_font) { pango_font_description_free(bat2_font_desc); bat2_font_desc = NULL; } battery_init_fonts(); for (int i = 0; i < num_panels; i++) { panels[i].battery.area.resize_needed = TRUE; schedule_redraw(&panels[i].battery.area); } panel_refresh = TRUE; } void update_battery_tick(void *arg) { if (!battery_enabled) return; gboolean old_found = battery_found; int old_percentage = battery_state.percentage; gboolean old_ac_connected = battery_state.ac_connected; int16_t old_hours = battery_state.time.hours; int8_t old_minutes = battery_state.time.minutes; if (!battery_found) { init_battery(); old_ac_connected = battery_state.ac_connected; } if (update_battery() != 0) { // Try to reconfigure on failed update init_battery(); } if (old_ac_connected != battery_state.ac_connected) { if (battery_state.ac_connected) tint_exec(ac_connected_cmd); else tint_exec(ac_disconnected_cmd); } if (battery_state.percentage < battery_low_status && battery_state.state == BATTERY_DISCHARGING && !battery_low_cmd_sent) { tint_exec(battery_low_cmd); battery_low_cmd_sent = TRUE; } if (battery_state.percentage > battery_low_status && battery_state.state == BATTERY_CHARGING && battery_low_cmd_sent) { battery_low_cmd_sent = FALSE; } for (int i = 0; i < num_panels; i++) { // Show/hide if needed if (!battery_found) { if (panels[i].battery.area.on_screen) { hide(&panels[i].battery.area); panel_refresh = TRUE; } } else { if (battery_state.percentage >= percentage_hide) { if (panels[i].battery.area.on_screen) { hide(&panels[i].battery.area); panel_refresh = TRUE; } } else { if (!panels[i].battery.area.on_screen) { show(&panels[i].battery.area); panel_refresh = TRUE; } } } // Redraw if needed if (panels[i].battery.area.on_screen) { if (old_found != battery_found || old_percentage != battery_state.percentage || old_hours != battery_state.time.hours || old_minutes != battery_state.time.minutes) { panels[i].battery.area.resize_needed = TRUE; panel_refresh = TRUE; } } } } int update_battery() { // Reset battery_state.state = BATTERY_UNKNOWN; battery_state.percentage = 0; battery_state.ac_connected = FALSE; battery_state_set_time(&battery_state, 0); int err = battery_os_update(&battery_state); // Clamp percentage to 100 in case battery is misreporting that its current charge is more than its max if (battery_state.percentage > 100) { battery_state.percentage = 100; } return err; } gboolean resize_battery(void *obj) { Battery *battery = obj; Panel *panel = battery->area.panel; int bat_percentage_height, bat_percentage_width, bat_percentage_height_ink; int bat_time_height, bat_time_width, bat_time_height_ink; int ret = 0; schedule_redraw(&battery->area); snprintf(buf_bat_percentage, sizeof(buf_bat_percentage), "%d%%", battery_state.percentage); if (battery_state.state == BATTERY_FULL) { strcpy(buf_bat_time, "Full"); } else { snprintf(buf_bat_time, sizeof(buf_bat_time), "%02d:%02d", battery_state.time.hours, battery_state.time.minutes); } get_text_size2(bat1_font_desc, &bat_percentage_height_ink, &bat_percentage_height, &bat_percentage_width, panel->area.height, panel->area.width, buf_bat_percentage, strlen(buf_bat_percentage), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, FALSE); get_text_size2(bat2_font_desc, &bat_time_height_ink, &bat_time_height, &bat_time_width, panel->area.height, panel->area.width, buf_bat_time, strlen(buf_bat_time), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, FALSE); if (panel_horizontal) { int new_size = (bat_percentage_width > bat_time_width) ? bat_percentage_width : bat_time_width; new_size += 2 * battery->area.paddingxlr + 2 * battery->area.bg->border.width; if (new_size > battery->area.width || new_size < battery->area.width - 2) { // we try to limit the number of resize battery->area.width = new_size; battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height) / 2; battery->bat2_posy = battery->bat1_posy + bat_percentage_height; ret = 1; } } else { int new_size = bat_percentage_height + bat_time_height + (2 * (battery->area.paddingxlr + battery->area.bg->border.width)); if (new_size > battery->area.height || new_size < battery->area.height - 2) { battery->area.height = new_size; battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height - 2) / 2; battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2; ret = 1; } } return ret; } void draw_battery(void *obj, cairo_t *c) { Battery *battery = obj; PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_font_description(layout, bat1_font_desc); pango_layout_set_width(layout, battery->area.width * PANGO_SCALE); pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); pango_layout_set_text(layout, buf_bat_percentage, strlen(buf_bat_percentage)); cairo_set_source_rgba(c, battery->font_color.rgb[0], battery->font_color.rgb[1], battery->font_color.rgb[2], battery->font_color.alpha); pango_cairo_update_layout(c, layout); draw_text(layout, c, 0, battery->bat1_posy, &battery->font_color, ((Panel *)battery->area.panel)->font_shadow); pango_layout_set_font_description(layout, bat2_font_desc); pango_layout_set_indent(layout, 0); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); pango_layout_set_text(layout, buf_bat_time, strlen(buf_bat_time)); pango_layout_set_width(layout, battery->area.width * PANGO_SCALE); pango_cairo_update_layout(c, layout); draw_text(layout, c, 0, battery->bat2_posy, &battery->font_color, ((Panel *)battery->area.panel)->font_shadow); pango_cairo_show_layout(c, layout); g_object_unref(layout); } char *battery_get_tooltip(void *obj) { return battery_os_tooltip(); } void battery_action(int button) { char *command = NULL; 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); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/battery.h000066400000000000000000000051141265276141000245370ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2009-2015 Sebastian Reichel * * Battery with functional data (percentage, time to life) and drawing data * (area, font, ...). Each panel use his own drawing data. * **************************************************************************/ #ifndef BATTERY_H #define BATTERY_H #include #include #include #include "common.h" #include "area.h" typedef struct Battery { Area area; Color font_color; int bat1_posy; int bat2_posy; } Battery; typedef enum ChargeState { BATTERY_UNKNOWN = 0, BATTERY_CHARGING, BATTERY_DISCHARGING, BATTERY_FULL, } ChargeState; typedef struct BatteryTime { int16_t hours; int8_t minutes; int8_t seconds; } BatteryTime; typedef struct BatteryState { int percentage; BatteryTime time; ChargeState state; gboolean ac_connected; } BatteryState; extern struct BatteryState battery_state; extern gboolean bat1_has_font; extern PangoFontDescription *bat1_font_desc; extern gboolean bat2_has_font; extern PangoFontDescription *bat2_font_desc; extern gboolean battery_enabled; extern gboolean battery_tooltip_enabled; extern int percentage_hide; extern int8_t battery_low_status; extern char *battery_low_cmd; extern char *ac_connected_cmd; extern char *ac_disconnected_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; static inline gchar *chargestate2str(ChargeState state) { switch (state) { case BATTERY_CHARGING: return "Charging"; case BATTERY_DISCHARGING: return "Discharging"; case BATTERY_FULL: return "Full"; case BATTERY_UNKNOWN: default: return "Unknown"; }; } static inline void battery_state_set_time(BatteryState *state, int seconds) { state->time.hours = seconds / 3600; seconds -= 3600 * state->time.hours; state->time.minutes = seconds / 60; seconds -= 60 * state->time.minutes; state->time.seconds = seconds; } // default global data void default_battery(); // freed memory void cleanup_battery(); void update_battery_tick(void *arg); int update_battery(); void init_battery(); void init_battery_panel(void *panel); void reinit_battery(); void draw_battery(void *obj, cairo_t *c); void battery_default_font_changed(); gboolean resize_battery(void *obj); void battery_action(int button); /* operating system specific functions */ gboolean battery_os_init(); void battery_os_free(); int battery_os_update(BatteryState *state); char *battery_os_tooltip(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/dummy.c000066400000000000000000000023641265276141000242170ustar00rootroot00000000000000/************************************************************************** * * Tint2 : Dummy battery (non-functional) * * Copyright (C) 2015 Sebastian Reichel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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 #include "common.h" #include "battery.h" #warning tint2 has no battery support for this operating system! gboolean battery_os_init() { return FALSE; } void battery_os_free() { return; } int battery_os_update(BatteryState *state) { return -1; } char *battery_os_tooltip() { return strdup("Operating System not supported"); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/freebsd.c000066400000000000000000000054061265276141000244760ustar00rootroot00000000000000/************************************************************************** * * Tint2 : FreeBSD battery * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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. **************************************************************************/ #if defined(__FreeBSD__) || defined(__DragonFly__) #include #include #include #include "common.h" #include "battery.h" gboolean battery_os_init() { int sysctl_out = 0; size_t len = sizeof(sysctl_out); return (sysctlbyname("hw.acpi.battery.state", &sysctl_out, &len, NULL, 0) == 0) || (sysctlbyname("hw.acpi.battery.time", &sysctl_out, &len, NULL, 0) == 0) || (sysctlbyname("hw.acpi.battery.life", &sysctl_out, &len, NULL, 0) == 0); } void battery_os_free() { return; } int battery_os_update(BatteryState *state) { int sysctl_out = 0; size_t len = sizeof(sysctl_out); gboolean err = 0; if (sysctlbyname("hw.acpi.battery.state", &sysctl_out, &len, NULL, 0) == 0) { switch (sysctl_out) { case 1: state->state = BATTERY_DISCHARGING; break; case 2: state->state = BATTERY_CHARGING; break; default: state->state = BATTERY_FULL; break; } } else { fprintf(stderr, "power update: no such sysctl"); err = -1; } if (sysctlbyname("hw.acpi.battery.time", &sysctl_out, &len, NULL, 0) == 0) battery_state_set_time(state, sysctl_out * 60); else err = -1; if (sysctlbyname("hw.acpi.battery.life", &sysctl_out, &len, NULL, 0) == 0) state->percentage = sysctl_out; else err = -1; if (sysctlbyname("hw.acpi.acline", &sysctl_out, &len, NULL, 0) == 0) state->ac_connected = sysctl_out; return err; } char *battery_os_tooltip() { GString *tooltip = g_string_new(""); gchar *result; g_string_append_printf(tooltip, "Battery\n"); gchar *state = (battery_state.state == BATTERY_UNKNOWN) ? "Level" : chargestate2str(battery_state.state); g_string_append_printf(tooltip, "\t%s: %d%%", state, battery_state.percentage); g_string_append_c(tooltip, '\n'); g_string_append_printf(tooltip, "AC\n"); g_string_append_printf(tooltip, battery_state.ac_connected ? "\tConnected" : "\tDisconnected"); result = tooltip->str; g_string_free(tooltip, FALSE); return result; } #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/linux.c000066400000000000000000000321361265276141000242230ustar00rootroot00000000000000/************************************************************************** * * Tint2 : Linux battery * * Copyright (C) 2015 Sebastian Reichel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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. **************************************************************************/ #ifdef __linux #include #include "common.h" #include "battery.h" #include "uevent.h" enum psy_type { PSY_UNKNOWN, PSY_BATTERY, PSY_MAINS, }; struct psy_battery { /* generic properties */ gchar *name; /* monotonic time, in microseconds */ gint64 timestamp; /* sysfs files */ gchar *path_present; gchar *path_energy_now; gchar *path_energy_full; gchar *path_power_now; gchar *path_status; /* sysfs hints */ gboolean energy_in_uamp; gboolean power_in_uamp; /* values */ gboolean present; gint energy_now; gint energy_full; gint power_now; ChargeState status; }; struct psy_mains { /* generic properties */ gchar *name; /* sysfs files */ gchar *path_online; /* values */ gboolean online; }; static void uevent_battery_update() { update_battery_tick(NULL); } static struct uevent_notify psy_change = {UEVENT_CHANGE, "power_supply", NULL, uevent_battery_update}; static void uevent_battery_plug() { printf("reinitialize batteries after HW change\n"); reinit_battery(); } static struct uevent_notify psy_plug = {UEVENT_ADD | UEVENT_REMOVE, "power_supply", NULL, uevent_battery_plug}; #define RETURN_ON_ERROR(err) \ if (error) { \ g_error_free(err); \ return FALSE; \ } static GList *batteries = NULL; static GList *mains = NULL; static guint8 energy_to_percent(gint energy_now, gint energy_full) { return 0.5 + ((energy_now <= energy_full ? energy_now : energy_full) * 100.0) / energy_full; } static enum psy_type power_supply_get_type(const gchar *entryname) { gchar *path_type = g_build_filename("/sys/class/power_supply", entryname, "type", NULL); GError *error = NULL; gchar *type; gsize typelen; g_file_get_contents(path_type, &type, &typelen, &error); g_free(path_type); if (error) { g_error_free(error); return PSY_UNKNOWN; } if (!g_strcmp0(type, "Battery\n")) { g_free(type); return PSY_BATTERY; } if (!g_strcmp0(type, "Mains\n")) { g_free(type); return PSY_MAINS; } g_free(type); return PSY_UNKNOWN; } static gboolean init_linux_battery(struct psy_battery *bat) { const gchar *entryname = bat->name; bat->energy_in_uamp = FALSE; bat->power_in_uamp = FALSE; bat->path_present = g_build_filename("/sys/class/power_supply", entryname, "present", NULL); if (!g_file_test(bat->path_present, G_FILE_TEST_EXISTS)) { goto err0; } bat->path_energy_now = g_build_filename("/sys/class/power_supply", entryname, "energy_now", NULL); if (!g_file_test(bat->path_energy_now, G_FILE_TEST_EXISTS)) { g_free(bat->path_energy_now); bat->path_energy_now = g_build_filename("/sys/class/power_supply", entryname, "charge_now", NULL); bat->energy_in_uamp = TRUE; } if (!g_file_test(bat->path_energy_now, G_FILE_TEST_EXISTS)) { goto err1; } if (!bat->energy_in_uamp) { bat->path_energy_full = g_build_filename("/sys/class/power_supply", entryname, "energy_full", NULL); if (!g_file_test(bat->path_energy_full, G_FILE_TEST_EXISTS)) goto err2; } else { bat->path_energy_full = g_build_filename("/sys/class/power_supply", entryname, "charge_full", NULL); if (!g_file_test(bat->path_energy_full, G_FILE_TEST_EXISTS)) goto err2; } bat->path_power_now = g_build_filename("/sys/class/power_supply", entryname, "power_now", NULL); if (!g_file_test(bat->path_power_now, G_FILE_TEST_EXISTS)) { g_free(bat->path_power_now); bat->path_power_now = g_build_filename("/sys/class/power_supply", entryname, "current_now", NULL); bat->power_in_uamp = TRUE; } if (!g_file_test(bat->path_power_now, G_FILE_TEST_EXISTS)) { goto err3; } bat->path_status = g_build_filename("/sys/class/power_supply", entryname, "status", NULL); if (!g_file_test(bat->path_status, G_FILE_TEST_EXISTS)) { goto err4; } return TRUE; err4: g_free(bat->path_status); err3: g_free(bat->path_power_now); err2: g_free(bat->path_energy_full); err1: g_free(bat->path_energy_now); err0: g_free(bat->path_present); return FALSE; } static gboolean init_linux_mains(struct psy_mains *ac) { const gchar *entryname = ac->name; ac->path_online = g_build_filename("/sys/class/power_supply", entryname, "online", NULL); if (!g_file_test(ac->path_online, G_FILE_TEST_EXISTS)) { g_free(ac->path_online); return FALSE; } return TRUE; } static void psy_battery_free(gpointer data) { struct psy_battery *bat = data; g_free(bat->name); g_free(bat->path_status); g_free(bat->path_power_now); g_free(bat->path_energy_full); g_free(bat->path_energy_now); g_free(bat->path_present); g_free(bat); } static void psy_mains_free(gpointer data) { struct psy_mains *ac = data; g_free(ac->name); g_free(ac->path_online); g_free(ac); } void battery_os_free() { uevent_unregister_notifier(&psy_change); uevent_unregister_notifier(&psy_plug); g_list_free_full(batteries, psy_battery_free); batteries = NULL; g_list_free_full(mains, psy_mains_free); mains = NULL; } static void add_battery(const char *entryname) { struct psy_battery *bat = g_malloc0(sizeof(*bat)); bat->name = g_strdup(entryname); if (init_linux_battery(bat)) { batteries = g_list_append(batteries, bat); fprintf(stdout, "found battery \"%s\"\n", bat->name); } else { g_free(bat); fprintf(stderr, RED "failed to initialize battery \"%s\"" RESET "\n", entryname); } } static void add_mains(const char *entryname) { struct psy_mains *ac = g_malloc0(sizeof(*ac)); ac->name = g_strdup(entryname); if (init_linux_mains(ac)) { mains = g_list_append(mains, ac); fprintf(stdout, "found mains \"%s\"\n", ac->name); } else { g_free(ac); fprintf(stderr, RED "failed to initialize mains \"%s\"" RESET "\n", entryname); } } gboolean battery_os_init() { GDir *directory = 0; GError *error = NULL; const char *entryname; battery_os_free(); directory = g_dir_open("/sys/class/power_supply", 0, &error); RETURN_ON_ERROR(error); while ((entryname = g_dir_read_name(directory))) { enum psy_type type = power_supply_get_type(entryname); switch (type) { case PSY_BATTERY: add_battery(entryname); break; case PSY_MAINS: add_mains(entryname); break; default: break; } } g_dir_close(directory); uevent_register_notifier(&psy_change); uevent_register_notifier(&psy_plug); return batteries != NULL; } static gint estimate_power_usage(struct psy_battery *bat, gint old_energy_now, gint64 old_timestamp) { gint64 diff_power = ABS(bat->energy_now - old_energy_now); gint64 diff_time = bat->timestamp - old_timestamp; /* µW = (µWh * 3600) / (µs / 1000000) */ gint power = diff_power * 3600 * 1000000 / MAX(1, diff_time); return power; } static gboolean update_linux_battery(struct psy_battery *bat) { GError *error = NULL; gchar *data; gsize datalen; gint64 old_timestamp = bat->timestamp; int old_energy_now = bat->energy_now; /* reset values */ bat->present = 0; bat->status = BATTERY_UNKNOWN; bat->energy_now = 0; bat->energy_full = 0; bat->power_now = 0; bat->timestamp = g_get_monotonic_time(); /* present */ g_file_get_contents(bat->path_present, &data, &datalen, &error); RETURN_ON_ERROR(error); bat->present = (atoi(data) == 1); g_free(data); /* we are done, if battery is not present */ if (!bat->present) return TRUE; /* status */ bat->status = BATTERY_UNKNOWN; g_file_get_contents(bat->path_status, &data, &datalen, &error); RETURN_ON_ERROR(error); if (!g_strcmp0(data, "Charging\n")) { bat->status = BATTERY_CHARGING; } else if (!g_strcmp0(data, "Discharging\n")) { bat->status = BATTERY_DISCHARGING; } else if (!g_strcmp0(data, "Full\n")) { bat->status = BATTERY_FULL; } g_free(data); /* energy now */ g_file_get_contents(bat->path_energy_now, &data, &datalen, &error); RETURN_ON_ERROR(error); bat->energy_now = atoi(data); g_free(data); /* energy full */ g_file_get_contents(bat->path_energy_full, &data, &datalen, &error); RETURN_ON_ERROR(error); bat->energy_full = atoi(data); g_free(data); /* power now */ g_file_get_contents(bat->path_power_now, &data, &datalen, &error); if (g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NODEV)) { /* some hardware does not support reading current power consumption */ g_error_free(error); bat->power_now = estimate_power_usage(bat, old_energy_now, old_timestamp); } else if (error) { g_error_free(error); return FALSE; } else { bat->power_now = atoi(data); g_free(data); } return TRUE; } static gboolean update_linux_mains(struct psy_mains *ac) { GError *error = NULL; gchar *data; gsize datalen; ac->online = FALSE; /* online */ g_file_get_contents(ac->path_online, &data, &datalen, &error); RETURN_ON_ERROR(error); ac->online = (atoi(data) == 1); g_free(data); return TRUE; } int battery_os_update(BatteryState *state) { GList *l; gint64 total_energy_now = 0; gint64 total_energy_full = 0; gint64 total_power_now = 0; gint seconds = 0; gboolean charging = FALSE; gboolean discharging = FALSE; gboolean full = FALSE; gboolean ac_connected = FALSE; for (l = batteries; l != NULL; l = l->next) { struct psy_battery *bat = l->data; update_linux_battery(bat); total_energy_now += bat->energy_now; total_energy_full += bat->energy_full; total_power_now += bat->power_now; charging |= (bat->status == BATTERY_CHARGING); discharging |= (bat->status == BATTERY_DISCHARGING); full |= (bat->status == BATTERY_FULL); } for (l = mains; l != NULL; l = l->next) { struct psy_mains *ac = l->data; update_linux_mains(ac); ac_connected |= (ac->online); } /* build global state */ if (charging && !discharging) state->state = BATTERY_CHARGING; else if (!charging && discharging) state->state = BATTERY_DISCHARGING; else if (!charging && !discharging && full) state->state = BATTERY_FULL; /* calculate seconds */ if (total_power_now > 0) { if (state->state == BATTERY_CHARGING) seconds = 3600 * (total_energy_full - total_energy_now) / total_power_now; else if (state->state == BATTERY_DISCHARGING) seconds = 3600 * total_energy_now / total_power_now; } battery_state_set_time(state, seconds); /* calculate percentage */ state->percentage = energy_to_percent(total_energy_now, total_energy_full); /* AC state */ state->ac_connected = ac_connected; return 0; } static gchar *energy_human_readable(struct psy_battery *bat) { gint now = bat->energy_now; gint full = bat->energy_full; gchar unit = bat->energy_in_uamp ? 'A' : 'W'; if (full >= 1000000) { return g_strdup_printf("%d.%d / %d.%d %ch", now / 1000000, (now % 1000000) / 100000, full / 1000000, (full % 1000000) / 100000, unit); } else if (full >= 1000) { return g_strdup_printf("%d.%d / %d.%d m%ch", now / 1000, (now % 1000) / 100, full / 1000, (full % 1000) / 100, unit); } else { return g_strdup_printf("%d / %d µ%ch", now, full, unit); } } static gchar *power_human_readable(struct psy_battery *bat) { gint power = bat->power_now; gchar unit = bat->power_in_uamp ? 'A' : 'W'; if (power >= 1000000) { return g_strdup_printf("%d.%d %c", power / 1000000, (power % 1000000) / 100000, unit); } else if (power >= 1000) { return g_strdup_printf("%d.%d m%c", power / 1000, (power % 1000) / 100, unit); } else if (power > 0) { return g_strdup_printf("%d µ%c", power, unit); } else { return g_strdup_printf("0 %c", unit); } } char *battery_os_tooltip() { GList *l; GString *tooltip = g_string_new(""); gchar *result; for (l = batteries; l != NULL; l = l->next) { struct psy_battery *bat = l->data; if (tooltip->len) g_string_append_c(tooltip, '\n'); g_string_append_printf(tooltip, "%s\n", bat->name); if (!bat->present) { g_string_append_printf(tooltip, "\tnot connected"); continue; } gchar *power = power_human_readable(bat); gchar *energy = energy_human_readable(bat); gchar *state = (bat->status == BATTERY_UNKNOWN) ? "Level" : chargestate2str(bat->status); guint8 percentage = energy_to_percent(bat->energy_now, bat->energy_full); g_string_append_printf(tooltip, "\t%s: %s (%u %%)\n\tPower: %s", state, energy, percentage, power); g_free(power); g_free(energy); } for (l = mains; l != NULL; l = l->next) { struct psy_mains *ac = l->data; if (tooltip->len) g_string_append_c(tooltip, '\n'); g_string_append_printf(tooltip, "%s\n", ac->name); g_string_append_printf(tooltip, ac->online ? "\tConnected" : "\tDisconnected"); } result = tooltip->str; g_string_free(tooltip, FALSE); return result; } #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/battery/openbsd.c000066400000000000000000000053231265276141000245140ustar00rootroot00000000000000/************************************************************************** * * Tint2 : OpenBSD & NetBSD battery * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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. **************************************************************************/ #if defined(__OpenBSD__) || defined(__NetBSD__) #include #include #include #include #include #include #include "common.h" #include "battery.h" int apm_fd = -1; gboolean battery_os_init() { if (apm_fd > 0) close(apm_fd); apm_fd = open("/dev/apm", O_RDONLY); if (apm_fd < 0) { warn("ERROR: battery applet cannot open /dev/apm."); return FALSE; } else { return TRUE; } } void battery_os_free() { if ((apm_fd != -1) && (close(apm_fd) == -1)) warn("cannot close /dev/apm"); apm_fd = -1; } int battery_os_update(BatteryState *state) { struct apm_power_info info; if (apm_fd > 0 && ioctl(apm_fd, APM_IOC_GETPOWER, &(info)) == 0) { // best attempt at mapping to Linux battery states switch (info.battery_state) { case APM_BATT_CHARGING: state->state = BATTERY_CHARGING; break; default: state->state = BATTERY_DISCHARGING; break; } if (info.battery_life > 100) info.battery_life = 100; if (info.battery_life == 100) state->state = BATTERY_FULL; state->percentage = info.battery_life; if (info.minutes_left != -1) battery_state_set_time(state, info.minutes_left * 60); state->ac_connected = info.ac_state == APM_AC_ON; } else { warn("power update: APM_IOC_GETPOWER"); return -1; } return 0; } char *battery_os_tooltip() { GString *tooltip = g_string_new(""); gchar *result; g_string_append_printf(tooltip, "Battery\n"); gchar *state = (battery_state.state == BATTERY_UNKNOWN) ? "Level" : chargestate2str(battery_state.state); g_string_append_printf(tooltip, "\t%s: %d%%", state, battery_state.percentage); g_string_append_c(tooltip, '\n'); g_string_append_printf(tooltip, "AC\n"); g_string_append_printf(tooltip, battery_state.ac_connected ? "\tConnected" : "\tDisconnected"); result = tooltip->str; g_string_free(tooltip, FALSE); return result; } #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/clock/000077500000000000000000000000001265276141000223345ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/clock/clock.c000066400000000000000000000241231265276141000235750ustar00rootroot00000000000000/************************************************************************** * * Tint2 : clock * * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include "window.h" #include "server.h" #include "panel.h" #include "clock.h" #include "timer.h" #include "common.h" char *time1_format; char *time1_timezone; char *time2_format; 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; gboolean time1_has_font; PangoFontDescription *time1_font_desc; gboolean time2_has_font; PangoFontDescription *time2_font_desc; static char buf_time[256]; static char buf_date[256]; static char buf_tooltip[512]; int clock_enabled; static timeout *clock_timeout; void clock_init_fonts(); char *clock_get_tooltip(void *obj); void default_clock() { clock_enabled = 0; clock_timeout = NULL; time1_format = NULL; time1_timezone = NULL; time2_format = NULL; time2_timezone = NULL; 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_has_font = FALSE; time1_font_desc = NULL; time2_has_font = FALSE; time2_font_desc = NULL; } void cleanup_clock() { pango_font_description_free(time1_font_desc); time1_font_desc = NULL; pango_font_description_free(time2_font_desc); time2_font_desc = NULL; free(time1_format); time1_format = NULL; free(time2_format); time2_format = NULL; free(time_tooltip_format); time_tooltip_format = NULL; free(time1_timezone); time1_timezone = NULL; free(time2_timezone); time2_timezone = NULL; free(time_tooltip_timezone); 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; } void update_clocks_sec(void *arg) { gettimeofday(&time_clock, 0); if (time1_format) { for (int i = 0; i < num_panels; i++) panels[i].clock.area.resize_needed = 1; } panel_refresh = TRUE; } void update_clocks_min(void *arg) { // remember old_sec because after suspend/hibernate the clock should be updated directly, and not // on next minute change time_t old_sec = time_clock.tv_sec; gettimeofday(&time_clock, 0); if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) { if (time1_format) { for (int i = 0; i < num_panels; i++) panels[i].clock.area.resize_needed = 1; } panel_refresh = TRUE; } } struct tm *clock_gettime_for_tz(const char *timezone) { if (timezone) { const char *old_tz = getenv("TZ"); setenv("TZ", timezone, 1); struct tm *result = localtime(&time_clock.tv_sec); if (old_tz) setenv("TZ", old_tz, 1); else unsetenv("TZ"); return result; } else { return localtime(&time_clock.tv_sec); } } gboolean time_format_needs_sec_ticks(char *time_format) { if (!time_format) return FALSE; if (strchr(time_format, 'S') || strchr(time_format, 'T') || strchr(time_format, 'r')) return TRUE; return FALSE; } void init_clock() { if (!clock_timeout) { if (time_format_needs_sec_ticks(time1_format) || time_format_needs_sec_ticks(time2_format)) { clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0, &clock_timeout); } else { clock_timeout = add_timeout(10, 1000, update_clocks_min, 0, &clock_timeout); } } } void init_clock_panel(void *p) { Panel *panel = (Panel *)p; Clock *clock = &panel->clock; if (!clock->area.bg) clock->area.bg = &g_array_index(backgrounds, Background, 0); clock_init_fonts(); clock->area.parent = p; clock->area.panel = p; clock->area.has_mouse_press_effect = clock->area.has_mouse_over_effect = panel_config.mouse_effects && (clock_lclick_command || clock_mclick_command || clock_rclick_command || clock_uwheel_command || clock_dwheel_command); clock->area._draw_foreground = draw_clock; clock->area.size_mode = LAYOUT_FIXED; clock->area._resize = resize_clock; // check consistency if (!time1_format) return; clock->area.resize_needed = 1; clock->area.on_screen = TRUE; if (time_tooltip_format) { clock->area._get_tooltip_text = clock_get_tooltip; strftime(buf_tooltip, sizeof(buf_tooltip), time_tooltip_format, clock_gettime_for_tz(time_tooltip_timezone)); } } void clock_init_fonts() { if (!time1_font_desc) { time1_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_weight(time1_font_desc, PANGO_WEIGHT_BOLD); pango_font_description_set_size(time1_font_desc, pango_font_description_get_size(time1_font_desc)); } if (!time2_font_desc) { time2_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(time2_font_desc, pango_font_description_get_size(time2_font_desc) - PANGO_SCALE); } } void clock_default_font_changed() { if (!clock_enabled) return; if (time1_has_font && time2_has_font) return; if (!time1_has_font) { pango_font_description_free(time1_font_desc); time1_font_desc = NULL; } if (!time2_has_font) { pango_font_description_free(time2_font_desc); time2_font_desc = NULL; } clock_init_fonts(); for (int i = 0; i < num_panels; i++) { panels[i].clock.area.resize_needed = TRUE; schedule_redraw(&panels[i].clock.area); } panel_refresh = TRUE; } gboolean resize_clock(void *obj) { Clock *clock = obj; Panel *panel = clock->area.panel; int time_height_ink, time_height, time_width, date_height_ink, date_height, date_width; gboolean result = FALSE; schedule_redraw(&clock->area); date_height = date_width = 0; strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone)); get_text_size2(time1_font_desc, &time_height_ink, &time_height, &time_width, panel->area.height, panel->area.width, buf_time, strlen(buf_time), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, FALSE); if (time2_format) { strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone)); get_text_size2(time2_font_desc, &date_height_ink, &date_height, &date_width, panel->area.height, panel->area.width, buf_date, strlen(buf_date), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, FALSE); } if (panel_horizontal) { int new_size = (time_width > date_width) ? time_width : date_width; new_size += (2 * clock->area.paddingxlr) + (2 * clock->area.bg->border.width); if (new_size > clock->area.width || new_size < (clock->area.width - 6)) { // we try to limit the number of resizes clock->area.width = new_size + 1; clock->time1_posy = (clock->area.height - time_height) / 2; if (time2_format) { clock->time1_posy -= (date_height) / 2; clock->time2_posy = clock->time1_posy + time_height; } result = TRUE; } } else { int new_size = time_height + date_height + (2 * (clock->area.paddingxlr + clock->area.bg->border.width)); if (new_size != clock->area.height) { // we try to limit the number of resizes clock->area.height = new_size; clock->time1_posy = (clock->area.height - time_height) / 2; if (time2_format) { clock->time1_posy -= (date_height) / 2; clock->time2_posy = clock->time1_posy + time_height; } result = TRUE; } } return result; } void draw_clock(void *obj, cairo_t *c) { Clock *clock = obj; PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_font_description(layout, time1_font_desc); pango_layout_set_width(layout, clock->area.width * PANGO_SCALE); pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); pango_layout_set_text(layout, buf_time, strlen(buf_time)); cairo_set_source_rgba(c, clock->font.rgb[0], clock->font.rgb[1], clock->font.rgb[2], clock->font.alpha); pango_cairo_update_layout(c, layout); draw_text(layout, c, 0, clock->time1_posy, &clock->font, ((Panel *)clock->area.panel)->font_shadow); if (time2_format) { pango_layout_set_font_description(layout, time2_font_desc); pango_layout_set_indent(layout, 0); pango_layout_set_text(layout, buf_date, strlen(buf_date)); pango_layout_set_width(layout, clock->area.width * PANGO_SCALE); pango_cairo_update_layout(c, layout); draw_text(layout, c, 0, clock->time2_posy, &clock->font, ((Panel *)clock->area.panel)->font_shadow); } g_object_unref(layout); } char *clock_get_tooltip(void *obj) { strftime(buf_tooltip, sizeof(buf_tooltip), time_tooltip_format, clock_gettime_for_tz(time_tooltip_timezone)); return strdup(buf_tooltip); } void clock_action(int button) { char *command = NULL; switch (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); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/clock/clock.h000066400000000000000000000026431265276141000236050ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) * * Clock with fonctionnal data (timeval, precision) and drawing data (area, font, ...). * Each panel use his own drawing data. * **************************************************************************/ #ifndef CLOCK_H #define CLOCK_H #include #include "common.h" #include "area.h" typedef struct Clock { // always start with area Area area; Color font; int time1_posy; int time2_posy; } Clock; extern char *time1_format; extern char *time1_timezone; extern char *time2_format; extern char *time2_timezone; extern char *time_tooltip_format; extern char *time_tooltip_timezone; extern gboolean time1_has_font; extern PangoFontDescription *time1_font_desc; extern gboolean time2_has_font; 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 gboolean clock_enabled; // default global data void default_clock(); // freed memory void cleanup_clock(); // initialize clock : y position, precision, ... void init_clock(); void init_clock_panel(void *panel); void clock_default_font_changed(); void draw_clock(void *obj, cairo_t *c); gboolean resize_clock(void *obj); void clock_action(int button); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/config.c000066400000000000000000001162271265276141000226630ustar00rootroot00000000000000/************************************************************************** * * Tint2 : read/write config file * * Copyright (C) 2007 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #ifndef TINT2CONF #include "common.h" #include "server.h" #include "strnatcmp.h" #include "panel.h" #include "task.h" #include "taskbar.h" #include "taskbarname.h" #include "systraybar.h" #include "launcher.h" #include "clock.h" #include "window.h" #include "tooltip.h" #include "timer.h" #include "execplugin.h" #ifdef ENABLE_BATTERY #include "battery.h" #endif #endif // global path char *config_path; char *snapshot_path; #ifndef TINT2CONF // -------------------------------------------------- // backward compatibility // detect if it's an old config file (==1) static gboolean new_config_file; static gboolean read_bg_color_hover; static gboolean read_border_color_hover; static gboolean read_bg_color_press; static gboolean read_border_color_press; static gboolean read_panel_position; void default_config() { config_path = NULL; snapshot_path = NULL; new_config_file = FALSE; read_panel_position = FALSE; } void cleanup_config() { free(config_path); config_path = NULL; free(snapshot_path); snapshot_path = NULL; } void get_action(char *event, MouseAction *action) { if (strcmp(event, "none") == 0) *action = NONE; else if (strcmp(event, "close") == 0) *action = CLOSE; else if (strcmp(event, "toggle") == 0) *action = TOGGLE; else if (strcmp(event, "iconify") == 0) *action = ICONIFY; else if (strcmp(event, "shade") == 0) *action = SHADE; else if (strcmp(event, "toggle_iconify") == 0) *action = TOGGLE_ICONIFY; else if (strcmp(event, "maximize_restore") == 0) *action = MAXIMIZE_RESTORE; else if (strcmp(event, "desktop_left") == 0) *action = DESKTOP_LEFT; else if (strcmp(event, "desktop_right") == 0) *action = DESKTOP_RIGHT; else if (strcmp(event, "next_task") == 0) *action = NEXT_TASK; else if (strcmp(event, "prev_task") == 0) *action = PREV_TASK; else fprintf(stderr, "Error: unrecognized action '%s'. Please fix your config file.\n", event); } int get_task_status(char *status) { if (strcmp(status, "active") == 0) return TASK_ACTIVE; if (strcmp(status, "iconified") == 0) return TASK_ICONIFIED; if (strcmp(status, "urgent") == 0) return TASK_URGENT; return -1; } int config_get_monitor(char *monitor) { if (strcmp(monitor, "all") != 0) { char *endptr; int ret_int = strtol(monitor, &endptr, 10); if (*endptr == 0) return ret_int - 1; else { // monitor specified by name, not by index int i, j; for (i = 0; i < server.num_monitors; ++i) { if (server.monitors[i].names == 0) // xrandr can't identify monitors continue; j = 0; while (server.monitors[i].names[j] != 0) { if (strcmp(monitor, server.monitors[i].names[j++]) == 0) return i; } } } } // monitor == "all" or monitor not found or xrandr can't identify monitors 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) { 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")) { 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_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); } Execp *get_or_create_last_execp() { if (!panel_config.execp_list) { fprintf(stderr, "Warning: execp items should start with 'execp = new'\n"); panel_config.execp_list = g_list_append(panel_config.execp_list, create_execp()); } return (Execp *)g_list_last(panel_config.execp_list)->data; } void add_entry(char *key, char *value) { char *value1 = 0, *value2 = 0, *value3 = 0; /* Background and border */ if (strcmp(key, "rounded") == 0) { // 'rounded' is the first parameter => alloc a new background if (backgrounds->len > 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); if (!read_bg_color_hover) memcpy(&bg->fill_color_hover, &bg->fill_color, sizeof(Color)); if (!read_border_color_hover) memcpy(&bg->border_color_hover, &bg->border, sizeof(Color)); if (!read_bg_color_press) memcpy(&bg->fill_color_pressed, &bg->fill_color_hover, sizeof(Color)); if (!read_border_color_press) memcpy(&bg->border_color_pressed, &bg->border_color_hover, sizeof(Color)); } Background bg; init_background(&bg); bg.border.radius = atoi(value); g_array_append_val(backgrounds, bg); read_bg_color_hover = 0; read_border_color_hover = 0; read_bg_color_press = 0; read_border_color_press = 0; } else if (strcmp(key, "border_width") == 0) { g_array_index(backgrounds, Background, backgrounds->len - 1).border.width = atoi(value); } else if (strcmp(key, "background_color") == 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); extract_values(value, &value1, &value2, &value3); get_color(value1, bg->fill_color.rgb); if (value2) bg->fill_color.alpha = (atoi(value2) / 100.0); else bg->fill_color.alpha = 0.5; } else if (strcmp(key, "border_color") == 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); extract_values(value, &value1, &value2, &value3); get_color(value1, bg->border.color.rgb); if (value2) bg->border.color.alpha = (atoi(value2) / 100.0); else bg->border.color.alpha = 0.5; } else if (strcmp(key, "background_color_hover") == 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); extract_values(value, &value1, &value2, &value3); get_color(value1, bg->fill_color_hover.rgb); if (value2) bg->fill_color_hover.alpha = (atoi(value2) / 100.0); else bg->fill_color_hover.alpha = 0.5; read_bg_color_hover = 1; } else if (strcmp(key, "border_color_hover") == 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); extract_values(value, &value1, &value2, &value3); get_color(value1, bg->border_color_hover.rgb); if (value2) bg->border_color_hover.alpha = (atoi(value2) / 100.0); else bg->border_color_hover.alpha = 0.5; read_border_color_hover = 1; } else if (strcmp(key, "background_color_pressed") == 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); extract_values(value, &value1, &value2, &value3); get_color(value1, bg->fill_color_pressed.rgb); if (value2) bg->fill_color_pressed.alpha = (atoi(value2) / 100.0); else bg->fill_color_pressed.alpha = 0.5; read_bg_color_press = 1; } else if (strcmp(key, "border_color_pressed") == 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); extract_values(value, &value1, &value2, &value3); get_color(value1, bg->border_color_pressed.rgb); if (value2) bg->border_color_pressed.alpha = (atoi(value2) / 100.0); else bg->border_color_pressed.alpha = 0.5; read_border_color_press = 1; } /* Panel */ else if (strcmp(key, "panel_monitor") == 0) { panel_config.monitor = config_get_monitor(value); } else if (strcmp(key, "primary_monitor_first") == 0) { primary_monitor_first = atoi(value); } else if (strcmp(key, "panel_size") == 0) { extract_values(value, &value1, &value2, &value3); char *b; if ((b = strchr(value1, '%'))) { b[0] = '\0'; panel_config.fractional_width = 1; } panel_config.area.width = atoi(value1); if (panel_config.area.width == 0) { // full width mode panel_config.area.width = 100; panel_config.fractional_width = 1; } if (value2) { if ((b = strchr(value2, '%'))) { b[0] = '\0'; panel_config.fractional_height = 1; } panel_config.area.height = atoi(value2); } } else if (strcmp(key, "panel_items") == 0) { new_config_file = TRUE; panel_items_order = strdup(value); systray_enabled = 0; launcher_enabled = 0; #ifdef ENABLE_BATTERY battery_enabled = 0; #endif clock_enabled = 0; taskbar_enabled = 0; for (int j = 0; j < strlen(panel_items_order); j++) { if (panel_items_order[j] == 'L') launcher_enabled = 1; if (panel_items_order[j] == 'T') taskbar_enabled = 1; if (panel_items_order[j] == 'B') { #ifdef ENABLE_BATTERY battery_enabled = 1; #else fprintf(stderr, "tint2 is build without battery support\n"); #endif } if (panel_items_order[j] == 'S') { // systray disabled in snapshot mode if (snapshot_path == 0) systray_enabled = 1; } if (panel_items_order[j] == 'C') clock_enabled = 1; } } else if (strcmp(key, "panel_margin") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.marginx = atoi(value1); if (value2) panel_config.marginy = atoi(value2); } else if (strcmp(key, "panel_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.area.paddingxlr = panel_config.area.paddingx = atoi(value1); if (value2) panel_config.area.paddingy = atoi(value2); if (value3) panel_config.area.paddingx = atoi(value3); } else if (strcmp(key, "panel_position") == 0) { read_panel_position = TRUE; extract_values(value, &value1, &value2, &value3); if (strcmp(value1, "top") == 0) panel_position = TOP; else { if (strcmp(value1, "bottom") == 0) panel_position = BOTTOM; else panel_position = CENTER; } if (!value2) panel_position |= CENTER; else { if (strcmp(value2, "left") == 0) panel_position |= LEFT; else { if (strcmp(value2, "right") == 0) panel_position |= RIGHT; else panel_position |= CENTER; } } if (!value3) panel_horizontal = 1; else { if (strcmp(value3, "vertical") == 0) panel_horizontal = 0; else panel_horizontal = 1; } } else if (strcmp(key, "font_shadow") == 0) panel_config.font_shadow = atoi(value); else if (strcmp(key, "panel_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.area.bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "wm_menu") == 0) wm_menu = atoi(value); else if (strcmp(key, "panel_dock") == 0) panel_dock = atoi(value); else if (strcmp(key, "urgent_nb_of_blink") == 0) max_tick_urgent = atoi(value); else if (strcmp(key, "panel_layer") == 0) { if (strcmp(value, "bottom") == 0) panel_layer = BOTTOM_LAYER; else if (strcmp(value, "top") == 0) panel_layer = TOP_LAYER; else panel_layer = NORMAL_LAYER; } else if (strcmp(key, "disable_transparency") == 0) { server.disable_transparency = atoi(value); } else if (strcmp(key, "panel_window_name") == 0) { if (strlen(value) > 0) { free(panel_window_name); panel_window_name = strdup(value); } } /* Battery */ else if (strcmp(key, "battery_low_status") == 0) { #ifdef ENABLE_BATTERY 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) { #ifdef ENABLE_BATTERY if (strlen(value) > 0) battery_low_cmd = strdup(value); #endif } else if (strcmp(key, "ac_connected_cmd") == 0) { #ifdef ENABLE_BATTERY if (strlen(value) > 0) ac_connected_cmd = strdup(value); #endif } else if (strcmp(key, "ac_disconnected_cmd") == 0) { #ifdef ENABLE_BATTERY if (strlen(value) > 0) ac_disconnected_cmd = strdup(value); #endif } else if (strcmp(key, "bat1_font") == 0) { #ifdef ENABLE_BATTERY bat1_font_desc = pango_font_description_from_string(value); bat1_has_font = TRUE; #endif } else if (strcmp(key, "bat2_font") == 0) { #ifdef ENABLE_BATTERY bat2_font_desc = pango_font_description_from_string(value); bat2_has_font = TRUE; #endif } else if (strcmp(key, "battery_font_color") == 0) { #ifdef ENABLE_BATTERY extract_values(value, &value1, &value2, &value3); get_color(value1, panel_config.battery.font_color.rgb); if (value2) panel_config.battery.font_color.alpha = (atoi(value2) / 100.0); else panel_config.battery.font_color.alpha = 0.5; #endif } else if (strcmp(key, "battery_padding") == 0) { #ifdef ENABLE_BATTERY extract_values(value, &value1, &value2, &value3); panel_config.battery.area.paddingxlr = panel_config.battery.area.paddingx = atoi(value1); if (value2) panel_config.battery.area.paddingy = atoi(value2); if (value3) panel_config.battery.area.paddingx = atoi(value3); #endif } else if (strcmp(key, "battery_background_id") == 0) { #ifdef ENABLE_BATTERY int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.battery.area.bg = &g_array_index(backgrounds, Background, id); #endif } else if (strcmp(key, "battery_hide") == 0) { #ifdef ENABLE_BATTERY percentage_hide = atoi(value); if (percentage_hide == 0) percentage_hide = 101; #endif } else if (strcmp(key, "battery_tooltip") == 0) { #ifdef ENABLE_BATTERY battery_tooltip_enabled = atoi(value); #endif } /* Execp */ else if (strcmp(key, "execp") == 0) { panel_config.execp_list = g_list_append(panel_config.execp_list, create_execp()); } else if (strcmp(key, "execp_command") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->command); if (strlen(value) > 0) execp->backend->command = strdup(value); } else if (strcmp(key, "execp_interval") == 0) { Execp *execp = get_or_create_last_execp(); execp->backend->interval = 0; int v = atoi(value); if (v < 1) { fprintf(stderr, "execp_interval must be an integer >= 1\n"); } else { execp->backend->interval = v; } } else if (strcmp(key, "execp_has_icon") == 0) { Execp *execp = get_or_create_last_execp(); execp->backend->has_icon = atoi(value); } else if (strcmp(key, "execp_continuous") == 0) { Execp *execp = get_or_create_last_execp(); execp->backend->continuous = atoi(value); } else if (strcmp(key, "execp_markup") == 0) { Execp *execp = get_or_create_last_execp(); execp->backend->has_markup = atoi(value); } else if (strcmp(key, "execp_cache_icon") == 0) { Execp *execp = get_or_create_last_execp(); execp->backend->cache_icon = atoi(value); } else if (strcmp(key, "execp_tooltip") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->tooltip); execp->backend->tooltip = strdup(value); } else if (strcmp(key, "execp_font") == 0) { Execp *execp = get_or_create_last_execp(); pango_font_description_free(execp->backend->font_desc); execp->backend->font_desc = pango_font_description_from_string(value); execp->backend->has_font = TRUE; } else if (strcmp(key, "execp_font_color") == 0) { Execp *execp = get_or_create_last_execp(); extract_values(value, &value1, &value2, &value3); get_color(value1, execp->backend->font_color.rgb); if (value2) execp->backend->font_color.alpha = atoi(value2) / 100.0; else execp->backend->font_color.alpha = 0.5; } else if (strcmp(key, "execp_padding") == 0) { Execp *execp = get_or_create_last_execp(); extract_values(value, &value1, &value2, &value3); execp->backend->paddingxlr = execp->backend->paddingx = atoi(value1); if (value2) execp->backend->paddingy = atoi(value2); else execp->backend->paddingy = 0; if (value3) execp->backend->paddingx = atoi(value3); } else if (strcmp(key, "execp_background_id") == 0) { Execp *execp = get_or_create_last_execp(); int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; execp->backend->bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "execp_centered") == 0) { Execp *execp = get_or_create_last_execp(); execp->backend->centered = atoi(value); } else if (strcmp(key, "execp_icon_w") == 0) { Execp *execp = get_or_create_last_execp(); int v = atoi(value); if (v < 0) { fprintf(stderr, "execp_icon_w must be an integer >= 0\n"); } else { execp->backend->icon_w = v; } } else if (strcmp(key, "execp_icon_h") == 0) { Execp *execp = get_or_create_last_execp(); int v = atoi(value); if (v < 0) { fprintf(stderr, "execp_icon_h must be an integer >= 0\n"); } else { execp->backend->icon_h = v; } } else if (strcmp(key, "execp_lclick_command") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->lclick_command); if (strlen(value) > 0) execp->backend->lclick_command = strdup(value); } else if (strcmp(key, "execp_mclick_command") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->mclick_command); if (strlen(value) > 0) execp->backend->mclick_command = strdup(value); } else if (strcmp(key, "execp_rclick_command") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->rclick_command); if (strlen(value) > 0) execp->backend->rclick_command = strdup(value); } else if (strcmp(key, "execp_uwheel_command") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->uwheel_command); if (strlen(value) > 0) execp->backend->uwheel_command = strdup(value); } else if (strcmp(key, "execp_dwheel_command") == 0) { Execp *execp = get_or_create_last_execp(); free_and_null(execp->backend->dwheel_command); if (strlen(value) > 0) execp->backend->dwheel_command = strdup(value); } /* Clock */ else if (strcmp(key, "time1_format") == 0) { if (!new_config_file) { clock_enabled = TRUE; if (panel_items_order) { gchar *tmp = g_strconcat(panel_items_order, "C", NULL); free(panel_items_order); panel_items_order = strdup(tmp); g_free(tmp); } else { panel_items_order = strdup("C"); } } if (strlen(value) > 0) { time1_format = strdup(value); clock_enabled = TRUE; } } else if (strcmp(key, "time2_format") == 0) { if (strlen(value) > 0) time2_format = strdup(value); } else if (strcmp(key, "time1_font") == 0) { time1_font_desc = pango_font_description_from_string(value); time1_has_font = TRUE; } else if (strcmp(key, "time1_timezone") == 0) { if (strlen(value) > 0) time1_timezone = strdup(value); } else if (strcmp(key, "time2_timezone") == 0) { if (strlen(value) > 0) time2_timezone = strdup(value); } else if (strcmp(key, "time2_font") == 0) { time2_font_desc = pango_font_description_from_string(value); time2_has_font = TRUE; } else if (strcmp(key, "clock_font_color") == 0) { extract_values(value, &value1, &value2, &value3); get_color(value1, panel_config.clock.font.rgb); if (value2) panel_config.clock.font.alpha = (atoi(value2) / 100.0); else panel_config.clock.font.alpha = 0.5; } else if (strcmp(key, "clock_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.clock.area.paddingxlr = panel_config.clock.area.paddingx = atoi(value1); if (value2) panel_config.clock.area.paddingy = atoi(value2); if (value3) panel_config.clock.area.paddingx = atoi(value3); } else if (strcmp(key, "clock_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.clock.area.bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "clock_tooltip") == 0) { if (strlen(value) > 0) time_tooltip_format = strdup(value); } else if (strcmp(key, "clock_tooltip_timezone") == 0) { if (strlen(value) > 0) time_tooltip_timezone = strdup(value); } else if (strcmp(key, "clock_lclick_command") == 0) { 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) { if (strcmp(value, "multi_desktop") == 0) taskbar_mode = MULTI_DESKTOP; else taskbar_mode = SINGLE_DESKTOP; } else if (strcmp(key, "taskbar_distribute_size") == 0) { taskbar_distribute_size = atoi(value); } else if (strcmp(key, "taskbar_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.g_taskbar.area.paddingxlr = panel_config.g_taskbar.area.paddingx = atoi(value1); if (value2) panel_config.g_taskbar.area.paddingy = atoi(value2); if (value3) panel_config.g_taskbar.area.paddingx = atoi(value3); } else if (strcmp(key, "taskbar_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.g_taskbar.background[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id); if (panel_config.g_taskbar.background[TASKBAR_ACTIVE] == 0) panel_config.g_taskbar.background[TASKBAR_ACTIVE] = panel_config.g_taskbar.background[TASKBAR_NORMAL]; } else if (strcmp(key, "taskbar_active_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.g_taskbar.background[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "taskbar_name") == 0) { taskbarname_enabled = atoi(value); } else if (strcmp(key, "taskbar_name_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.g_taskbar.area_name.paddingxlr = panel_config.g_taskbar.area_name.paddingx = atoi(value1); if (value2) panel_config.g_taskbar.area_name.paddingy = atoi(value2); } else if (strcmp(key, "taskbar_name_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.g_taskbar.background_name[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id); if (panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] == 0) panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] = panel_config.g_taskbar.background_name[TASKBAR_NORMAL]; } else if (strcmp(key, "taskbar_name_active_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "taskbar_name_font") == 0) { panel_config.taskbarname_font_desc = pango_font_description_from_string(value); panel_config.taskbarname_has_font = TRUE; } else if (strcmp(key, "taskbar_name_font_color") == 0) { extract_values(value, &value1, &value2, &value3); get_color(value1, taskbarname_font.rgb); if (value2) taskbarname_font.alpha = (atoi(value2) / 100.0); else taskbarname_font.alpha = 0.5; } else if (strcmp(key, "taskbar_name_active_font_color") == 0) { extract_values(value, &value1, &value2, &value3); get_color(value1, taskbarname_active_font.rgb); if (value2) taskbarname_active_font.alpha = (atoi(value2) / 100.0); else taskbarname_active_font.alpha = 0.5; } else if (strcmp(key, "taskbar_hide_inactive_tasks") == 0) { hide_inactive_tasks = atoi(value); } else if (strcmp(key, "taskbar_hide_different_monitor") == 0) { hide_task_diff_monitor = atoi(value); } else if (strcmp(key, "taskbar_always_show_all_desktop_tasks") == 0) { always_show_all_desktop_tasks = atoi(value); } else if (strcmp(key, "taskbar_sort_order") == 0) { if (strcmp(value, "center") == 0) { taskbar_sort_method = TASKBAR_SORT_CENTER; } else if (strcmp(value, "title") == 0) { taskbar_sort_method = TASKBAR_SORT_TITLE; } else if (strcmp(value, "lru") == 0) { taskbar_sort_method = TASKBAR_SORT_LRU; } else if (strcmp(value, "mru") == 0) { taskbar_sort_method = TASKBAR_SORT_MRU; } else { 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) panel_config.g_task.has_text = atoi(value); else if (strcmp(key, "task_icon") == 0) panel_config.g_task.has_icon = atoi(value); else if (strcmp(key, "task_centered") == 0) panel_config.g_task.centered = atoi(value); else if (strcmp(key, "task_width") == 0) { // old parameter : just for backward compatibility panel_config.g_task.maximum_width = atoi(value); panel_config.g_task.maximum_height = 30; } else if (strcmp(key, "task_maximum_size") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.g_task.maximum_width = atoi(value1); panel_config.g_task.maximum_height = 30; if (value2) panel_config.g_task.maximum_height = atoi(value2); } else if (strcmp(key, "task_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.g_task.area.paddingxlr = panel_config.g_task.area.paddingx = atoi(value1); if (value2) panel_config.g_task.area.paddingy = atoi(value2); if (value3) panel_config.g_task.area.paddingx = atoi(value3); } else if (strcmp(key, "task_font") == 0) { panel_config.g_task.font_desc = pango_font_description_from_string(value); panel_config.g_task.has_font = TRUE; } else if (g_regex_match_simple("task.*_font_color", key, 0, 0)) { gchar **split = g_regex_split_simple("_", key, 0, 0); int status = g_strv_length(split) == 3 ? TASK_NORMAL : get_task_status(split[1]); g_strfreev(split); if (status >= 0) { extract_values(value, &value1, &value2, &value3); float alpha = 1; if (value2) alpha = (atoi(value2) / 100.0); get_color(value1, panel_config.g_task.font[status].rgb); panel_config.g_task.font[status].alpha = alpha; panel_config.g_task.config_font_mask |= (1 << status); } } else if (g_regex_match_simple("task.*_icon_asb", key, 0, 0)) { gchar **split = g_regex_split_simple("_", key, 0, 0); int status = g_strv_length(split) == 3 ? TASK_NORMAL : get_task_status(split[1]); g_strfreev(split); if (status >= 0) { extract_values(value, &value1, &value2, &value3); panel_config.g_task.alpha[status] = atoi(value1); panel_config.g_task.saturation[status] = atoi(value2); panel_config.g_task.brightness[status] = atoi(value3); panel_config.g_task.config_asb_mask |= (1 << status); } } else if (g_regex_match_simple("task.*_background_id", key, 0, 0)) { gchar **split = g_regex_split_simple("_", key, 0, 0); int status = g_strv_length(split) == 3 ? TASK_NORMAL : get_task_status(split[1]); g_strfreev(split); if (status >= 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.g_task.background[status] = &g_array_index(backgrounds, Background, id); panel_config.g_task.config_background_mask |= (1 << status); if (status == TASK_NORMAL) panel_config.g_task.area.bg = panel_config.g_task.background[TASK_NORMAL]; } } // "tooltip" is deprecated but here for backwards compatibility else if (strcmp(key, "task_tooltip") == 0 || strcmp(key, "tooltip") == 0) panel_config.g_task.tooltip_enabled = atoi(value); /* Systray */ else if (strcmp(key, "systray_padding") == 0) { if (!new_config_file && systray_enabled == 0) { systray_enabled = TRUE; if (panel_items_order) { gchar *tmp = g_strconcat(panel_items_order, "S", NULL); free(panel_items_order); panel_items_order = strdup(tmp); g_free(tmp); } else panel_items_order = strdup("S"); } extract_values(value, &value1, &value2, &value3); systray.area.paddingxlr = systray.area.paddingx = atoi(value1); if (value2) systray.area.paddingy = atoi(value2); if (value3) systray.area.paddingx = atoi(value3); } else if (strcmp(key, "systray_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; systray.area.bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "systray_sort") == 0) { if (strcmp(value, "descending") == 0) systray.sort = SYSTRAY_SORT_DESCENDING; else if (strcmp(value, "ascending") == 0) systray.sort = SYSTRAY_SORT_ASCENDING; else if (strcmp(value, "left2right") == 0) systray.sort = SYSTRAY_SORT_LEFT2RIGHT; else if (strcmp(value, "right2left") == 0) systray.sort = SYSTRAY_SORT_RIGHT2LEFT; } else if (strcmp(key, "systray_icon_size") == 0) { systray_max_icon_size = atoi(value); } else if (strcmp(key, "systray_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); systray.alpha = atoi(value1); systray.saturation = atoi(value2); systray.brightness = atoi(value3); } else if (strcmp(key, "systray_monitor") == 0) { systray_monitor = atoi(value) - 1; } /* Launcher */ else if (strcmp(key, "launcher_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.launcher.area.paddingxlr = panel_config.launcher.area.paddingx = atoi(value1); if (value2) panel_config.launcher.area.paddingy = atoi(value2); if (value3) panel_config.launcher.area.paddingx = atoi(value3); } else if (strcmp(key, "launcher_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; panel_config.launcher.area.bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "launcher_icon_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; launcher_icon_bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "launcher_icon_size") == 0) { launcher_max_icon_size = atoi(value); } else if (strcmp(key, "launcher_item_app") == 0) { char *app = expand_tilde(value); panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, app); } else if (strcmp(key, "launcher_apps_dir") == 0) { char *path = expand_tilde(value); load_launcher_app_dir(path); free(path); } else if (strcmp(key, "launcher_icon_theme") == 0) { // if XSETTINGS manager running, tint2 use it. if (icon_theme_name_config) free(icon_theme_name_config); icon_theme_name_config = strdup(value); } else if (strcmp(key, "launcher_icon_theme_override") == 0) { launcher_icon_theme_override = atoi(value); } else if (strcmp(key, "launcher_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); launcher_alpha = atoi(value1); launcher_saturation = atoi(value2); launcher_brightness = atoi(value3); } else if (strcmp(key, "launcher_tooltip") == 0) { launcher_tooltip_enabled = atoi(value); } else if (strcmp(key, "startup_notifications") == 0) { startup_notifications = atoi(value); } /* Tooltip */ else if (strcmp(key, "tooltip_show_timeout") == 0) { int timeout_msec = 1000 * atof(value); g_tooltip.show_timeout_msec = timeout_msec; } else if (strcmp(key, "tooltip_hide_timeout") == 0) { int timeout_msec = 1000 * atof(value); g_tooltip.hide_timeout_msec = timeout_msec; } else if (strcmp(key, "tooltip_padding") == 0) { extract_values(value, &value1, &value2, &value3); if (value1) g_tooltip.paddingx = atoi(value1); if (value2) g_tooltip.paddingy = atoi(value2); } else if (strcmp(key, "tooltip_background_id") == 0) { int id = atoi(value); id = (id < backgrounds->len && id >= 0) ? id : 0; g_tooltip.bg = &g_array_index(backgrounds, Background, id); } else if (strcmp(key, "tooltip_font_color") == 0) { extract_values(value, &value1, &value2, &value3); get_color(value1, g_tooltip.font_color.rgb); if (value2) g_tooltip.font_color.alpha = (atoi(value2) / 100.0); else g_tooltip.font_color.alpha = 0.1; } else if (strcmp(key, "tooltip_font") == 0) { g_tooltip.font_desc = pango_font_description_from_string(value); } /* Mouse actions */ else if (strcmp(key, "mouse_left") == 0) get_action(value, &mouse_left); else if (strcmp(key, "mouse_middle") == 0) get_action(value, &mouse_middle); else if (strcmp(key, "mouse_right") == 0) get_action(value, &mouse_right); else if (strcmp(key, "mouse_scroll_up") == 0) get_action(value, &mouse_scroll_up); else if (strcmp(key, "mouse_scroll_down") == 0) get_action(value, &mouse_scroll_down); else if (strcmp(key, "mouse_effects") == 0) panel_config.mouse_effects = atoi(value); else if (strcmp(key, "mouse_hover_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.mouse_over_alpha = atoi(value1); panel_config.mouse_over_saturation = atoi(value2); panel_config.mouse_over_brightness = atoi(value3); } else if (strcmp(key, "mouse_pressed_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.mouse_pressed_alpha = atoi(value1); panel_config.mouse_pressed_saturation = atoi(value2); panel_config.mouse_pressed_brightness = atoi(value3); } /* autohide options */ else if (strcmp(key, "autohide") == 0) panel_autohide = atoi(value); else if (strcmp(key, "autohide_show_timeout") == 0) panel_autohide_show_timeout = 1000 * atof(value); else if (strcmp(key, "autohide_hide_timeout") == 0) panel_autohide_hide_timeout = 1000 * atof(value); else if (strcmp(key, "strut_policy") == 0) { if (strcmp(value, "follow_size") == 0) panel_strut_policy = STRUT_FOLLOW_SIZE; else if (strcmp(value, "none") == 0) panel_strut_policy = STRUT_NONE; else panel_strut_policy = STRUT_MINIMUM; } else if (strcmp(key, "autohide_height") == 0) { panel_autohide_height = atoi(value); if (panel_autohide_height == 0) { // autohide need height > 0 panel_autohide_height = 1; } } // old config option else if (strcmp(key, "systray") == 0) { if (!new_config_file) { systray_enabled = atoi(value); if (systray_enabled) { if (panel_items_order) { gchar *tmp = g_strconcat(panel_items_order, "S", NULL); free(panel_items_order); panel_items_order = strdup(tmp); g_free(tmp); } else panel_items_order = strdup("S"); } } } #ifdef ENABLE_BATTERY else if (strcmp(key, "battery") == 0) { if (!new_config_file) { battery_enabled = atoi(value); if (battery_enabled) { if (panel_items_order) { gchar *tmp = g_strconcat(panel_items_order, "B", NULL); free(panel_items_order); panel_items_order = strdup(tmp); g_free(tmp); } else panel_items_order = strdup("B"); } } } #endif else fprintf(stderr, "tint2 : invalid option \"%s\",\n upgrade tint2 or correct your config file\n", key); if (value1) free(value1); if (value2) free(value2); if (value3) free(value3); } gboolean config_read_file(const char *path) { FILE *fp; char line[512]; char *key, *value; if ((fp = fopen(path, "r")) == NULL) return FALSE; while (fgets(line, sizeof(line), fp) != NULL) { if (parse_line(line, &key, &value)) { add_entry(key, value); free(key); free(value); } } fclose(fp); if (!read_panel_position) { panel_horizontal = TRUE; panel_position = BOTTOM; } // append Taskbar item if (!new_config_file) { taskbar_enabled = TRUE; if (panel_items_order) { gchar *tmp = g_strconcat("T", panel_items_order, NULL); free(panel_items_order); panel_items_order = strdup(tmp); g_free(tmp); } else { panel_items_order = strdup("T"); } } if (backgrounds->len > 0) { Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); if (!read_bg_color_hover) memcpy(&bg->fill_color_hover, &bg->fill_color, sizeof(Color)); if (!read_border_color_hover) memcpy(&bg->border_color_hover, &bg->border, sizeof(Color)); if (!read_bg_color_press) memcpy(&bg->fill_color_pressed, &bg->fill_color_hover, sizeof(Color)); if (!read_border_color_press) memcpy(&bg->border_color_pressed, &bg->border_color_hover, sizeof(Color)); } return TRUE; } gboolean config_read_default_path() { const gchar *const *system_dirs; gchar *path1; // follow XDG specification // check tint2rc in user directory path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL); if (g_file_test(path1, G_FILE_TEST_EXISTS)) { gboolean result = config_read_file(path1); config_path = strdup(path1); g_free(path1); return result; } g_free(path1); // copy tint2rc from system directory to user directory gchar *path2 = 0; system_dirs = g_get_system_config_dirs(); for (int i = 0; system_dirs[i]; i++) { path2 = g_build_filename(system_dirs[i], "tint2", "tint2rc", NULL); if (g_file_test(path2, G_FILE_TEST_EXISTS)) break; g_free(path2); path2 = 0; } if (path2) { // copy file in user directory (path1) gchar *dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL); if (!g_file_test(dir, G_FILE_TEST_IS_DIR)) g_mkdir(dir, 0700); g_free(dir); path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL); copy_file(path2, path1); g_free(path2); gboolean result = config_read_file(path1); config_path = strdup(path1); g_free(path1); return result; } // generate empty config file fprintf(stderr, "tint2 warning: could not find a config file!\n"); gchar *dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL); if (!g_file_test(dir, G_FILE_TEST_IS_DIR)) g_mkdir(dir, 0700); g_free(dir); path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL); copy_file("/dev/null", path1); gboolean result = config_read_file(path1); config_path = strdup(path1); g_free(path1); return result; } gboolean config_read() { if (config_path) return config_read_file(config_path); return config_read_default_path(); } #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/config.h000066400000000000000000000007261265276141000226640ustar00rootroot00000000000000/************************************************************************** * config : * - parse config file in Panel struct. * * Check COPYING file for Copyright * **************************************************************************/ #ifndef CONFIG_H #define CONFIG_H #include extern char *config_path; extern char *snapshot_path; // default global data void default_config(); // freed memory void cleanup_config(); gboolean config_read(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/execplugin/000077500000000000000000000000001265276141000234045ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/execplugin/execplugin.c000066400000000000000000000533721265276141000257250ustar00rootroot00000000000000#include "execplugin.h" #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "server.h" #include "panel.h" #include "timer.h" #include "common.h" void execp_timer_callback(void *arg); char *execp_get_tooltip(void *obj); void execp_init_fonts(); void default_execp() { } Execp *create_execp() { Execp *execp = calloc(1, sizeof(Execp)); execp->backend = calloc(1, sizeof(ExecpBackend)); execp->backend->child_pipe = -1; execp->backend->interval = 30; execp->backend->cache_icon = TRUE; execp->backend->centered = TRUE; execp->backend->font_color.alpha = 0.5; return execp; } gpointer create_execp_frontend(gconstpointer arg, gpointer data) { Execp *execp_backend = (Execp *)arg; Execp *execp_frontend = calloc(1, sizeof(Execp)); execp_frontend->backend = execp_backend->backend; execp_backend->backend->instances = g_list_append(execp_backend->backend->instances, execp_frontend); execp_frontend->frontend = calloc(1, sizeof(ExecpFrontend)); return execp_frontend; } void destroy_execp(void *obj) { Execp *execp = (Execp *)obj; if (execp->frontend) { // This is a frontend element execp->backend->instances = g_list_remove_all(execp->backend->instances, execp); free_and_null(execp->frontend); } else { // This is a backend element stop_timeout(execp->backend->timer); execp->backend->timer = NULL; if (execp->backend->icon) { imlib_context_set_image(execp->backend->icon); imlib_free_image(); execp->backend->icon = NULL; } free_and_null(execp->backend->buf_output); free_and_null(execp->backend->text); free_and_null(execp->backend->icon_path); if (execp->backend->child) { kill(-execp->backend->child, SIGHUP); execp->backend->child = 0; } if (execp->backend->child_pipe >= 0) { close(execp->backend->child_pipe); execp->backend->child_pipe = -1; } execp->backend->bg = NULL; pango_font_description_free(execp->backend->font_desc); execp->backend->font_desc = NULL; free_and_null(execp->backend->command); free_and_null(execp->backend->tooltip); free_and_null(execp->backend->lclick_command); free_and_null(execp->backend->mclick_command); free_and_null(execp->backend->rclick_command); free_and_null(execp->backend->dwheel_command); free_and_null(execp->backend->uwheel_command); if (execp->backend->instances) { fprintf(stderr, "Error: Attempt to destroy backend while there are still frontend instances!\n"); exit(-1); } free(execp->backend); free(execp); } } void init_execp() { GList *to_remove = panel_config.execp_list; for (int k = 0; k < strlen(panel_items_order) && to_remove; k++) { if (panel_items_order[k] == 'E') { to_remove = to_remove->next; } } if (to_remove) { if (to_remove == panel_config.execp_list) { g_list_free_full(to_remove, destroy_execp); panel_config.execp_list = NULL; } else { // Cut panel_config.execp_list if (to_remove->prev) to_remove->prev->next = NULL; to_remove->prev = NULL; // Remove all elements of to_remove and to_remove itself g_list_free_full(to_remove, destroy_execp); } } execp_init_fonts(); for (GList *l = panel_config.execp_list; l; l = l->next) { Execp *execp = l->data; // Set missing config options if (!execp->backend->bg) execp->backend->bg = &g_array_index(backgrounds, Background, 0); execp->backend->buf_capacity = 1024; execp->backend->buf_output = calloc(execp->backend->buf_capacity, 1); execp->backend->text = strdup(" "); execp->backend->icon_path = NULL; } } void init_execp_panel(void *p) { Panel *panel = (Panel *)p; // Make sure this is only done once if there are multiple items if (panel->execp_list && ((Execp *)panel->execp_list->data)->frontend) return; // panel->execp_list is now a copy of the pointer panel_config.execp_list // We make it a deep copy panel->execp_list = g_list_copy_deep(panel_config.execp_list, create_execp_frontend, NULL); for (GList *l = panel->execp_list; l; l = l->next) { Execp *execp = l->data; execp->area.bg = execp->backend->bg; execp->area.paddingx = execp->backend->paddingx; execp->area.paddingy = execp->backend->paddingy; execp->area.paddingxlr = execp->backend->paddingxlr; execp->area.parent = panel; execp->area.panel = panel; execp->area._draw_foreground = draw_execp; execp->area.size_mode = LAYOUT_FIXED; execp->area._resize = resize_execp; execp->area._get_tooltip_text = execp_get_tooltip; execp->area.has_mouse_press_effect = panel_config.mouse_effects && (execp->area.has_mouse_over_effect = execp->backend->lclick_command || execp->backend->mclick_command || execp->backend->rclick_command || execp->backend->uwheel_command || execp->backend->dwheel_command); execp->area.resize_needed = TRUE; execp->area.on_screen = TRUE; if (!execp->backend->timer) execp->backend->timer = add_timeout(10, 0, execp_timer_callback, execp, &execp->backend->timer); } } void execp_init_fonts() { for (GList *l = panel_config.execp_list; l; l = l->next) { Execp *execp = l->data; if (!execp->backend->font_desc) execp->backend->font_desc = pango_font_description_from_string(get_default_font()); } } void execp_default_font_changed() { gboolean needs_update = FALSE; for (GList *l = panel_config.execp_list; l; l = l->next) { Execp *execp = l->data; if (!execp->backend->has_font) { pango_font_description_free(execp->backend->font_desc); execp->backend->font_desc = NULL; needs_update = TRUE; } } if (!needs_update) return; execp_init_fonts(); for (int i = 0; i < num_panels; i++) { for (GList *l = panels[i].execp_list; l; l = l->next) { Execp *execp = l->data; if (!execp->backend->has_font) { execp->area.resize_needed = TRUE; schedule_redraw(&execp->area); } } } panel_refresh = TRUE; } void cleanup_execp() { // Cleanup frontends for (int i = 0; i < num_panels; i++) { g_list_free_full(panels[i].execp_list, destroy_execp); panels[i].execp_list = NULL; } // Cleanup backends g_list_free_full(panel_config.execp_list, destroy_execp); panel_config.execp_list = NULL; } // Called from backend functions. gboolean reload_icon(Execp *execp) { char *icon_path = execp->backend->icon_path; if (execp->backend->has_icon && icon_path) { if (execp->backend->icon) { imlib_context_set_image(execp->backend->icon); imlib_free_image(); } execp->backend->icon = load_image(icon_path, execp->backend->cache_icon); if (execp->backend->icon) { imlib_context_set_image(execp->backend->icon); int w = imlib_image_get_width(); int h = imlib_image_get_height(); if (w && h) { if (execp->backend->icon_w) { if (!execp->backend->icon_h) { h = (int)(0.5 + h * execp->backend->icon_w / (float)(w)); w = execp->backend->icon_w; } else { w = execp->backend->icon_w; h = execp->backend->icon_h; } } else { if (execp->backend->icon_h) { w = (int)(0.5 + w * execp->backend->icon_h / (float)(h)); h = execp->backend->icon_h; } } if (w < 1) w = 1; if (h < 1) h = 1; } if (w != imlib_image_get_width() || h != imlib_image_get_height()) { Imlib_Image icon_scaled = imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), w, h); imlib_context_set_image(execp->backend->icon); imlib_free_image(); execp->backend->icon = icon_scaled; } return TRUE; } } return FALSE; } gboolean resize_execp(void *obj) { Execp *execp = obj; Panel *panel = execp->area.panel; int horiz_padding = (panel_horizontal ? execp->area.paddingxlr : execp->area.paddingy); int vert_padding = (panel_horizontal ? execp->area.paddingy : execp->area.paddingxlr); int interior_padding = execp->area.paddingx; schedule_redraw(&execp->area); int icon_w, icon_h; if (reload_icon(execp)) { if (execp->backend->icon) { imlib_context_set_image(execp->backend->icon); icon_w = imlib_image_get_width(); icon_h = imlib_image_get_height(); } else { icon_w = icon_h = 0; } } else { icon_w = icon_h = 0; } int text_next_line = !panel_horizontal && icon_w > execp->area.width / 2; int txt_height_ink, txt_height, txt_width; if (panel_horizontal) { get_text_size2(execp->backend->font_desc, &txt_height_ink, &txt_height, &txt_width, panel->area.height, panel->area.width, execp->backend->text, strlen(execp->backend->text), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, execp->backend->has_markup); } else { get_text_size2(execp->backend->font_desc, &txt_height_ink, &txt_height, &txt_width, panel->area.height, !text_next_line ? execp->area.width - icon_w - (icon_w ? interior_padding : 0) - 2 * (horiz_padding + execp->area.bg->border.width) : execp->area.width - 2 * (horiz_padding + execp->area.bg->border.width), execp->backend->text, strlen(execp->backend->text), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, execp->backend->has_markup); } gboolean result = FALSE; if (panel_horizontal) { int new_size = txt_width; if (icon_w) new_size += interior_padding + icon_w; new_size += 2 * (horiz_padding + execp->area.bg->border.width); if (new_size > execp->area.width || new_size < (execp->area.width - 6)) { // we try to limit the number of resize execp->area.width = new_size + 1; result = TRUE; } } else { int new_size; if (!text_next_line) { new_size = txt_height + (2 * (vert_padding + execp->area.bg->border.width)); if (new_size < icon_h + (2 * (vert_padding + execp->area.bg->border.width))) { new_size = icon_h + (2 * (vert_padding + execp->area.bg->border.width)); } } else { new_size = icon_h + interior_padding + txt_height + (2 * (vert_padding + execp->area.bg->border.width)); } if (new_size != execp->area.height) { execp->area.height = new_size; result = TRUE; } } execp->frontend->textw = txt_width; execp->frontend->texth = txt_height; if (execp->backend->centered) { if (icon_w) { if (!text_next_line) { execp->frontend->icony = (execp->area.height - icon_h) / 2; execp->frontend->iconx = (execp->area.width - txt_width - interior_padding - icon_w) / 2; execp->frontend->texty = (execp->area.height - txt_height) / 2; execp->frontend->textx = execp->frontend->iconx + icon_w + interior_padding; } else { execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2; execp->frontend->iconx = (execp->area.width - icon_w) / 2; execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; execp->frontend->textx = (execp->area.width - txt_width) / 2; } } else { execp->frontend->texty = (execp->area.height - txt_height) / 2; execp->frontend->textx = (execp->area.width - txt_width) / 2; } } else { if (icon_w) { if (!text_next_line) { execp->frontend->icony = (execp->area.height - icon_h) / 2; execp->frontend->iconx = execp->area.bg->border.width + horiz_padding; execp->frontend->texty = (execp->area.height - txt_height) / 2; execp->frontend->textx = execp->frontend->iconx + icon_w + interior_padding; } else { execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2; execp->frontend->iconx = execp->area.bg->border.width + horiz_padding; execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; execp->frontend->textx = execp->frontend->iconx; } } else { execp->frontend->texty = (execp->area.height - txt_height) / 2; execp->frontend->textx = execp->area.bg->border.width + horiz_padding; } } return result; } void draw_execp(void *obj, cairo_t *c) { Execp *execp = obj; PangoLayout *layout = pango_cairo_create_layout(c); if (execp->backend->has_icon && execp->backend->icon) { imlib_context_set_image(execp->backend->icon); // Render icon render_image(execp->area.pix, execp->frontend->iconx, execp->frontend->icony); } // draw layout pango_layout_set_font_description(layout, execp->backend->font_desc); pango_layout_set_width(layout, execp->frontend->textw * PANGO_SCALE); pango_layout_set_alignment(layout, execp->backend->centered ? PANGO_ALIGN_CENTER : PANGO_ALIGN_LEFT); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); if (!execp->backend->has_markup) pango_layout_set_text(layout, execp->backend->text, strlen(execp->backend->text)); else pango_layout_set_markup(layout, execp->backend->text, strlen(execp->backend->text)); pango_cairo_update_layout(c, layout); draw_text(layout, c, execp->frontend->textx, execp->frontend->texty, &execp->backend->font_color, panel_config.font_shadow); g_object_unref(layout); } void execp_action(void *obj, int button, int x, int y) { Execp *execp = obj; char *command = NULL; switch (button) { case 1: command = execp->backend->lclick_command; break; case 2: command = execp->backend->mclick_command; break; case 3: command = execp->backend->rclick_command; break; case 4: command = execp->backend->uwheel_command; break; case 5: command = execp->backend->dwheel_command; break; } if (command) { char *full_cmd = g_strdup_printf("export EXECP_X=%d;" "export EXECP_Y=%d;" "export EXECP_W=%d;" "export EXECP_H=%d; %s", x, y, execp->area.width, execp->area.height, command); tint_exec(full_cmd); g_free(full_cmd); } else { if (execp->backend->child_pipe > 0) { // Command currently running, nothing to do } else { if (execp->backend->timer) stop_timeout(execp->backend->timer); // Run command right away execp->backend->timer = add_timeout(10, 0, execp_timer_callback, execp, &execp->backend->timer); } } } void execp_timer_callback(void *arg) { Execp *execp = arg; if (!execp->backend->command) return; // Still running! if (execp->backend->child_pipe > 0) return; int pipe_fd[2]; if (pipe(pipe_fd)) { // TODO maybe write this in tooltip, but if this happens we're screwed anyways fprintf(stderr, "Execp: Creating pipe failed!\n"); return; } fcntl(pipe_fd[0], F_SETFL, O_NONBLOCK | fcntl(pipe_fd[0], F_GETFL)); // Fork and run command, capturing stdout in pipe pid_t child = fork(); if (child == -1) { // TODO maybe write this in tooltip, but if this happens we're screwed anyways fprintf(stderr, "Fork failed.\n"); close(pipe_fd[1]); close(pipe_fd[0]); return; } else if (child == 0) { // We are in the child close(pipe_fd[0]); dup2(pipe_fd[1], 1); // 1 is stdout close(pipe_fd[1]); setpgid(0, 0); execl("/bin/sh", "/bin/sh", "-c", execp->backend->command, NULL); // This should never happen! fprintf(stdout, "execl() failed\nexecl() failed\n"); fflush(stdout); exit(0); } close(pipe_fd[1]); execp->backend->child = child; execp->backend->child_pipe = pipe_fd[0]; execp->backend->buf_length = 0; execp->backend->buf_output[execp->backend->buf_length] = '\0'; execp->backend->last_update_start_time = time(NULL); } gboolean read_execp(void *obj) { Execp *execp = (Execp *)obj; if (execp->backend->child_pipe < 0) return FALSE; gboolean command_finished = FALSE; while (1) { // Make sure there is free space in the buffer if (execp->backend->buf_capacity - execp->backend->buf_length < 1024) { execp->backend->buf_capacity *= 2; execp->backend->buf_output = realloc(execp->backend->buf_output, execp->backend->buf_capacity); } ssize_t count = read(execp->backend->child_pipe, execp->backend->buf_output + execp->backend->buf_length, execp->backend->buf_capacity - execp->backend->buf_length - 1); if (count > 0) { // Successful read execp->backend->buf_length += count; execp->backend->buf_output[execp->backend->buf_length] = '\0'; continue; } else if (count == 0) { // End of file command_finished = TRUE; break; } else if (errno == EAGAIN || errno == EWOULDBLOCK) { // No more data available at the moment break; } else if (errno == EINTR) { // Harmless interruption by signal continue; } else { // Error command_finished = TRUE; break; } break; } if (command_finished) { execp->backend->child = 0; close(execp->backend->child_pipe); execp->backend->child_pipe = -1; if (execp->backend->interval) execp->backend->timer = add_timeout(execp->backend->interval * 1000, 0, execp_timer_callback, execp, &execp->backend->timer); } if (!execp->backend->continuous && command_finished) { free_and_null(execp->backend->text); free_and_null(execp->backend->icon_path); if (!execp->backend->has_icon) { execp->backend->text = strdup(execp->backend->buf_output); } else { char *text = strchr(execp->backend->buf_output, '\n'); if (text) { *text = '\0'; text++; execp->backend->text = strdup(text); } else { execp->backend->text = strdup(""); } execp->backend->icon_path = strdup(execp->backend->buf_output); } int len = strlen(execp->backend->text); if (len > 0 && execp->backend->text[len - 1] == '\n') execp->backend->text[len - 1] = '\0'; execp->backend->buf_length = 0; execp->backend->buf_output[execp->backend->buf_length] = '\0'; execp->backend->last_update_finish_time = time(NULL); execp->backend->last_update_duration = execp->backend->last_update_finish_time - execp->backend->last_update_start_time; return TRUE; } else if (execp->backend->continuous > 0) { // Count lines in buffer int num_lines = 0; char *last = execp->backend->buf_output; char *end = NULL; for (char *c = execp->backend->buf_output; *c; c++) { if (*c == '\n') { num_lines++; if (num_lines == execp->backend->continuous) end = c; } last = c; } if (*last && *last != '\n') num_lines++; if (num_lines >= execp->backend->continuous) { if (end) *end = '\0'; free_and_null(execp->backend->text); free_and_null(execp->backend->icon_path); if (!execp->backend->has_icon) { execp->backend->text = strdup(execp->backend->buf_output); } else { char *text = strchr(execp->backend->buf_output, '\n'); if (text) { *text = '\0'; text++; execp->backend->text = strdup(text); } else { execp->backend->text = strdup(""); } execp->backend->icon_path = strdup(execp->backend->buf_output); } int len = strlen(execp->backend->text); if (len > 0 && execp->backend->text[len - 1] == '\n') execp->backend->text[len - 1] = '\0'; if (end) { char *next = end + 1; int copied = next - execp->backend->buf_output; int remaining = execp->backend->buf_length - copied; if (remaining > 0) { memmove(execp->backend->buf_output, next, remaining); execp->backend->buf_length = remaining; execp->backend->buf_output[execp->backend->buf_length] = '\0'; } else { execp->backend->buf_length = 0; execp->backend->buf_output[execp->backend->buf_length] = '\0'; } } execp->backend->last_update_finish_time = time(NULL); execp->backend->last_update_duration = execp->backend->last_update_finish_time - execp->backend->last_update_start_time; return TRUE; } } return FALSE; } const char *time_to_string(int seconds, char *buffer) { if (seconds < 60) { sprintf(buffer, "%ds", seconds); } else if (seconds < 60 * 60) { int m = seconds / 60; seconds = seconds % 60; int s = seconds; sprintf(buffer, "%d:%ds", m, s); } else { int h = seconds / (60 * 60); seconds = seconds % (60 * 60); int m = seconds / 60; seconds = seconds % 60; int s = seconds; sprintf(buffer, "%d:%d:%ds", h, m, s); } return buffer; } char *execp_get_tooltip(void *obj) { Execp *execp = obj; if (execp->backend->tooltip) { if (strlen(execp->backend->tooltip) > 0) return strdup(execp->backend->tooltip); else return NULL; } time_t now = time(NULL); char tmp_buf1[256]; char tmp_buf2[256]; char tmp_buf3[256]; if (execp->backend->child_pipe < 0) { // Not executing command if (execp->backend->last_update_finish_time) { // We updated at least once if (execp->backend->interval > 0) { sprintf(execp->backend->tooltip_text, "Last update finished %s ago (took %s). Next update starting in %s.", time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1), time_to_string((int)execp->backend->last_update_duration, tmp_buf2), time_to_string((int)(execp->backend->interval - (now - execp->backend->last_update_finish_time)), tmp_buf3)); } else { sprintf(execp->backend->tooltip_text, "Last update finished %s ago (took %s).", time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1), time_to_string((int)execp->backend->last_update_duration, tmp_buf2)); } } else { // we never requested an update sprintf(execp->backend->tooltip_text, "Never updated. No update scheduled."); } } else { // Currently executing command if (execp->backend->last_update_finish_time) { // we finished updating at least once sprintf(execp->backend->tooltip_text, "Last update finished %s ago. Update in progress (started %s ago).", time_to_string((int)(now - execp->backend->last_update_finish_time), tmp_buf1), time_to_string((int)(now - execp->backend->last_update_start_time), tmp_buf3)); } else { // we never finished an update sprintf(execp->backend->tooltip_text, "First update in progress (started %s seconds ago).", time_to_string((int)(now - execp->backend->last_update_start_time), tmp_buf1)); } } return strdup(execp->backend->tooltip_text); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/execplugin/execplugin.h000066400000000000000000000105041265276141000257200ustar00rootroot00000000000000#ifndef EXECPLUGIN_H #define EXECPLUGIN_H #include #include #include "area.h" #include "common.h" #include "timer.h" // Architecture: // Panel panel_config contains an array of Execp, each storing all config options and all the state variables. // Only these run commands. // // Tint2 maintains an array of Panels, one for each monitor. Each stores an array of Execp which was initially copied // from panel_config. Each works as a frontend to the corresponding Execp in panel_config as backend, using the // backend's config and state variables. typedef struct ExecpBackend { // Config: // Command to execute at a specified interval char *command; // Interval in seconds int interval; // 1 if first line of output is an icon path gboolean has_icon; gboolean cache_icon; int icon_w; int icon_h; char *tooltip; gboolean centered; gboolean has_font; PangoFontDescription *font_desc; Color font_color; int continuous; gboolean has_markup; char *lclick_command; char *mclick_command; char *rclick_command; char *uwheel_command; char *dwheel_command; // paddingxlr = horizontal padding left/right // paddingx = horizontal padding between childs int paddingxlr, paddingx, paddingy; Background *bg; // Backend state: timeout *timer; int child_pipe; pid_t child; // Command output buffer char *buf_output; int buf_length; int buf_capacity; // Text extracted from the output buffer char *text; // Icon path extracted from the output buffer char *icon_path; Imlib_Image icon; char tooltip_text[512]; // The time the last command was started time_t last_update_start_time; // The time the last output was obtained time_t last_update_finish_time; // The time it took to execute last command time_t last_update_duration; // List of Execp which are frontends for this backend, one for each panel GList *instances; } ExecpBackend; typedef struct ExecpFrontend { // Frontend state: int iconx; int icony; int textx; int texty; int textw; int texth; } ExecpFrontend; typedef struct Execp { Area area; // All elements have the backend pointer set. However only backend elements have ownership. ExecpBackend *backend; // Set only for frontend Execp items. ExecpFrontend *frontend; } Execp; // Called before the config is read and panel_config/panels are created. // Afterwards, the config parsing code creates the array of Execp in panel_config and populates the configuration fields // in the backend. // Probably does nothing. void default_execp(); // Creates a new Execp item with only the backend field set. The state is NOT initialized. The config is initialized to // the default values. // This will be used by the config code to populate its backedn config fields. Execp *create_execp(); void destroy_execp(void *obj); // Called after the config is read and panel_config is populated, but before panels are created. // Initializes the state of the backend items. // panel_config.panel_items is used to determine which backend items are enabled. The others should be destroyed and // removed from panel_config.execp_list. void init_execp(); // Called after each on-screen panel is created, with a pointer to the panel. // Initializes the state of the frontend items. Also adds a pointer to it in backend->instances. // At this point the Area has not been added yet to the GUI tree, but it will be added right away. void init_execp_panel(void *panel); // Called just before the panels are destroyed. Afterwards, tint2 exits or restarts and reads the config again. // Releases all frontends and then all the backends. // The frontend items are not freed by this function, only their members. The items are Areas which are freed in the // GUI element tree cleanup function (remove_area). void cleanup_execp(); // Called on draw, obj = pointer to the front-end Execp item. void draw_execp(void *obj, cairo_t *c); // Called on resize, obj = pointer to the front-end Execp item. // Returns 1 if the new size is different than the previous size. gboolean resize_execp(void *obj); // Called on mouse click event. void execp_action(void *obj, int button, int x, int y); // Called to check if new output from the command can be read. // No command might be running. // Returns 1 if the output has been updated and a redraw is needed. gboolean read_execp(void *obj); void execp_default_font_changed(); #endif // EXECPLUGIN_H tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/freespace/000077500000000000000000000000001265276141000231765ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/freespace/freespace.c000066400000000000000000000052571265276141000253100ustar00rootroot00000000000000/************************************************************************** * * 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 #include #include #include #include #include #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) freespace->area.bg = &g_array_index(backgrounds, Background, 0); freespace->area.parent = p; freespace->area.panel = p; freespace->area.size_mode = LAYOUT_FIXED; freespace->area.resize_needed = 1; freespace->area.on_screen = TRUE; freespace->area._resize = resize_freespace; } int freespace_get_max_size(Panel *p) { // Get space used by every element except the freespace int size = 0; for (GList *walk = p->area.children; 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; } gboolean resize_freespace(void *obj) { FreeSpace *freespace = (FreeSpace *)obj; Panel *panel = (Panel *)freespace->area.panel; if (!freespace->area.on_screen) return FALSE; int old_size = panel_horizontal ? freespace->area.width : freespace->area.height; int size = freespace_get_max_size(panel); if (old_size == size) return FALSE; if (panel_horizontal) { freespace->area.width = size; } else { freespace->area.height = size; } schedule_redraw(&freespace->area); panel_refresh = TRUE; return TRUE; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/freespace/freespace.h000066400000000000000000000007131265276141000253050ustar00rootroot00000000000000/************************************************************************** * 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); gboolean resize_freespace(void *obj); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/000077500000000000000000000000001265276141000230425ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/apps-common.c000066400000000000000000000123771265276141000254510ustar00rootroot00000000000000/************************************************************************** * Tint2 : .desktop file handling * * Copyright (C) 2015 (mrovi9000@gmail.com) * * 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. **************************************************************************/ /* http://standards.freedesktop.org/desktop-entry-spec/ */ #include "apps-common.h" #include #include #include #include int parse_dektop_line(char *line, char **key, char **value) { char *p; int found = 0; *key = line; for (p = line; *p; p++) { if (*p == '=') { *value = p + 1; *p = 0; found = 1; break; } } if (!found) return 0; if (found && (strlen(*key) == 0 || strlen(*value) == 0)) return 0; return 1; } void expand_exec(DesktopEntry *entry, const char *path) { // Expand % in exec // %i -> --icon Icon // %c -> Name // %k -> path if (entry->exec) { char *exec2 = calloc(strlen(entry->exec) + (entry->name ? strlen(entry->name) : 1) + (entry->icon ? strlen(entry->icon) : 1) + 100, 1); char *p, *q; // p will never point to an escaped char for (p = entry->exec, q = exec2; *p; p++, q++) { *q = *p; // Copy if (*p == '\\') { p++, q++; // Copy the escaped char if (*p == '%') // For % we delete the backslash, i.e. write % over it q--; *q = *p; if (!*p) break; continue; } if (*p == '%') { p++; if (!*p) break; if (*p == 'i' && entry->icon != NULL) { sprintf(q, "--icon '%s'", entry->icon); q += strlen("--icon ''"); q += strlen(entry->icon); q--; // To balance the q++ in the for } else if (*p == 'c' && entry->name != NULL) { sprintf(q, "'%s'", entry->name); q += strlen("''"); q += strlen(entry->name); q--; // To balance the q++ in the for } else if (*p == 'c') { sprintf(q, "'%s'", path); q += strlen("''"); q += strlen(path); q--; // To balance the q++ in the for } else { // We don't care about other expansions q--; // Delete the last % from q } continue; } } *q = '\0'; free(entry->exec); entry->exec = exec2; } } int read_desktop_file(const char *path, DesktopEntry *entry) { FILE *fp; char *line = NULL; size_t line_size; char *key, *value; int i; entry->path = strdup(path); entry->name = entry->icon = entry->exec = NULL; if ((fp = fopen(path, "rt")) == NULL) { fprintf(stderr, "Could not open file %s\n", path); return 0; } const gchar **languages = (const gchar **)g_get_language_names(); // lang_index is the index of the language for the best Name key in the language vector // lang_index_default is a constant that encodes the Name key without a language int lang_index, lang_index_default; #define LANG_DBG 0 if (LANG_DBG) printf("Languages:"); for (i = 0; languages[i]; i++) { if (LANG_DBG) printf(" %s", languages[i]); } if (LANG_DBG) printf("\n"); lang_index_default = i; // we currently do not know about any Name key at all, so use an invalid index lang_index = lang_index_default + 1; int inside_desktop_entry = 0; while (getline(&line, &line_size, fp) >= 0) { int len = strlen(line); if (len == 0) continue; line[len - 1] = '\0'; if (line[0] == '[') { inside_desktop_entry = (strcmp(line, "[Desktop Entry]") == 0); } if (inside_desktop_entry && parse_dektop_line(line, &key, &value)) { if (strstr(key, "Name") == key) { if (strcmp(key, "Name") == 0 && lang_index > lang_index_default) { entry->name = strdup(value); lang_index = lang_index_default; } else { for (i = 0; languages[i] && i < lang_index; i++) { gchar *localized_key = g_strdup_printf("Name[%s]", languages[i]); if (strcmp(key, localized_key) == 0) { if (entry->name) free(entry->name); entry->name = strdup(value); lang_index = i; } g_free(localized_key); } } } else if (!entry->exec && strcmp(key, "Exec") == 0) { entry->exec = strdup(value); } else if (!entry->icon && strcmp(key, "Icon") == 0) { entry->icon = strdup(value); } } } fclose(fp); // From this point: // entry->name, entry->icon, entry->exec will never be empty strings (can be NULL though) expand_exec(entry, path); free(line); return 1; } void free_desktop_entry(DesktopEntry *entry) { free(entry->name); free(entry->icon); free(entry->exec); free(entry->path); entry->name = entry->icon = entry->exec = entry->path = NULL; } void test_read_desktop_file() { fprintf(stdout, "\033[1;33m"); DesktopEntry entry; read_desktop_file("/usr/share/applications/firefox.desktop", &entry); printf("Name:%s Icon:%s Exec:%s\n", entry.name, entry.icon, entry.exec); fprintf(stdout, "\033[0m"); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/apps-common.h000066400000000000000000000016221265276141000254450ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2015 (mrovi9000@gmail.com) * * **************************************************************************/ #ifndef APPS_COMMON_H #define APPS_COMMON_H typedef struct DesktopEntry { char *name; char *exec; char *icon; char *path; } DesktopEntry; // Parses a line of the form "key = value". Modifies the line. // Returns 1 if successful, and parts are not empty. // Key and value point to the parts. int parse_dektop_line(char *line, char **key, char **value); // Reads the .desktop file from the given path into the DesktopEntry entry. // The DesktopEntry object must be initially empty. // Returns 1 if successful. int read_desktop_file(const char *path, DesktopEntry *entry); // Empties DesktopEntry: releases the memory of the *members* of entry. void free_desktop_entry(DesktopEntry *entry); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/icon-theme-common.c000066400000000000000000000475151265276141000265400ustar00rootroot00000000000000/************************************************************************** * Tint2 : Icon theme handling * * Copyright (C) 2015 (mrovi9000@gmail.com) * * 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. **************************************************************************/ /* http://standards.freedesktop.org/icon-theme-spec/ */ #include "icon-theme-common.h" #include #include #include #include "apps-common.h" #define ICON_DIR_TYPE_SCALABLE 0 #define ICON_DIR_TYPE_FIXED 1 #define ICON_DIR_TYPE_THRESHOLD 2 typedef struct IconThemeDir { char *name; int size; int type; int max_size; int min_size; int threshold; } IconThemeDir; int parse_theme_line(char *line, char **key, char **value) { return parse_dektop_line(line, key, value); } GSList *icon_locations = NULL; // Do not free the result. const GSList *get_icon_locations() { if (icon_locations) return icon_locations; gchar *path; path = g_build_filename(g_get_home_dir(), ".icons", NULL); icon_locations = g_slist_append(icon_locations, g_strdup(path)); g_free(path); path = g_build_filename(g_get_home_dir(), ".local/share/icons", NULL); icon_locations = g_slist_append(icon_locations, g_strdup(path)); g_free(path); icon_locations = g_slist_append(icon_locations, g_strdup("/usr/local/share/icons")); icon_locations = g_slist_append(icon_locations, g_strdup("/usr/local/share/pixmaps")); icon_locations = g_slist_append(icon_locations, g_strdup("/usr/share/icons")); icon_locations = g_slist_append(icon_locations, g_strdup("/usr/share/pixmaps")); icon_locations = g_slist_append(icon_locations, g_strdup("/opt/share/icons")); icon_locations = g_slist_append(icon_locations, g_strdup("/opt/share/pixmaps")); return icon_locations; } IconTheme *make_theme(const char *name) { IconTheme *theme = calloc(1, sizeof(IconTheme)); theme->name = strdup(name); theme->list_inherits = NULL; theme->list_directories = NULL; return theme; } // TODO Use UTF8 when parsing the file IconTheme *load_theme_from_index(const char *file_name, const char *name) { IconTheme *theme; FILE *f; char *line = NULL; size_t line_size; if ((f = fopen(file_name, "rt")) == NULL) { fprintf(stderr, "Could not open theme '%s'\n", file_name); return NULL; } theme = make_theme(name); IconThemeDir *current_dir = NULL; int inside_header = 1; while (getline(&line, &line_size, f) >= 0) { char *key, *value; int line_len = strlen(line); if (line_len >= 1) { if (line[line_len - 1] == '\n') { line[line_len - 1] = '\0'; line_len--; } } if (line_len == 0) continue; if (inside_header) { if (parse_theme_line(line, &key, &value)) { if (strcmp(key, "Inherits") == 0) { // value is like oxygen,wood,default char *token; token = strtok(value, ",\n"); while (token != NULL) { theme->list_inherits = g_slist_append(theme->list_inherits, strdup(token)); token = strtok(NULL, ",\n"); } } else if (strcmp(key, "Directories") == 0) { // value is like 48x48/apps,48x48/mimetypes,32x32/apps,scalable/apps,scalable/mimetypes char *token; token = strtok(value, ",\n"); while (token != NULL) { IconThemeDir *dir = calloc(1, sizeof(IconThemeDir)); dir->name = strdup(token); dir->max_size = dir->min_size = dir->size = -1; dir->type = ICON_DIR_TYPE_THRESHOLD; dir->threshold = 2; theme->list_directories = g_slist_append(theme->list_directories, dir); token = strtok(NULL, ",\n"); } } } } else if (current_dir != NULL) { if (parse_theme_line(line, &key, &value)) { if (strcmp(key, "Size") == 0) { // value is like 24 sscanf(value, "%d", ¤t_dir->size); if (current_dir->max_size == -1) current_dir->max_size = current_dir->size; if (current_dir->min_size == -1) current_dir->min_size = current_dir->size; } else if (strcmp(key, "MaxSize") == 0) { // value is like 24 sscanf(value, "%d", ¤t_dir->max_size); } else if (strcmp(key, "MinSize") == 0) { // value is like 24 sscanf(value, "%d", ¤t_dir->min_size); } else if (strcmp(key, "Threshold") == 0) { // value is like 2 sscanf(value, "%d", ¤t_dir->threshold); } else if (strcmp(key, "Type") == 0) { // value is Fixed, Scalable or Threshold : default to scalable for unknown Type. if (strcmp(value, "Fixed") == 0) { current_dir->type = ICON_DIR_TYPE_FIXED; } else if (strcmp(value, "Threshold") == 0) { current_dir->type = ICON_DIR_TYPE_THRESHOLD; } else { current_dir->type = ICON_DIR_TYPE_SCALABLE; } } } } if (line[0] == '[' && line[line_len - 1] == ']' && strcmp(line, "[Icon Theme]") != 0) { inside_header = 0; current_dir = NULL; line[line_len - 1] = '\0'; char *dir_name = line + 1; GSList *dir_item = theme->list_directories; while (dir_item != NULL) { IconThemeDir *dir = dir_item->data; if (strcmp(dir->name, dir_name) == 0) { current_dir = dir; break; } dir_item = g_slist_next(dir_item); } } } fclose(f); free(line); return theme; } void load_theme_from_fs_dir(IconTheme *theme, const char *dir_name) { gchar *file_name = g_build_filename(dir_name, "index.theme", NULL); if (g_file_test(file_name, G_FILE_TEST_EXISTS)) { g_free(file_name); return; } GDir *d = g_dir_open(dir_name, 0, NULL); if (d) { const gchar *size_name; while ((size_name = g_dir_read_name(d))) { gchar *full_size_name = g_build_filename(dir_name, size_name, NULL); if (g_file_test(file_name, G_FILE_TEST_IS_DIR)) { int size, size2; if ((sscanf(size_name, "%dx%d", &size, &size2) == 2 && size == size2) || (sscanf(size_name, "%d", &size) == 1)) { GDir *dSize = g_dir_open(full_size_name, 0, NULL); if (dSize) { const gchar *subdir_name; while ((subdir_name = g_dir_read_name(dSize))) { IconThemeDir *dir = calloc(1, sizeof(IconThemeDir)); // value is like 48x48/apps gchar *value = g_build_filename(size_name, subdir_name, NULL); dir->name = strdup(value); g_free(value); dir->max_size = dir->min_size = dir->size = size; dir->type = ICON_DIR_TYPE_FIXED; theme->list_directories = g_slist_append(theme->list_directories, dir); } g_dir_close(dSize); } } } g_free(full_size_name); } g_dir_close(d); } } IconTheme *load_theme_from_fs(const char *name, IconTheme *theme) { gchar *dir_name = NULL; for (const GSList *location = get_icon_locations(); location; location = g_slist_next(location)) { gchar *path = (gchar *)location->data; dir_name = g_build_filename(path, name, NULL); if (g_file_test(dir_name, G_FILE_TEST_IS_DIR)) { if (!theme) { theme = make_theme(name); } load_theme_from_fs_dir(theme, dir_name); } g_free(dir_name); dir_name = NULL; } return theme; } IconTheme *load_theme(const char *name) { // Look for name/index.theme in $HOME/.icons, /usr/share/icons, /usr/share/pixmaps (stop at the first found) // Parse index.theme -> list of IconThemeDir with attributes // Return IconTheme* if (name == NULL) return NULL; gchar *file_name = NULL; for (const GSList *location = get_icon_locations(); location; location = g_slist_next(location)) { gchar *path = (gchar *)location->data; file_name = g_build_filename(path, name, "index.theme", NULL); if (!g_file_test(file_name, G_FILE_TEST_EXISTS)) { g_free(file_name); file_name = NULL; } if (file_name) break; } IconTheme *theme = NULL; if (file_name) { theme = load_theme_from_index(file_name, name); g_free(file_name); } return load_theme_from_fs(name, theme); } void free_icon_theme(IconTheme *theme) { if (!theme) return; free(theme->name); theme->name = NULL; for (GSList *l_inherits = theme->list_inherits; l_inherits; l_inherits = l_inherits->next) { free(l_inherits->data); } g_slist_free(theme->list_inherits); theme->list_inherits = NULL; for (GSList *l_dir = theme->list_directories; l_dir; l_dir = l_dir->next) { IconThemeDir *dir = (IconThemeDir *)l_dir->data; free(dir->name); free(l_dir->data); } g_slist_free(theme->list_directories); theme->list_directories = NULL; } void free_themes(IconThemeWrapper *themes) { if (!themes) return; for (GSList *l = themes->themes; l; l = l->next) { IconTheme *theme = (IconTheme *)l->data; free_icon_theme(theme); free(theme); } g_slist_free(themes->themes); for (GSList *l = themes->themes_fallback; l; l = l->next) { IconTheme *theme = (IconTheme *)l->data; free_icon_theme(theme); free(theme); } g_slist_free(themes->themes_fallback); free(themes); } void test_launcher_read_theme_file() { fprintf(stdout, "\033[1;33m"); IconTheme *theme = load_theme("oxygen"); if (!theme) { printf("Could not load theme\n"); return; } printf("Loaded theme: %s\n", theme->name); GSList *item = theme->list_inherits; while (item != NULL) { printf("Inherits:%s\n", (char *)item->data); item = g_slist_next(item); } item = theme->list_directories; while (item != NULL) { IconThemeDir *dir = item->data; printf("Dir:%s Size=%d MinSize=%d MaxSize=%d Threshold=%d Type=%s\n", dir->name, dir->size, dir->min_size, dir->max_size, dir->threshold, dir->type == ICON_DIR_TYPE_FIXED ? "Fixed" : dir->type == ICON_DIR_TYPE_SCALABLE ? "Scalable" : dir->type == ICON_DIR_TYPE_THRESHOLD ? "Threshold" : "?????"); item = g_slist_next(item); } fprintf(stdout, "\033[0m"); } gboolean str_list_contains(const GSList *list, const char *value) { const GSList *item = list; while (item != NULL) { if (g_str_equal(item->data, value)) { return TRUE; } item = g_slist_next(item); } return FALSE; } void load_themes_helper(const char *name, GSList **themes, GSList **queued) { if (str_list_contains(*queued, name)) return; GSList *queue = g_slist_append(NULL, strdup(name)); *queued = g_slist_append(*queued, strdup(name)); // Load wrapper->themes while (queue) { char *queued_name = queue->data; queue = g_slist_remove(queue, queued_name); fprintf(stderr, " '%s',", queued_name); IconTheme *theme = load_theme(queued_name); if (theme != NULL) { *themes = g_slist_append(*themes, theme); GSList *item = theme->list_inherits; int pos = 0; while (item != NULL) { char *parent = item->data; if (!str_list_contains(*queued, parent)) { queue = g_slist_insert(queue, strdup(parent), pos); pos++; *queued = g_slist_append(*queued, strdup(parent)); } item = g_slist_next(item); } } free(queued_name); } fprintf(stderr, "\n"); // Free the queue GSList *l; for (l = queue; l; l = l->next) free(l->data); g_slist_free(queue); } IconThemeWrapper *load_themes(const char *icon_theme_name) { IconThemeWrapper *wrapper = calloc(1, sizeof(IconThemeWrapper)); if (!icon_theme_name) { fprintf(stderr, "Missing icon_theme_name theme, default to 'hicolor'.\n"); icon_theme_name = "hicolor"; } else { fprintf(stderr, "Loading %s. Icon theme :", icon_theme_name); } GSList *queued = NULL; load_themes_helper(icon_theme_name, &wrapper->themes, &queued); load_themes_helper("hicolor", &wrapper->themes, &queued); // Load wrapper->themes_fallback const GSList *location; for (location = get_icon_locations(); location; location = g_slist_next(location)) { gchar *path = (gchar *)location->data; GDir *d = g_dir_open(path, 0, NULL); if (d) { const gchar *name; while ((name = g_dir_read_name(d))) { gchar *file_name = g_build_filename(path, name, "index.theme", NULL); if (g_file_test(file_name, G_FILE_TEST_EXISTS) && !g_file_test(file_name, G_FILE_TEST_IS_DIR)) { load_themes_helper(name, &wrapper->themes_fallback, &queued); } g_free(file_name); } g_dir_close(d); } } // Free the queued list GSList *l; for (l = queued; l; l = l->next) free(l->data); g_slist_free(queued); return wrapper; } int directory_matches_size(IconThemeDir *dir, int size) { if (dir->type == ICON_DIR_TYPE_FIXED) { return dir->size == size; } else if (dir->type == ICON_DIR_TYPE_SCALABLE) { return dir->min_size <= size && size <= dir->max_size; } else /*if (dir->type == ICON_DIR_TYPE_THRESHOLD)*/ { return dir->size - dir->threshold <= size && size <= dir->size + dir->threshold; } } int directory_size_distance(IconThemeDir *dir, int size) { if (dir->type == ICON_DIR_TYPE_FIXED) { return abs(dir->size - size); } else if (dir->type == ICON_DIR_TYPE_SCALABLE) { if (size < dir->min_size) { return dir->min_size - size; } else if (size > dir->max_size) { return size - dir->max_size; } else { return 0; } } else /*if (dir->type == ICON_DIR_TYPE_THRESHOLD)*/ { if (size < dir->size - dir->threshold) { return dir->min_size - size; } else if (size > dir->size + dir->threshold) { return size - dir->max_size; } else { return 0; } } } gint compare_theme_directories(gconstpointer a, gconstpointer b, gpointer size_query) { int size = GPOINTER_TO_INT(size_query); const IconThemeDir *da = (const IconThemeDir *)a; const IconThemeDir *db = (const IconThemeDir *)b; return abs(da->size - size) - abs(db->size - size); } #define DEBUG_ICON_SEARCH 0 char *get_icon_path_helper(GSList *themes, const char *icon_name, int size) { if (icon_name == NULL) return NULL; // If the icon_name is already a path and the file exists, return it if (strstr(icon_name, "/") == icon_name) { if (g_file_test(icon_name, G_FILE_TEST_EXISTS)) return strdup(icon_name); else return NULL; } const GSList *basenames = get_icon_locations(); GSList *extensions = NULL; extensions = g_slist_append(extensions, ".png"); extensions = g_slist_append(extensions, ".xpm"); #ifdef HAVE_RSVG extensions = g_slist_append(extensions, ".svg"); #endif // if the icon name already contains one of the extensions (e.g. vlc.png instead of vlc) add a special entry for (GSList *ext = extensions; ext; ext = g_slist_next(ext)) { char *extension = (char *)ext->data; if (strlen(icon_name) > strlen(extension) && strcmp(extension, icon_name + strlen(icon_name) - strlen(extension)) == 0) { extensions = g_slist_append(extensions, ""); break; } } GSList *theme; // Best size match // Contrary to the freedesktop spec, we are not choosing the closest icon in size, but the next larger icon // otherwise the quality is usually crap (for size 22, if you can choose 16 or 32, you're better with 32) // We do fallback to the closest size if we cannot find a larger or equal icon // These 3 variables are used for keeping the closest size match int minimal_size = INT_MAX; char *best_file_name = NULL; GSList *best_file_theme = NULL; // These 3 variables are used for keeping the next larger match int next_larger_size = -1; char *next_larger = NULL; GSList *next_larger_theme = NULL; int file_name_size = 4096; char *file_name = calloc(file_name_size, 1); for (theme = themes; theme; theme = g_slist_next(theme)) { ((IconTheme *)theme->data)->list_directories = g_slist_sort_with_data(((IconTheme *)theme->data)->list_directories, compare_theme_directories, GINT_TO_POINTER(size)); GSList *dir; for (dir = ((IconTheme *)theme->data)->list_directories; dir; dir = g_slist_next(dir)) { // Closest match gboolean possible = directory_size_distance((IconThemeDir *)dir->data, size) < minimal_size && (!best_file_theme ? TRUE : theme == best_file_theme); // Next larger match possible = possible || (((IconThemeDir *)dir->data)->size >= size && (next_larger_size == -1 || ((IconThemeDir *)dir->data)->size < next_larger_size) && (!next_larger_theme ? 1 : theme == next_larger_theme)); if (!possible) continue; const GSList *base; for (base = basenames; base; base = g_slist_next(base)) { for (GSList *ext = extensions; ext; ext = g_slist_next(ext)) { char *base_name = (char *)base->data; char *theme_name = ((IconTheme *)theme->data)->name; char *dir_name = ((IconThemeDir *)dir->data)->name; char *extension = (char *)ext->data; if (strlen(base_name) + strlen(theme_name) + strlen(dir_name) + strlen(icon_name) + strlen(extension) + 100 > file_name_size) { file_name_size = strlen(base_name) + strlen(theme_name) + strlen(dir_name) + strlen(icon_name) + strlen(extension) + 100; file_name = realloc(file_name, file_name_size); } file_name[0] = 0; // filename = directory/$(themename)/subdirectory/iconname.extension sprintf(file_name, "%s/%s/%s/%s%s", base_name, theme_name, dir_name, icon_name, extension); if (DEBUG_ICON_SEARCH) printf("checking %s\n", file_name); if (g_file_test(file_name, G_FILE_TEST_EXISTS)) { if (DEBUG_ICON_SEARCH) printf("found: %s\n", file_name); // Closest match if (directory_size_distance((IconThemeDir *)dir->data, size) < minimal_size && (!best_file_theme ? 1 : theme == best_file_theme)) { if (best_file_name) { free(best_file_name); best_file_name = NULL; } best_file_name = strdup(file_name); minimal_size = directory_size_distance((IconThemeDir *)dir->data, size); best_file_theme = theme; if (DEBUG_ICON_SEARCH) printf("best_file_name = %s; minimal_size = %d\n", best_file_name, minimal_size); } // Next larger match if (((IconThemeDir *)dir->data)->size >= size && (next_larger_size == -1 || ((IconThemeDir *)dir->data)->size < next_larger_size) && (!next_larger_theme ? 1 : theme == next_larger_theme)) { if (next_larger) { free(next_larger); next_larger = NULL; } next_larger = strdup(file_name); next_larger_size = ((IconThemeDir *)dir->data)->size; next_larger_theme = theme; if (DEBUG_ICON_SEARCH) printf("next_larger = %s; next_larger_size = %d\n", next_larger, next_larger_size); } } } } } } free(file_name); file_name = NULL; if (next_larger) { g_slist_free(extensions); free(best_file_name); return next_larger; } if (best_file_name) { g_slist_free(extensions); return best_file_name; } // Look in unthemed icons { for (const GSList *base = basenames; base; base = g_slist_next(base)) { for (GSList *ext = extensions; ext; ext = g_slist_next(ext)) { char *base_name = (char *)base->data; char *extension = (char *)ext->data; file_name = calloc(strlen(base_name) + strlen(icon_name) + strlen(extension) + 100, 1); // filename = directory/iconname.extension sprintf(file_name, "%s/%s%s", base_name, icon_name, extension); if (DEBUG_ICON_SEARCH) printf("checking %s\n", file_name); if (g_file_test(file_name, G_FILE_TEST_EXISTS)) { g_slist_free(extensions); return file_name; } else { free(file_name); file_name = NULL; } } } } g_slist_free(extensions); return NULL; } char *get_icon_path(IconThemeWrapper *theme, const char *icon_name, int size) { if (!theme) return NULL; icon_name = icon_name ? icon_name : DEFAULT_ICON; char *path = get_icon_path_helper(theme->themes, icon_name, size); if (!path) { path = get_icon_path_helper(theme->themes_fallback, icon_name, size); } if (!path) { fprintf(stderr, "Could not find icon %s\n", icon_name); path = get_icon_path_helper(theme->themes, DEFAULT_ICON, size); } if (!path) { path = get_icon_path_helper(theme->themes_fallback, DEFAULT_ICON, size); } return path; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/icon-theme-common.h000066400000000000000000000027641265276141000265420ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2015 (mrovi9000@gmail.com) * **************************************************************************/ #ifndef ICON_THEME_COMMON_H #define ICON_THEME_COMMON_H #include typedef struct IconThemeWrapper { // List of IconTheme* GSList *themes; // List of IconTheme* GSList *themes_fallback; } IconThemeWrapper; typedef struct IconTheme { char *name; GSList *list_inherits; // each item is a char* (theme name) GSList *list_directories; // each item is an IconThemeDir* } IconTheme; // Parses a line of the form "key = value". Modifies the line. // Returns 1 if successful, and parts are not empty. // Key and value point to the parts. int parse_theme_line(char *line, char **key, char **value); // Returns an IconThemeWrapper* containing the icon theme identified by the name icon_theme_name, all the // inherited themes, the hicolor theme and possibly fallback themes. IconThemeWrapper *load_themes(const char *icon_theme_name); void free_themes(IconThemeWrapper *themes); #define DEFAULT_ICON "application-x-executable" // Returns the full path to an icon file (or NULL) given the list of icon themes to search and the icon name // Note: needs to be released with free(). char *get_icon_path(IconThemeWrapper *theme, const char *icon_name, int size); // Returns a list of the directories used to store icons. // Do not free the result, it is cached. const GSList *get_icon_locations(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/launcher.c000066400000000000000000000367411265276141000250220ustar00rootroot00000000000000/************************************************************************** * Tint2 : launcher * * Copyright (C) 2010 (mrovi@interfete-web-club.com) * * SVG support: https://github.com/ixxra/tint2-svg * Copyright (C) 2010 Rene Garcia (garciamx@gmail.com) * * 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 #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "server.h" #include "area.h" #include "panel.h" #include "taskbar.h" #include "launcher.h" #include "apps-common.h" #include "icon-theme-common.h" int launcher_enabled; int launcher_max_icon_size; int launcher_tooltip_enabled; int launcher_alpha; int launcher_saturation; int launcher_brightness; char *icon_theme_name_config; char *icon_theme_name_xsettings; int launcher_icon_theme_override; int startup_notifications; Background *launcher_icon_bg; Imlib_Image scale_icon(Imlib_Image original, int icon_size); void free_icon(Imlib_Image icon); void default_launcher() { launcher_enabled = 0; launcher_max_icon_size = 0; launcher_tooltip_enabled = 0; launcher_alpha = 100; launcher_saturation = 0; launcher_brightness = 0; icon_theme_name_config = NULL; icon_theme_name_xsettings = NULL; launcher_icon_theme_override = 0; startup_notifications = 0; launcher_icon_bg = NULL; } void init_launcher() { } void init_launcher_panel(void *p) { Panel *panel = (Panel *)p; Launcher *launcher = &panel->launcher; launcher->area.parent = p; launcher->area.panel = p; launcher->area._draw_foreground = NULL; launcher->area.size_mode = LAYOUT_FIXED; launcher->area._resize = resize_launcher; launcher->area.resize_needed = 1; schedule_redraw(&launcher->area); if (!launcher->area.bg) launcher->area.bg = &g_array_index(backgrounds, Background, 0); if (!launcher_icon_bg) launcher_icon_bg = &g_array_index(backgrounds, Background, 0); // check consistency if (launcher->list_apps == NULL) return; launcher->area.on_screen = TRUE; panel_refresh = TRUE; launcher_load_themes(launcher); launcher_load_icons(launcher); } void cleanup_launcher() { for (int i = 0; i < num_panels; i++) { Panel *panel = &panels[i]; Launcher *launcher = &panel->launcher; cleanup_launcher_theme(launcher); } for (GSList *l = panel_config.launcher.list_apps; l; l = l->next) { free(l->data); } g_slist_free(panel_config.launcher.list_apps); panel_config.launcher.list_apps = NULL; free(icon_theme_name_config); icon_theme_name_config = NULL; free(icon_theme_name_xsettings); icon_theme_name_xsettings = NULL; launcher_enabled = FALSE; } void cleanup_launcher_theme(Launcher *launcher) { free_area(&launcher->area); for (GSList *l = launcher->list_icons; l; l = l->next) { LauncherIcon *launcherIcon = (LauncherIcon *)l->data; if (launcherIcon) { free_icon(launcherIcon->image); free_icon(launcherIcon->image_hover); free_icon(launcherIcon->image_pressed); free(launcherIcon->icon_name); free(launcherIcon->icon_path); free(launcherIcon->cmd); free(launcherIcon->icon_tooltip); } free(launcherIcon); } g_slist_free(launcher->list_icons); launcher->list_icons = NULL; free_themes(launcher->list_themes); launcher->list_themes = NULL; } gboolean resize_launcher(void *obj) { Launcher *launcher = obj; int icons_per_column = 1, icons_per_row = 1, margin = 0; int icon_size; if (panel_horizontal) { icon_size = launcher->area.height; } else { icon_size = launcher->area.width; } icon_size = icon_size - (2 * launcher->area.bg->border.width) - (2 * launcher->area.paddingy); if (launcher_max_icon_size > 0 && icon_size > launcher_max_icon_size) icon_size = launcher_max_icon_size; // Resize icons if necessary for (GSList *l = launcher->list_icons; l; l = l->next) { LauncherIcon *launcherIcon = (LauncherIcon *)l->data; if (launcherIcon->icon_size != icon_size || !launcherIcon->image) { launcherIcon->icon_size = icon_size; launcherIcon->area.width = launcherIcon->icon_size; launcherIcon->area.height = launcherIcon->icon_size; // Get the path for an icon file with the new size char *new_icon_path = get_icon_path(launcher->list_themes, launcherIcon->icon_name, launcherIcon->icon_size); if (!new_icon_path) { // Draw a blank icon free_icon(launcherIcon->image); free_icon(launcherIcon->image_hover); free_icon(launcherIcon->image_pressed); launcherIcon->image = NULL; continue; } // Free the old files free_icon(launcherIcon->image); free_icon(launcherIcon->image_hover); free_icon(launcherIcon->image_pressed); // Load the new file launcherIcon->image = load_image(new_icon_path, 1); // On loading error, fallback to default if (!launcherIcon->image) { free(new_icon_path); new_icon_path = get_icon_path(launcher->list_themes, DEFAULT_ICON, launcherIcon->icon_size); if (new_icon_path) launcherIcon->image = imlib_load_image_immediately(new_icon_path); } if (!launcherIcon->image) { // Loading default icon failed, draw a blank icon free(new_icon_path); } else { // Loaded icon successfully, rescale it Imlib_Image original = launcherIcon->image; launcherIcon->image = scale_icon(launcherIcon->image, launcherIcon->icon_size); free_icon(original); free(launcherIcon->icon_path); launcherIcon->icon_path = new_icon_path; fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path); } } if (panel_config.mouse_effects) { launcherIcon->image_hover = adjust_icon(launcherIcon->image, panel_config.mouse_over_alpha, panel_config.mouse_over_saturation, panel_config.mouse_over_brightness); launcherIcon->image_pressed = adjust_icon(launcherIcon->image, panel_config.mouse_pressed_alpha, panel_config.mouse_pressed_saturation, panel_config.mouse_pressed_brightness); } } int count = g_slist_length(launcher->list_icons); if (panel_horizontal) { if (!count) { launcher->area.width = 0; } else { int height = launcher->area.height - 2 * launcher->area.bg->border.width - 2 * launcher->area.paddingy; // here icons_per_column always higher than 0 icons_per_column = (height + launcher->area.paddingx) / (icon_size + launcher->area.paddingx); margin = height - (icons_per_column - 1) * (icon_size + launcher->area.paddingx) - icon_size; icons_per_row = count / icons_per_column + (count % icons_per_column != 0); launcher->area.width = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_row) + ((icons_per_row - 1) * launcher->area.paddingx); } } else { if (!count) { launcher->area.height = 0; } else { int width = launcher->area.width - 2 * launcher->area.bg->border.width - 2 * launcher->area.paddingy; // here icons_per_row always higher than 0 icons_per_row = (width + launcher->area.paddingx) / (icon_size + launcher->area.paddingx); margin = width - (icons_per_row - 1) * (icon_size + launcher->area.paddingx) - icon_size; icons_per_column = count / icons_per_row + (count % icons_per_row != 0); launcher->area.height = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_column) + ((icons_per_column - 1) * launcher->area.paddingx); } } int posx, posy; int start = launcher->area.bg->border.width + launcher->area.paddingy + margin / 2; if (panel_horizontal) { posy = start; posx = launcher->area.bg->border.width + launcher->area.paddingxlr; } else { posx = start; posy = launcher->area.bg->border.width + launcher->area.paddingxlr; } int i; GSList *l; for (i = 1, l = launcher->list_icons; l; i++, l = l->next) { LauncherIcon *launcherIcon = (LauncherIcon *)l->data; launcherIcon->y = posy; launcherIcon->x = posx; launcherIcon->area.posy = ((Area *)launcherIcon->area.parent)->posy + launcherIcon->y; launcherIcon->area.posx = ((Area *)launcherIcon->area.parent)->posx + launcherIcon->x; launcherIcon->area.width = launcherIcon->icon_size; launcherIcon->area.height = launcherIcon->icon_size; // printf("launcher %d : %d,%d\n", i, posx, posy); if (panel_horizontal) { if (i % icons_per_column) { posy += icon_size + launcher->area.paddingx; } else { posy = start; posx += (icon_size + launcher->area.paddingx); } } else { if (i % icons_per_row) { posx += icon_size + launcher->area.paddingx; } else { posx = start; posy += (icon_size + launcher->area.paddingx); } } } return TRUE; } // Here we override the default layout of the icons; normally Area layouts its children // in a stack; we need to layout them in a kind of table void launcher_icon_on_change_layout(void *obj) { LauncherIcon *launcherIcon = (LauncherIcon *)obj; launcherIcon->area.posy = ((Area *)launcherIcon->area.parent)->posy + launcherIcon->y; launcherIcon->area.posx = ((Area *)launcherIcon->area.parent)->posx + launcherIcon->x; launcherIcon->area.width = launcherIcon->icon_size; launcherIcon->area.height = launcherIcon->icon_size; } char *launcher_icon_get_tooltip_text(void *obj) { LauncherIcon *launcherIcon = (LauncherIcon *)obj; return strdup(launcherIcon->icon_tooltip); } void draw_launcher_icon(void *obj, cairo_t *c) { LauncherIcon *launcherIcon = (LauncherIcon *)obj; Imlib_Image image; // Render if (panel_config.mouse_effects) { if (launcherIcon->area.mouse_state == MOUSE_OVER) image = launcherIcon->image_hover ? launcherIcon->image_hover : launcherIcon->image; else if (launcherIcon->area.mouse_state == MOUSE_DOWN) image = launcherIcon->image_pressed ? launcherIcon->image_pressed : launcherIcon->image; else image = launcherIcon->image; } else { image = launcherIcon->image; } imlib_context_set_image(image); render_image(launcherIcon->area.pix, 0, 0); } Imlib_Image scale_icon(Imlib_Image original, int icon_size) { Imlib_Image icon_scaled; if (original) { imlib_context_set_image(original); icon_scaled = imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), icon_size, icon_size); imlib_context_set_image(icon_scaled); imlib_image_set_has_alpha(1); DATA32 *data = imlib_image_get_data(); adjust_asb(data, icon_size, icon_size, launcher_alpha, (float)launcher_saturation / 100, (float)launcher_brightness / 100); imlib_image_put_back_data(data); imlib_context_set_image(icon_scaled); } else { icon_scaled = imlib_create_image(icon_size, icon_size); imlib_context_set_image(icon_scaled); imlib_context_set_color(255, 255, 255, 255); imlib_image_fill_rectangle(0, 0, icon_size, icon_size); } return icon_scaled; } void free_icon(Imlib_Image icon) { if (icon) { imlib_context_set_image(icon); imlib_free_image(); } } void launcher_action(LauncherIcon *icon, XEvent *evt) { char *cmd = calloc(strlen(icon->cmd) + 10, 1); sprintf(cmd, "(%s&)", icon->cmd); #if HAVE_SN SnLauncherContext *ctx = 0; Time time; if (startup_notifications) { ctx = sn_launcher_context_new(server.sn_display, server.screen); sn_launcher_context_set_name(ctx, icon->icon_tooltip); sn_launcher_context_set_description(ctx, "Application launched from tint2"); sn_launcher_context_set_binary_name(ctx, icon->cmd); // Get a timestamp from the X event if (evt->type == ButtonPress || evt->type == ButtonRelease) { time = evt->xbutton.time; } else { fprintf(stderr, "Unknown X event: %d\n", evt->type); free(cmd); return; } sn_launcher_context_initiate(ctx, "tint2", icon->cmd, time); } #endif /* HAVE_SN */ pid_t pid; pid = fork(); if (pid < 0) { fprintf(stderr, "Could not fork\n"); } else if (pid == 0) { // Child process #if HAVE_SN if (startup_notifications) { sn_launcher_context_setup_child_process(ctx); } #endif // HAVE_SN // Allow children to exist after parent destruction setsid(); // Run the command execl("/bin/sh", "/bin/sh", "-c", icon->cmd, NULL); fprintf(stderr, "Failed to execlp %s\n", icon->cmd); #if HAVE_SN if (startup_notifications) { sn_launcher_context_unref(ctx); } #endif // HAVE_SN exit(1); } else { // Parent process #if HAVE_SN if (startup_notifications) { g_tree_insert(server.pids, GINT_TO_POINTER(pid), ctx); } #endif // HAVE_SN } free(cmd); } // Populates the list_icons list from the list_apps list void launcher_load_icons(Launcher *launcher) { // Load apps (.desktop style launcher items) GSList *app = launcher->list_apps; while (app != NULL) { DesktopEntry entry; read_desktop_file(app->data, &entry); if (entry.exec) { LauncherIcon *launcherIcon = calloc(1, sizeof(LauncherIcon)); launcherIcon->area.panel = launcher->area.panel; launcherIcon->area._draw_foreground = draw_launcher_icon; launcherIcon->area.size_mode = LAYOUT_FIXED; launcherIcon->area._resize = NULL; launcherIcon->area.resize_needed = 0; schedule_redraw(&launcherIcon->area); launcherIcon->area.has_mouse_over_effect = panel_config.mouse_effects; launcherIcon->area.has_mouse_press_effect = launcherIcon->area.has_mouse_over_effect; launcherIcon->area.bg = launcher_icon_bg; launcherIcon->area.on_screen = TRUE; launcherIcon->area._on_change_layout = launcher_icon_on_change_layout; if (launcher_tooltip_enabled) { launcherIcon->area._get_tooltip_text = launcher_icon_get_tooltip_text; } else { launcherIcon->area._get_tooltip_text = NULL; } launcherIcon->is_app_desktop = 1; launcherIcon->cmd = strdup(entry.exec); launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON); launcherIcon->icon_size = 1; launcherIcon->icon_tooltip = entry.name ? strdup(entry.name) : strdup(entry.exec); launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon); add_area(&launcherIcon->area, (Area *)launcher); } free_desktop_entry(&entry); app = g_slist_next(app); } } // Populates the list_themes list void launcher_load_themes(Launcher *launcher) { launcher->list_themes = load_themes(launcher_icon_theme_override ? (icon_theme_name_config ? icon_theme_name_config : icon_theme_name_xsettings ? icon_theme_name_xsettings : "hicolor") : (icon_theme_name_xsettings ? icon_theme_name_xsettings : icon_theme_name_config ? icon_theme_name_config : "hicolor")); } void launcher_default_icon_theme_changed() { if (!launcher_enabled) return; if (launcher_icon_theme_override && icon_theme_name_config) return; for (int i = 0; i < num_panels; i++) { Launcher *launcher = &panels[i].launcher; cleanup_launcher_theme(launcher); launcher_load_themes(launcher); launcher_load_icons(launcher); launcher->area.resize_needed = 1; } panel_refresh = TRUE; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/launcher.h000066400000000000000000000036121265276141000250160ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2010 (mrovi@interfete-web-club.com) * * **************************************************************************/ #ifndef LAUNCHER_H #define LAUNCHER_H #include "common.h" #include "area.h" #include "xsettings-client.h" #include "icon-theme-common.h" typedef struct Launcher { // always start with area Area area; GSList *list_apps; // List of char*, each is a path to a app.desktop file GSList *list_icons; // List of LauncherIcon* IconThemeWrapper *list_themes; } Launcher; typedef struct LauncherIcon { // always start with area Area area; Imlib_Image image; Imlib_Image image_hover; Imlib_Image image_pressed; char *cmd; char *icon_name; char *icon_path; char *icon_tooltip; int icon_size; int is_app_desktop; int x, y; } LauncherIcon; extern gboolean launcher_enabled; extern int launcher_max_icon_size; extern int launcher_tooltip_enabled; extern int launcher_alpha; extern int launcher_saturation; extern int launcher_brightness; extern char *icon_theme_name_xsettings; // theme name extern char *icon_theme_name_config; extern int launcher_icon_theme_override; extern int startup_notifications; extern Background *launcher_icon_bg; // default global data void default_launcher(); // initialize launcher : y position, precision, ... void init_launcher(); void init_launcher_panel(void *panel); void cleanup_launcher(); void cleanup_launcher_theme(Launcher *launcher); gboolean resize_launcher(void *obj); void draw_launcher(void *obj, cairo_t *c); void launcher_default_icon_theme_changed(); // Populates the list_icons list void launcher_load_icons(Launcher *launcher); // Populates the list_themes list void launcher_load_themes(Launcher *launcher); void launcher_action(LauncherIcon *icon, XEvent *e); void test_launcher_read_desktop_file(); void test_launcher_read_theme_file(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/xsettings-client.c000066400000000000000000000306311265276141000265150ustar00rootroot00000000000000/* * Copyright © 2001 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Red Hat not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Red Hat makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Owen Taylor, Red Hat, Inc. */ #include #include #include #include #include #include /* For CARD16 */ #include "xsettings-client.h" #include "server.h" #include "panel.h" #include "launcher.h" struct _XSettingsClient { Display *display; int screen; XSettingsNotifyFunc notify; XSettingsWatchFunc watch; void *cb_data; Window manager_window; XSettingsList *settings; }; void xsettings_notify_cb(const char *name, XSettingsAction action, XSettingsSetting *setting, void *data) { if ((action == XSETTINGS_ACTION_NEW || action == XSETTINGS_ACTION_CHANGED) && name != NULL && setting != NULL) { if (strcmp(name, "Net/IconThemeName") == 0 && setting->type == XSETTINGS_TYPE_STRING) { fprintf(stderr, "xsettings: %s = %s\n", name, setting->data.v_string); if (icon_theme_name_xsettings) { if (strcmp(icon_theme_name_xsettings, setting->data.v_string) == 0) return; free(icon_theme_name_xsettings); } icon_theme_name_xsettings = strdup(setting->data.v_string); default_icon_theme_changed(); } else if (strcmp(name, "Gtk/FontName") == 0 && setting->type == XSETTINGS_TYPE_STRING) { fprintf(stderr, "xsettings: %s = %s\n", name, setting->data.v_string); if (default_font) { if (strcmp(default_font, setting->data.v_string) == 0) return; free(default_font); } default_font = strdup(setting->data.v_string); default_font_changed(); } } } static void notify_changes(XSettingsClient *client, XSettingsList *old_list) { XSettingsList *old_iter = old_list; XSettingsList *new_iter = client->settings; if (!client->notify) return; while (old_iter || new_iter) { int cmp; if (old_iter && new_iter) cmp = strcmp(old_iter->setting->name, new_iter->setting->name); else if (old_iter) cmp = -1; else cmp = 1; if (cmp < 0) { client->notify(old_iter->setting->name, XSETTINGS_ACTION_DELETED, NULL, client->cb_data); } else if (cmp == 0) { if (!xsettings_setting_equal(old_iter->setting, new_iter->setting)) client->notify(old_iter->setting->name, XSETTINGS_ACTION_CHANGED, new_iter->setting, client->cb_data); } else { client->notify(new_iter->setting->name, XSETTINGS_ACTION_NEW, new_iter->setting, client->cb_data); } if (old_iter) old_iter = old_iter->next; if (new_iter) new_iter = new_iter->next; } } static int ignore_errors(Display *display, XErrorEvent *event) { return True; } static char local_byte_order = '\0'; #define BYTES_LEFT(buffer) ((buffer)->data + (buffer)->len - (buffer)->pos) static XSettingsResult fetch_card16(XSettingsBuffer *buffer, CARD16 *result) { CARD16 x; if (BYTES_LEFT(buffer) < 2) return XSETTINGS_ACCESS; x = *(CARD16 *)buffer->pos; buffer->pos += 2; if (buffer->byte_order == local_byte_order) *result = x; else *result = (x << 8) | (x >> 8); return XSETTINGS_SUCCESS; } static XSettingsResult fetch_ushort(XSettingsBuffer *buffer, unsigned short *result) { CARD16 x; XSettingsResult r; r = fetch_card16(buffer, &x); if (r == XSETTINGS_SUCCESS) *result = x; return r; } static XSettingsResult fetch_card32(XSettingsBuffer *buffer, CARD32 *result) { CARD32 x; if (BYTES_LEFT(buffer) < 4) return XSETTINGS_ACCESS; x = *(CARD32 *)buffer->pos; buffer->pos += 4; if (buffer->byte_order == local_byte_order) *result = x; else *result = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); return XSETTINGS_SUCCESS; } static XSettingsResult fetch_card8(XSettingsBuffer *buffer, CARD8 *result) { if (BYTES_LEFT(buffer) < 1) return XSETTINGS_ACCESS; *result = *(CARD8 *)buffer->pos; buffer->pos += 1; return XSETTINGS_SUCCESS; } #define XSETTINGS_PAD(n, m) ((n + m - 1) & (~(m - 1))) static XSettingsList *parse_settings(unsigned char *data, size_t len) { XSettingsBuffer buffer; XSettingsResult result = XSETTINGS_SUCCESS; XSettingsList *settings = NULL; CARD32 serial; CARD32 n_entries; CARD32 i; XSettingsSetting *setting = NULL; local_byte_order = xsettings_byte_order(); buffer.byte_order = local_byte_order; buffer.pos = buffer.data = data; buffer.len = len; result = fetch_card8(&buffer, (CARD8 *)&buffer.byte_order); if (buffer.byte_order != MSBFirst && buffer.byte_order != LSBFirst) { fprintf(stderr, "Invalid byte order %x in XSETTINGS property\n", buffer.byte_order); result = XSETTINGS_FAILED; goto out; } buffer.pos += 3; result = fetch_card32(&buffer, &serial); if (result != XSETTINGS_SUCCESS) goto out; result = fetch_card32(&buffer, &n_entries); if (result != XSETTINGS_SUCCESS) goto out; for (i = 0; i < n_entries; i++) { CARD8 type; CARD16 name_len; CARD32 v_int; size_t pad_len; result = fetch_card8(&buffer, &type); if (result != XSETTINGS_SUCCESS) goto out; buffer.pos += 1; result = fetch_card16(&buffer, &name_len); if (result != XSETTINGS_SUCCESS) goto out; pad_len = XSETTINGS_PAD(name_len, 4); if (BYTES_LEFT(&buffer) < pad_len) { result = XSETTINGS_ACCESS; goto out; } setting = calloc(1, sizeof *setting); if (!setting) { result = XSETTINGS_NO_MEM; goto out; } setting->type = XSETTINGS_TYPE_INT; /* No allocated memory */ setting->name = calloc(name_len + 1, 1); if (!setting->name) { result = XSETTINGS_NO_MEM; goto out; } memcpy(setting->name, buffer.pos, name_len); setting->name[name_len] = '\0'; buffer.pos += pad_len; result = fetch_card32(&buffer, &v_int); if (result != XSETTINGS_SUCCESS) goto out; setting->last_change_serial = v_int; switch (type) { case XSETTINGS_TYPE_INT: result = fetch_card32(&buffer, &v_int); if (result != XSETTINGS_SUCCESS) goto out; setting->data.v_int = (INT32)v_int; break; case XSETTINGS_TYPE_STRING: result = fetch_card32(&buffer, &v_int); if (result != XSETTINGS_SUCCESS) goto out; pad_len = XSETTINGS_PAD(v_int, 4); if (v_int + 1 == 0 || /* Guard against wrap-around */ BYTES_LEFT(&buffer) < pad_len) { result = XSETTINGS_ACCESS; goto out; } setting->data.v_string = calloc(v_int + 1, 1); if (!setting->data.v_string) { result = XSETTINGS_NO_MEM; goto out; } memcpy(setting->data.v_string, buffer.pos, v_int); setting->data.v_string[v_int] = '\0'; buffer.pos += pad_len; break; case XSETTINGS_TYPE_COLOR: result = fetch_ushort(&buffer, &setting->data.v_color.red); if (result != XSETTINGS_SUCCESS) goto out; result = fetch_ushort(&buffer, &setting->data.v_color.green); if (result != XSETTINGS_SUCCESS) goto out; result = fetch_ushort(&buffer, &setting->data.v_color.blue); if (result != XSETTINGS_SUCCESS) goto out; result = fetch_ushort(&buffer, &setting->data.v_color.alpha); if (result != XSETTINGS_SUCCESS) goto out; break; default: /* Quietly ignore unknown types */ break; } setting->type = type; result = xsettings_list_insert(&settings, setting); if (result != XSETTINGS_SUCCESS) goto out; setting = NULL; } out: if (result != XSETTINGS_SUCCESS) { switch (result) { case XSETTINGS_NO_MEM: fprintf(stderr, "Out of memory reading XSETTINGS property\n"); break; case XSETTINGS_ACCESS: fprintf(stderr, "Invalid XSETTINGS property (read off end)\n"); break; case XSETTINGS_DUPLICATE_ENTRY: fprintf(stderr, "Duplicate XSETTINGS entry for '%s'\n", setting->name); case XSETTINGS_FAILED: case XSETTINGS_SUCCESS: case XSETTINGS_NO_ENTRY: break; } if (setting) xsettings_setting_free(setting); xsettings_list_free(settings); settings = NULL; } return settings; } static void read_settings(XSettingsClient *client) { Atom type; int format; unsigned long n_items; unsigned long bytes_after; unsigned char *data; int (*old_handler)(Display *, XErrorEvent *); XSettingsList *old_list = client->settings; client->settings = NULL; old_handler = XSetErrorHandler(ignore_errors); int result = XGetWindowProperty(client->display, client->manager_window, server.atom._XSETTINGS_SETTINGS, 0, LONG_MAX, False, server.atom._XSETTINGS_SETTINGS, &type, &format, &n_items, &bytes_after, &data); XSetErrorHandler(old_handler); if (result == Success && type == server.atom._XSETTINGS_SETTINGS) { if (format != 8) { fprintf(stderr, "Invalid format for XSETTINGS property %d", format); } else client->settings = parse_settings(data, n_items); XFree(data); } notify_changes(client, old_list); xsettings_list_free(old_list); } static void check_manager_window(XSettingsClient *client) { if (client->manager_window && client->watch) client->watch(client->manager_window, False, 0, client->cb_data); XGrabServer(client->display); client->manager_window = XGetSelectionOwner(server.display, server.atom._XSETTINGS_SCREEN); if (client->manager_window) XSelectInput(server.display, client->manager_window, PropertyChangeMask | StructureNotifyMask); XUngrabServer(client->display); XFlush(client->display); if (client->manager_window && client->watch) client->watch(client->manager_window, True, PropertyChangeMask | StructureNotifyMask, client->cb_data); read_settings(client); } XSettingsClient *xsettings_client_new(Display *display, int screen, XSettingsNotifyFunc notify, XSettingsWatchFunc watch, void *cb_data) { XSettingsClient *client = calloc(1, sizeof *client); if (!client) return NULL; client->display = display; client->screen = screen; client->notify = notify; client->watch = watch; client->cb_data = cb_data; client->manager_window = None; client->settings = NULL; if (client->watch) client->watch(RootWindow(display, screen), True, StructureNotifyMask, client->cb_data); check_manager_window(client); if (client->manager_window == None) { printf("No XSETTINGS manager, tint2 uses config option 'launcher_icon_theme'.\n"); free(client); return NULL; } else { return client; } } void xsettings_client_destroy(XSettingsClient *client) { if (!client) return; if (client->watch) client->watch(RootWindow(client->display, client->screen), False, 0, client->cb_data); if (client->manager_window && client->watch) client->watch(client->manager_window, False, 0, client->cb_data); xsettings_list_free(client->settings); free(client); } XSettingsResult xsettings_client_get_setting(XSettingsClient *client, const char *name, XSettingsSetting **setting) { XSettingsSetting *search = xsettings_list_lookup(client->settings, name); if (search) { *setting = xsettings_setting_copy(search); return *setting ? XSETTINGS_SUCCESS : XSETTINGS_NO_MEM; } else return XSETTINGS_NO_ENTRY; } Bool xsettings_client_process_event(XSettingsClient *client, XEvent *xev) { /* The checks here will not unlikely cause us to reread * the properties from the manager window a number of * times when the manager changes from A->B. But manager changes * are going to be pretty rare. */ if (xev->xany.window == RootWindow(server.display, server.screen)) { if (xev->xany.type == ClientMessage && xev->xclient.message_type == server.atom.MANAGER) { check_manager_window(client); return True; } } else if (xev->xany.window == client->manager_window) { if (xev->xany.type == DestroyNotify) { check_manager_window(client); return True; } else if (xev->xany.type == PropertyNotify) { read_settings(client); return True; } } return False; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/xsettings-client.h000066400000000000000000000044341265276141000265240ustar00rootroot00000000000000/* * Copyright © 2001 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Red Hat not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Red Hat makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Owen Taylor, Red Hat, Inc. */ #ifndef XSETTINGS_CLIENT_H #define XSETTINGS_CLIENT_H #include #include "xsettings-common.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _XSettingsClient XSettingsClient; typedef enum { XSETTINGS_ACTION_NEW, XSETTINGS_ACTION_CHANGED, XSETTINGS_ACTION_DELETED } XSettingsAction; typedef void (*XSettingsNotifyFunc)(const char *name, XSettingsAction action, XSettingsSetting *setting, void *cb_data); typedef void (*XSettingsWatchFunc)(Window window, Bool is_start, long mask, void *cb_data); XSettingsClient *xsettings_client_new(Display *display, int screen, XSettingsNotifyFunc notify, XSettingsWatchFunc watch, void *cb_data); void xsettings_client_destroy(XSettingsClient *client); Bool xsettings_client_process_event(XSettingsClient *client, XEvent *xev); void xsettings_notify_cb(const char *name, XSettingsAction action, XSettingsSetting *setting, void *data); XSettingsResult xsettings_client_get_setting(XSettingsClient *client, const char *name, XSettingsSetting **setting); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* XSETTINGS_CLIENT_H */ tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/xsettings-common.c000066400000000000000000000125161265276141000265310ustar00rootroot00000000000000/* * Copyright © 2001 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Red Hat not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Red Hat makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Owen Taylor, Red Hat, Inc. */ #include "string.h" #include "stdlib.h" #include #include /* For CARD32 */ #include "xsettings-common.h" XSettingsSetting *xsettings_setting_copy(XSettingsSetting *setting) { XSettingsSetting *result; size_t str_len; result = calloc(1, sizeof *result); if (!result) return NULL; str_len = strlen(setting->name); result->name = calloc(str_len + 1, 1); if (!result->name) goto err; memcpy(result->name, setting->name, str_len + 1); result->type = setting->type; switch (setting->type) { case XSETTINGS_TYPE_INT: result->data.v_int = setting->data.v_int; break; case XSETTINGS_TYPE_COLOR: result->data.v_color = setting->data.v_color; break; case XSETTINGS_TYPE_STRING: str_len = strlen(setting->data.v_string); result->data.v_string = calloc(str_len + 1, 1); if (!result->data.v_string) goto err; memcpy(result->data.v_string, setting->data.v_string, str_len + 1); break; default: break; } result->last_change_serial = setting->last_change_serial; return result; err: if (result->name) free(result->name); free(result); return NULL; } XSettingsList *xsettings_list_copy(XSettingsList *list) { XSettingsList *new = NULL; XSettingsList *old_iter = list; XSettingsList *new_iter = NULL; while (old_iter) { XSettingsList *new_node; new_node = calloc(1, sizeof *new_node); if (!new_node) goto error; new_node->setting = xsettings_setting_copy(old_iter->setting); if (!new_node->setting) { free(new_node); goto error; } if (new_iter) new_iter->next = new_node; else new = new_node; new_iter = new_node; old_iter = old_iter->next; } return new; error: xsettings_list_free(new); return NULL; } int xsettings_setting_equal(XSettingsSetting *setting_a, XSettingsSetting *setting_b) { if (setting_a->type != setting_b->type) return 0; if (strcmp(setting_a->name, setting_b->name) != 0) return 0; switch (setting_a->type) { case XSETTINGS_TYPE_INT: return setting_a->data.v_int == setting_b->data.v_int; case XSETTINGS_TYPE_COLOR: return (setting_a->data.v_color.red == setting_b->data.v_color.red && setting_a->data.v_color.green == setting_b->data.v_color.green && setting_a->data.v_color.blue == setting_b->data.v_color.blue && setting_a->data.v_color.alpha == setting_b->data.v_color.alpha); case XSETTINGS_TYPE_STRING: return strcmp(setting_a->data.v_string, setting_b->data.v_string) == 0; default: break; } return 0; } void xsettings_setting_free(XSettingsSetting *setting) { if (setting->type == XSETTINGS_TYPE_STRING) free(setting->data.v_string); if (setting->name) free(setting->name); free(setting); } void xsettings_list_free(XSettingsList *list) { while (list) { XSettingsList *next = list->next; xsettings_setting_free(list->setting); free(list); list = next; } } XSettingsResult xsettings_list_insert(XSettingsList **list, XSettingsSetting *setting) { XSettingsList *node; XSettingsList *iter; XSettingsList *last = NULL; node = calloc(1, sizeof *node); if (!node) return XSETTINGS_NO_MEM; node->setting = setting; iter = *list; while (iter) { int cmp = strcmp(setting->name, iter->setting->name); if (cmp < 0) break; else if (cmp == 0) { free(node); return XSETTINGS_DUPLICATE_ENTRY; } last = iter; iter = iter->next; } if (last) last->next = node; else *list = node; node->next = iter; return XSETTINGS_SUCCESS; } XSettingsResult xsettings_list_delete(XSettingsList **list, const char *name) { XSettingsList *iter; XSettingsList *last = NULL; iter = *list; while (iter) { if (strcmp(name, iter->setting->name) == 0) { if (last) last->next = iter->next; else *list = iter->next; xsettings_setting_free(iter->setting); free(iter); return XSETTINGS_SUCCESS; } last = iter; iter = iter->next; } return XSETTINGS_FAILED; } XSettingsSetting *xsettings_list_lookup(XSettingsList *list, const char *name) { XSettingsList *iter; iter = list; while (iter) { if (strcmp(name, iter->setting->name) == 0) return iter->setting; iter = iter->next; } return NULL; } char xsettings_byte_order(void) { CARD32 myint = 0x01020304; return (*(char *)&myint == 1) ? MSBFirst : LSBFirst; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/launcher/xsettings-common.h000066400000000000000000000057221265276141000265370ustar00rootroot00000000000000/* * Copyright © 2001 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Red Hat not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Red Hat makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Owen Taylor, Red Hat, Inc. */ #ifndef XSETTINGS_COMMON_H #define XSETTINGS_COMMON_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _XSettingsBuffer XSettingsBuffer; typedef struct _XSettingsColor XSettingsColor; typedef struct _XSettingsList XSettingsList; typedef struct _XSettingsSetting XSettingsSetting; /* Types of settings possible. Enum values correspond to * protocol values. */ typedef enum { XSETTINGS_TYPE_INT = 0, XSETTINGS_TYPE_STRING = 1, XSETTINGS_TYPE_COLOR = 2, XSETTINGS_TYPE_NONE = 0xff } XSettingsType; typedef enum { XSETTINGS_SUCCESS, XSETTINGS_NO_MEM, XSETTINGS_ACCESS, XSETTINGS_FAILED, XSETTINGS_NO_ENTRY, XSETTINGS_DUPLICATE_ENTRY } XSettingsResult; struct _XSettingsBuffer { char byte_order; size_t len; unsigned char *data; unsigned char *pos; }; struct _XSettingsColor { unsigned short red, green, blue, alpha; }; struct _XSettingsList { XSettingsSetting *setting; XSettingsList *next; }; struct _XSettingsSetting { char *name; XSettingsType type; union { int v_int; char *v_string; XSettingsColor v_color; } data; unsigned long last_change_serial; }; XSettingsSetting *xsettings_setting_copy(XSettingsSetting *setting); void xsettings_setting_free(XSettingsSetting *setting); int xsettings_setting_equal(XSettingsSetting *setting_a, XSettingsSetting *setting_b); void xsettings_list_free(XSettingsList *list); XSettingsList *xsettings_list_copy(XSettingsList *list); XSettingsResult xsettings_list_insert(XSettingsList **list, XSettingsSetting *setting); XSettingsSetting *xsettings_list_lookup(XSettingsList *list, const char *name); XSettingsResult xsettings_list_delete(XSettingsList **list, const char *name); char xsettings_byte_order(void); #define XSETTINGS_PAD(n, m) ((n + m - 1) & (~(m - 1))) #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* XSETTINGS_COMMON_H */ tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/panel.c000066400000000000000000000717531265276141000225210ustar00rootroot00000000000000/************************************************************************** * * Copyright (C) 2008 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include #include #include "server.h" #include "config.h" #include "window.h" #include "task.h" #include "panel.h" #include "tooltip.h" void panel_clear_background(void *obj); int signal_pending; MouseAction mouse_left; MouseAction mouse_middle; MouseAction mouse_right; MouseAction mouse_scroll_up; MouseAction mouse_scroll_down; MouseAction mouse_tilt_left; MouseAction mouse_tilt_right; TaskbarMode taskbar_mode; gboolean wm_menu; gboolean panel_dock; Layer panel_layer; PanelPosition panel_position; gboolean panel_horizontal; gboolean panel_refresh; gboolean task_dragged; char *panel_window_name = NULL; gboolean panel_autohide; int panel_autohide_show_timeout; int panel_autohide_hide_timeout; int panel_autohide_height; Strut panel_strut_policy; char *panel_items_order; int max_tick_urgent; // panel's initial config Panel panel_config; // panels (one panel per monitor) Panel *panels; int num_panels; GArray *backgrounds; Imlib_Image default_icon; char *default_font = NULL; void default_panel() { panels = NULL; num_panels = 0; default_icon = NULL; task_dragged = FALSE; panel_horizontal = TRUE; panel_position = CENTER; panel_items_order = NULL; panel_autohide = FALSE; panel_autohide_show_timeout = 0; panel_autohide_hide_timeout = 0; panel_autohide_height = 5; // for vertical panels this is of course the width panel_strut_policy = STRUT_FOLLOW_SIZE; panel_dock = FALSE; // default not in the dock panel_layer = BOTTOM_LAYER; // default is bottom layer panel_window_name = strdup("tint2"); wm_menu = FALSE; max_tick_urgent = 14; mouse_left = TOGGLE_ICONIFY; backgrounds = g_array_new(0, 0, sizeof(Background)); memset(&panel_config, 0, sizeof(Panel)); panel_config.mouse_over_alpha = 100; panel_config.mouse_over_saturation = 0; panel_config.mouse_over_brightness = 10; panel_config.mouse_pressed_alpha = 100; panel_config.mouse_pressed_saturation = 0; panel_config.mouse_pressed_brightness = 0; panel_config.mouse_effects = 1; // First background is always fully transparent Background transparent_bg; init_background(&transparent_bg); g_array_append_val(backgrounds, transparent_bg); } void cleanup_panel() { if (!panels) return; cleanup_taskbar(); for (int i = 0; i < num_panels; i++) { Panel *p = &panels[i]; free_area(&p->area); if (p->temp_pmap) XFreePixmap(server.display, p->temp_pmap); p->temp_pmap = 0; if (p->hidden_pixmap) XFreePixmap(server.display, p->hidden_pixmap); p->hidden_pixmap = 0; if (p->main_win) XDestroyWindow(server.display, p->main_win); p->main_win = 0; stop_timeout(p->autohide_timeout); } free(panel_items_order); panel_items_order = NULL; free(panel_window_name); panel_window_name = NULL; free(panels); panels = NULL; if (backgrounds) g_array_free(backgrounds, 1); backgrounds = NULL; pango_font_description_free(panel_config.g_task.font_desc); panel_config.g_task.font_desc = NULL; pango_font_description_free(panel_config.taskbarname_font_desc); panel_config.taskbarname_font_desc = NULL; } void init_panel() { if (panel_config.monitor > (server.num_monitors - 1)) { // server.num_monitors minimum value is 1 (see get_monitors()) fprintf(stderr, "warning : monitor not found. tint2 default to all monitors.\n"); panel_config.monitor = 0; } fprintf(stderr, "panel items: %s\n", panel_items_order); init_tooltip(); init_systray(); init_launcher(); init_clock(); #ifdef ENABLE_BATTERY init_battery(); #endif init_taskbar(); init_execp(); // number of panels (one monitor or 'all' monitors) if (panel_config.monitor >= 0) num_panels = 1; else num_panels = server.num_monitors; panels = calloc(num_panels, sizeof(Panel)); for (int i = 0; i < num_panels; i++) { memcpy(&panels[i], &panel_config, sizeof(Panel)); } fprintf(stderr, "tint2 : nb monitor %d, nb monitor used %d, nb desktop %d\n", server.num_monitors, num_panels, server.num_desktops); for (int i = 0; i < num_panels; i++) { Panel *p = &panels[i]; if (panel_config.monitor < 0) p->monitor = i; if (!p->area.bg) p->area.bg = &g_array_index(backgrounds, Background, 0); p->area.parent = p; p->area.panel = p; p->area.on_screen = TRUE; p->area.resize_needed = 1; p->area.size_mode = LAYOUT_DYNAMIC; p->area._resize = resize_panel; p->area._clear = panel_clear_background; init_panel_size_and_position(p); // add children according to panel_items for (int k = 0; k < strlen(panel_items_order); k++) { if (panel_items_order[k] == 'L') init_launcher_panel(p); if (panel_items_order[k] == 'T') init_taskbar_panel(p); #ifdef ENABLE_BATTERY if (panel_items_order[k] == 'B') init_battery_panel(p); #endif if (panel_items_order[k] == 'S' && systray_on_monitor(i, num_panels)) { init_systray_panel(p); refresh_systray = 1; } 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); if (panel_items_order[k] == 'E') init_execp_panel(p); } set_panel_items_order(p); // catch some events XSetWindowAttributes att = {.colormap = server.colormap, .background_pixel = 0, .border_pixel = 0}; unsigned long mask = CWEventMask | CWColormap | CWBackPixel | CWBorderPixel; p->main_win = XCreateWindow(server.display, server.root_win, p->posx, p->posy, p->area.width, p->area.height, 0, server.depth, InputOutput, server.visual, mask, &att); long event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask; if (p->mouse_effects || p->g_task.tooltip_enabled || p->clock.area._get_tooltip_text || (launcher_enabled && launcher_tooltip_enabled)) event_mask |= PointerMotionMask | LeaveWindowMask; if (panel_autohide) event_mask |= LeaveWindowMask | EnterWindowMask; XChangeWindowAttributes(server.display, p->main_win, CWEventMask, &(XSetWindowAttributes){.event_mask = event_mask}); if (!server.gc) { XGCValues gcv; server.gc = XCreateGC(server.display, p->main_win, 0, &gcv); } // printf("panel %d : %d, %d, %d, %d\n", i, p->posx, p->posy, p->area.width, p->area.height); set_panel_properties(p); set_panel_background(p); if (!snapshot_path) { // if we are not in 'snapshot' mode then map new panel XMapWindow(server.display, p->main_win); } if (panel_autohide) autohide_trigger_hide(p); update_taskbar_visibility(p); } taskbar_refresh_tasklist(); reset_active_task(); } void init_panel_size_and_position(Panel *panel) { // detect panel size if (panel_horizontal) { if (panel->area.width == 0) { panel->fractional_width = TRUE; panel->area.width = 100; } if (panel->area.height == 0) { panel->fractional_height = FALSE; panel->area.height = 32; } if (panel->fractional_width) panel->area.width = (float)server.monitors[panel->monitor].width * panel->area.width / 100; if (panel->fractional_height) panel->area.height = (float)server.monitors[panel->monitor].height * panel->area.height / 100; if (panel->area.width + panel->marginx > server.monitors[panel->monitor].width) panel->area.width = server.monitors[panel->monitor].width - panel->marginx; if (panel->area.bg->border.radius > panel->area.height / 2) { printf("panel_background_id rounded is too big... please fix your tint2rc\n"); g_array_append_val(backgrounds, *panel->area.bg); panel->area.bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); panel->area.bg->border.radius = panel->area.height / 2; } } else { if (panel->area.height == 0) { panel->fractional_height = TRUE; panel->area.height = 100; } if (panel->area.width == 0) { panel->fractional_width = FALSE; panel->area.width = 140; } int old_panel_height = panel->area.height; if (panel->fractional_width) panel->area.height = (float)server.monitors[panel->monitor].height * panel->area.width / 100; else panel->area.height = panel->area.width; if (panel->fractional_height) panel->area.width = (float)server.monitors[panel->monitor].width * old_panel_height / 100; else panel->area.width = old_panel_height; if (panel->area.height + panel->marginy > server.monitors[panel->monitor].height) panel->area.height = server.monitors[panel->monitor].height - panel->marginy; if (panel->area.bg->border.radius > panel->area.width / 2) { printf("panel_background_id rounded is too big... please fix your tint2rc\n"); g_array_append_val(backgrounds, *panel->area.bg); panel->area.bg = &g_array_index(backgrounds, Background, backgrounds->len - 1); panel->area.bg->border.radius = panel->area.width / 2; } } // panel position determined here if (panel_position & LEFT) { panel->posx = server.monitors[panel->monitor].x + panel->marginx; } else { if (panel_position & RIGHT) { panel->posx = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width - panel->area.width - panel->marginx; } else { if (panel_horizontal) panel->posx = server.monitors[panel->monitor].x + ((server.monitors[panel->monitor].width - panel->area.width) / 2); else panel->posx = server.monitors[panel->monitor].x + panel->marginx; } } if (panel_position & TOP) { panel->posy = server.monitors[panel->monitor].y + panel->marginy; } else { if (panel_position & BOTTOM) { panel->posy = server.monitors[panel->monitor].y + server.monitors[panel->monitor].height - panel->area.height - panel->marginy; } else { panel->posy = server.monitors[panel->monitor].y + ((server.monitors[panel->monitor].height - panel->area.height) / 2); } } // autohide or strut_policy=minimum int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height; if (panel_horizontal) { panel->hidden_width = panel->area.width; panel->hidden_height = panel->area.height - diff; } else { panel->hidden_width = panel->area.width - diff; panel->hidden_height = panel->area.height; } // printf("panel : posx %d, posy %d, width %d, height %d\n", panel->posx, panel->posy, panel->area.width, // panel->area.height); } gboolean resize_panel(void *obj) { Panel *panel = (Panel *)obj; relayout_with_constraint(&panel->area, 0); // printf("resize_panel\n"); if (taskbar_mode != MULTI_DESKTOP && taskbar_enabled) { // propagate width/height on hidden taskbar int width = panel->taskbar[server.desktop].area.width; int height = panel->taskbar[server.desktop].area.height; for (int i = 0; i < panel->num_desktops; i++) { panel->taskbar[i].area.width = width; panel->taskbar[i].area.height = height; panel->taskbar[i].area.resize_needed = 1; } } if (taskbar_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) { // Distribute the available space between taskbars // Compute the total available size, and the total size requested by the taskbars int total_size = 0; int total_name_size = 0; int total_items = 0; for (int i = 0; i < panel->num_desktops; i++) { if (panel_horizontal) { total_size += panel->taskbar[i].area.width; } else { total_size += panel->taskbar[i].area.height; } Taskbar *taskbar = &panel->taskbar[i]; GList *l; for (l = taskbar->area.children; l; l = l->next) { Area *child = (Area *)l->data; if (!child->on_screen) continue; total_items++; } if (taskbarname_enabled) { if (taskbar->area.children) { total_items--; Area *name = (Area *)taskbar->area.children->data; if (panel_horizontal) { total_name_size += name->width; } else { total_name_size += name->height; } } } } // Distribute the space proportionally to the requested size (that is, to the // number of tasks in each taskbar) if (total_items) { int actual_name_size; if (total_name_size <= total_size) { actual_name_size = total_name_size / panel->num_desktops; } else { actual_name_size = total_size / panel->num_desktops; } total_size -= total_name_size; for (int i = 0; i < panel->num_desktops; i++) { Taskbar *taskbar = &panel->taskbar[i]; int requested_size = (2 * taskbar->area.bg->border.width) + (2 * taskbar->area.paddingxlr); int items = 0; GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l; l = l->next) { Area *child = (Area *)l->data; if (!child->on_screen) continue; items++; if (panel_horizontal) { requested_size += child->width + taskbar->area.paddingy; } else { requested_size += child->height + taskbar->area.paddingx; } } if (panel_horizontal) { requested_size -= taskbar->area.paddingy; } else { requested_size -= taskbar->area.paddingx; } if (panel_horizontal) { taskbar->area.width = actual_name_size + items / (float)total_items * total_size; } else { taskbar->area.height = actual_name_size + items / (float)total_items * total_size; } taskbar->area.resize_needed = 1; } } } if (panel->freespace.area.on_screen) resize_freespace(&panel->freespace); return FALSE; } void update_strut(Panel *p) { if (panel_strut_policy == STRUT_NONE) { XDeleteProperty(server.display, p->main_win, server.atom._NET_WM_STRUT); XDeleteProperty(server.display, p->main_win, server.atom._NET_WM_STRUT_PARTIAL); return; } // Reserved space unsigned int d1, screen_width, screen_height; Window d2; int d3; XGetGeometry(server.display, server.root_win, &d2, &d3, &d3, &screen_width, &screen_height, &d1, &d1); Monitor monitor = server.monitors[p->monitor]; long struts[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (panel_horizontal) { int height = p->area.height + p->marginy; if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) height = p->hidden_height; if (panel_position & TOP) { struts[2] = height + monitor.y; struts[8] = p->posx; // p->area.width - 1 allowed full screen on monitor 2 struts[9] = p->posx + p->area.width - 1; } else { struts[3] = height + screen_height - monitor.y - monitor.height; struts[10] = p->posx; // p->area.width - 1 allowed full screen on monitor 2 struts[11] = p->posx + p->area.width - 1; } } else { int width = p->area.width + p->marginx; if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) width = p->hidden_width; if (panel_position & LEFT) { struts[0] = width + monitor.x; struts[4] = p->posy; // p->area.width - 1 allowed full screen on monitor 2 struts[5] = p->posy + p->area.height - 1; } else { struts[1] = width + screen_width - monitor.x - monitor.width; struts[6] = p->posy; // p->area.width - 1 allowed full screen on monitor 2 struts[7] = p->posy + p->area.height - 1; } } // Old specification : fluxbox need _NET_WM_STRUT. XChangeProperty(server.display, p->main_win, server.atom._NET_WM_STRUT, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&struts, 4); XChangeProperty(server.display, p->main_win, server.atom._NET_WM_STRUT_PARTIAL, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&struts, 12); } void set_panel_items_order(Panel *p) { if (p->area.children) { g_list_free(p->area.children); p->area.children = 0; } int i_execp = 0; for (int k = 0; k < strlen(panel_items_order); k++) { if (panel_items_order[k] == 'L') { p->area.children = g_list_append(p->area.children, &p->launcher); p->launcher.area.resize_needed = 1; } if (panel_items_order[k] == 'T') { for (int j = 0; j < p->num_desktops; j++) p->area.children = g_list_append(p->area.children, &p->taskbar[j]); } #ifdef ENABLE_BATTERY if (panel_items_order[k] == 'B') p->area.children = g_list_append(p->area.children, &p->battery); #endif int i = p - panels; if (panel_items_order[k] == 'S' && systray_on_monitor(i, num_panels)) { p->area.children = g_list_append(p->area.children, &systray); } if (panel_items_order[k] == 'C') p->area.children = g_list_append(p->area.children, &p->clock); if (panel_items_order[k] == 'F') p->area.children = g_list_append(p->area.children, &p->freespace); if (panel_items_order[k] == 'E') { GList *item = g_list_nth(p->execp_list, i_execp); i_execp++; if (item) p->area.children = g_list_append(p->area.children, (Area*)item->data); } } initialize_positions(&p->area, 0); } void set_panel_properties(Panel *p) { XStoreName(server.display, p->main_win, panel_window_name); XSetIconName(server.display, p->main_win, panel_window_name); gsize len; gchar *name = g_locale_to_utf8(panel_window_name, -1, NULL, &len, NULL); if (name != NULL) { XChangeProperty(server.display, p->main_win, server.atom._NET_WM_NAME, server.atom.UTF8_STRING, 8, PropModeReplace, (unsigned char *)name, (int)len); XChangeProperty(server.display, p->main_win, server.atom._NET_WM_ICON_NAME, server.atom.UTF8_STRING, 8, PropModeReplace, (unsigned char *)name, (int)len); g_free(name); } // Dock long val = server.atom._NET_WM_WINDOW_TYPE_DOCK; XChangeProperty(server.display, p->main_win, server.atom._NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (unsigned char *)&val, 1); val = ALL_DESKTOPS; XChangeProperty(server.display, p->main_win, server.atom._NET_WM_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); Atom state[4]; state[0] = server.atom._NET_WM_STATE_SKIP_PAGER; state[1] = server.atom._NET_WM_STATE_SKIP_TASKBAR; state[2] = server.atom._NET_WM_STATE_STICKY; state[3] = panel_layer == BOTTOM_LAYER ? server.atom._NET_WM_STATE_BELOW : server.atom._NET_WM_STATE_ABOVE; int num_atoms = panel_layer == NORMAL_LAYER ? 3 : 4; XChangeProperty(server.display, p->main_win, server.atom._NET_WM_STATE, XA_ATOM, 32, PropModeReplace, (unsigned char *)state, num_atoms); XWMHints wmhints; memset(&wmhints, 0, sizeof(wmhints)); if (panel_dock) { // Necessary for placing the panel into the dock on Openbox and Fluxbox. // See https://gitlab.com/o9000/tint2/issues/465 wmhints.flags = IconWindowHint | WindowGroupHint | StateHint; wmhints.icon_window = wmhints.window_group = p->main_win; wmhints.initial_state = WithdrawnState; } // We do not need keyboard input focus. wmhints.flags |= InputHint; wmhints.input = False; XSetWMHints(server.display, p->main_win, &wmhints); // Undecorated long prop[5] = {2, 0, 0, 0, 0}; XChangeProperty(server.display, p->main_win, server.atom._MOTIF_WM_HINTS, server.atom._MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char *)prop, 5); // XdndAware - Register for Xdnd events Atom version = 4; XChangeProperty(server.display, p->main_win, server.atom.XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char *)&version, 1); update_strut(p); // Fixed position and non-resizable window // Allow panel move and resize when tint2 reload config file int minwidth = panel_autohide ? p->hidden_width : p->area.width; int minheight = panel_autohide ? p->hidden_height : p->area.height; XSizeHints size_hints; size_hints.flags = PPosition | PMinSize | PMaxSize; size_hints.min_width = minwidth; size_hints.max_width = p->area.width; size_hints.min_height = minheight; size_hints.max_height = p->area.height; XSetWMNormalHints(server.display, p->main_win, &size_hints); // Set WM_CLASS XClassHint *classhint = XAllocClassHint(); classhint->res_name = (char *)"tint2"; classhint->res_class = (char *)"Tint2"; XSetClassHint(server.display, p->main_win, classhint); XFree(classhint); } void panel_clear_background(void *obj) { Panel *p = obj; clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height); if (!server.real_transparency) { get_root_pixmap(); // copy background (server.root_pmap) in panel.area.pix Window dummy; int x, y; XTranslateCoordinates(server.display, p->main_win, server.root_win, 0, 0, &x, &y, &dummy); if (panel_autohide && p->is_hidden) { int xoff = 0, yoff = 0; if (panel_horizontal && panel_position & BOTTOM) yoff = p->area.height - p->hidden_height; else if (!panel_horizontal && panel_position & RIGHT) xoff = p->area.width - p->hidden_width; x -= xoff; y -= yoff; } XSetTSOrigin(server.display, server.gc, -x, -y); XFillRectangle(server.display, p->area.pix, server.gc, 0, 0, p->area.width, p->area.height); } } void set_panel_background(Panel *p) { panel_clear_background(p); schedule_redraw(&p->area); if (p->hidden_pixmap) { XFreePixmap(server.display, p->hidden_pixmap); p->hidden_pixmap = 0; } } Panel *get_panel(Window win) { for (int i = 0; i < num_panels; i++) { if (panels[i].main_win == win) { return &panels[i]; } } return 0; } Taskbar *click_taskbar(Panel *panel, int x, int y) { if (panel_horizontal) { for (int i = 0; i < panel->num_desktops; i++) { Taskbar *taskbar = &panel->taskbar[i]; if (taskbar->area.on_screen && x >= taskbar->area.posx && x <= (taskbar->area.posx + taskbar->area.width)) return taskbar; } } else { for (int i = 0; i < panel->num_desktops; i++) { Taskbar *taskbar = &panel->taskbar[i]; if (taskbar->area.on_screen && y >= taskbar->area.posy && y <= (taskbar->area.posy + taskbar->area.height)) return taskbar; } } return NULL; } Task *click_task(Panel *panel, int x, int y) { Taskbar *taskbar = click_taskbar(panel, x, y); if (taskbar) { if (panel_horizontal) { GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l; l = l->next) { Task *task = (Task *)l->data; if (task->area.on_screen && x >= task->area.posx && x <= (task->area.posx + task->area.width)) { return task; } } } else { GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l; l = l->next) { Task *task = (Task *)l->data; if (task->area.on_screen && y >= task->area.posy && y <= (task->area.posy + task->area.height)) { return task; } } } } return NULL; } Launcher *click_launcher(Panel *panel, int x, int y) { Launcher *launcher = &panel->launcher; if (panel_horizontal) { if (launcher->area.on_screen && x >= launcher->area.posx && x <= (launcher->area.posx + launcher->area.width)) return launcher; } else { if (launcher->area.on_screen && y >= launcher->area.posy && y <= (launcher->area.posy + launcher->area.height)) return launcher; } return NULL; } LauncherIcon *click_launcher_icon(Panel *panel, int x, int y) { Launcher *launcher = click_launcher(panel, x, y); if (launcher) { for (GSList *l = launcher->list_icons; l; l = l->next) { LauncherIcon *icon = (LauncherIcon *)l->data; if (x >= (launcher->area.posx + icon->x) && x <= (launcher->area.posx + icon->x + icon->icon_size) && y >= (launcher->area.posy + icon->y) && y <= (launcher->area.posy + icon->y + icon->icon_size)) { return icon; } } } return NULL; } gboolean click_padding(Panel *panel, int x, int y) { if (panel_horizontal) { if (x < panel->area.paddingxlr || x > panel->area.width - panel->area.paddingxlr) return TRUE; } else { if (y < panel->area.paddingxlr || y > panel->area.height - panel->area.paddingxlr) return TRUE; } return FALSE; } int click_clock(Panel *panel, int x, int y) { Clock *clock = &panel->clock; if (panel_horizontal) { if (clock->area.on_screen && x >= clock->area.posx && x <= (clock->area.posx + clock->area.width)) return TRUE; } else { if (clock->area.on_screen && y >= clock->area.posy && y <= (clock->area.posy + clock->area.height)) return TRUE; } return FALSE; } #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 Execp *click_execp(Panel *panel, int x, int y) { GList *l; for (l = panel->execp_list; l; l = l->next) { Execp *execp = (Execp *)l->data; if (panel_horizontal) { if (execp->area.on_screen && x >= execp->area.posx && x <= (execp->area.posx + execp->area.width)) return execp; } else { if (execp->area.on_screen && y >= execp->area.posy && y <= (execp->area.posy + execp->area.height)) return execp; } } return NULL; } Area *click_area(Panel *panel, int x, int y) { Area *result = &panel->area; Area *new_result = result; do { result = new_result; GList *it = result->children; while (it) { Area *a = (Area *)it->data; if (a->on_screen && x >= a->posx && x <= (a->posx + a->width) && y >= a->posy && y <= (a->posy + a->height)) { new_result = a; break; } it = it->next; } } while (new_result != result); return result; } void stop_autohide_timeout(Panel *p) { stop_timeout(p->autohide_timeout); } void autohide_show(void *p) { Panel *panel = (Panel *)p; stop_autohide_timeout(panel); panel->is_hidden = 0; XMapSubwindows(server.display, panel->main_win); // systray windows if (panel_horizontal) { if (panel_position & TOP) XResizeWindow(server.display, panel->main_win, panel->area.width, panel->area.height); else XMoveResizeWindow(server.display, panel->main_win, panel->posx, panel->posy, panel->area.width, panel->area.height); } else { if (panel_position & LEFT) XResizeWindow(server.display, panel->main_win, panel->area.width, panel->area.height); else XMoveResizeWindow(server.display, panel->main_win, panel->posx, panel->posy, panel->area.width, panel->area.height); } if (panel_strut_policy == STRUT_FOLLOW_SIZE) update_strut(panel); refresh_systray = TRUE; // ugly hack, because we actually only need to call XSetBackgroundPixmap panel_refresh = TRUE; } void autohide_hide(void *p) { Panel *panel = (Panel *)p; stop_autohide_timeout(panel); panel->is_hidden = TRUE; if (panel_strut_policy == STRUT_FOLLOW_SIZE) update_strut(panel); XUnmapSubwindows(server.display, panel->main_win); // systray windows int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height; // printf("autohide_hide : diff %d, w %d, h %d\n", diff, panel->hidden_width, panel->hidden_height); if (panel_horizontal) { if (panel_position & TOP) XResizeWindow(server.display, panel->main_win, panel->hidden_width, panel->hidden_height); else XMoveResizeWindow(server.display, panel->main_win, panel->posx, panel->posy + diff, panel->hidden_width, panel->hidden_height); } else { if (panel_position & LEFT) XResizeWindow(server.display, panel->main_win, panel->hidden_width, panel->hidden_height); else XMoveResizeWindow(server.display, panel->main_win, panel->posx + diff, panel->posy, panel->hidden_width, panel->hidden_height); } panel_refresh = TRUE; } void autohide_trigger_show(Panel *p) { if (!p) return; change_timeout(&p->autohide_timeout, panel_autohide_show_timeout, 0, autohide_show, p); } void autohide_trigger_hide(Panel *p) { if (!p) return; Window root, child; int xr, yr, xw, yw; unsigned int mask; if (XQueryPointer(server.display, p->main_win, &root, &child, &xr, &yr, &xw, &yw, &mask)) if (child) return; // mouse over one of the system tray icons change_timeout(&p->autohide_timeout, panel_autohide_hide_timeout, 0, autohide_hide, p); } void render_panel(Panel *panel) { relayout(&panel->area); draw_tree(&panel->area); } const char *get_default_font() { if (default_font) return default_font; return DEFAULT_FONT; } void default_icon_theme_changed() { launcher_default_icon_theme_changed(); } void default_font_changed() { #ifdef ENABLE_BATTERY battery_default_font_changed(); #endif clock_default_font_changed(); execp_default_font_changed(); taskbar_default_font_changed(); taskbarname_default_font_changed(); tooltip_default_font_changed(); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/panel.h000066400000000000000000000104421265276141000225120ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2008 Pål Staurland (staura@gmail.com) * Modified (C) 2008/2009 thierry lorthiois (lorthiois@bbsoft.fr) * * panel : * - draw panel and all objects according to panel_layout * * **************************************************************************/ #ifndef PANEL_H #define PANEL_H #include #include #include "common.h" #include "clock.h" #include "task.h" #include "taskbar.h" #include "systraybar.h" #include "launcher.h" #include "freespace.h" #include "execplugin.h" #ifdef ENABLE_BATTERY #include "battery.h" #endif extern int signal_pending; // -------------------------------------------------- // mouse events extern MouseAction mouse_left; extern MouseAction mouse_middle; extern MouseAction mouse_right; extern MouseAction mouse_scroll_up; extern MouseAction mouse_scroll_down; extern MouseAction mouse_tilt_left; extern MouseAction mouse_tilt_right; // panel mode typedef enum TaskbarMode { SINGLE_DESKTOP = 0, MULTI_DESKTOP, } TaskbarMode; typedef enum Layer { BOTTOM_LAYER, NORMAL_LAYER, TOP_LAYER, } Layer; // panel position typedef enum PanelPosition { LEFT = 0x01, RIGHT = 0x02, CENTER = 0X04, TOP = 0X08, BOTTOM = 0x10, } PanelPosition; typedef enum Strut { STRUT_MINIMUM, STRUT_FOLLOW_SIZE, STRUT_NONE, } Strut; extern TaskbarMode taskbar_mode; extern gboolean wm_menu; extern gboolean panel_dock; extern Layer panel_layer; extern char *panel_window_name; extern PanelPosition panel_position; extern gboolean panel_horizontal; extern gboolean panel_refresh; extern gboolean task_dragged; extern gboolean panel_autohide; extern int panel_autohide_show_timeout; extern int panel_autohide_hide_timeout; extern int panel_autohide_height; // for vertical panels this is of course the width extern Strut panel_strut_policy; extern char *panel_items_order; extern int max_tick_urgent; extern GArray *backgrounds; extern Imlib_Image default_icon; #define DEFAULT_FONT "sans 10" extern char *default_font; extern XSettingsClient *xsettings_client; typedef struct Panel { Area area; Window main_win; Pixmap temp_pmap; // position relative to root window int posx, posy; int marginx, marginy; int fractional_width, fractional_height; int monitor; int font_shadow; gboolean mouse_effects; // Mouse effects for icons int mouse_over_alpha; int mouse_over_saturation; int mouse_over_brightness; int mouse_pressed_alpha; int mouse_pressed_saturation; int mouse_pressed_brightness; // Per-panel parameters and states for Taskbar and Task GlobalTaskbar g_taskbar; GlobalTask g_task; // Array of Taskbar, with num_desktops items Taskbar *taskbar; int num_desktops; gboolean taskbarname_has_font; PangoFontDescription *taskbarname_font_desc; Clock clock; #ifdef ENABLE_BATTERY Battery battery; #endif Launcher launcher; FreeSpace freespace; GList *execp_list; // Autohide gboolean is_hidden; int hidden_width, hidden_height; Pixmap hidden_pixmap; timeout *autohide_timeout; } Panel; extern Panel panel_config; extern Panel *panels; extern int num_panels; // default global data void default_panel(); // freed memory void cleanup_panel(); // realloc panels according to number of monitor // use panel_config as default value void init_panel(); void init_panel_size_and_position(Panel *panel); gboolean resize_panel(void *obj); void render_panel(Panel *panel); void set_panel_items_order(Panel *p); void set_panel_properties(Panel *p); // draw background panel void set_panel_background(Panel *p); // detect witch panel Panel *get_panel(Window win); Taskbar *click_taskbar(Panel *panel, int x, int y); Task *click_task(Panel *panel, int x, int y); Launcher *click_launcher(Panel *panel, int x, int y); LauncherIcon *click_launcher_icon(Panel *panel, int x, int y); gboolean click_padding(Panel *panel, int x, int y); gboolean click_clock(Panel *panel, int x, int y); #ifdef ENABLE_BATTERY gboolean click_battery(Panel *panel, int x, int y); #endif Area *click_area(Panel *panel, int x, int y); Execp *click_execp(Panel *panel, int x, int y); void autohide_show(void *p); void autohide_hide(void *p); void autohide_trigger_show(Panel *p); void autohide_trigger_hide(Panel *p); const char *get_default_font(); void default_icon_theme_changed(); void default_font_changed(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/server.c000066400000000000000000000525451265276141000227260ustar00rootroot00000000000000/************************************************************************** * * Tint2 panel * * Copyright (C) 2007 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) * * 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 #include #include #include #include #include "server.h" #include "config.h" #include "window.h" Server server; gboolean primary_monitor_first = FALSE; void server_catch_error(Display *d, XErrorEvent *ev) { } void server_init_atoms() { server.atom._XROOTPMAP_ID = XInternAtom(server.display, "_XROOTPMAP_ID", False); server.atom._XROOTMAP_ID = XInternAtom(server.display, "_XROOTMAP_ID", False); server.atom._NET_CURRENT_DESKTOP = XInternAtom(server.display, "_NET_CURRENT_DESKTOP", False); server.atom._NET_NUMBER_OF_DESKTOPS = XInternAtom(server.display, "_NET_NUMBER_OF_DESKTOPS", False); server.atom._NET_DESKTOP_NAMES = XInternAtom(server.display, "_NET_DESKTOP_NAMES", False); server.atom._NET_DESKTOP_GEOMETRY = XInternAtom(server.display, "_NET_DESKTOP_GEOMETRY", False); server.atom._NET_DESKTOP_VIEWPORT = XInternAtom(server.display, "_NET_DESKTOP_VIEWPORT", False); server.atom._NET_WORKAREA = XInternAtom(server.display, "_NET_WORKAREA", False); server.atom._NET_ACTIVE_WINDOW = XInternAtom(server.display, "_NET_ACTIVE_WINDOW", False); server.atom._NET_WM_WINDOW_TYPE = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE", False); server.atom._NET_WM_STATE_SKIP_PAGER = XInternAtom(server.display, "_NET_WM_STATE_SKIP_PAGER", False); server.atom._NET_WM_STATE_SKIP_TASKBAR = XInternAtom(server.display, "_NET_WM_STATE_SKIP_TASKBAR", False); server.atom._NET_WM_STATE_STICKY = XInternAtom(server.display, "_NET_WM_STATE_STICKY", False); server.atom._NET_WM_STATE_DEMANDS_ATTENTION = XInternAtom(server.display, "_NET_WM_STATE_DEMANDS_ATTENTION", False); server.atom._NET_WM_WINDOW_TYPE_DOCK = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_DOCK", False); server.atom._NET_WM_WINDOW_TYPE_DESKTOP = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_DESKTOP", False); server.atom._NET_WM_WINDOW_TYPE_TOOLBAR = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_TOOLBAR", False); server.atom._NET_WM_WINDOW_TYPE_MENU = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_MENU", False); server.atom._NET_WM_WINDOW_TYPE_SPLASH = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_SPLASH", False); server.atom._NET_WM_WINDOW_TYPE_DIALOG = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_DIALOG", False); server.atom._NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(server.display, "_NET_WM_WINDOW_TYPE_NORMAL", False); server.atom._NET_WM_DESKTOP = XInternAtom(server.display, "_NET_WM_DESKTOP", False); server.atom.WM_STATE = XInternAtom(server.display, "WM_STATE", False); server.atom._NET_WM_STATE = XInternAtom(server.display, "_NET_WM_STATE", False); server.atom._NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(server.display, "_NET_WM_STATE_MAXIMIZED_VERT", False); server.atom._NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(server.display, "_NET_WM_STATE_MAXIMIZED_HORZ", False); server.atom._NET_WM_STATE_SHADED = XInternAtom(server.display, "_NET_WM_STATE_SHADED", False); server.atom._NET_WM_STATE_HIDDEN = XInternAtom(server.display, "_NET_WM_STATE_HIDDEN", False); server.atom._NET_WM_STATE_BELOW = XInternAtom(server.display, "_NET_WM_STATE_BELOW", False); server.atom._NET_WM_STATE_ABOVE = XInternAtom(server.display, "_NET_WM_STATE_ABOVE", False); server.atom._NET_WM_STATE_MODAL = XInternAtom(server.display, "_NET_WM_STATE_MODAL", False); server.atom._NET_CLIENT_LIST = XInternAtom(server.display, "_NET_CLIENT_LIST", False); server.atom._NET_WM_VISIBLE_NAME = XInternAtom(server.display, "_NET_WM_VISIBLE_NAME", False); server.atom._NET_WM_NAME = XInternAtom(server.display, "_NET_WM_NAME", False); server.atom._NET_WM_STRUT = XInternAtom(server.display, "_NET_WM_STRUT", False); server.atom._NET_WM_ICON = XInternAtom(server.display, "_NET_WM_ICON", False); server.atom._NET_WM_ICON_GEOMETRY = XInternAtom(server.display, "_NET_WM_ICON_GEOMETRY", False); server.atom._NET_WM_ICON_NAME = XInternAtom(server.display, "_NET_WM_ICON_NAME", False); server.atom._NET_CLOSE_WINDOW = XInternAtom(server.display, "_NET_CLOSE_WINDOW", False); server.atom.UTF8_STRING = XInternAtom(server.display, "UTF8_STRING", False); server.atom._NET_SUPPORTING_WM_CHECK = XInternAtom(server.display, "_NET_SUPPORTING_WM_CHECK", False); server.atom._NET_WM_CM_S0 = XInternAtom(server.display, "_NET_WM_CM_S0", False); server.atom._NET_SUPPORTING_WM_CHECK = XInternAtom(server.display, "_NET_WM_NAME", False); server.atom._NET_WM_STRUT_PARTIAL = XInternAtom(server.display, "_NET_WM_STRUT_PARTIAL", False); server.atom.WM_NAME = XInternAtom(server.display, "WM_NAME", False); server.atom.__SWM_VROOT = XInternAtom(server.display, "__SWM_VROOT", False); server.atom._MOTIF_WM_HINTS = XInternAtom(server.display, "_MOTIF_WM_HINTS", False); server.atom.WM_HINTS = XInternAtom(server.display, "WM_HINTS", False); gchar *name = g_strdup_printf("_XSETTINGS_S%d", DefaultScreen(server.display)); server.atom._XSETTINGS_SCREEN = XInternAtom(server.display, name, False); g_free(name); server.atom._XSETTINGS_SETTINGS = XInternAtom(server.display, "_XSETTINGS_SETTINGS", False); // systray protocol name = g_strdup_printf("_NET_SYSTEM_TRAY_S%d", DefaultScreen(server.display)); server.atom._NET_SYSTEM_TRAY_SCREEN = XInternAtom(server.display, name, False); g_free(name); server.atom._NET_SYSTEM_TRAY_OPCODE = XInternAtom(server.display, "_NET_SYSTEM_TRAY_OPCODE", False); server.atom.MANAGER = XInternAtom(server.display, "MANAGER", False); server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA = XInternAtom(server.display, "_NET_SYSTEM_TRAY_MESSAGE_DATA", False); server.atom._NET_SYSTEM_TRAY_ORIENTATION = XInternAtom(server.display, "_NET_SYSTEM_TRAY_ORIENTATION", False); server.atom._NET_SYSTEM_TRAY_ICON_SIZE = XInternAtom(server.display, "_NET_SYSTEM_TRAY_ICON_SIZE", False); server.atom._NET_SYSTEM_TRAY_PADDING = XInternAtom(server.display, "_NET_SYSTEM_TRAY_PADDING", False); server.atom._XEMBED = XInternAtom(server.display, "_XEMBED", False); server.atom._XEMBED_INFO = XInternAtom(server.display, "_XEMBED_INFO", False); server.atom._NET_WM_PID = XInternAtom(server.display, "_NET_WM_PID", True); // drag 'n' drop server.atom.XdndAware = XInternAtom(server.display, "XdndAware", False); server.atom.XdndEnter = XInternAtom(server.display, "XdndEnter", False); server.atom.XdndPosition = XInternAtom(server.display, "XdndPosition", False); server.atom.XdndStatus = XInternAtom(server.display, "XdndStatus", False); server.atom.XdndDrop = XInternAtom(server.display, "XdndDrop", False); server.atom.XdndLeave = XInternAtom(server.display, "XdndLeave", False); server.atom.XdndSelection = XInternAtom(server.display, "XdndSelection", False); server.atom.XdndTypeList = XInternAtom(server.display, "XdndTypeList", False); server.atom.XdndActionCopy = XInternAtom(server.display, "XdndActionCopy", False); server.atom.XdndFinished = XInternAtom(server.display, "XdndFinished", False); server.atom.TARGETS = XInternAtom(server.display, "TARGETS", False); } void cleanup_server() { if (server.colormap) XFreeColormap(server.display, server.colormap); server.colormap = 0; if (server.colormap32) XFreeColormap(server.display, server.colormap32); server.colormap32 = 0; if (server.monitors) { for (int i = 0; i < server.num_monitors; ++i) { g_strfreev(server.monitors[i].names); server.monitors[i].names = NULL; } free(server.monitors); server.monitors = NULL; } if (server.gc) XFreeGC(server.display, server.gc); server.gc = NULL; server.disable_transparency = FALSE; } void send_event32(Window win, Atom at, long data1, long data2, long data3) { XEvent event; event.xclient.type = ClientMessage; event.xclient.serial = 0; event.xclient.send_event = True; event.xclient.display = server.display; event.xclient.window = win; event.xclient.message_type = at; event.xclient.format = 32; event.xclient.data.l[0] = data1; event.xclient.data.l[1] = data2; event.xclient.data.l[2] = data3; event.xclient.data.l[3] = 0; event.xclient.data.l[4] = 0; XSendEvent(server.display, server.root_win, False, SubstructureRedirectMask | SubstructureNotifyMask, &event); } int get_property32(Window win, Atom at, Atom type) { Atom type_ret; int format_ret = 0, data = 0; unsigned long nitems_ret = 0; unsigned long bafter_ret = 0; unsigned char *prop_value = 0; int result; if (!win) return 0; result = XGetWindowProperty(server.display, win, at, 0, 0x7fffffff, False, type, &type_ret, &format_ret, &nitems_ret, &bafter_ret, &prop_value); if (result == Success && prop_value) { data = ((gulong *)prop_value)[0]; XFree(prop_value); } return data; } void *server_get_property(Window win, Atom at, Atom type, int *num_results) { Atom type_ret; int format_ret = 0; unsigned long nitems_ret = 0; unsigned long bafter_ret = 0; unsigned char *prop_value; if (!win) return NULL; int result = XGetWindowProperty(server.display, win, at, 0, 0x7fffffff, False, type, &type_ret, &format_ret, &nitems_ret, &bafter_ret, &prop_value); // Send fill_color resultcount if (num_results) *num_results = (int)nitems_ret; if (result == Success && prop_value) return prop_value; else return NULL; } void get_root_pixmap() { Pixmap ret = None; Atom pixmap_atoms[] = {server.atom._XROOTPMAP_ID, server.atom._XROOTMAP_ID}; for (int i = 0; i < sizeof(pixmap_atoms) / sizeof(Atom); ++i) { unsigned long *res = (unsigned long *)server_get_property(server.root_win, pixmap_atoms[i], XA_PIXMAP, NULL); if (res) { ret = *((Pixmap *)res); XFree(res); break; } } server.root_pmap = ret; if (server.root_pmap == None) { fprintf(stderr, "tint2 : pixmap background detection failed\n"); } else { XGCValues gcv; gcv.ts_x_origin = 0; gcv.ts_y_origin = 0; gcv.fill_style = FillTiled; uint mask = GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle | GCTile; gcv.tile = server.root_pmap; XChangeGC(server.display, server.gc, mask, &gcv); } } int compare_monitor_pos(const void *monitor1, const void *monitor2) { const Monitor *m1 = (const Monitor *)monitor1; const Monitor *m2 = (const Monitor *)monitor2; if (primary_monitor_first) { if (m1->primary && !m2->primary) return -1; if (!m1->primary && m2->primary) return 1; } if (m1->x < m2->x) { return -1; } else if (m1->x > m2->x) { return 1; } else if (m1->y < m2->y) { return -1; } else if (m1->y > m2->y) { return 1; } else { return 0; } } int monitor_includes_monitor(const void *monitor1, const void *monitor2) { const Monitor *m1 = (const Monitor *)monitor1; const Monitor *m2 = (const Monitor *)monitor2; if (m1->x >= m2->x && m1->y >= m2->y && (m1->x + m1->width) <= (m2->x + m2->width) && (m1->y + m1->height) <= (m2->y + m2->height)) { // m1 included inside m2 return 1; } else { return -1; } } void get_monitors() { if (XineramaIsActive(server.display)) { int num_monitors; XineramaScreenInfo *info = XineramaQueryScreens(server.display, &num_monitors); XRRScreenResources *res = XRRGetScreenResourcesCurrent(server.display, server.root_win); RROutput primary_output = XRRGetOutputPrimary(server.display, server.root_win); if (res && res->ncrtc >= num_monitors) { // use xrandr to identify monitors (does not work with proprietery nvidia drivers) // 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; XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(server.display, res, res->crtcs[i]); if (!(crtc_info->x || crtc_info->y || crtc_info->width || crtc_info->height)) { res->ncrtc -= 1; } XRRFreeCrtcInfo(crtc_info); } printf("xRandr: Found crtc's: %d\n", res->ncrtc); server.monitors = calloc(res->ncrtc, sizeof(Monitor)); for (int i = 0; i < res->ncrtc; ++i) { XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(server.display, res, res->crtcs[i]); server.monitors[i].x = crtc_info->x; server.monitors[i].y = crtc_info->y; server.monitors[i].width = crtc_info->width; server.monitors[i].height = crtc_info->height; server.monitors[i].names = calloc((crtc_info->noutput + 1), sizeof(gchar *)); for (int j = 0; j < crtc_info->noutput; ++j) { XRROutputInfo *output_info = XRRGetOutputInfo(server.display, res, crtc_info->outputs[j]); printf("xRandr: Linking output %s with crtc %d\n", output_info->name, i); server.monitors[i].names[j] = g_strdup(output_info->name); XRRFreeOutputInfo(output_info); server.monitors[i].primary = crtc_info->outputs[j] == primary_output; } server.monitors[i].names[crtc_info->noutput] = NULL; XRRFreeCrtcInfo(crtc_info); } num_monitors = res->ncrtc; } else if (info && num_monitors > 0) { server.monitors = calloc(num_monitors, sizeof(Monitor)); for (int i = 0; i < num_monitors; i++) { server.monitors[i].x = info[i].x_org; server.monitors[i].y = info[i].y_org; server.monitors[i].width = info[i].width; server.monitors[i].height = info[i].height; server.monitors[i].names = 0; } } // Sort monitors by inclusion qsort(server.monitors, num_monitors, sizeof(Monitor), monitor_includes_monitor); // Remove monitors included in other ones int i = 0; while (i < num_monitors) { for (int j = 0; j < i; j++) { if (monitor_includes_monitor(&server.monitors[i], &server.monitors[j]) > 0) { goto next; } } i++; } next: for (int j = i; j < num_monitors; ++j) if (server.monitors[j].names) g_strfreev(server.monitors[j].names); server.num_monitors = i; server.monitors = realloc(server.monitors, server.num_monitors * sizeof(Monitor)); qsort(server.monitors, server.num_monitors, sizeof(Monitor), compare_monitor_pos); if (res) XRRFreeScreenResources(res); XFree(info); } if (!server.num_monitors) { server.num_monitors = 1; server.monitors = calloc(1, sizeof(Monitor)); server.monitors[0].x = server.monitors[0].y = 0; server.monitors[0].width = DisplayWidth(server.display, server.screen); server.monitors[0].height = DisplayHeight(server.display, server.screen); server.monitors[0].names = 0; } } void print_monitors() { fprintf(stderr, "Number of monitors: %d\n", server.num_monitors); for (int i = 0; i < server.num_monitors; i++) { fprintf(stderr, "Monitor %d: x = %d, y = %d, w = %d, h = %d\n", i + 1, server.monitors[i].x, server.monitors[i].y, server.monitors[i].width, server.monitors[i].height); } } void server_get_number_of_desktops() { if (server.viewports) { free(server.viewports); server.viewports = NULL; } server.num_desktops = get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL); if (server.num_desktops > 1) return; int num_results; long *work_area_size = server_get_property(server.root_win, server.atom._NET_WORKAREA, XA_CARDINAL, &num_results); if (!work_area_size) return; int work_area_width = work_area_size[0] + work_area_size[2]; int work_area_height = work_area_size[1] + work_area_size[3]; XFree(work_area_size); long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results); if (!x_screen_size) return; int x_screen_width = x_screen_size[0]; int x_screen_height = x_screen_size[1]; XFree(x_screen_size); int num_viewports = MAX(x_screen_width / work_area_width, 1) * MAX(x_screen_height / work_area_height, 1); if (num_viewports <= 1) { server.num_desktops = 1; return; } server.viewports = calloc(num_viewports, sizeof(Viewport)); int k = 0; for (int i = 0; i < MAX(x_screen_height / work_area_height, 1); i++) { for (int j = 0; j < MAX(x_screen_width / work_area_width, 1); j++) { server.viewports[k].x = j * work_area_width; server.viewports[k].y = i * work_area_height; server.viewports[k].width = work_area_width; server.viewports[k].height = work_area_height; k++; } } server.num_desktops = num_viewports; } GSList *get_desktop_names() { if (server.viewports) { GSList *list = NULL; for (int j = 0; j < server.num_desktops; j++) { list = g_slist_append(list, g_strdup_printf("%d", j + 1)); } return list; } int count; GSList *list = NULL; gchar *data_ptr = server_get_property(server.root_win, server.atom._NET_DESKTOP_NAMES, server.atom.UTF8_STRING, &count); if (data_ptr) { list = g_slist_append(list, g_strdup(data_ptr)); for (int j = 0; j < count - 1; j++) { if (*(data_ptr + j) == '\0') { gchar *ptr = (gchar *)data_ptr + j + 1; list = g_slist_append(list, g_strdup(ptr)); } } XFree(data_ptr); } return list; } int get_current_desktop() { if (!server.viewports) { return MAX(0, MIN(server.num_desktops - 1, get_property32(server.root_win, server.atom._NET_CURRENT_DESKTOP, XA_CARDINAL))); } int num_results; long *work_area_size = server_get_property(server.root_win, server.atom._NET_WORKAREA, XA_CARDINAL, &num_results); if (!work_area_size) return 0; int work_area_width = work_area_size[0] + work_area_size[2]; int work_area_height = work_area_size[1] + work_area_size[3]; XFree(work_area_size); if (work_area_width <= 0 || work_area_height <= 0) return 0; long *viewport = server_get_property(server.root_win, server.atom._NET_DESKTOP_VIEWPORT, XA_CARDINAL, &num_results); if (!viewport) return 0; int viewport_x = viewport[0]; int viewport_y = viewport[1]; XFree(viewport); long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results); if (!x_screen_size) return 0; int x_screen_width = x_screen_size[0]; XFree(x_screen_size); int ncols = x_screen_width / work_area_width; // fprintf(stderr, "\n"); // fprintf(stderr, "Work area size: %d x %d\n", work_area_width, work_area_height); // fprintf(stderr, "Viewport pos: %d x %d\n", viewport_x, viewport_y); // fprintf(stderr, "Viewport i: %d\n", (viewport_y / work_area_height) * ncols + viewport_x / work_area_width); int result = (viewport_y / work_area_height) * ncols + viewport_x / work_area_width; return MAX(0, MIN(server.num_desktops - 1, result)); } void change_desktop(int desktop) { if (!server.viewports) { send_event32(server.root_win, server.atom._NET_CURRENT_DESKTOP, desktop, 0, 0); } else { send_event32(server.root_win, server.atom._NET_DESKTOP_VIEWPORT, server.viewports[desktop].x, server.viewports[desktop].y, 0); } } void get_desktops() { // detect number of desktops // wait 15s to leave some time for window manager startup for (int i = 0; i < 15; i++) { server_get_number_of_desktops(); if (server.num_desktops > 0) break; sleep(1); } if (server.num_desktops == 0) { server.num_desktops = 1; fprintf(stderr, "warning : WM doesn't respect NETWM specs. tint2 default to 1 desktop.\n"); } } void server_init_visual() { // inspired by freedesktops fdclock ;) XVisualInfo templ = {.screen = server.screen, .depth = 32, .class = TrueColor}; int nvi; XVisualInfo *xvi = XGetVisualInfo(server.display, VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi); Visual *visual = NULL; if (xvi) { XRenderPictFormat *format; for (int i = 0; i < nvi; i++) { format = XRenderFindVisualFormat(server.display, xvi[i].visual); if (format->type == PictTypeDirect && format->direct.alphaMask) { visual = xvi[i].visual; break; } } } XFree(xvi); // check composite manager server.composite_manager = XGetSelectionOwner(server.display, server.atom._NET_WM_CM_S0); if (server.colormap) XFreeColormap(server.display, server.colormap); if (server.colormap32) XFreeColormap(server.display, server.colormap32); if (visual) { server.visual32 = visual; server.colormap32 = XCreateColormap(server.display, server.root_win, visual, AllocNone); } if (!server.disable_transparency && visual && server.composite_manager != None && !snapshot_path) { XSetWindowAttributes attrs; attrs.event_mask = StructureNotifyMask; XChangeWindowAttributes(server.display, server.composite_manager, CWEventMask, &attrs); server.real_transparency = TRUE; server.depth = 32; printf("real transparency on... depth: %d\n", server.depth); server.colormap = XCreateColormap(server.display, server.root_win, visual, AllocNone); server.visual = visual; } else { // no composite manager or snapshot mode => fake transparency server.real_transparency = FALSE; server.depth = DefaultDepth(server.display, server.screen); printf("real transparency off.... depth: %d\n", server.depth); server.colormap = DefaultColormap(server.display, server.screen); server.visual = DefaultVisual(server.display, server.screen); } } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/server.h000066400000000000000000000074551265276141000227330ustar00rootroot00000000000000/************************************************************************** * server : * - * * Check COPYING file for Copyright * **************************************************************************/ #ifndef SERVER_H #define SERVER_H #include #include #include #ifdef HAVE_SN #include #endif #include extern gboolean primary_monitor_first; typedef struct Global_atom { Atom _XROOTPMAP_ID; Atom _XROOTMAP_ID; Atom _NET_CURRENT_DESKTOP; Atom _NET_NUMBER_OF_DESKTOPS; Atom _NET_DESKTOP_NAMES; Atom _NET_DESKTOP_GEOMETRY; Atom _NET_DESKTOP_VIEWPORT; Atom _NET_WORKAREA; Atom _NET_ACTIVE_WINDOW; Atom _NET_WM_WINDOW_TYPE; Atom _NET_WM_STATE_SKIP_PAGER; Atom _NET_WM_STATE_SKIP_TASKBAR; Atom _NET_WM_STATE_STICKY; Atom _NET_WM_STATE_DEMANDS_ATTENTION; Atom _NET_WM_WINDOW_TYPE_DOCK; Atom _NET_WM_WINDOW_TYPE_DESKTOP; Atom _NET_WM_WINDOW_TYPE_TOOLBAR; Atom _NET_WM_WINDOW_TYPE_MENU; Atom _NET_WM_WINDOW_TYPE_SPLASH; Atom _NET_WM_WINDOW_TYPE_DIALOG; Atom _NET_WM_WINDOW_TYPE_NORMAL; Atom _NET_WM_DESKTOP; Atom WM_STATE; Atom _NET_WM_STATE; Atom _NET_WM_STATE_MAXIMIZED_VERT; Atom _NET_WM_STATE_MAXIMIZED_HORZ; Atom _NET_WM_STATE_SHADED; Atom _NET_WM_STATE_HIDDEN; Atom _NET_WM_STATE_BELOW; Atom _NET_WM_STATE_ABOVE; Atom _NET_WM_STATE_MODAL; Atom _NET_CLIENT_LIST; Atom _NET_WM_NAME; Atom _NET_WM_VISIBLE_NAME; Atom _NET_WM_STRUT; Atom _NET_WM_ICON; Atom _NET_WM_ICON_GEOMETRY; Atom _NET_WM_ICON_NAME; Atom _NET_CLOSE_WINDOW; Atom UTF8_STRING; Atom _NET_SUPPORTING_WM_CHECK; Atom _NET_WM_CM_S0; Atom _NET_WM_STRUT_PARTIAL; Atom WM_NAME; Atom __SWM_VROOT; Atom _MOTIF_WM_HINTS; Atom WM_HINTS; Atom _NET_SYSTEM_TRAY_SCREEN; Atom _NET_SYSTEM_TRAY_OPCODE; 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; Atom _XSETTINGS_SCREEN; Atom _XSETTINGS_SETTINGS; Atom XdndAware; Atom XdndEnter; Atom XdndPosition; Atom XdndStatus; Atom XdndDrop; Atom XdndLeave; Atom XdndSelection; Atom XdndTypeList; Atom XdndActionCopy; Atom XdndFinished; Atom TARGETS; } Global_atom; typedef struct Monitor { int x; int y; int width; int height; gboolean primary; gchar **names; } Monitor; typedef struct Viewport { int x; int y; int width; int height; } Viewport; typedef struct Server { Display *display; Window root_win; Window composite_manager; gboolean real_transparency; gboolean disable_transparency; // current desktop int desktop; int screen; int depth; int num_desktops; // number of monitor (without monitor included into another one) int num_monitors; // Non-null only if WM uses viewports (compiz) and number of viewports > 1. // In that case there are num_desktops viewports. Viewport *viewports; Monitor *monitors; gboolean got_root_win; Visual *visual; Visual *visual32; // root background Pixmap root_pmap; GC gc; Colormap colormap; Colormap colormap32; Global_atom atom; #ifdef HAVE_SN SnDisplay *sn_display; GTree *pids; #endif // HAVE_SN } Server; extern Server server; // freed memory void cleanup_server(); void send_event32(Window win, Atom at, long data1, long data2, long data3); int get_property32(Window win, Atom at, Atom type); void *server_get_property(Window win, Atom at, Atom type, int *num_results); Atom server_get_atom(char *atom_name); void server_catch_error(Display *d, XErrorEvent *ev); void server_init_atoms(); void server_init_visual(); // detect root background void get_root_pixmap(); // detect monitors and desktops void get_monitors(); void print_monitors(); void get_desktops(); void server_get_number_of_desktops(); GSList *get_desktop_names(); int get_current_desktop(); void change_desktop(int desktop); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/systray/000077500000000000000000000000001265276141000227575ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/systray/systraybar.c000066400000000000000000001424421265276141000253350ustar00rootroot00000000000000/************************************************************************** * Tint2 : systraybar * * Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * based on 'docker-1.5' from Ben Jansens. * * 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 #include #include #include #include #include #include #include #include #include #include #include #include "systraybar.h" #include "server.h" #include "panel.h" GSList *icons; /* defined in the systray spec */ #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 // selection window Window net_sel_win = None; // freedesktop specification doesn't allow multi systray Systraybar systray; int refresh_systray; int systray_enabled; int systray_max_icon_size; int systray_monitor; int chrono; int systray_composited; int systray_profile; // background pixmap if we render ourselves the icons static Pixmap render_background; const int min_refresh_period = 50; const int max_fast_refreshes = 5; const int resize_period_threshold = 1000; const int fast_resize_period = 50; const int slow_resize_period = 5000; const int min_bad_resize_events = 3; const int max_bad_resize_events = 10; void default_systray() { systray_enabled = 0; memset(&systray, 0, sizeof(Systraybar)); render_background = 0; chrono = 0; systray.alpha = 100; systray.sort = SYSTRAY_SORT_LEFT2RIGHT; systray.area._draw_foreground = draw_systray; systray.area._on_change_layout = on_change_systray; systray.area.size_mode = LAYOUT_FIXED; systray.area._resize = resize_systray; systray_profile = getenv("SYSTRAY_PROFILING") != NULL; } void cleanup_systray() { stop_net(); systray_enabled = 0; systray_max_icon_size = 0; systray_monitor = 0; systray.area.on_screen = FALSE; free_area(&systray.area); if (render_background) { XFreePixmap(server.display, render_background); render_background = 0; } } void init_systray() { if (!systray_enabled) return; systray_composited = !server.disable_transparency && server.visual32 && server.colormap32; fprintf(stderr, "Systray composited rendering %s\n", systray_composited ? "on" : "off"); if (!systray_composited) { fprintf(stderr, "systray_asb forced to 100 0 0\n"); systray.alpha = 100; systray.brightness = systray.saturation = 0; } } void init_systray_panel(void *p) { Panel *panel = (Panel *)p; systray.area.parent = panel; systray.area.panel = panel; if (!systray.area.bg) systray.area.bg = &g_array_index(backgrounds, Background, 0); show(&systray.area); systray.area.resize_needed = 1; panel->area.resize_needed = 1; schedule_redraw(&systray.area); panel_refresh = TRUE; refresh_systray = 1; } gboolean resize_systray(void *obj) { if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); Systraybar *sysbar = obj; if (panel_horizontal) sysbar->icon_size = sysbar->area.height; else sysbar->icon_size = sysbar->area.width; sysbar->icon_size = sysbar->icon_size - (2 * sysbar->area.bg->border.width) - (2 * sysbar->area.paddingy); if (systray_max_icon_size > 0 && sysbar->icon_size > systray_max_icon_size) sysbar->icon_size = systray_max_icon_size; if (systray.icon_size > 0) { long icon_size = systray.icon_size; XChangeProperty(server.display, net_sel_win, server.atom._NET_SYSTEM_TRAY_ICON_SIZE, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&icon_size, 1); } int count = 0; for (GSList *l = systray.list_icons; l; l = l->next) { if (((TrayWindow *)l->data)->hide) continue; count++; } if (systray_profile) fprintf(stderr, BLUE "%s:%d number of icons = %d" RESET "\n", __FUNCTION__, __LINE__, count); if (panel_horizontal) { int height = sysbar->area.height - 2 * sysbar->area.bg->border.width - 2 * sysbar->area.paddingy; // here icons_per_column always higher than 0 sysbar->icons_per_column = (height + sysbar->area.paddingx) / (sysbar->icon_size + sysbar->area.paddingx); sysbar->margin = height - (sysbar->icons_per_column - 1) * (sysbar->icon_size + sysbar->area.paddingx) - sysbar->icon_size; sysbar->icons_per_row = count / sysbar->icons_per_column + (count % sysbar->icons_per_column != 0); systray.area.width = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) + (sysbar->icon_size * sysbar->icons_per_row) + ((sysbar->icons_per_row - 1) * systray.area.paddingx); } else { int width = sysbar->area.width - 2 * sysbar->area.bg->border.width - 2 * sysbar->area.paddingy; // here icons_per_row always higher than 0 sysbar->icons_per_row = (width + sysbar->area.paddingx) / (sysbar->icon_size + sysbar->area.paddingx); sysbar->margin = width - (sysbar->icons_per_row - 1) * (sysbar->icon_size + sysbar->area.paddingx) - sysbar->icon_size; sysbar->icons_per_column = count / sysbar->icons_per_row + (count % sysbar->icons_per_row != 0); systray.area.height = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) + (sysbar->icon_size * sysbar->icons_per_column) + ((sysbar->icons_per_column - 1) * systray.area.paddingx); } if (net_sel_win == None) { start_net(); } return TRUE; } void draw_systray(void *obj, cairo_t *c) { if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); if (systray_composited) { if (render_background) XFreePixmap(server.display, render_background); render_background = XCreatePixmap(server.display, server.root_win, systray.area.width, systray.area.height, server.depth); XCopyArea(server.display, systray.area.pix, render_background, server.gc, 0, 0, systray.area.width, systray.area.height, 0, 0); } refresh_systray = TRUE; } void on_change_systray(void *obj) { if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); // here, systray.area.posx/posy are defined by rendering engine. so we can calculate position of tray icon. Systraybar *sysbar = obj; if (sysbar->icons_per_column == 0 || sysbar->icons_per_row == 0) return; Panel *panel = sysbar->area.panel; int posx, posy; int start = panel->area.bg->border.width + panel->area.paddingy + systray.area.bg->border.width + systray.area.paddingy + sysbar->margin / 2; if (panel_horizontal) { posy = start; posx = systray.area.posx + systray.area.bg->border.width + systray.area.paddingxlr; } else { posx = start; posy = systray.area.posy + systray.area.bg->border.width + systray.area.paddingxlr; } TrayWindow *traywin; GSList *l; int i; for (i = 1, l = systray.list_icons; l; i++, l = l->next) { traywin = (TrayWindow *)l->data; if (traywin->hide) continue; traywin->y = posy; traywin->x = posx; if (systray_profile) fprintf(stderr, "%s:%d win = %lu (%s), parent = %lu, x = %d, y = %d\n", __FUNCTION__, __LINE__, traywin->win, traywin->name, traywin->parent, posx, posy); traywin->width = sysbar->icon_size; traywin->height = sysbar->icon_size; if (panel_horizontal) { if (i % sysbar->icons_per_column) { posy += sysbar->icon_size + sysbar->area.paddingx; } else { posy = start; posx += (sysbar->icon_size + systray.area.paddingx); } } else { if (i % sysbar->icons_per_row) { posx += sysbar->icon_size + systray.area.paddingx; } else { posx = start; posy += (sysbar->icon_size + systray.area.paddingx); } } // position and size the icon window unsigned int border_width; int xpos, ypos; unsigned int width, height, depth; Window root; if (!XGetGeometry(server.display, traywin->parent, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) { fprintf(stderr, RED "Couldn't get geometry of window!" RESET "\n"); } if (width != traywin->width || height != traywin->height || xpos != traywin->x || ypos != traywin->y) { if (systray_profile) fprintf(stderr, "XMoveResizeWindow(server.display, traywin->parent = %ld, traywin->x = %d, traywin->y = %d, " "traywin->width = %d, traywin->height = %d)\n", traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height); XMoveResizeWindow(server.display, traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height); } if (!traywin->reparented) reparent_icon(traywin); } refresh_systray = TRUE; } // *********************************************** // systray protocol void start_net() { if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); if (net_sel_win) { // protocol already started if (!systray_enabled) stop_net(); return; } else { if (!systray_enabled) return; } Window win = XGetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN); // freedesktop systray specification if (win != None) { // search pid Atom _NET_WM_PID, actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = 0; int pid; _NET_WM_PID = XInternAtom(server.display, "_NET_WM_PID", True); int ret = XGetWindowProperty(server.display, win, _NET_WM_PID, 0, 1024, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop); fprintf(stderr, RED "tint2 : another systray is running" RESET); if (ret == Success && prop) { pid = prop[1] * 256; pid += prop[0]; fprintf(stderr, " pid=%d", pid); } fprintf(stderr, RESET "\n"); return; } // init systray protocol net_sel_win = XCreateSimpleWindow(server.display, server.root_win, -1, -1, 1, 1, 0, 0, 0); fprintf(stderr, "systray window %ld\n", net_sel_win); // v0.3 trayer specification. tint2 always horizontal. // Vertical panel will draw the systray horizontal. long orientation = 0; XChangeProperty(server.display, net_sel_win, server.atom._NET_SYSTEM_TRAY_ORIENTATION, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&orientation, 1); if (systray.icon_size > 0) { long icon_size = systray.icon_size; XChangeProperty(server.display, net_sel_win, server.atom._NET_SYSTEM_TRAY_ICON_SIZE, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&icon_size, 1); } long padding = 0; XChangeProperty(server.display, net_sel_win, server.atom._NET_SYSTEM_TRAY_PADDING, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&padding, 1); VisualID vid; if (systray_composited) vid = XVisualIDFromVisual(server.visual32); else vid = XVisualIDFromVisual(server.visual); XChangeProperty(server.display, net_sel_win, XInternAtom(server.display, "_NET_SYSTEM_TRAY_VISUAL", False), XA_VISUALID, 32, PropModeReplace, (unsigned char *)&vid, 1); XSetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime); if (XGetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) { stop_net(); fprintf(stderr, RED "tint2 : can't get systray manager" RESET "\n"); return; } fprintf(stderr, GREEN "tint2 : systray started" RESET "\n"); if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); XClientMessageEvent ev; ev.type = ClientMessage; ev.window = server.root_win; ev.message_type = server.atom.MANAGER; ev.format = 32; ev.data.l[0] = CurrentTime; ev.data.l[1] = server.atom._NET_SYSTEM_TRAY_SCREEN; ev.data.l[2] = net_sel_win; ev.data.l[3] = 0; ev.data.l[4] = 0; XSendEvent(server.display, server.root_win, False, StructureNotifyMask, (XEvent *)&ev); } void net_message(XClientMessageEvent *e) { if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); Window win; unsigned long opcode = e->data.l[1]; switch (opcode) { case SYSTEM_TRAY_REQUEST_DOCK: win = e->data.l[2]; if (win) add_icon(win); break; case SYSTEM_TRAY_BEGIN_MESSAGE: case SYSTEM_TRAY_CANCEL_MESSAGE: // we don't show baloons messages. break; default: if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA) fprintf(stderr, "message from dockapp: %s\n", e->data.b); else fprintf(stderr, RED "SYSTEM_TRAY : unknown message type" RESET "\n"); break; } } void stop_net() { if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); if (systray.list_icons) { // remove_icon change systray.list_icons while (systray.list_icons) remove_icon((TrayWindow *)systray.list_icons->data); g_slist_free(systray.list_icons); systray.list_icons = NULL; } if (net_sel_win != None) { XDestroyWindow(server.display, net_sel_win); net_sel_win = None; } } gboolean error; int window_error_handler(Display *d, XErrorEvent *e) { if (systray_profile) fprintf(stderr, RED "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); error = TRUE; if (e->error_code != BadWindow) { fprintf(stderr, RED "systray: error code %d" RESET "\n", e->error_code); } return 0; } static gint compare_traywindows(gconstpointer a, gconstpointer b) { const TrayWindow *traywin_a = (const TrayWindow *)a; const TrayWindow *traywin_b = (const TrayWindow *)b; #if 0 // This breaks pygtk2 StatusIcon with blinking activated if (traywin_a->empty && !traywin_b->empty) return 1 * (systray.sort == SYSTRAY_SORT_RIGHT2LEFT ? -1 : 1); if (!traywin_a->empty && traywin_b->empty) return -1 * (systray.sort == SYSTRAY_SORT_RIGHT2LEFT ? -1 : 1); #endif if (systray.sort == SYSTRAY_SORT_ASCENDING || systray.sort == SYSTRAY_SORT_DESCENDING) { return g_ascii_strncasecmp(traywin_a->name, traywin_b->name, -1) * (systray.sort == SYSTRAY_SORT_ASCENDING ? 1 : -1); } if (systray.sort == SYSTRAY_SORT_LEFT2RIGHT || systray.sort == SYSTRAY_SORT_RIGHT2LEFT) { return (traywin_a->chrono - traywin_b->chrono) * (systray.sort == SYSTRAY_SORT_LEFT2RIGHT ? 1 : -1); } return 0; } void print_icons() { fprintf(stderr, "systray.list_icons: \n"); for (GSList *l = systray.list_icons; l; l = l->next) { TrayWindow *t = l->data; fprintf(stderr, "%s\n", t->name); } fprintf(stderr, "systray.list_icons order: \n"); for (GSList *l = systray.list_icons; l; l = l->next) { if (l->next) { TrayWindow *t = l->data; TrayWindow *u = l->next->data; int cmp = compare_traywindows(t, u); fprintf(stderr, "%s %s %s\n", t->name, cmp < 0 ? "<" : cmp == 0 ? "=" : ">" , u->name); } } } gboolean add_icon(Window win) { XTextProperty xname; char *name; if (XGetWMName(server.display, win, &xname)) { name = strdup((char *)xname.value); XFree(xname.value); } else { name = strdup(""); } if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, win, name); Panel *panel = systray.area.panel; int hide = 0; // Get the process ID of the application that created the window int pid = 0; { Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = 0; int ret = XGetWindowProperty(server.display, win, server.atom._NET_WM_PID, 0, 1024, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop); if (ret == Success && prop) { pid = prop[1] * 256; pid += prop[0]; } } for (GSList *l = systray.list_icons; l; l = l->next) { TrayWindow *other = (TrayWindow *)l->data; if (other->win == win) { free(name); return FALSE; } } // Check if the application leaves behind empty icons int num_empty_same_pid = 0; #if 0 for (GSList *l = systray.list_icons; l; l = l->next) { TrayWindow *other = (TrayWindow *)l->data; if (!systray_composited) { // Empty icon detection: we compare the contents of the icon with the contents of the panel pixmap. // If any pixel is different, the icon is not empty. imlib_context_set_visual(server.visual); imlib_context_set_colormap(server.colormap); imlib_context_set_drawable(other->win); Imlib_Image image = imlib_create_image_from_drawable(0, 0, 0, other->width, other->height, 1); if (image) { imlib_context_set_drawable(panel->temp_pmap); Imlib_Image bg = imlib_create_image_from_drawable(0, other->x, other->y, other->width, other->height, 1); imlib_context_set_image(bg); DATA32 *data_bg = imlib_image_get_data_for_reading_only(); imlib_context_set_image(image); imlib_image_set_has_alpha(other->depth > 24); DATA32 *data = imlib_image_get_data_for_reading_only(); int x, y; gboolean empty = TRUE; for (x = 0; x < other->width && empty; x++) { for (y = 0; y < other->height && empty; y++) { DATA32 pixel = data[y * other->width + x]; DATA32 a = (pixel >> 24) & 0xff; if (a == 0) continue; DATA32 rgb = pixel & 0xffFFff; DATA32 pixel_bg = data_bg[y * other->width + x]; DATA32 rgb_bg = pixel_bg & 0xffFFff; if (rgb != rgb_bg) { if (systray_profile) fprintf(stderr, "Pixel: %x different from bg %x at pos %d %d\n", pixel, pixel_bg, x, y); empty = FALSE; } } } other->empty = empty; imlib_free_image_and_decache(); imlib_context_set_image(bg); imlib_free_image_and_decache(); if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s) empty = %d\n", profiling_get_time(), __FUNCTION__, __LINE__, other->win, other->name, other->empty); } } if (pid && other->pid == pid) { if (other->empty) num_empty_same_pid++; } } // Remove empty icons if the application leaves behind more than 1 const int max_num_empty_same_pid = 0; if (num_empty_same_pid > max_num_empty_same_pid) { for (GSList *l = systray.list_icons; l; l = l->next) { if (pid && ((TrayWindow *)l->data)->pid == pid && ((TrayWindow *)l->data)->empty) { num_empty_same_pid++; fprintf(stderr, RED "Removing tray icon %lu (%s) from misbehaving application with pid=%d (too many icons)" RESET "\n", ((TrayWindow *)l->data)->win, ((TrayWindow *)l->data)->name, pid); remove_icon((TrayWindow *)l->data); break; } } } #endif // Create the parent window that will embed the icon XWindowAttributes attr; if (systray_profile) fprintf(stderr, "XGetWindowAttributes(server.display, win = %ld, &attr)\n", win); if (XGetWindowAttributes(server.display, win, &attr) == False) { free(name); return FALSE; } unsigned long mask = 0; XSetWindowAttributes set_attr; Visual *visual = server.visual; fprintf(stderr, GREEN "add_icon: %lu (%s), pid %d, %d, visual %p, colormap %lu, depth %d, width %d, height %d" RESET "\n", win, name, pid, num_empty_same_pid, attr.visual, attr.colormap, attr.depth, attr.width, attr.height); if (server.disable_transparency) { set_attr.background_pixmap = ParentRelative; mask = CWBackPixmap; if (systray_composited || attr.depth != server.depth) { visual = attr.visual; set_attr.colormap = attr.colormap; mask |= CWColormap; } } else { if (systray_composited || attr.depth != server.depth) { visual = attr.visual; set_attr.background_pixel = 0; set_attr.border_pixel = 0; set_attr.colormap = attr.colormap; mask = CWColormap | CWBackPixel | CWBorderPixel; } else { set_attr.background_pixmap = ParentRelative; mask = CWBackPixmap; } } if (systray_profile) fprintf(stderr, "XCreateWindow(...)\n"); Window parent = XCreateWindow(server.display, panel->main_win, 0, 0, systray.icon_size, systray.icon_size, 0, attr.depth, InputOutput, visual, mask, &set_attr); // Add the icon to the list TrayWindow *traywin = g_new0(TrayWindow, 1); traywin->parent = parent; traywin->win = win; traywin->hide = hide; traywin->depth = attr.depth; // Reparenting is done at the first paint event when the window is positioned correctly over its empty background, // to prevent graphical corruptions in icons with fake transparency traywin->pid = pid; traywin->name = name; traywin->chrono = chrono; chrono++; if (systray.area.on_screen == 0) show(&systray.area); if (systray.sort == SYSTRAY_SORT_RIGHT2LEFT) systray.list_icons = g_slist_prepend(systray.list_icons, traywin); else systray.list_icons = g_slist_append(systray.list_icons, traywin); systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows); // print_icons(); if (!traywin->hide && !panel->is_hidden) { if (systray_profile) fprintf(stderr, "XMapRaised(server.display, traywin->parent)\n"); XMapRaised(server.display, traywin->parent); } if (systray_profile) fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__); // Resize and redraw the systray if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); systray.area.resize_needed = TRUE; schedule_redraw(&systray.area); panel->area.resize_needed = TRUE; panel_refresh = TRUE; refresh_systray = TRUE; return TRUE; } gboolean reparent_icon(TrayWindow *traywin) { if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); if (traywin->reparented) return TRUE; // Watch for the icon trying to resize itself / closing again XSync(server.display, False); error = FALSE; XErrorHandler old = XSetErrorHandler(window_error_handler); if (systray_profile) fprintf(stderr, "XSelectInput(server.display, traywin->win, ...)\n"); XSelectInput(server.display, traywin->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask); XWithdrawWindow(server.display, traywin->win, server.screen); XReparentWindow(server.display, traywin->win, traywin->parent, 0, 0); if (systray_profile) fprintf(stderr, "XMoveResizeWindow(server.display, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height = %d)\n", traywin->win, traywin->width, traywin->height); XMoveResizeWindow(server.display, traywin->win, 0, 0, traywin->width, traywin->height); // Embed into parent { XEvent e; e.xclient.type = ClientMessage; e.xclient.serial = 0; e.xclient.send_event = True; e.xclient.message_type = server.atom._XEMBED; e.xclient.window = traywin->win; e.xclient.format = 32; e.xclient.data.l[0] = CurrentTime; e.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY; e.xclient.data.l[2] = 0; e.xclient.data.l[3] = traywin->parent; e.xclient.data.l[4] = 0; if (systray_profile) fprintf(stderr, "XSendEvent(server.display, traywin->win, False, NoEventMask, &e)\n"); XSendEvent(server.display, traywin->win, False, NoEventMask, &e); } XSync(server.display, False); XSetErrorHandler(old); if (error != FALSE) { fprintf(stderr, RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d" RESET "\n", __LINE__, traywin->win, traywin->name, traywin->parent, traywin->pid); remove_icon(traywin); return FALSE; } traywin->reparented = TRUE; if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); return TRUE; } gboolean embed_icon(TrayWindow *traywin) { if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); if (traywin->embedded) return TRUE; Panel *panel = systray.area.panel; XSync(server.display, False); error = FALSE; XErrorHandler old = XSetErrorHandler(window_error_handler); if (0) { Atom acttype; int actfmt; unsigned long nbitem, bytes; unsigned long *data = 0; int ret; if (systray_profile) fprintf(stderr, "XGetWindowProperty(server.display, traywin->win, server.atom._XEMBED_INFO, 0, 2, False, " "server.atom._XEMBED_INFO, &acttype, &actfmt, &nbitem, &bytes, &data)\n"); ret = XGetWindowProperty(server.display, traywin->win, server.atom._XEMBED_INFO, 0, 2, False, server.atom._XEMBED_INFO, &acttype, &actfmt, &nbitem, &bytes, (unsigned char **)&data); if (ret == Success) { if (data) { if (nbitem >= 2) { int hide = ((data[1] & XEMBED_MAPPED) == 0); if (hide) { // In theory we have to check the embedding with this and remove icons that refuse embedding. // In practice we have no idea when the other application processes the event and accepts the // embed // so we cannot check now without a race. // Race can be triggered with PyGtk(2) apps. // We could defer this for later (if we set PropertyChangeMask in XSelectInput we get notified) // but // for some reason it breaks transparency for Qt icons. So we don't. // fprintf(stderr, RED "tint2: window refused embedding" RESET "\n"); // remove_icon(traywin); // XFree(data); // return FALSE; } } XFree(data); } } else { fprintf(stderr, RED "tint2 : xembed error" RESET "\n"); remove_icon(traywin); return FALSE; } } // Redirect rendering when using compositing if (systray_composited) { if (systray_profile) fprintf(stderr, "XDamageCreate(server.display, traywin->parent, XDamageReportRawRectangles)\n"); traywin->damage = XDamageCreate(server.display, traywin->parent, XDamageReportRawRectangles); if (systray_profile) fprintf(stderr, "XCompositeRedirectWindow(server.display, traywin->parent, CompositeRedirectManual)\n"); XCompositeRedirectWindow(server.display, traywin->parent, CompositeRedirectManual); } XRaiseWindow(server.display, traywin->win); // Make the icon visible if (!traywin->hide) { if (systray_profile) fprintf(stderr, "XMapWindow(server.display, traywin->win)\n"); XMapWindow(server.display, traywin->win); } if (!traywin->hide && !panel->is_hidden) { if (systray_profile) fprintf(stderr, "XMapRaised(server.display, traywin->parent)\n"); XMapRaised(server.display, traywin->parent); } if (systray_profile) fprintf(stderr, "XSync(server.display, False)\n"); XSync(server.display, False); XSetErrorHandler(old); if (error != FALSE) { fprintf(stderr, RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d" RESET "\n", __LINE__, traywin->win, traywin->name, traywin->parent, traywin->pid); remove_icon(traywin); return FALSE; } traywin->embedded = TRUE; if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); return TRUE; } void remove_icon(TrayWindow *traywin) { // This code causes an X11 I/O error // close(((_XPrivDisplay)server.display)->fd); if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); Panel *panel = systray.area.panel; // remove from our list systray.list_icons = g_slist_remove(systray.list_icons, traywin); fprintf(stderr, YELLOW "remove_icon: %lu (%s)" RESET "\n", traywin->win, traywin->name); XSelectInput(server.display, traywin->win, NoEventMask); if (traywin->damage) XDamageDestroy(server.display, traywin->damage); // reparent to root XSync(server.display, False); error = FALSE; XErrorHandler old = XSetErrorHandler(window_error_handler); if (!traywin->hide) XUnmapWindow(server.display, traywin->win); XReparentWindow(server.display, traywin->win, server.root_win, 0, 0); XDestroyWindow(server.display, traywin->parent); XSync(server.display, False); XSetErrorHandler(old); stop_timeout(traywin->render_timeout); stop_timeout(traywin->resize_timeout); free(traywin->name); if (traywin->image) { imlib_context_set_image(traywin->image); imlib_free_image_and_decache(); } g_free(traywin); // check empty systray int count = 0; GSList *l; for (l = systray.list_icons; l; l = l->next) { if (((TrayWindow *)l->data)->hide) continue; count++; } if (count == 0) hide(&systray.area); // Resize and redraw the systray if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); systray.area.resize_needed = TRUE; schedule_redraw(&systray.area); panel->area.resize_needed = TRUE; panel_refresh = TRUE; refresh_systray = TRUE; } void systray_resize_icon(void *t) { // we end up in this function only in real transparency mode or if systray_task_asb != 100 0 0 // we made also sure, that we always have a 32 bit visual, i.e. we can safely create 32 bit pixmaps here TrayWindow *traywin = t; unsigned int border_width; int xpos, ypos; unsigned int width, height, depth; Window root; if (!XGetGeometry(server.display, traywin->win, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) { return; } else { if (1 || xpos != 0 || ypos != 0 || width != traywin->width || height != traywin->height) { if (systray_profile) fprintf(stderr, "XMoveResizeWindow(server.display, traywin->win = %ld, 0, 0, traywin->width = %d, traywin->height " "= %d)\n", traywin->win, traywin->width, traywin->height); if (0) { XMoveResizeWindow(server.display, traywin->win, 0, 0, traywin->width, traywin->height); } if (0) { XWindowChanges changes; changes.x = changes.y = 0; changes.width = traywin->width; changes.height = traywin->height; XConfigureWindow(server.display, traywin->win, CWX | CWY | CWWidth | CWHeight, &changes); } if (1) { XConfigureEvent ev; ev.type = ConfigureNotify; ev.serial = 0; ev.send_event = True; ev.event = traywin->win; ev.window = traywin->win; ev.x = 0; ev.y = 0; ev.width = traywin->width; ev.height = traywin->height; ev.border_width = 0; ev.above = None; ev.override_redirect = False; XSendEvent(server.display, traywin->win, False, StructureNotifyMask, (XEvent *)&ev); } XSync(server.display, False); } } } void systray_reconfigure_event(TrayWindow *traywin, XEvent *e) { if (systray_profile) fprintf(stderr, "XConfigure event: win = %lu (%s), x = %d, y = %d, w = %d, h = %d\n", traywin->win, traywin->name, e->xconfigure.x, e->xconfigure.y, e->xconfigure.width, e->xconfigure.height); if (!traywin->reparented) return; if (e->xconfigure.width != traywin->width || e->xconfigure.height != traywin->height || e->xconfigure.x != 0 || e->xconfigure.y != 0) { if (traywin->bad_size_counter < max_bad_resize_events) { struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); struct timespec earliest_resize = add_msec_to_timespec(traywin->time_last_resize, resize_period_threshold); if (compare_timespecs(&earliest_resize, &now) > 0) { // Fast resize, but below the threshold traywin->bad_size_counter++; } else { // Slow resize, reset counter traywin->time_last_resize.tv_sec = now.tv_sec; traywin->time_last_resize.tv_nsec = now.tv_nsec; traywin->bad_size_counter = 0; } if (traywin->bad_size_counter < min_bad_resize_events) { systray_resize_icon(traywin); } else { if (!traywin->resize_timeout) traywin->resize_timeout = add_timeout(fast_resize_period, 0, systray_resize_icon, traywin, &traywin->resize_timeout); } } else { if (traywin->bad_size_counter == max_bad_resize_events) { traywin->bad_size_counter++; fprintf(stderr, RED "Detected resize loop for tray icon %lu (%s), throttling resize events" RESET "\n", traywin->win, traywin->name); } // Delayed resize // FIXME Normally we should force the icon to resize fill_color to the size we resized it to when we // embedded it. // However this triggers a resize loop in new versions of GTK, which we must avoid. if (!traywin->resize_timeout) traywin->resize_timeout = add_timeout(slow_resize_period, 0, systray_resize_icon, traywin, &traywin->resize_timeout); return; } } else { // Correct size stop_timeout(traywin->resize_timeout); } // Resize and redraw the systray if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); panel_refresh = TRUE; refresh_systray = 1; } void systray_property_notify(TrayWindow *traywin, XEvent *e) { Atom at = e->xproperty.atom; if (at == server.atom.WM_NAME) { free(traywin->name); XTextProperty xname; if (XGetWMName(server.display, traywin->win, &xname)) { traywin->name = strdup((char *)xname.value); XFree(xname.value); } else { traywin->name = strdup(""); } if (systray.sort == SYSTRAY_SORT_ASCENDING || systray.sort == SYSTRAY_SORT_DESCENDING) { systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows); // print_icons(); } } } void systray_resize_request_event(TrayWindow *traywin, XEvent *e) { if (systray_profile) fprintf(stderr, "XResizeRequest event: win = %lu (%s), w = %d, h = %d\n", traywin->win, traywin->name, e->xresizerequest.width, e->xresizerequest.height); if (!traywin->reparented) return; if (e->xresizerequest.width != traywin->width || e->xresizerequest.height != traywin->height) { if (traywin->bad_size_counter < max_bad_resize_events) { struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); struct timespec earliest_resize = add_msec_to_timespec(traywin->time_last_resize, resize_period_threshold); if (compare_timespecs(&earliest_resize, &now) > 0) { // Fast resize, but below the threshold traywin->bad_size_counter++; } else { // Slow resize, reset counter traywin->time_last_resize.tv_sec = now.tv_sec; traywin->time_last_resize.tv_nsec = now.tv_nsec; traywin->bad_size_counter = 0; } if (traywin->bad_size_counter < min_bad_resize_events) { systray_resize_icon(traywin); } else { if (!traywin->resize_timeout) traywin->resize_timeout = add_timeout(fast_resize_period, 0, systray_resize_icon, traywin, &traywin->resize_timeout); } } else { if (traywin->bad_size_counter == max_bad_resize_events) { traywin->bad_size_counter++; fprintf(stderr, RED "Detected resize loop for tray icon %lu (%s), throttling resize events" RESET "\n", traywin->win, traywin->name); } // Delayed resize // FIXME Normally we should force the icon to resize fill_color to the size we resized it to when we // embedded it. // However this triggers a resize loop in new versions of GTK, which we must avoid. if (!traywin->resize_timeout) traywin->resize_timeout = add_timeout(slow_resize_period, 0, systray_resize_icon, traywin, &traywin->resize_timeout); return; } } else { // Correct size stop_timeout(traywin->resize_timeout); } // Resize and redraw the systray if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); panel_refresh = TRUE; refresh_systray = 1; } void systray_destroy_event(TrayWindow *traywin) { if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); remove_icon(traywin); } void systray_render_icon_from_image(TrayWindow *traywin) { if (!traywin->image) return; imlib_context_set_image(traywin->image); XCopyArea(server.display, render_background, systray.area.pix, server.gc, traywin->x - systray.area.posx, traywin->y - systray.area.posy, traywin->width, traywin->height, traywin->x - systray.area.posx, traywin->y - systray.area.posy); render_image(systray.area.pix, traywin->x - systray.area.posx, traywin->y - systray.area.posy); } void systray_render_icon_composited(void *t) { // we end up in this function only in real transparency mode or if systray_task_asb != 100 0 0 // we made also sure, that we always have a 32 bit visual, i.e. we can safely create 32 bit pixmaps here TrayWindow *traywin = t; if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); // wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); struct timespec earliest_render = add_msec_to_timespec(traywin->time_last_render, min_refresh_period); if (compare_timespecs(&earliest_render, &now) > 0) { traywin->num_fast_renders++; if (traywin->num_fast_renders > max_fast_refreshes) { traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon_composited, traywin, &traywin->render_timeout); if (systray_profile) fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); return; } } else { traywin->time_last_render.tv_sec = now.tv_sec; traywin->time_last_render.tv_nsec = now.tv_nsec; traywin->num_fast_renders = 0; } if (traywin->width == 0 || traywin->height == 0) { // reschedule rendering since the geometry information has not yet been processed (can happen on slow cpu) traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon_composited, traywin, &traywin->render_timeout); if (systray_profile) fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); return; } if (traywin->render_timeout) { stop_timeout(traywin->render_timeout); traywin->render_timeout = NULL; } // good systray icons support 32 bit depth, but some icons are still 24 bit. // We create a heuristic mask for these icons, i.e. we get the rgb value in the top left corner, and // mask out all pixel with the same rgb value Panel *panel = systray.area.panel; // Very ugly hack, but somehow imlib2 is not able to get the image from the traywindow itself, // so we first render the tray window onto a pixmap, and then we tell imlib2 to use this pixmap as // drawable. If someone knows why it does not work with the traywindow itself, please tell me ;) Pixmap tmp_pmap = XCreatePixmap(server.display, traywin->win, traywin->width, traywin->height, 32); if (!tmp_pmap) { goto on_systray_error; } XRenderPictFormat *f; if (traywin->depth == 24) { f = XRenderFindStandardFormat(server.display, PictStandardRGB24); } else if (traywin->depth == 32) { f = XRenderFindStandardFormat(server.display, PictStandardARGB32); } else { fprintf(stderr, RED "Strange tray icon found with depth: %d" RESET "\n", traywin->depth); XFreePixmap(server.display, tmp_pmap); return; } XRenderPictFormat *f32 = XRenderFindVisualFormat(server.display, server.visual32); if (!f || !f32) { XFreePixmap(server.display, tmp_pmap); goto on_systray_error; } XSync(server.display, False); error = FALSE; XErrorHandler old = XSetErrorHandler(window_error_handler); // if (server.real_transparency) // Picture pict_image = XRenderCreatePicture(server.display, traywin->parent, f, 0, 0); // reverted Rev 407 because here it's breaking alls icon with systray + xcompmgr Picture pict_image = XRenderCreatePicture(server.display, traywin->win, f, 0, 0); if (!pict_image) { XFreePixmap(server.display, tmp_pmap); XSetErrorHandler(old); goto on_error; } Picture pict_drawable = XRenderCreatePicture(server.display, tmp_pmap, XRenderFindVisualFormat(server.display, server.visual32), 0, 0); if (!pict_drawable) { XRenderFreePicture(server.display, pict_image); XFreePixmap(server.display, tmp_pmap); XSetErrorHandler(old); goto on_error; } XRenderComposite(server.display, PictOpSrc, pict_image, None, pict_drawable, 0, 0, 0, 0, 0, 0, traywin->width, traywin->height); XRenderFreePicture(server.display, pict_image); XRenderFreePicture(server.display, pict_drawable); // end of the ugly hack and we can continue as before imlib_context_set_visual(server.visual32); imlib_context_set_colormap(server.colormap32); imlib_context_set_drawable(tmp_pmap); Imlib_Image image = imlib_create_image_from_drawable(0, 0, 0, traywin->width, traywin->height, 1); imlib_context_set_visual(server.visual); imlib_context_set_colormap(server.colormap); XFreePixmap(server.display, tmp_pmap); if (!image) { imlib_context_set_visual(server.visual); imlib_context_set_colormap(server.colormap); XSetErrorHandler(old); goto on_error; } else { if (traywin->image) { imlib_context_set_image(traywin->image); imlib_free_image_and_decache(); } traywin->image = image; } imlib_context_set_image(traywin->image); // if (traywin->depth == 24) // imlib_save_image("/home/thil77/test.jpg"); imlib_image_set_has_alpha(1); DATA32 *data = imlib_image_get_data(); if (traywin->depth == 24) { create_heuristic_mask(data, traywin->width, traywin->height); } gboolean empty = FALSE; //image_empty(data, traywin->width, traywin->height); if (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) adjust_asb(data, traywin->width, traywin->height, systray.alpha, (float)systray.saturation / 100, (float)systray.brightness / 100); imlib_image_put_back_data(data); systray_render_icon_from_image(traywin); if (traywin->damage) XDamageSubtract(server.display, traywin->damage, None, None); XSync(server.display, False); XSetErrorHandler(old); if (error) goto on_error; if (traywin->empty != empty) { traywin->empty = empty; systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows); // print_icons(); // Resize and redraw the systray if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); systray.area.resize_needed = 1; schedule_redraw(&systray.area); panel->area.resize_needed = 1; panel_refresh = TRUE; refresh_systray = 1; } panel_refresh = TRUE; if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); return; on_error: fprintf(stderr, RED "systray %d: rendering error for icon %lu (%s) pid %d" RESET "\n", __LINE__, traywin->win, traywin->name, traywin->pid); return; on_systray_error: fprintf(stderr, RED "systray %d: rendering error for icon %lu (%s) pid %d. " "Disabling compositing and restarting systray..." RESET "\n", __LINE__, traywin->win, traywin->name, traywin->pid); systray_composited = 0; stop_net(); start_net(); return; } void systray_render_icon(void *t) { TrayWindow *traywin = t; if (systray_profile) fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); if (!traywin->reparented || !traywin->embedded) { if (systray_profile) fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); stop_timeout(traywin->render_timeout); traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout); return; } if (systray_composited) { XSync(server.display, False); error = FALSE; XErrorHandler old = XSetErrorHandler(window_error_handler); unsigned int border_width; int xpos, ypos; unsigned int width, height, depth; Window root; if (!XGetGeometry(server.display, traywin->win, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) { stop_timeout(traywin->render_timeout); if (!traywin->resize_timeout) traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout); systray_render_icon_from_image(traywin); XSetErrorHandler(old); return; } else { if (xpos != 0 || ypos != 0 || width != traywin->width || height != traywin->height) { stop_timeout(traywin->render_timeout); if (!traywin->resize_timeout) traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout); systray_render_icon_from_image(traywin); if (systray_profile) fprintf(stderr, YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__, traywin->win, traywin->name); XSetErrorHandler(old); return; } } XSetErrorHandler(old); } if (systray_profile) fprintf(stderr, "rendering tray icon\n"); if (systray_composited) { systray_render_icon_composited(traywin); } else { // Trigger window repaint if (systray_profile) fprintf(stderr, "XClearArea(server.display, traywin->parent = %ld, 0, 0, traywin->width, traywin->height, True)\n", traywin->parent); XClearArea(server.display, traywin->parent, 0, 0, 0, 0, True); if (systray_profile) fprintf(stderr, "XClearArea(server.display, traywin->win = %ld, 0, 0, traywin->width, traywin->height, True)\n", traywin->win); XClearArea(server.display, traywin->win, 0, 0, 0, 0, True); } } void refresh_systray_icons() { if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); TrayWindow *traywin; GSList *l; for (l = systray.list_icons; l; l = l->next) { traywin = (TrayWindow *)l->data; if (traywin->hide) continue; systray_render_icon(traywin); } } gboolean systray_on_monitor(int i_monitor, int num_panelss) { return (i_monitor == systray_monitor) || (i_monitor == 0 && (systray_monitor >= num_panelss || systray_monitor < 0)); } TrayWindow *systray_find_icon(Window win) { for (GSList *l = systray.list_icons; l; l = l->next) { TrayWindow *traywin = (TrayWindow *)l->data; if (traywin->win == win || traywin->parent == win) return traywin; } return NULL; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/systray/systraybar.h000066400000000000000000000054521265276141000253410ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr) * * systraybar * systray implementation come from 'docker-1.5' by Ben Jansens, * and from systray/xembed specification (freedesktop.org). * **************************************************************************/ #ifndef SYSTRAYBAR_H #define SYSTRAYBAR_H #include "common.h" #include "area.h" #include "timer.h" #include // XEMBED messages #define XEMBED_EMBEDDED_NOTIFY 0 // Flags for _XEMBED_INFO #define XEMBED_MAPPED (1 << 0) typedef enum SystraySortMethod { SYSTRAY_SORT_ASCENDING = 0, SYSTRAY_SORT_DESCENDING, SYSTRAY_SORT_LEFT2RIGHT, SYSTRAY_SORT_RIGHT2LEFT, } SystraySortMethod; typedef struct { // always start with area Area area; GSList *list_icons; SystraySortMethod sort; int alpha, saturation, brightness; int icon_size, icons_per_column, icons_per_row, margin; } Systraybar; typedef struct { Window parent; Window win; int x, y; int width, height; // TODO: manage icon's show/hide gboolean hide; int depth; Damage damage; timeout *render_timeout; gboolean empty; int pid; int chrono; struct timespec time_last_render; int num_fast_renders; gboolean reparented; gboolean embedded; int bad_size_counter; timeout *resize_timeout; struct timespec time_last_resize; char *name; Imlib_Image image; } TrayWindow; // net_sel_win != None when protocol started extern Window net_sel_win; extern Systraybar systray; extern gboolean refresh_systray; extern gboolean systray_enabled; extern int systray_max_icon_size; extern int systray_monitor; extern gboolean systray_profile; // default global data void default_systray(); // freed memory void cleanup_systray(); // initialize protocol and panel position void init_systray(); void init_systray_panel(void *p); void draw_systray(void *obj, cairo_t *c); gboolean resize_systray(void *obj); void on_change_systray(void *obj); gboolean systray_on_monitor(int i_monitor, int num_panelss); // systray protocol // many tray icon doesn't manage stop/restart of the systray manager void start_net(); 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_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_property_notify(TrayWindow *traywin, XEvent *e); void systray_destroy_event(TrayWindow *traywin); void kde_update_icons(); TrayWindow *systray_find_icon(Window win); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/000077500000000000000000000000001265276141000226705ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/task.c000066400000000000000000000440651265276141000240070ustar00rootroot00000000000000/************************************************************************** * * Tint2 : task * * Copyright (C) 2007 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include "panel.h" #include "server.h" #include "task.h" #include "taskbar.h" #include "timer.h" #include "tooltip.h" #include "window.h" timeout *urgent_timeout; GSList *urgent_list; char *task_get_tooltip(void *obj) { Task *t = (Task *)obj; return strdup(t->title); } Task *add_task(Window win) { if (!win) return NULL; if (window_is_hidden(win)) return NULL; XSelectInput(server.display, win, PropertyChangeMask | StructureNotifyMask); XFlush(server.display); int monitor = 0; if (num_panels > 1) { monitor = get_window_monitor(win); if (monitor >= num_panels) monitor = 0; } // TODO why do we add the task only to the panel for the current monitor, without checking hide_task_diff_monitor? Task task_template; memset(&task_template, 0, sizeof(task_template)); task_template.area.has_mouse_over_effect = panel_config.mouse_effects; task_template.area.has_mouse_press_effect = panel_config.mouse_effects; task_template.win = win; task_template.desktop = get_window_desktop(win); task_template.area.panel = &panels[monitor]; task_template.current_state = window_is_iconified(win) ? TASK_ICONIFIED : TASK_NORMAL; get_window_coordinates(win, &task_template.win_x, &task_template.win_y, &task_template.win_w, &task_template.win_h); // allocate only one title and one icon // even with task_on_all_desktop and with task_on_all_panel task_template.title = NULL; for (int k = 0; k < TASK_STATE_COUNT; ++k) { task_template.icon[k] = NULL; } task_update_title(&task_template); task_update_icon(&task_template); // fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task_template.title ? task_template.title : "??"); // fprintf(stderr, "new task %s win %u: desktop %d, monitor %d\n", new_task.title, win, new_task.desktop, monitor); GPtrArray *task_buttons = g_ptr_array_new(); for (int j = 0; j < panels[monitor].num_desktops; j++) { if (task_template.desktop != ALL_DESKTOPS && task_template.desktop != j) continue; Taskbar *taskbar = &panels[monitor].taskbar[j]; Task *task_instance = calloc(1, sizeof(Task)); memcpy(&task_instance->area, &panels[monitor].g_task.area, sizeof(Area)); task_instance->area.has_mouse_over_effect = panel_config.mouse_effects; task_instance->area.has_mouse_press_effect = panel_config.mouse_effects; task_instance->win = task_template.win; task_instance->desktop = task_template.desktop; task_instance->win_x = task_template.win_x; task_instance->win_y = task_template.win_y; task_instance->win_w = task_template.win_w; task_instance->win_h = task_template.win_h; task_instance->current_state = TASK_UNDEFINED; // to update the current state later in set_task_state... if (task_instance->desktop == ALL_DESKTOPS && server.desktop != j) { // fprintf(stderr, "%s %d: win = %ld hiding task: another desktop\n", __FUNCTION__, __LINE__, win); task_instance->area.on_screen = always_show_all_desktop_tasks; } task_instance->title = task_template.title; if (panels[monitor].g_task.tooltip_enabled) task_instance->area._get_tooltip_text = task_get_tooltip; for (int k = 0; k < TASK_STATE_COUNT; ++k) { task_instance->icon[k] = task_template.icon[k]; task_instance->icon_hover[k] = task_template.icon_hover[k]; task_instance->icon_press[k] = task_template.icon_press[k]; } task_instance->icon_width = task_template.icon_width; task_instance->icon_height = task_template.icon_height; add_area(&task_instance->area, &taskbar->area); g_ptr_array_add(task_buttons, task_instance); } Window *key = calloc(1, sizeof(Window)); *key = task_template.win; g_hash_table_insert(win_to_task, key, task_buttons); set_task_state((Task*)g_ptr_array_index(task_buttons, 0), task_template.current_state); sort_taskbar_for_win(win); if (taskbar_mode == MULTI_DESKTOP) { Panel *panel = (Panel*)task_template.area.panel; panel->area.resize_needed = TRUE; } if (window_is_urgent(win)) { add_urgent((Task*)g_ptr_array_index(task_buttons, 0)); } return (Task*)g_ptr_array_index(task_buttons, 0); } void remove_task(Task *task) { if (!task) return; // fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, task->win, task->title ? task->title : "??"); if (taskbar_mode == MULTI_DESKTOP) { Panel *panel = task->area.panel; panel->area.resize_needed = 1; } Window win = task->win; // free title and icon just for the first task // even with task_on_all_desktop and with task_on_all_panel // printf("remove_task %s %d\n", task->title, task->desktop); if (task->title) free(task->title); for (int k = 0; k < TASK_STATE_COUNT; ++k) { if (task->icon[k]) { imlib_context_set_image(task->icon[k]); imlib_free_image(); task->icon[k] = 0; } if (task->icon_hover[k]) { imlib_context_set_image(task->icon_hover[k]); imlib_free_image(); task->icon_hover[k] = 0; } if (task->icon_press[k]) { imlib_context_set_image(task->icon_press[k]); imlib_free_image(); task->icon_press[k] = 0; } } GPtrArray *task_buttons = g_hash_table_lookup(win_to_task, &win); for (int i = 0; i < task_buttons->len; ++i) { Task *task2 = g_ptr_array_index(task_buttons, i); if (task2 == active_task) active_task = 0; if (task2 == task_drag) task_drag = 0; if (g_slist_find(urgent_list, task2)) del_urgent(task2); remove_area((Area *)task2); free(task2); } g_hash_table_remove(win_to_task, &win); } gboolean task_update_title(Task *task) { Panel *panel = task->area.panel; if (!panel->g_task.has_text && !panel->g_task.tooltip_enabled && taskbar_sort_method != TASKBAR_SORT_TITLE) return FALSE; char *name = server_get_property(task->win, server.atom._NET_WM_VISIBLE_NAME, server.atom.UTF8_STRING, 0); if (!name || !strlen(name)) { name = server_get_property(task->win, server.atom._NET_WM_NAME, server.atom.UTF8_STRING, 0); if (!name || !strlen(name)) { name = server_get_property(task->win, server.atom.WM_NAME, XA_STRING, 0); } } char *title; if (name && strlen(name)) { title = strdup(name); } else { title = strdup("Untitled"); } if (name) XFree(name); if (task->title) { // check unecessary title change if (strcmp(task->title, title) == 0) { free(title); return FALSE; } else { free(task->title); } } task->title = title; GPtrArray *task_buttons = get_task_buttons(task->win); if (task_buttons) { for (int i = 0; i < task_buttons->len; ++i) { Task *task2 = g_ptr_array_index(task_buttons, i); task2->title = task->title; schedule_redraw(&task2->area); } } return TRUE; } void task_update_icon(Task *task) { Panel *panel = task->area.panel; if (!panel->g_task.has_icon) return; for (int k = 0; k < TASK_STATE_COUNT; ++k) { if (task->icon[k]) { imlib_context_set_image(task->icon[k]); imlib_free_image(); task->icon[k] = 0; } } Imlib_Image img = NULL; int i; gulong *data = server_get_property(task->win, server.atom._NET_WM_ICON, XA_CARDINAL, &i); if (data) { // get ARGB icon int w, h; gulong *tmp_data; tmp_data = get_best_icon(data, get_icon_count(data, i), i, &w, &h, panel->g_task.icon_size1); DATA32 icon_data[w * h]; for (int j = 0; j < w * h; ++j) icon_data[j] = tmp_data[j]; img = imlib_create_image_using_copied_data(w, h, icon_data); XFree(data); } else { // get Pixmap icon XWMHints *hints = XGetWMHints(server.display, task->win); if (hints) { if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) { // get width, height and depth for the pixmap Window root; int icon_x, icon_y; uint border_width, bpp; uint w, h; // printf(" get pixmap\n"); XGetGeometry(server.display, hints->icon_pixmap, &root, &icon_x, &icon_y, &w, &h, &border_width, &bpp); imlib_context_set_drawable(hints->icon_pixmap); img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, w, h, 0); } XFree(hints); } } if (img == NULL) { imlib_context_set_image(default_icon); img = imlib_clone_image(); } // transform icons imlib_context_set_image(img); imlib_image_set_has_alpha(1); int w = imlib_image_get_width(); int h = imlib_image_get_height(); Imlib_Image orig_image = imlib_create_cropped_scaled_image(0, 0, w, h, panel->g_task.icon_size1, panel->g_task.icon_size1); imlib_free_image(); imlib_context_set_image(orig_image); task->icon_width = imlib_image_get_width(); task->icon_height = imlib_image_get_height(); for (int k = 0; k < TASK_STATE_COUNT; ++k) { imlib_context_set_image(orig_image); task->icon[k] = imlib_clone_image(); imlib_context_set_image(task->icon[k]); DATA32 *data32; if (panel->g_task.alpha[k] != 100 || panel->g_task.saturation[k] != 0 || panel->g_task.brightness[k] != 0) { data32 = imlib_image_get_data(); adjust_asb(data32, task->icon_width, task->icon_height, panel->g_task.alpha[k], (float)panel->g_task.saturation[k] / 100, (float)panel->g_task.brightness[k] / 100); imlib_image_put_back_data(data32); } if (panel_config.mouse_effects) { task->icon_hover[k] = adjust_icon(task->icon[k], panel_config.mouse_over_alpha, panel_config.mouse_over_saturation, panel_config.mouse_over_brightness); task->icon_press[k] = adjust_icon(task->icon[k], panel_config.mouse_pressed_alpha, panel_config.mouse_pressed_saturation, panel_config.mouse_pressed_brightness); } } imlib_context_set_image(orig_image); imlib_free_image(); GPtrArray *task_buttons = get_task_buttons(task->win); if (task_buttons) { for (i = 0; i < task_buttons->len; ++i) { Task *task2 = g_ptr_array_index(task_buttons, i); task2->icon_width = task->icon_width; task2->icon_height = task->icon_height; for (int k = 0; k < TASK_STATE_COUNT; ++k) { task2->icon[k] = task->icon[k]; task2->icon_hover[k] = task->icon_hover[k]; task2->icon_press[k] = task->icon_press[k]; } schedule_redraw(&task2->area); } } } // TODO icons look too large when the panel is large void draw_task_icon(Task *task, int text_width) { if (!task->icon[task->current_state]) return; // Find pos int pos_x; Panel *panel = (Panel *)task->area.panel; if (panel->g_task.centered) { if (panel->g_task.has_text) pos_x = (task->area.width - text_width - panel->g_task.icon_size1) / 2; else pos_x = (task->area.width - panel->g_task.icon_size1) / 2; } else { pos_x = panel->g_task.area.paddingxlr + task->area.bg->border.width; } // Render Imlib_Image image; // Render if (panel_config.mouse_effects) { if (task->area.mouse_state == MOUSE_OVER) image = task->icon_hover[task->current_state]; else if (task->area.mouse_state == MOUSE_DOWN) image = task->icon_press[task->current_state]; else image = task->icon[task->current_state]; } else { image = task->icon[task->current_state]; } imlib_context_set_image(image); render_image(task->area.pix, pos_x, panel->g_task.icon_posy); } void draw_task(void *obj, cairo_t *c) { Task *task = (Task *)obj; Panel *panel = (Panel *)task->area.panel; int text_width = 0; if (panel->g_task.has_text) { PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_font_description(layout, panel->g_task.font_desc); pango_layout_set_text(layout, task->title, -1); pango_layout_set_width(layout, ((Taskbar *)task->area.parent)->text_width * PANGO_SCALE); pango_layout_set_height(layout, panel->g_task.text_height * PANGO_SCALE); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END); if (panel->g_task.centered) pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); else pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT); int text_height; pango_layout_get_pixel_size(layout, &text_width, &text_height); double text_posy = (panel->g_task.area.height - text_height) / 2.0; Color *config_text = &panel->g_task.font[task->current_state]; draw_text(layout, c, panel->g_task.text_posx, text_posy, config_text, panel->font_shadow); g_object_unref(layout); } if (panel->g_task.has_icon) draw_task_icon(task, text_width); } void on_change_task(void *obj) { Task *task = (Task *)obj; Panel *panel = (Panel *)task->area.panel; long value[] = {panel->posx + task->area.posx, panel->posy + task->area.posy, task->area.width, task->area.height}; XChangeProperty(server.display, task->win, server.atom._NET_WM_ICON_GEOMETRY, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)value, 4); } Task *find_active_task(Task *current_task) { if (active_task == NULL) return current_task; Taskbar *taskbar = (Taskbar *)current_task->area.parent; GList *l0 = taskbar->area.children; if (taskbarname_enabled) l0 = l0->next; for (; l0; l0 = l0->next) { Task *task = (Task *)l0->data; if (task->win == active_task->win) return task; } return current_task; } Task *next_task(Task *task) { if (!task) return NULL; Taskbar *taskbar = task->area.parent; GList *l0 = taskbar->area.children; if (taskbarname_enabled) l0 = l0->next; GList *lfirst_task = l0; for (; l0; l0 = l0->next) { Task *task1 = l0->data; if (task1 == task) { l0 = l0->next ? l0->next : lfirst_task; return l0->data; } } return NULL; } Task *prev_task(Task *task) { if (!task) return 0; Taskbar *taskbar = task->area.parent; Task *task2 = NULL; GList *l0 = taskbar->area.children; if (taskbarname_enabled) l0 = l0->next; GList *lfirst_task = l0; for (; l0; l0 = l0->next) { Task *task1 = l0->data; if (task1 == task) { if (l0 == lfirst_task) { l0 = g_list_last(l0); task2 = l0->data; } return task2; } task2 = task1; } return NULL; } void reset_active_task() { if (active_task) { set_task_state(active_task, window_is_iconified(active_task->win) ? TASK_ICONIFIED : TASK_NORMAL); active_task = NULL; } Window w1 = get_active_window(); // printf("Change active task %ld\n", w1); if (w1) { if (!get_task_buttons(w1)) { Window w2; while (XGetTransientForHint(server.display, w1, &w2)) w1 = w2; } set_task_state((active_task = get_task(w1)), TASK_ACTIVE); } } void set_task_state(Task *task, TaskState state) { if (!task || state == TASK_UNDEFINED || state >= TASK_STATE_COUNT) return; if (state == TASK_ACTIVE && task->current_state != state) { clock_gettime(CLOCK_MONOTONIC, &task->last_activation_time); if (taskbar_sort_method == TASKBAR_SORT_LRU || taskbar_sort_method == TASKBAR_SORT_MRU) { GPtrArray *task_buttons = get_task_buttons(task->win); if (task_buttons) { for (int i = 0; i < task_buttons->len; ++i) { Task *task1 = g_ptr_array_index(task_buttons, i); Taskbar *taskbar = (Taskbar *)task1->area.parent; sort_tasks(taskbar); } } } } if (task->current_state != state || hide_task_diff_monitor) { GPtrArray *task_buttons = get_task_buttons(task->win); if (task_buttons) { for (int i = 0; i < task_buttons->len; ++i) { Task *task1 = g_ptr_array_index(task_buttons, i); task1->current_state = state; task1->area.bg = panels[0].g_task.background[state]; schedule_redraw(&task1->area); if (state == TASK_ACTIVE && g_slist_find(urgent_list, task1)) del_urgent(task1); gboolean hide = FALSE; Taskbar *taskbar = (Taskbar *)task1->area.parent; if (task->desktop == ALL_DESKTOPS && server.desktop != taskbar->desktop) { // Hide ALL_DESKTOPS task on non-current desktop hide = !always_show_all_desktop_tasks; } if (hide_inactive_tasks) { // Show only the active task if (state != TASK_ACTIVE) { hide = TRUE; } } if (get_window_monitor(task->win) != ((Panel *)task->area.panel)->monitor && (hide_task_diff_monitor || num_panels > 1)) { hide = TRUE; } if ((!hide) != task1->area.on_screen) { task1->area.on_screen = !hide; schedule_redraw(&task1->area); Panel *p = (Panel *)task->area.panel; task->area.resize_needed = TRUE; p->taskbar->area.resize_needed = TRUE; p->area.resize_needed = TRUE; } } panel_refresh = TRUE; } } } void blink_urgent(void *arg) { GSList *urgent_task = urgent_list; while (urgent_task) { Task *t = urgent_task->data; if (t->urgent_tick < max_tick_urgent) { if (t->urgent_tick++ % 2) set_task_state(t, TASK_URGENT); else set_task_state(t, window_is_iconified(t->win) ? TASK_ICONIFIED : TASK_NORMAL); } urgent_task = urgent_task->next; } panel_refresh = TRUE; } void add_urgent(Task *task) { if (!task) return; // some programs set urgency hint although they are active if (active_task && active_task->win == task->win) return; task = get_task(task->win); // always add the first task for the task buttons (omnipresent windows) task->urgent_tick = 0; if (g_slist_find(urgent_list, task)) return; // not yet in the list, so we have to add it urgent_list = g_slist_prepend(urgent_list, task); if (!urgent_timeout) urgent_timeout = add_timeout(10, 1000, blink_urgent, 0, &urgent_timeout); Panel *panel = task->area.panel; if (panel->is_hidden) autohide_show(panel); } void del_urgent(Task *task) { urgent_list = g_slist_remove(urgent_list, task); if (!urgent_list) { stop_timeout(urgent_timeout); urgent_timeout = NULL; } } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/task.h000066400000000000000000000046341265276141000240120ustar00rootroot00000000000000/************************************************************************** * task : * - * **************************************************************************/ #ifndef TASK_H #define TASK_H #include #include #include #include "common.h" #include "timer.h" typedef enum TaskState { TASK_NORMAL = 0, TASK_ACTIVE, TASK_ICONIFIED, TASK_URGENT, TASK_UNDEFINED, TASK_STATE_COUNT, } TaskState; typedef struct GlobalTask { Area area; gboolean has_text; gboolean has_icon; gboolean centered; int icon_posy; int icon_size1; int maximum_width; int maximum_height; int alpha[TASK_STATE_COUNT]; int saturation[TASK_STATE_COUNT]; int brightness[TASK_STATE_COUNT]; int config_asb_mask; Background *background[TASK_STATE_COUNT]; int config_background_mask; // starting position for text ~ task_padding + task_border + icon_size double text_posx, text_height; gboolean has_font; PangoFontDescription *font_desc; Color font[TASK_STATE_COUNT]; int config_font_mask; gboolean tooltip_enabled; } GlobalTask; // Stores information about a task. // Warning: any dynamically allocated members are shared between the Task instances created for the same window // (if the task appears on all desktops, there will be a different instance on each desktop's taskbar). typedef struct Task { Area area; Window win; int desktop; TaskState current_state; Imlib_Image icon[TASK_STATE_COUNT]; Imlib_Image icon_hover[TASK_STATE_COUNT]; Imlib_Image icon_press[TASK_STATE_COUNT]; unsigned int icon_width; unsigned int icon_height; char *title; int urgent_tick; // These may not be up-to-date int win_x; int win_y; int win_w; int win_h; struct timespec last_activation_time; } Task; extern timeout *urgent_timeout; extern GSList *urgent_list; Task *add_task(Window win); void remove_task(Task *task); void draw_task(void *obj, cairo_t *c); void on_change_task(void *obj); void task_update_icon(Task *task); gboolean task_update_title(Task *task); void reset_active_task(); void set_task_state(Task *task, TaskState state); // Given a pointer to the task that is currently under the mouse (current_task), // returns a pointer to the Task for the active window on the same taskbar. // If not found, returns the current task. Task *find_active_task(Task *current_task); Task *next_task(Task *task); Task *prev_task(Task *task); void add_urgent(Task *task); void del_urgent(Task *task); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/taskbar.c000066400000000000000000000446041265276141000244730ustar00rootroot00000000000000/************************************************************************** * * Tint2 : taskbar * * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include "task.h" #include "taskbar.h" #include "server.h" #include "window.h" #include "panel.h" #include "strnatcmp.h" GHashTable *win_to_task; Task *active_task; Task *task_drag; gboolean taskbar_enabled; gboolean taskbar_distribute_size; gboolean hide_inactive_tasks; gboolean hide_task_diff_monitor; gboolean always_show_all_desktop_tasks; TaskbarSortMethod taskbar_sort_method; Alignment taskbar_alignment; void taskbar_init_fonts(); // Removes the task with &win = key. The other args are ignored. void taskbar_remove_task(Window *win); guint win_hash(gconstpointer key) { return *((const Window *)key); } gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((const Window *)a) == *((const Window *)b)); } void free_ptr_array(gpointer data) { g_ptr_array_free(data, 1); } void default_taskbar() { win_to_task = NULL; urgent_timeout = NULL; urgent_list = NULL; taskbar_enabled = FALSE; taskbar_distribute_size = FALSE; hide_inactive_tasks = FALSE; hide_task_diff_monitor = FALSE; always_show_all_desktop_tasks = FALSE; taskbar_sort_method = TASKBAR_NOSORT; taskbar_alignment = ALIGN_LEFT; default_taskbarname(); } void cleanup_taskbar() { cleanup_taskbarname(); if (win_to_task) { while (g_hash_table_size(win_to_task)) { GHashTableIter iter; gpointer key, value; g_hash_table_iter_init(&iter, win_to_task); if (g_hash_table_iter_next(&iter, &key, &value)) { taskbar_remove_task(key); } } g_hash_table_destroy(win_to_task); win_to_task = NULL; } for (int i = 0; i < num_panels; i++) { Panel *panel = &panels[i]; for (int j = 0; j < panel->num_desktops; j++) { Taskbar *taskbar = &panel->taskbar[j]; free_area(&taskbar->area); // remove taskbar from the panel remove_area((Area *)taskbar); } if (panel->taskbar) { free(panel->taskbar); panel->taskbar = NULL; } } g_slist_free(urgent_list); urgent_list = NULL; stop_timeout(urgent_timeout); } void init_taskbar() { if (!panel_config.g_task.has_text && !panel_config.g_task.has_icon) { panel_config.g_task.has_text = panel_config.g_task.has_icon = 1; } if (!win_to_task) win_to_task = g_hash_table_new_full(win_hash, win_compare, free, free_ptr_array); active_task = 0; task_drag = 0; } void init_taskbar_panel(void *p) { Panel *panel = (Panel *)p; if (!panel->g_taskbar.background[TASKBAR_NORMAL]) { panel->g_taskbar.background[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, 0); panel->g_taskbar.background[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, 0); } if (!panel->g_taskbar.background_name[TASKBAR_NORMAL]) { panel->g_taskbar.background_name[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, 0); panel->g_taskbar.background_name[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, 0); } if (!panel->g_task.area.bg) panel->g_task.area.bg = &g_array_index(backgrounds, Background, 0); taskbar_init_fonts(); // taskbar name panel->g_taskbar.area_name.panel = panel; panel->g_taskbar.area_name.size_mode = LAYOUT_FIXED; panel->g_taskbar.area_name._resize = resize_taskbarname; panel->g_taskbar.area_name._draw_foreground = draw_taskbarname; panel->g_taskbar.area_name._on_change_layout = 0; panel->g_taskbar.area_name.resize_needed = 1; panel->g_taskbar.area_name.on_screen = TRUE; // taskbar panel->g_taskbar.area.parent = panel; panel->g_taskbar.area.panel = panel; panel->g_taskbar.area.size_mode = LAYOUT_DYNAMIC; panel->g_taskbar.area.alignment = taskbar_alignment; panel->g_taskbar.area._resize = resize_taskbar; panel->g_taskbar.area.resize_needed = 1; panel->g_taskbar.area.on_screen = TRUE; if (panel_horizontal) { panel->g_taskbar.area.posy = panel->area.bg->border.width + panel->area.paddingy; panel->g_taskbar.area.height = panel->area.height - (2 * panel->g_taskbar.area.posy); panel->g_taskbar.area_name.posy = panel->g_taskbar.area.posy; panel->g_taskbar.area_name.height = panel->g_taskbar.area.height; } else { panel->g_taskbar.area.posx = panel->area.bg->border.width + panel->area.paddingy; panel->g_taskbar.area.width = panel->area.width - (2 * panel->g_taskbar.area.posx); panel->g_taskbar.area_name.posx = panel->g_taskbar.area.posx; panel->g_taskbar.area_name.width = panel->g_taskbar.area.width; } // task panel->g_task.area.panel = panel; panel->g_task.area.size_mode = LAYOUT_DYNAMIC; panel->g_task.area._draw_foreground = draw_task; panel->g_task.area._on_change_layout = on_change_task; panel->g_task.area.resize_needed = 1; panel->g_task.area.on_screen = TRUE; if ((panel->g_task.config_asb_mask & (1 << TASK_NORMAL)) == 0) { panel->g_task.alpha[TASK_NORMAL] = 100; panel->g_task.saturation[TASK_NORMAL] = 0; panel->g_task.brightness[TASK_NORMAL] = 0; } if ((panel->g_task.config_asb_mask & (1 << TASK_ACTIVE)) == 0) { panel->g_task.alpha[TASK_ACTIVE] = panel->g_task.alpha[TASK_NORMAL]; panel->g_task.saturation[TASK_ACTIVE] = panel->g_task.saturation[TASK_NORMAL]; panel->g_task.brightness[TASK_ACTIVE] = panel->g_task.brightness[TASK_NORMAL]; } if ((panel->g_task.config_asb_mask & (1 << TASK_ICONIFIED)) == 0) { panel->g_task.alpha[TASK_ICONIFIED] = panel->g_task.alpha[TASK_NORMAL]; panel->g_task.saturation[TASK_ICONIFIED] = panel->g_task.saturation[TASK_NORMAL]; panel->g_task.brightness[TASK_ICONIFIED] = panel->g_task.brightness[TASK_NORMAL]; } if ((panel->g_task.config_asb_mask & (1 << TASK_URGENT)) == 0) { panel->g_task.alpha[TASK_URGENT] = panel->g_task.alpha[TASK_ACTIVE]; panel->g_task.saturation[TASK_URGENT] = panel->g_task.saturation[TASK_ACTIVE]; panel->g_task.brightness[TASK_URGENT] = panel->g_task.brightness[TASK_ACTIVE]; } if ((panel->g_task.config_font_mask & (1 << TASK_NORMAL)) == 0) panel->g_task.font[TASK_NORMAL] = (Color){{1, 1, 1}, 1}; if ((panel->g_task.config_font_mask & (1 << TASK_ACTIVE)) == 0) panel->g_task.font[TASK_ACTIVE] = panel->g_task.font[TASK_NORMAL]; if ((panel->g_task.config_font_mask & (1 << TASK_ICONIFIED)) == 0) panel->g_task.font[TASK_ICONIFIED] = panel->g_task.font[TASK_NORMAL]; if ((panel->g_task.config_font_mask & (1 << TASK_URGENT)) == 0) panel->g_task.font[TASK_URGENT] = panel->g_task.font[TASK_ACTIVE]; if ((panel->g_task.config_background_mask & (1 << TASK_NORMAL)) == 0) panel->g_task.background[TASK_NORMAL] = &g_array_index(backgrounds, Background, 0); if ((panel->g_task.config_background_mask & (1 << TASK_ACTIVE)) == 0) panel->g_task.background[TASK_ACTIVE] = panel->g_task.background[TASK_NORMAL]; if ((panel->g_task.config_background_mask & (1 << TASK_ICONIFIED)) == 0) panel->g_task.background[TASK_ICONIFIED] = panel->g_task.background[TASK_NORMAL]; if ((panel->g_task.config_background_mask & (1 << TASK_URGENT)) == 0) panel->g_task.background[TASK_URGENT] = panel->g_task.background[TASK_ACTIVE]; if (panel_horizontal) { panel->g_task.area.posy = panel->g_taskbar.area.posy + panel->g_taskbar.background[TASKBAR_NORMAL]->border.width + panel->g_taskbar.area.paddingy; panel->g_task.area.height = panel->area.height - (2 * panel->g_task.area.posy); } else { panel->g_task.area.posx = panel->g_taskbar.area.posx + panel->g_taskbar.background[TASKBAR_NORMAL]->border.width + panel->g_taskbar.area.paddingy; panel->g_task.area.width = panel->area.width - (2 * panel->g_task.area.posx); panel->g_task.area.height = panel->g_task.maximum_height; } for (int j = 0; j < TASK_STATE_COUNT; ++j) { if (!panel->g_task.background[j]) panel->g_task.background[j] = &g_array_index(backgrounds, Background, 0); if (panel->g_task.background[j]->border.radius > panel->g_task.area.height / 2) { printf("task%sbackground_id has a too large rounded value. Please fix your tint2rc\n", j == 0 ? "_" : j == 1 ? "_active_" : j == 2 ? "_iconified_" : "_urgent_"); g_array_append_val(backgrounds, *panel->g_task.background[j]); panel->g_task.background[j] = &g_array_index(backgrounds, Background, backgrounds->len - 1); panel->g_task.background[j]->border.radius = panel->g_task.area.height / 2; } } // compute vertical position : text and icon int height_ink, height, width; get_text_size2(panel->g_task.font_desc, &height_ink, &height, &width, panel->area.height, panel->area.width, "TAjpg", 5, PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_END, FALSE); if (!panel->g_task.maximum_width && panel_horizontal) panel->g_task.maximum_width = server.monitors[panel->monitor].width; panel->g_task.text_posx = panel->g_task.background[0]->border.width + panel->g_task.area.paddingxlr; panel->g_task.text_height = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); if (panel->g_task.has_icon) { panel->g_task.icon_size1 = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); panel->g_task.text_posx += panel->g_task.icon_size1 + panel->g_task.area.paddingx; panel->g_task.icon_posy = (panel->g_task.area.height - panel->g_task.icon_size1) / 2; } // printf("monitor %d, task_maximum_width %d\n", panel->monitor, panel->g_task.maximum_width); Taskbar *taskbar; panel->num_desktops = server.num_desktops; panel->taskbar = calloc(server.num_desktops, sizeof(Taskbar)); for (int j = 0; j < panel->num_desktops; j++) { taskbar = &panel->taskbar[j]; memcpy(&taskbar->area, &panel->g_taskbar.area, sizeof(Area)); taskbar->desktop = j; if (j == server.desktop) taskbar->area.bg = panel->g_taskbar.background[TASKBAR_ACTIVE]; else taskbar->area.bg = panel->g_taskbar.background[TASKBAR_NORMAL]; } init_taskbarname_panel(panel); } void taskbar_init_fonts() { for (int i = 0; i < num_panels; i++) { if (!panels[i].g_task.font_desc) { panels[i].g_task.font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(panels[i].g_task.font_desc, pango_font_description_get_size(panels[i].g_task.font_desc) - PANGO_SCALE); } } } void taskbar_default_font_changed() { if (!taskbar_enabled) return; gboolean needs_update = FALSE; for (int i = 0; i < num_panels; i++) { if (!panels[i].g_task.has_font) { pango_font_description_free(panels[i].g_task.font_desc); panels[i].g_task.font_desc = NULL; needs_update = TRUE; } } if (!needs_update) return; taskbar_init_fonts(); for (int i = 0; i < num_panels; i++) { for (int j = 0; j < panels[i].num_desktops; j++) { Taskbar *taskbar = &panels[i].taskbar[j]; for (GList *c = taskbar->area.children; c; c = c->next) { Task *t = c->data; t->area.resize_needed = TRUE; schedule_redraw(&t->area); } } } panel_refresh = TRUE; } void taskbar_remove_task(Window *win) { remove_task(get_task(*win)); } Task *get_task(Window win) { GPtrArray *task_buttons = get_task_buttons(win); if (task_buttons) return g_ptr_array_index(task_buttons, 0); return NULL; } GPtrArray *get_task_buttons(Window win) { if (win_to_task && taskbar_enabled) return g_hash_table_lookup(win_to_task, &win); return NULL; } void taskbar_refresh_tasklist() { if (!taskbar_enabled) return; // fprintf(stderr, "%s %d:\n", __FUNCTION__, __LINE__); int num_results; Window *win = server_get_property(server.root_win, server.atom._NET_CLIENT_LIST, XA_WINDOW, &num_results); if (!win) return; GList *win_list = g_hash_table_get_keys(win_to_task); for (GList *it = win_list; it; it = it->next) { int i; for (i = 0; i < num_results; i++) if (*((Window *)it->data) == win[i]) break; if (i == num_results) taskbar_remove_task(it->data); } g_list_free(win_list); // Add any new for (int i = 0; i < num_results; i++) if (!get_task(win[i])) add_task(win[i]); XFree(win); } gboolean resize_taskbar(void *obj) { Taskbar *taskbar = (Taskbar *)obj; Panel *panel = (Panel *)taskbar->area.panel; // printf("resize_taskbar %d %d\n", taskbar->area.posx, taskbar->area.posy); if (panel_horizontal) { relayout_with_constraint(&taskbar->area, panel->g_task.maximum_width); int text_width = panel->g_task.maximum_width; GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l != NULL; l = l->next) { if (((Task *)l->data)->area.on_screen) { text_width = ((Task *)l->data)->area.width; break; } } taskbar->text_width = text_width - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingxlr; } else { relayout_with_constraint(&taskbar->area, panel->g_task.maximum_height); taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.area.paddingy) - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingxlr; } return FALSE; } void set_taskbar_state(Taskbar *taskbar, TaskbarState state) { taskbar->area.bg = panels[0].g_taskbar.background[state]; if (taskbarname_enabled) { taskbar->bar_name.area.bg = panels[0].g_taskbar.background_name[state]; } if (taskbar_mode != MULTI_DESKTOP) { if (state == TASKBAR_NORMAL) taskbar->area.on_screen = FALSE; else taskbar->area.on_screen = TRUE; } if (taskbar->area.on_screen) { schedule_redraw(&taskbar->area); if (taskbarname_enabled) { schedule_redraw(&taskbar->bar_name.area); } if (taskbar_mode == MULTI_DESKTOP && panels[0].g_taskbar.background[TASKBAR_NORMAL] != panels[0].g_taskbar.background[TASKBAR_ACTIVE]) { GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l; l = l->next) schedule_redraw((Area *)l->data); } } panel_refresh = TRUE; } void update_taskbar_visibility(void *p) { Panel *panel = (Panel *)p; for (int j = 0; j < panel->num_desktops; j++) { Taskbar *taskbar = &panel->taskbar[j]; if (taskbar_mode != MULTI_DESKTOP && taskbar->desktop != server.desktop) { // SINGLE_DESKTOP and not current desktop taskbar->area.on_screen = FALSE; } else { taskbar->area.on_screen = TRUE; } } panel_refresh = TRUE; } #define NONTRIVIAL 2 gint compare_tasks_trivial(Task *a, Task *b, Taskbar *taskbar) { if (a == b) return 0; if (taskbarname_enabled) { if (a == taskbar->area.children->data) return -1; if (b == taskbar->area.children->data) return 1; } return NONTRIVIAL; } gboolean contained_within(Task *a, Task *b) { if ((a->win_x <= b->win_x) && (a->win_y <= b->win_y) && (a->win_x + a->win_w >= b->win_x + b->win_w) && (a->win_y + a->win_h >= b->win_y + b->win_h)) { return TRUE; } return FALSE; } gint compare_task_centers(Task *a, Task *b, Taskbar *taskbar) { int trivial = compare_tasks_trivial(a, b, taskbar); if (trivial != NONTRIVIAL) return trivial; // If a window has the same coordinates and size as the other, // they are considered to be equal in the comparison. if ((a->win_x == b->win_x) && (a->win_y == b->win_y) && (a->win_w == b->win_w) && (a->win_h == b->win_h)) { return 0; } // If a window is completely contained in another, // then it is considered to come after (to the right/bottom) of the other. if (contained_within(a, b)) return -1; if (contained_within(b, a)) return 1; // Compare centers int a_horiz_c = a->win_x + a->win_w / 2; int b_horiz_c = b->win_x + b->win_w / 2; int a_vert_c = a->win_y + a->win_h / 2; int b_vert_c = b->win_y + b->win_h / 2; if (panel_horizontal) { if (a_horiz_c != b_horiz_c) { return a_horiz_c - b_horiz_c; } return a_vert_c - b_vert_c; } else { if (a_vert_c != b_vert_c) { return a_vert_c - b_vert_c; } return a_horiz_c - b_horiz_c; } } gint compare_task_titles(Task *a, Task *b, Taskbar *taskbar) { int trivial = compare_tasks_trivial(a, b, taskbar); if (trivial != NONTRIVIAL) return trivial; return strnatcasecmp(a->title ? a->title : "", b->title ? b->title : ""); } gint compare_tasks(Task *a, Task *b, Taskbar *taskbar) { int trivial = compare_tasks_trivial(a, b, taskbar); if (trivial != NONTRIVIAL) return trivial; if (taskbar_sort_method == TASKBAR_NOSORT) { return 0; } else if (taskbar_sort_method == TASKBAR_SORT_CENTER) { return compare_task_centers(a, b, taskbar); } else if (taskbar_sort_method == TASKBAR_SORT_TITLE) { return compare_task_titles(a, b, taskbar); } else if (taskbar_sort_method == TASKBAR_SORT_LRU) { return compare_timespecs(&a->last_activation_time, &b->last_activation_time); } else if (taskbar_sort_method == TASKBAR_SORT_MRU) { return -compare_timespecs(&a->last_activation_time, &b->last_activation_time); } return 0; } gboolean taskbar_needs_sort(Taskbar *taskbar) { if (taskbar_sort_method == TASKBAR_NOSORT) return FALSE; for (GList *i = taskbar->area.children, *j = i ? i->next : NULL; i && j; i = i->next, j = j->next) { if (compare_tasks(i->data, j->data, taskbar) > 0) { return TRUE; } } return FALSE; } void sort_tasks(Taskbar *taskbar) { if (!taskbar) return; if (!taskbar_needs_sort(taskbar)) return; taskbar->area.children = g_list_sort_with_data(taskbar->area.children, (GCompareDataFunc)compare_tasks, taskbar); taskbar->area.resize_needed = TRUE; panel_refresh = TRUE; ((Panel *)taskbar->area.panel)->area.resize_needed = TRUE; } void sort_taskbar_for_win(Window win) { if (taskbar_sort_method == TASKBAR_NOSORT) return; GPtrArray *task_buttons = get_task_buttons(win); if (task_buttons) { Task *task0 = g_ptr_array_index(task_buttons, 0); if (task0) { get_window_coordinates(win, &task0->win_x, &task0->win_y, &task0->win_w, &task0->win_h); } for (int i = 0; i < task_buttons->len; ++i) { Task *task = g_ptr_array_index(task_buttons, i); task->win_x = task0->win_x; task->win_y = task0->win_y; task->win_w = task0->win_w; task->win_h = task0->win_h; sort_tasks(task->area.parent); } } } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/taskbar.h000066400000000000000000000047421265276141000244770ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) * * taskbar * **************************************************************************/ #ifndef TASKBAR_H #define TASKBAR_H #include "task.h" #include "taskbarname.h" typedef enum TaskbarState { TASKBAR_NORMAL = 0, TASKBAR_ACTIVE, TASKBAR_STATE_COUNT, } TaskbarState; typedef enum TaskbarSortMethod { TASKBAR_NOSORT = 0, TASKBAR_SORT_CENTER, TASKBAR_SORT_TITLE, TASKBAR_SORT_LRU, TASKBAR_SORT_MRU, } TaskbarSortMethod; typedef struct { Area area; gchar *name; int posy; } TaskbarName; typedef struct { Area area; int desktop; TaskbarName bar_name; int text_width; } Taskbar; typedef struct GlobalTaskbar { Area area; Area area_name; Background *background[TASKBAR_STATE_COUNT]; Background *background_name[TASKBAR_STATE_COUNT]; } GlobalTaskbar; extern gboolean taskbar_enabled; extern gboolean taskbar_distribute_size; extern gboolean hide_inactive_tasks; extern gboolean hide_task_diff_monitor; extern gboolean always_show_all_desktop_tasks; extern TaskbarSortMethod taskbar_sort_method; extern Alignment taskbar_alignment; // win_to_task holds for every Window an array of tasks. Usually the array contains only one // element. However for omnipresent windows (windows which are visible in every taskbar) the array // contains to every Task* on each panel a pointer (i.e. GPtrArray.len == server.num_desktops) extern GHashTable *win_to_task; extern Task *active_task; extern Task *task_drag; void default_taskbar(); void cleanup_taskbar(); void init_taskbar(); void init_taskbar_panel(void *p); gboolean resize_taskbar(void *obj); void taskbar_default_font_changed(); // Reloads the entire list of tasks from the window manager and recreates the task buttons. void taskbar_refresh_tasklist(); // Returns the task button for this window. If there are multiple buttons, returns the first one. Task *get_task(Window win); // Returns the task buttons for this window, usually having only one element. // However for windows shown on all desktops, there are multiple buttons, one for each taskbar. GPtrArray *get_task_buttons(Window win); void set_taskbar_state(Taskbar *taskbar, TaskbarState state); // Updates the visibility of each taskbar when the current desktop changes. void update_taskbar_visibility(void *p); // Sorts the taskbar(s) on which the window is present. void sort_taskbar_for_win(Window win); void sort_tasks(Taskbar *taskbar); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/taskbarname.c000066400000000000000000000133531265276141000253310ustar00rootroot00000000000000/************************************************************************** * * Tint2 : taskbarname * * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include "window.h" #include "panel.h" #include "taskbar.h" #include "server.h" #include "taskbarname.h" gboolean taskbarname_enabled; Color taskbarname_font; Color taskbarname_active_font; void taskbarname_init_fonts(); void default_taskbarname() { taskbarname_enabled = FALSE; } void init_taskbarname_panel(void *p) { if (!taskbarname_enabled) return; Panel *panel = (Panel *)p; taskbarname_init_fonts(); GSList *list = get_desktop_names(); GSList *l = list; for (int j = 0; j < panel->num_desktops; j++) { Taskbar *taskbar = &panel->taskbar[j]; memcpy(&taskbar->bar_name.area, &panel->g_taskbar.area_name, sizeof(Area)); taskbar->bar_name.area.parent = taskbar; taskbar->bar_name.area.has_mouse_over_effect = panel_config.mouse_effects; taskbar->bar_name.area.has_mouse_press_effect = panel_config.mouse_effects; if (j == server.desktop) taskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_ACTIVE]; else taskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_NORMAL]; // use desktop number if name is missing if (l) { taskbar->bar_name.name = g_strdup(l->data); l = l->next; } else { taskbar->bar_name.name = g_strdup_printf("%d", j + 1); } // append the name at the beginning of taskbar taskbar->area.children = g_list_append(taskbar->area.children, &taskbar->bar_name); } for (l = list; l; l = l->next) g_free(l->data); g_slist_free(list); } void taskbarname_init_fonts() { if (!panel_config.taskbarname_font_desc) { panel_config.taskbarname_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_weight(panel_config.taskbarname_font_desc, PANGO_WEIGHT_BOLD); } } void taskbarname_default_font_changed() { if (!taskbar_enabled) return; if (!taskbarname_enabled) return; if (panel_config.taskbarname_has_font) return; pango_font_description_free(panel_config.taskbarname_font_desc); panel_config.taskbarname_font_desc = NULL; taskbarname_init_fonts(); for (int i = 0; i < num_panels; i++) { for (int j = 0; j < panels[i].num_desktops; j++) { Taskbar *taskbar = &panels[i].taskbar[j]; taskbar->bar_name.area.resize_needed = TRUE; schedule_redraw(&taskbar->bar_name.area); } } panel_refresh = TRUE; } void cleanup_taskbarname() { for (int i = 0; i < num_panels; i++) { Panel *panel = &panels[i]; for (int j = 0; j < panel->num_desktops; j++) { Taskbar *taskbar = &panel->taskbar[j]; g_free(taskbar->bar_name.name); taskbar->bar_name.name = NULL; free_area(&taskbar->bar_name.area); remove_area((Area *)&taskbar->bar_name); } } } gboolean resize_taskbarname(void *obj) { TaskbarName *taskbar_name = obj; Panel *panel = taskbar_name->area.panel; int name_height, name_width, name_height_ink; gboolean result = FALSE; schedule_redraw(&taskbar_name->area); get_text_size2(panel_config.taskbarname_font_desc, &name_height_ink, &name_height, &name_width, panel->area.height, panel->area.width, taskbar_name->name, strlen(taskbar_name->name), PANGO_WRAP_WORD_CHAR, PANGO_ELLIPSIZE_NONE, FALSE); if (panel_horizontal) { int new_size = name_width + (2 * (taskbar_name->area.paddingxlr + taskbar_name->area.bg->border.width)); if (new_size != taskbar_name->area.width) { taskbar_name->area.width = new_size; taskbar_name->posy = (taskbar_name->area.height - name_height) / 2; result = TRUE; } } else { int new_size = name_height + (2 * (taskbar_name->area.paddingxlr + taskbar_name->area.bg->border.width)); if (new_size != taskbar_name->area.height) { taskbar_name->area.height = new_size; taskbar_name->posy = (taskbar_name->area.height - name_height) / 2; result = TRUE; } } return result; } void draw_taskbarname(void *obj, cairo_t *c) { TaskbarName *taskbar_name = obj; Taskbar *taskbar = taskbar_name->area.parent; Color *config_text = (taskbar->desktop == server.desktop) ? &taskbarname_active_font : &taskbarname_font; // draw content PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_font_description(layout, panel_config.taskbarname_font_desc); pango_layout_set_width(layout, taskbar_name->area.width * PANGO_SCALE); pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); pango_layout_set_text(layout, taskbar_name->name, strlen(taskbar_name->name)); cairo_set_source_rgba(c, config_text->rgb[0], config_text->rgb[1], config_text->rgb[2], config_text->alpha); pango_cairo_update_layout(c, layout); draw_text(layout, c, 0, taskbar_name->posy, config_text, ((Panel *)taskbar_name->area.panel)->font_shadow); g_object_unref(layout); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/taskbar/taskbarname.h000066400000000000000000000011761265276141000253360ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) **************************************************************************/ #ifndef TASKBARNAME_H #define TASKBARNAME_H #include "common.h" #include "area.h" extern gboolean taskbarname_enabled; extern Color taskbarname_font; extern Color taskbarname_active_font; void default_taskbarname(); void cleanup_taskbarname(); void init_taskbarname_panel(void *p); void draw_taskbarname(void *obj, cairo_t *c); gboolean resize_taskbarname(void *obj); void taskbarname_default_font_changed(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint.c000066400000000000000000001506241265276141000223730ustar00rootroot00000000000000/************************************************************************** * * Tint2 panel * * Copyright (C) 2007 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SN #include #include #endif #include #include "server.h" #include "window.h" #include "config.h" #include "task.h" #include "taskbar.h" #include "systraybar.h" #include "launcher.h" #include "panel.h" #include "tooltip.h" #include "timer.h" #include "xsettings-client.h" #include "uevent.h" #ifdef ENABLE_LIBUNWIND #define UNW_LOCAL_ONLY #include #else #ifdef ENABLE_EXECINFO #include #endif #endif // Drag and Drop state variables Window dnd_source_window; Window dnd_target_window; int dnd_version; Atom dnd_selection; Atom dnd_atom; int dnd_sent_request; char *dnd_launcher_exec; XSettingsClient *xsettings_client = NULL; timeout *detect_compositor_timer = NULL; int detect_compositor_timer_counter = 0; void detect_compositor(void *arg) { if (server.composite_manager) { stop_timeout(detect_compositor_timer); return; } detect_compositor_timer_counter--; if (detect_compositor_timer_counter < 0) { stop_timeout(detect_compositor_timer); return; } // No compositor, check for one if (XGetSelectionOwner(server.display, server.atom._NET_WM_CM_S0) != None) { stop_timeout(detect_compositor_timer); // Restart tint2 fprintf(stderr, "Detected compositor, restarting tint2...\n"); kill(getpid(), SIGUSR1); } } void start_detect_compositor() { // Already have a compositor, nothing to do if (server.composite_manager) return; stop_timeout(detect_compositor_timer); // Check every 0.5 seconds for up to 30 seconds detect_compositor_timer_counter = 60; detect_compositor_timer = add_timeout(500, 500, detect_compositor, 0, &detect_compositor_timer); } void signal_handler(int sig) { // signal handler is light as it should be signal_pending = sig; } void write_string(int fd, const char *s) { int len = strlen(s); while (len > 0) { int count = write(fd, s, len); if (count >= 0) { s += count; len -= count; } else { break; } } } const char *signal_name(int sig) { switch (sig) { case SIGHUP: return "SIGHUP: Hangup (POSIX)."; case SIGINT: return "SIGINT: Interrupt (ANSI)."; case SIGQUIT: return "SIGQUIT: Quit (POSIX)."; case SIGILL: return "SIGILL: Illegal instruction (ANSI)."; case SIGTRAP: return "SIGTRAP: Trace trap (POSIX)."; case SIGABRT: return "SIGABRT/SIGIOT: Abort (ANSI) / IOT trap (4.2 BSD)."; case SIGBUS: return "SIGBUS: BUS error (4.2 BSD)."; case SIGFPE: return "SIGFPE: Floating-point exception (ANSI)."; case SIGKILL: return "SIGKILL: Kill, unblockable (POSIX)."; case SIGUSR1: return "SIGUSR1: User-defined signal 1 (POSIX)."; case SIGSEGV: return "SIGSEGV: Segmentation violation (ANSI)."; case SIGUSR2: return "SIGUSR2: User-defined signal 2 (POSIX)."; case SIGPIPE: return "SIGPIPE: Broken pipe (POSIX)."; case SIGALRM: return "SIGALRM: Alarm clock (POSIX)."; case SIGTERM: return "SIGTERM: Termination (ANSI)."; //case SIGSTKFLT: return "SIGSTKFLT: Stack fault."; case SIGCHLD: return "SIGCHLD: Child status has changed (POSIX)."; case SIGCONT: return "SIGCONT: Continue (POSIX)."; case SIGSTOP: return "SIGSTOP: Stop, unblockable (POSIX)."; case SIGTSTP: return "SIGTSTP: Keyboard stop (POSIX)."; case SIGTTIN: return "SIGTTIN: Background read from tty (POSIX)."; case SIGTTOU: return "SIGTTOU: Background write to tty (POSIX)."; case SIGURG: return "SIGURG: Urgent condition on socket (4.2 BSD)."; case SIGXCPU: return "SIGXCPU: CPU limit exceeded (4.2 BSD)."; case SIGXFSZ: return "SIGXFSZ: File size limit exceeded (4.2 BSD)."; case SIGVTALRM: return "SIGVTALRM: Virtual alarm clock (4.2 BSD)."; case SIGPROF: return "SIGPROF: Profiling alarm clock (4.2 BSD)."; case SIGWINCH: return "SIGWINCH: Window size change (4.3 BSD, Sun)."; case SIGIO: return "SIGIO: Pollable event occurred (System V) / I/O now possible (4.2 BSD)."; //case SIGPWR: return "SIGPWR: Power failure restart (System V)."; case SIGSYS: return "SIGSYS: Bad system call."; } static char s[64]; sprintf(s, "SIG=%d: Unknown", sig); return s; } void log_string(int fd, const char *s) { write_string(2, s); write_string(fd, s); } const char *get_home_dir() { const char *s = getenv("HOME"); if (s) return s; struct passwd *pw = getpwuid(getuid()); if (!pw) return NULL; return pw->pw_dir; } void dump_backtrace(int log_fd) { log_string(log_fd, "\n" YELLOW "Backtrace:" RESET "\n"); #ifdef ENABLE_LIBUNWIND unw_cursor_t cursor; unw_context_t context; unw_getcontext(&context); unw_init_local(&cursor, &context); while (unw_step(&cursor) > 0) { unw_word_t offset; char fname[128]; fname[0] = '\0'; (void) unw_get_proc_name(&cursor, fname, sizeof(fname), &offset); log_string(log_fd, fname); log_string(log_fd, "\n"); } #else #ifdef ENABLE_EXECINFO #define MAX_TRACE_SIZE 128 void *array[MAX_TRACE_SIZE]; size_t size = backtrace(array, MAX_TRACE_SIZE); char **strings = backtrace_symbols(array, size); for (size_t i = 0; i < size; i++) { log_string(log_fd, strings[i]); log_string(log_fd, "\n"); } free(strings); #else #ifdef DISABLE_BACKTRACE log_string(log_fd, "Backtrace support disabled at compile time.\n"); #endif #endif #endif } // sleep() returns early when signals arrive. This function does not. void safe_sleep(int seconds) { double t0 = get_time(); while (1) { double t = get_time(); if (t > t0 + seconds) return; sleep(1); } } void handle_crash(const char *reason) { // We are going to crash, so restart the panel char path[4096]; sprintf(path, "%s/.tint2-crash.log", get_home_dir()); int log_fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0600); log_string(log_fd, RED "tint2 crashed, reason: "); log_string(log_fd, reason); log_string(log_fd, RESET "\n"); dump_backtrace(log_fd); log_string(log_fd, RED "Please create a bug report with this log output." RESET "\n"); close(log_fd); } #ifdef BACKTRACE_ON_SIGNAL void crash_handler(int sig) { handle_crash(signal_name(sig)); struct sigaction sa = {.sa_handler = SIG_DFL}; sigaction(sig, &sa, 0); raise(sig); } #endif void x11_io_error(Display *display) { handle_crash("X11 I/O error"); } void init(int argc, char *argv[]) { // Make stdout/stderr flush after a newline (for some reason they don't even if tint2 is started from a terminal) setlinebuf(stdout); setlinebuf(stderr); // set global data default_config(); default_timeout(); default_systray(); memset(&server, 0, sizeof(server)); #ifdef ENABLE_BATTERY default_battery(); #endif default_clock(); default_launcher(); default_taskbar(); default_tooltip(); default_execp(); default_panel(); // Read command line arguments for (int i = 1; i < argc; ++i) { int error = 0; if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { printf("Usage: tint2 [[-c] ]\n"); exit(0); } else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { printf("tint2 version %s\n", VERSION_STRING); exit(0); } else if (strcmp(argv[i], "-c") == 0) { if (i + 1 < argc) { i++; config_path = strdup(argv[i]); } else { error = 1; } } else if (strcmp(argv[i], "-s") == 0) { if (i + 1 < argc) { i++; snapshot_path = strdup(argv[i]); } else { error = 1; } } else if (i + 1 == argc) { config_path = strdup(argv[i]); } else { error = 1; } if (error) { printf("Usage: tint2 [[-c] ]\n"); exit(1); } } // Set signal handlers signal_pending = 0; struct sigaction sa_chld = {.sa_handler = SIG_DFL, .sa_flags = SA_NOCLDWAIT | SA_RESTART}; sigaction(SIGCHLD, &sa_chld, 0); struct sigaction sa = {.sa_handler = signal_handler, .sa_flags = SA_RESTART}; sigaction(SIGUSR1, &sa, 0); sigaction(SIGINT, &sa, 0); sigaction(SIGTERM, &sa, 0); sigaction(SIGHUP, &sa, 0); #ifdef BACKTRACE_ON_SIGNAL struct sigaction sa_crash = {.sa_handler = crash_handler}; sigaction(SIGSEGV, &sa_crash, 0); sigaction(SIGFPE, &sa_crash, 0); sigaction(SIGPIPE, &sa_crash, 0); sigaction(SIGBUS, &sa_crash, 0); sigaction(SIGABRT, &sa_crash, 0); sigaction(SIGSYS, &sa_crash, 0); #endif } static int sn_pipe_valid = 0; static int sn_pipe[2]; #ifdef HAVE_SN static int error_trap_depth = 0; static void error_trap_push(SnDisplay *display, Display *xdisplay) { ++error_trap_depth; } static void error_trap_pop(SnDisplay *display, Display *xdisplay) { if (error_trap_depth == 0) { fprintf(stderr, "Error trap underflow!\n"); return; } XSync(xdisplay, False); /* get all errors out of the queue */ --error_trap_depth; } static void sigchld_handler(int sig) { if (!startup_notifications) return; if (!sn_pipe_valid) return; ssize_t wur = write(sn_pipe[1], "x", 1); (void)wur; fsync(sn_pipe[1]); } static void sigchld_handler_async() { if (!startup_notifications) return; // Wait for all dead processes pid_t pid; while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) { SnLauncherContext *ctx; ctx = (SnLauncherContext *)g_tree_lookup(server.pids, GINT_TO_POINTER(pid)); if (ctx) { g_tree_remove(server.pids, GINT_TO_POINTER(pid)); sn_launcher_context_complete(ctx); sn_launcher_context_unref(ctx); } } } static gint cmp_ptr(gconstpointer a, gconstpointer b) { if (a < b) return -1; else if (a == b) return 0; else return 1; } #else static void sigchld_handler_async() { } #endif // HAVE_SN void init_X11_pre_config() { server.display = XOpenDisplay(NULL); if (!server.display) { fprintf(stderr, "tint2: could not open display.\n"); exit(1); } XSetErrorHandler((XErrorHandler)server_catch_error); XSetIOErrorHandler((XIOErrorHandler)x11_io_error); server_init_atoms(); server.screen = DefaultScreen(server.display); server.root_win = RootWindow(server.display, server.screen); server.desktop = get_current_desktop(); setlocale(LC_ALL, ""); // config file use '.' as decimal separator setlocale(LC_NUMERIC, "POSIX"); /* Catch events */ XSelectInput(server.display, server.root_win, PropertyChangeMask | StructureNotifyMask); // get monitor and desktop config get_monitors(); get_desktops(); server.disable_transparency = 0; xsettings_client = xsettings_client_new(server.display, server.screen, xsettings_notify_cb, NULL, NULL); } void init_X11_post_config() { server_init_visual(); #ifdef HAVE_SN // Initialize startup-notification if (startup_notifications) { server.sn_display = sn_display_new(server.display, error_trap_push, error_trap_pop); server.pids = g_tree_new(cmp_ptr); // Setup a handler for child termination if (pipe(sn_pipe) != 0) { fprintf(stderr, "Creating pipe failed.\n"); } else { fcntl(sn_pipe[0], F_SETFL, O_NONBLOCK | fcntl(sn_pipe[0], F_GETFL)); fcntl(sn_pipe[1], F_SETFL, O_NONBLOCK | fcntl(sn_pipe[1], F_GETFL)); sn_pipe_valid = 1; struct sigaction act = {.sa_handler = sigchld_handler, .sa_flags = SA_NOCLDWAIT | SA_RESTART}; if (sigaction(SIGCHLD, &act, 0)) { perror("sigaction"); } } } #endif // HAVE_SN imlib_context_set_display(server.display); imlib_context_set_visual(server.visual); imlib_context_set_colormap(server.colormap); // load default icon const gchar *const *data_dirs = g_get_system_data_dirs(); for (int i = 0; data_dirs[i] != NULL; i++) { gchar *path = g_build_filename(data_dirs[i], "tint2", "default_icon.png", NULL); if (g_file_test(path, G_FILE_TEST_EXISTS)) default_icon = imlib_load_image(path); g_free(path); } } void cleanup() { cleanup_execp(); cleanup_systray(); cleanup_tooltip(); cleanup_clock(); cleanup_launcher(); #ifdef ENABLE_BATTERY cleanup_battery(); #endif cleanup_panel(); cleanup_config(); if (default_icon) { imlib_context_set_image(default_icon); imlib_free_image(); default_icon = NULL; } imlib_context_disconnect_display(); xsettings_client_destroy(xsettings_client); xsettings_client = NULL; cleanup_server(); cleanup_timeout(); if (server.display) XCloseDisplay(server.display); server.display = NULL; #ifdef HAVE_SN if (startup_notifications) { if (sn_pipe_valid) { sn_pipe_valid = 0; close(sn_pipe[1]); close(sn_pipe[0]); } } #endif uevent_cleanup(); } void get_snapshot(const char *path) { Panel *panel = &panels[0]; if (panel->area.width > server.monitors[0].width) panel->area.width = server.monitors[0].width; panel->temp_pmap = XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth); render_panel(panel); Imlib_Image img = NULL; imlib_context_set_drawable(panel->temp_pmap); img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 0); imlib_context_set_image(img); if (!panel_horizontal) { // rotate 90° vertical panel imlib_image_flip_horizontal(); imlib_image_flip_diagonal(); } imlib_save_image(path); imlib_free_image(); } void window_action(Task *task, MouseAction action) { if (!task) return; switch (action) { case NONE: break; case CLOSE: close_window(task->win); break; case TOGGLE: activate_window(task->win); break; case ICONIFY: XIconifyWindow(server.display, task->win, server.screen); break; case TOGGLE_ICONIFY: if (active_task && task->win == active_task->win) XIconifyWindow(server.display, task->win, server.screen); else activate_window(task->win); break; case SHADE: toggle_window_shade(task->win); break; case MAXIMIZE_RESTORE: toggle_window_maximized(task->win); break; case MAXIMIZE: toggle_window_maximized(task->win); break; case RESTORE: toggle_window_maximized(task->win); break; case DESKTOP_LEFT: { if (task->desktop == 0) break; int desktop = task->desktop - 1; change_window_desktop(task->win, desktop); if (desktop == server.desktop) activate_window(task->win); break; } case DESKTOP_RIGHT: { if (task->desktop == server.num_desktops) break; int desktop = task->desktop + 1; change_window_desktop(task->win, desktop); if (desktop == server.desktop) activate_window(task->win); break; } case NEXT_TASK: { Task *task1 = next_task(find_active_task(task)); activate_window(task1->win); } break; case PREV_TASK: { Task *task1 = prev_task(find_active_task(task)); activate_window(task1->win); } } } int tint2_handles_click(Panel *panel, XButtonEvent *e) { Task *task = click_task(panel, e->x, e->y); if (task) { if ((e->button == 1 && mouse_left != 0) || (e->button == 2 && mouse_middle != 0) || (e->button == 3 && mouse_right != 0) || (e->button == 4 && mouse_scroll_up != 0) || (e->button == 5 && mouse_scroll_down != 0)) { return 1; } else return 0; } LauncherIcon *icon = click_launcher_icon(panel, e->x, e->y); if (icon) { if (e->button == 1) { return 1; } else { return 0; } } // no launcher/task clicked --> check if taskbar clicked Taskbar *taskbar = click_taskbar(panel, e->x, e->y); if (taskbar && e->button == 1 && taskbar_mode == MULTI_DESKTOP) return 1; if (click_clock(panel, e->x, e->y)) { if ((e->button == 1 && clock_lclick_command) || (e->button == 2 && clock_mclick_command) || (e->button == 3 && clock_rclick_command) || (e->button == 4 && clock_uwheel_command) || (e->button == 5 && clock_dwheel_command)) return 1; else return 0; } #ifdef ENABLE_BATTERY if (click_battery(panel, e->x, e->y)) { if ((e->button == 1 && battery_lclick_command) || (e->button == 2 && battery_mclick_command) || (e->button == 3 && battery_rclick_command) || (e->button == 4 && battery_uwheel_command) || (e->button == 5 && battery_dwheel_command)) return 1; else return 0; } #endif if (click_execp(panel, e->x, e->y)) return 1; return 0; } void forward_click(XEvent *e) { // forward the click to the desktop window (thanks conky) XUngrabPointer(server.display, e->xbutton.time); e->xbutton.window = server.root_win; // icewm doesn't open under the mouse. // and xfce doesn't open at all. e->xbutton.x = e->xbutton.x_root; e->xbutton.y = e->xbutton.y_root; // printf("**** %d, %d\n", e->xbutton.x, e->xbutton.y); // XSetInputFocus(server.display, e->xbutton.window, RevertToParent, e->xbutton.time); XSendEvent(server.display, e->xbutton.window, False, ButtonPressMask, e); } void event_button_press(XEvent *e) { Panel *panel = get_panel(e->xany.window); if (!panel) return; if (wm_menu && !tint2_handles_click(panel, &e->xbutton)) { forward_click(e); return; } task_drag = click_task(panel, e->xbutton.x, e->xbutton.y); if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); } void event_button_motion_notify(XEvent *e) { Panel *panel = get_panel(e->xany.window); if (!panel || !task_drag) return; // Find the taskbar on the event's location Taskbar *event_taskbar = click_taskbar(panel, e->xbutton.x, e->xbutton.y); if (event_taskbar == NULL) return; // Find the task on the event's location Task *event_task = click_task(panel, e->xbutton.x, e->xbutton.y); // If the event takes place on the same taskbar as the task being dragged if (&event_taskbar->area == task_drag->area.parent) { if (taskbar_sort_method != TASKBAR_NOSORT) { sort_tasks(event_taskbar); } else { // Swap the task_drag with the task on the event's location (if they differ) if (event_task && event_task != task_drag) { GList *drag_iter = g_list_find(event_taskbar->area.children, task_drag); GList *task_iter = g_list_find(event_taskbar->area.children, event_task); if (drag_iter && task_iter) { gpointer temp = task_iter->data; task_iter->data = drag_iter->data; drag_iter->data = temp; event_taskbar->area.resize_needed = 1; panel_refresh = TRUE; task_dragged = 1; } } } } else { // The event is on another taskbar than the task being dragged if (task_drag->desktop == ALL_DESKTOPS || taskbar_mode != MULTI_DESKTOP) return; Taskbar *drag_taskbar = (Taskbar *)task_drag->area.parent; remove_area((Area *)task_drag); if (event_taskbar->area.posx > drag_taskbar->area.posx || event_taskbar->area.posy > drag_taskbar->area.posy) { int i = (taskbarname_enabled) ? 1 : 0; event_taskbar->area.children = g_list_insert(event_taskbar->area.children, task_drag, i); } else event_taskbar->area.children = g_list_append(event_taskbar->area.children, task_drag); // Move task to other desktop (but avoid the 'Window desktop changed' code in 'event_property_notify') task_drag->area.parent = &event_taskbar->area; task_drag->desktop = event_taskbar->desktop; change_window_desktop(task_drag->win, event_taskbar->desktop); if (taskbar_sort_method != TASKBAR_NOSORT) { sort_tasks(event_taskbar); } event_taskbar->area.resize_needed = 1; drag_taskbar->area.resize_needed = 1; task_dragged = 1; panel_refresh = TRUE; panel->area.resize_needed = 1; } } void event_button_release(XEvent *e) { Panel *panel = get_panel(e->xany.window); if (!panel) return; if (wm_menu && !tint2_handles_click(panel, &e->xbutton)) { forward_click(e); if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); task_drag = 0; return; } int action = TOGGLE_ICONIFY; switch (e->xbutton.button) { case 1: action = mouse_left; break; case 2: action = mouse_middle; break; case 3: action = mouse_right; break; case 4: action = mouse_scroll_up; break; case 5: action = mouse_scroll_down; break; case 6: action = mouse_tilt_left; break; case 7: action = mouse_tilt_right; break; } if (click_clock(panel, e->xbutton.x, e->xbutton.y)) { clock_action(e->xbutton.button); if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); task_drag = 0; return; } #ifdef ENABLE_BATTERY if (click_battery(panel, e->xbutton.x, e->xbutton.y)) { battery_action(e->xbutton.button); if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); task_drag = 0; return; } #endif Execp *execp = click_execp(panel, e->xbutton.x, e->xbutton.y); if (execp) { execp_action(execp, e->xbutton.button, e->xbutton.x - execp->area.posx, e->xbutton.y - execp->area.posy); if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); task_drag = 0; return; } if (e->xbutton.button == 1 && click_launcher(panel, e->xbutton.x, e->xbutton.y)) { LauncherIcon *icon = click_launcher_icon(panel, e->xbutton.x, e->xbutton.y); if (icon) { launcher_action(icon, e); } task_drag = 0; return; } Taskbar *taskbar; if (!(taskbar = click_taskbar(panel, e->xbutton.x, e->xbutton.y))) { // TODO: check better solution to keep window below if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); task_drag = 0; return; } // drag and drop task if (task_dragged) { task_drag = 0; task_dragged = 0; return; } // switch desktop if (taskbar_mode == MULTI_DESKTOP) { gboolean diff_desktop = FALSE; if (taskbar->desktop != server.desktop && action != CLOSE && action != DESKTOP_LEFT && action != DESKTOP_RIGHT) { diff_desktop = TRUE; change_desktop(taskbar->desktop); } Task *task = click_task(panel, e->xbutton.x, e->xbutton.y); if (task) { if (diff_desktop) { if (action == TOGGLE_ICONIFY) { if (!window_is_active(task->win)) activate_window(task->win); } else { window_action(task, action); } } else { window_action(task, action); } } } else { window_action(click_task(panel, e->xbutton.x, e->xbutton.y), action); } // to keep window below if (panel_layer == BOTTOM_LAYER) XLowerWindow(server.display, panel->main_win); } void update_desktop_names() { if (!taskbarname_enabled) return; GSList *list = get_desktop_names(); for (int i = 0; i < num_panels; i++) { int j; GSList *l; for (j = 0, l = list; j < panels[i].num_desktops; j++) { gchar *name; if (l) { name = g_strdup(l->data); l = l->next; } else { name = g_strdup_printf("%d", j + 1); } Taskbar *taskbar = &panels[i].taskbar[j]; if (strcmp(name, taskbar->bar_name.name) != 0) { g_free(taskbar->bar_name.name); taskbar->bar_name.name = name; taskbar->bar_name.area.resize_needed = 1; } else { g_free(name); } } } for (GSList *l = list; l; l = l->next) g_free(l->data); g_slist_free(list); panel_refresh = TRUE; } void update_task_desktop(Task *task) { // fprintf(stderr, "%s %d:\n", __FUNCTION__, __LINE__); Window win = task->win; remove_task(task); task = add_task(win); reset_active_task(); panel_refresh = TRUE; } void event_property_notify(XEvent *e) { gboolean debug = FALSE; Window win = e->xproperty.window; Atom at = e->xproperty.atom; if (xsettings_client) xsettings_client_process_event(xsettings_client, e); if (win == server.root_win) { if (!server.got_root_win) { XSelectInput(server.display, server.root_win, PropertyChangeMask | StructureNotifyMask); server.got_root_win = TRUE; } // Change name of desktops else if (at == server.atom._NET_DESKTOP_NAMES) { if (debug) fprintf(stderr, "%s %d: win = root, atom = _NET_DESKTOP_NAMES\n", __FUNCTION__, __LINE__); update_desktop_names(); } // Change desktops else if (at == server.atom._NET_NUMBER_OF_DESKTOPS || at == server.atom._NET_DESKTOP_GEOMETRY || at == server.atom._NET_DESKTOP_VIEWPORT || at == server.atom._NET_WORKAREA || at == server.atom._NET_CURRENT_DESKTOP) { if (debug) fprintf(stderr, "%s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__); if (!taskbar_enabled) return; int old_num_desktops = server.num_desktops; int old_desktop = server.desktop; server_get_number_of_desktops(); server.desktop = get_current_desktop(); if (old_num_desktops != server.num_desktops) { if (server.num_desktops <= server.desktop) { server.desktop = server.num_desktops - 1; } cleanup_taskbar(); init_taskbar(); for (int i = 0; i < num_panels; i++) { init_taskbar_panel(&panels[i]); set_panel_items_order(&panels[i]); update_taskbar_visibility(&panels[i]); panels[i].area.resize_needed = 1; } taskbar_refresh_tasklist(); reset_active_task(); panel_refresh = TRUE; } else if (old_desktop != server.desktop) { for (int i = 0; i < num_panels; i++) { Panel *panel = &panels[i]; set_taskbar_state(&panel->taskbar[old_desktop], TASKBAR_NORMAL); set_taskbar_state(&panel->taskbar[server.desktop], TASKBAR_ACTIVE); // check ALL_DESKTOPS task => resize taskbar Taskbar *taskbar; if (server.num_desktops > old_desktop) { taskbar = &panel->taskbar[old_desktop]; GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l; l = l->next) { Task *task = l->data; if (task->desktop == ALL_DESKTOPS) { task->area.on_screen = always_show_all_desktop_tasks; taskbar->area.resize_needed = 1; panel_refresh = TRUE; if (taskbar_mode == MULTI_DESKTOP) panel->area.resize_needed = 1; } } } taskbar = &panel->taskbar[server.desktop]; GList *l = taskbar->area.children; if (taskbarname_enabled) l = l->next; for (; l; l = l->next) { Task *task = l->data; if (task->desktop == ALL_DESKTOPS) { task->area.on_screen = TRUE; taskbar->area.resize_needed = 1; if (taskbar_mode == MULTI_DESKTOP) panel->area.resize_needed = 1; } } if (server.viewports) { GList *need_update = NULL; GHashTableIter iter; gpointer key, value; g_hash_table_iter_init(&iter, win_to_task); while (g_hash_table_iter_next(&iter, &key, &value)) { Window task_win = *(Window *)key; Task *task = get_task(task_win); if (task) { int desktop = get_window_desktop(task_win); if (desktop != task->desktop) { need_update = g_list_append(need_update, task); } } } for (l = need_update; l; l = l->next) { Task *task = l->data; update_task_desktop(task); } } } } } // Window list else if (at == server.atom._NET_CLIENT_LIST) { if (debug) fprintf(stderr, "%s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__); taskbar_refresh_tasklist(); panel_refresh = TRUE; } // Change active else if (at == server.atom._NET_ACTIVE_WINDOW) { if (debug) fprintf(stderr, "%s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __FUNCTION__, __LINE__); reset_active_task(); panel_refresh = TRUE; } else if (at == server.atom._XROOTPMAP_ID || at == server.atom._XROOTMAP_ID) { if (debug) fprintf(stderr, "%s %d: win = root, atom = _XROOTPMAP_ID\n", __FUNCTION__, __LINE__); // change Wallpaper for (int i = 0; i < num_panels; i++) { set_panel_background(&panels[i]); } panel_refresh = TRUE; } } else { TrayWindow *traywin = systray_find_icon(win); if (traywin) { systray_property_notify(traywin, e); return; } Task *task = get_task(win); if (debug) { char *atom_name = XGetAtomName(server.display, at); fprintf(stderr, "%s %d: win = %ld, task = %s, atom = %s\n", __FUNCTION__, __LINE__, win, task ? (task->title ? task->title : "??") : "null", atom_name); XFree(atom_name); } if (!task) { if (debug) fprintf(stderr, "%s %d\n", __FUNCTION__, __LINE__); if (at == server.atom._NET_WM_STATE) { // xfce4 sends _NET_WM_STATE after minimized to tray, so we need to check if window is mapped // if it is mapped and not set as skip_taskbar, we must add it to our task list XWindowAttributes wa; XGetWindowAttributes(server.display, win, &wa); if (wa.map_state == IsViewable && !window_is_skip_taskbar(win)) { if ((task = add_task(win))) panel_refresh = TRUE; } } return; } // printf("atom root_win = %s, %s\n", XGetAtomName(server.display, at), task->title); // Window title changed if (at == server.atom._NET_WM_VISIBLE_NAME || at == server.atom._NET_WM_NAME || at == server.atom.WM_NAME) { if (task_update_title(task)) { if (g_tooltip.mapped && (g_tooltip.area == (Area *)task)) { tooltip_copy_text((Area *)task); tooltip_update(); } if (taskbar_sort_method == TASKBAR_SORT_TITLE) sort_taskbar_for_win(win); panel_refresh = TRUE; } } // Demand attention else if (at == server.atom._NET_WM_STATE) { if (debug) { int count; Atom *atom_state = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count); for (int j = 0; j < count; j++) { char *atom_state_name = XGetAtomName(server.display, atom_state[j]); fprintf(stderr, "%s %d: _NET_WM_STATE = %s\n", __FUNCTION__, __LINE__, atom_state_name); XFree(atom_state_name); } XFree(atom_state); } if (window_is_urgent(win)) { add_urgent(task); } if (window_is_skip_taskbar(win)) { remove_task(task); panel_refresh = TRUE; } } else if (at == server.atom.WM_STATE) { // Iconic state TaskState state = (active_task && task->win == active_task->win ? TASK_ACTIVE : TASK_NORMAL); if (window_is_iconified(win)) state = TASK_ICONIFIED; set_task_state(task, state); panel_refresh = TRUE; } // Window icon changed else if (at == server.atom._NET_WM_ICON) { task_update_icon(task); panel_refresh = TRUE; } // Window desktop changed else if (at == server.atom._NET_WM_DESKTOP) { int desktop = get_window_desktop(win); // printf(" Window desktop changed %d, %d\n", task->desktop, desktop); // bug in windowmaker : send unecessary 'desktop changed' when focus changed if (desktop != task->desktop) { update_task_desktop(task); } } else if (at == server.atom.WM_HINTS) { XWMHints *wmhints = XGetWMHints(server.display, win); if (wmhints && wmhints->flags & XUrgencyHint) { add_urgent(task); } XFree(wmhints); } if (!server.got_root_win) server.root_win = RootWindow(server.display, server.screen); } } void event_expose(XEvent *e) { Panel *panel; panel = get_panel(e->xany.window); if (!panel) return; // TODO : one panel_refresh per panel ? panel_refresh = TRUE; } void event_configure_notify(XEvent *e) { Window win = e->xconfigure.window; if (0) { Task *task = get_task(win); fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task ? (task->title ? task->title : "??") : "null"); } // change in root window (xrandr) if (win == server.root_win) { fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window" RESET "\n", __FILE__, __LINE__); signal_pending = SIGUSR1; return; } TrayWindow *traywin = systray_find_icon(win); if (traywin) { systray_reconfigure_event(traywin, e); return; } // 'win' move in another monitor if (num_panels > 1 || hide_task_diff_monitor) { Task *task = get_task(win); if (task) { Panel *p = task->area.panel; int monitor = get_window_monitor(win); if ((hide_task_diff_monitor && p->monitor != monitor && task->area.on_screen) || (hide_task_diff_monitor && p->monitor == monitor && !task->area.on_screen) || (p->monitor != monitor && num_panels > 1)) { remove_task(task); task = add_task(win); if (win == get_active_window()) { set_task_state(task, TASK_ACTIVE); active_task = task; } panel_refresh = TRUE; } } } if (server.viewports) { Task *task = get_task(win); if (task) { int desktop = get_window_desktop(win); if (task->desktop != desktop) { update_task_desktop(task); } } } sort_taskbar_for_win(win); } const char *GetAtomName(Display *disp, Atom a) { if (a == None) return "None"; else return XGetAtomName(disp, a); } typedef struct Property { unsigned char *data; int format, nitems; Atom type; } Property; // This fetches all the data from a property struct Property read_property(Display *disp, Window w, Atom property) { Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *ret = 0; int read_bytes = 1024; // Keep trying to read the property until there are no // bytes unread. do { if (ret != 0) XFree(ret); XGetWindowProperty(disp, w, property, 0, read_bytes, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &ret); read_bytes *= 2; } while (bytes_after != 0); fprintf(stderr, "DnD %s:%d: Property:\n", __FILE__, __LINE__); fprintf(stderr, "DnD %s:%d: Actual type: %s\n", __FILE__, __LINE__, GetAtomName(disp, actual_type)); fprintf(stderr, "DnD %s:%d: Actual format: %d\n", __FILE__, __LINE__, actual_format); fprintf(stderr, "DnD %s:%d: Number of items: %lu\n", __FILE__, __LINE__, nitems); Property p; p.data = ret; p.format = actual_format; p.nitems = nitems; p.type = actual_type; return p; } // This function takes a list of targets which can be converted to (atom_list, nitems) // and a list of acceptable targets with prioritees (datatypes). It returns the highest // entry in datatypes which is also in atom_list: ie it finds the best match. Atom pick_target_from_list(Display *disp, Atom *atom_list, int nitems) { Atom to_be_requested = None; int i; for (i = 0; i < nitems; i++) { const char *atom_name = GetAtomName(disp, atom_list[i]); fprintf(stderr, "DnD %s:%d: Type %d = %s\n", __FILE__, __LINE__, i, atom_name); // See if this data type is allowed and of higher priority (closer to zero) // than the present one. if (strcmp(atom_name, "STRING") == 0) { to_be_requested = atom_list[i]; } } return to_be_requested; } // Finds the best target given up to three atoms provided (any can be None). // Useful for part of the Xdnd protocol. Atom pick_target_from_atoms(Display *disp, Atom t1, Atom t2, Atom t3) { Atom atoms[3]; int n = 0; if (t1 != None) atoms[n++] = t1; if (t2 != None) atoms[n++] = t2; if (t3 != None) atoms[n++] = t3; return pick_target_from_list(disp, atoms, n); } // Finds the best target given a local copy of a property. Atom pick_target_from_targets(Display *disp, Property p) { // The list of targets is a list of atoms, so it should have type XA_ATOM // but it may have the type TARGETS instead. if ((p.type != XA_ATOM && p.type != server.atom.TARGETS) || p.format != 32) { // This would be really broken. Targets have to be an atom list // and applications should support this. Nevertheless, some // seem broken (MATLAB 7, for instance), so ask for STRING // next instead as the lowest common denominator return XA_STRING; } else { Atom *atom_list = (Atom *)p.data; return pick_target_from_list(disp, atom_list, p.nitems); } } void dnd_enter(XClientMessageEvent *e) { dnd_atom = None; int more_than_3 = e->data.l[1] & 1; dnd_source_window = e->data.l[0]; dnd_version = (e->data.l[1] >> 24); fprintf(stderr, "DnD %s:%d: DnDEnter\n", __FILE__, __LINE__); fprintf(stderr, "DnD %s:%d: DnDEnter. Supports > 3 types = %s\n", __FILE__, __LINE__, more_than_3 ? "yes" : "no"); fprintf(stderr, "DnD %s:%d: Protocol version = %d\n", __FILE__, __LINE__, dnd_version); fprintf(stderr, "DnD %s:%d: Type 1 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[2])); fprintf(stderr, "DnD %s:%d: Type 2 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[3])); fprintf(stderr, "DnD %s:%d: Type 3 = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e->data.l[4])); // Query which conversions are available and pick the best if (more_than_3) { // Fetch the list of possible conversions // Notice the similarity to TARGETS with paste. Property p = read_property(server.display, dnd_source_window, server.atom.XdndTypeList); dnd_atom = pick_target_from_targets(server.display, p); XFree(p.data); } else { // Use the available list dnd_atom = pick_target_from_atoms(server.display, e->data.l[2], e->data.l[3], e->data.l[4]); } fprintf(stderr, "DnD %s:%d: Requested type = %s\n", __FILE__, __LINE__, GetAtomName(server.display, dnd_atom)); } void dnd_position(XClientMessageEvent *e) { dnd_target_window = e->window; int accept = 0; Panel *panel = get_panel(e->window); int x, y, mapX, mapY; Window child; x = (e->data.l[2] >> 16) & 0xFFFF; y = e->data.l[2] & 0xFFFF; XTranslateCoordinates(server.display, server.root_win, e->window, x, y, &mapX, &mapY, &child); Task *task = click_task(panel, mapX, mapY); if (task) { if (task->desktop != server.desktop) change_desktop(task->desktop); window_action(task, TOGGLE); } else { LauncherIcon *icon = click_launcher_icon(panel, mapX, mapY); if (icon) { accept = 1; dnd_launcher_exec = icon->cmd; } else { dnd_launcher_exec = 0; } } // send XdndStatus event to get more XdndPosition events XClientMessageEvent se; se.type = ClientMessage; se.window = e->data.l[0]; se.message_type = server.atom.XdndStatus; se.format = 32; se.data.l[0] = e->window; // XID of the target window se.data.l[1] = accept ? 1 : 0; // bit 0: accept drop bit 1: send XdndPosition events if inside rectangle se.data.l[2] = 0; // Rectangle x,y for which no more XdndPosition events se.data.l[3] = (1 << 16) | 1; // Rectangle w,h for which no more XdndPosition events if (accept) { se.data.l[4] = dnd_version >= 2 ? e->data.l[4] : server.atom.XdndActionCopy; } else { se.data.l[4] = None; // None = drop will not be accepted } XSendEvent(server.display, e->data.l[0], False, NoEventMask, (XEvent *)&se); } void dnd_drop(XClientMessageEvent *e) { if (dnd_target_window && dnd_launcher_exec) { if (dnd_version >= 1) { XConvertSelection(server.display, server.atom.XdndSelection, XA_STRING, dnd_selection, dnd_target_window, e->data.l[2]); } else { XConvertSelection(server.display, server.atom.XdndSelection, XA_STRING, dnd_selection, dnd_target_window, CurrentTime); } } else { // The source is sending anyway, despite instructions to the contrary. // So reply that we're not interested. XClientMessageEvent m; memset(&m, 0, sizeof(m)); m.type = ClientMessage; m.display = e->display; m.window = e->data.l[0]; m.message_type = server.atom.XdndFinished; m.format = 32; m.data.l[0] = dnd_target_window; m.data.l[1] = 0; m.data.l[2] = None; // Failed. XSendEvent(server.display, e->data.l[0], False, NoEventMask, (XEvent *)&m); } } int main(int argc, char *argv[]) { start: init(argc, argv); init_X11_pre_config(); if (!config_read()) { fprintf(stderr, "Could not read config file.\n" "Usage: tint2 [[-c] ]\n"); cleanup(); exit(1); } init_X11_post_config(); start_detect_compositor(); init_panel(); if (snapshot_path) { get_snapshot(snapshot_path); cleanup(); exit(0); } int damage_event, damage_error; XDamageQueryExtension(server.display, &damage_event, &damage_error); int x11_fd = ConnectionNumber(server.display); XSync(server.display, False); // XDND initialization dnd_source_window = 0; dnd_target_window = 0; dnd_version = 0; dnd_selection = XInternAtom(server.display, "PRIMARY", 0); dnd_atom = None; dnd_sent_request = 0; dnd_launcher_exec = 0; int ufd = uevent_init(); int hidden_dnd = 0; while (1) { if (panel_refresh) { if (systray_profile) fprintf(stderr, BLUE "[%f] %s:%d redrawing panel" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__); panel_refresh = FALSE; for (int i = 0; i < num_panels; i++) { Panel *panel = &panels[i]; if (panel->is_hidden) { if (!panel->hidden_pixmap) { panel->hidden_pixmap = XCreatePixmap(server.display, server.root_win, panel->hidden_width, panel->hidden_height, server.depth); int xoff = 0, yoff = 0; if (panel_horizontal && panel_position & BOTTOM) yoff = panel->area.height - panel->hidden_height; else if (!panel_horizontal && panel_position & RIGHT) xoff = panel->area.width - panel->hidden_width; XCopyArea(server.display, panel->area.pix, panel->hidden_pixmap, server.gc, xoff, yoff, panel->hidden_width, panel->hidden_height, 0, 0); } XCopyArea(server.display, panel->hidden_pixmap, panel->main_win, server.gc, 0, 0, panel->hidden_width, panel->hidden_height, 0, 0); XSetWindowBackgroundPixmap(server.display, panel->main_win, panel->hidden_pixmap); } else { if (panel->temp_pmap) XFreePixmap(server.display, panel->temp_pmap); panel->temp_pmap = XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth); render_panel(panel); if (panel == (Panel *)systray.area.panel) { if (refresh_systray && panel && !panel->is_hidden) { refresh_systray = FALSE; XSetWindowBackgroundPixmap(server.display, panel->main_win, panel->temp_pmap); refresh_systray_icons(); } } XCopyArea(server.display, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0); } } XFlush(server.display); } // Create a File Description Set containing x11_fd fd_set fdset; FD_ZERO(&fdset); FD_SET(x11_fd, &fdset); int maxfd = x11_fd; if (sn_pipe_valid) { FD_SET(sn_pipe[0], &fdset); maxfd = maxfd < sn_pipe[0] ? sn_pipe[0] : maxfd; } for (GList *l = panel_config.execp_list; l; l = l->next) { Execp *execp = (Execp *)l->data; int fd = execp->backend->child_pipe; if (fd > 0) { FD_SET(fd, &fdset); maxfd = maxfd < fd ? fd : maxfd; } } if (ufd > 0) { FD_SET(ufd, &fdset); maxfd = maxfd < ufd ? ufd : maxfd; } update_next_timeout(); struct timeval *select_timeout = (next_timeout.tv_sec >= 0 && next_timeout.tv_usec >= 0) ? &next_timeout : NULL; // Wait for X Event or a Timer if (XPending(server.display) > 0 || select(maxfd + 1, &fdset, 0, 0, select_timeout) >= 0) { uevent_handler(); if (sn_pipe_valid) { char buffer[1]; while (read(sn_pipe[0], buffer, sizeof(buffer)) > 0) { sigchld_handler_async(); } } for (GList *l = panel_config.execp_list; l; l = l->next) { Execp *execp = (Execp *)l->data; if (read_execp(execp)) { GList *l_instance; for (l_instance = execp->backend->instances; l_instance; l_instance = l_instance->next) { Execp *instance = l_instance->data; instance->area.resize_needed = TRUE; panel_refresh = TRUE; } } } if (XPending(server.display) > 0) { XEvent e; XNextEvent(server.display, &e); #if HAVE_SN if (startup_notifications) sn_display_process_event(server.sn_display, &e); #endif // HAVE_SN Panel *panel = get_panel(e.xany.window); if (panel && panel_autohide) { if (e.type == EnterNotify) autohide_trigger_show(panel); else if (e.type == LeaveNotify) autohide_trigger_hide(panel); if (panel->is_hidden) { if (e.type == ClientMessage && e.xclient.message_type == server.atom.XdndPosition) { hidden_dnd = 1; autohide_show(panel); } else continue; // discard further processing of this event because the panel is not visible yet } else if (hidden_dnd && e.type == ClientMessage && e.xclient.message_type == server.atom.XdndLeave) { hidden_dnd = 0; autohide_hide(panel); } } switch (e.type) { case ButtonPress: { tooltip_hide(0); event_button_press(&e); Area *area = click_area(panel, e.xbutton.x, e.xbutton.y); if (panel_config.mouse_effects) mouse_over(area, 1); break; } case ButtonRelease: { event_button_release(&e); Area *area = click_area(panel, e.xbutton.x, e.xbutton.y); if (panel_config.mouse_effects) mouse_over(area, 0); break; } case MotionNotify: { unsigned int button_mask = Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask; if (e.xmotion.state & button_mask) event_button_motion_notify(&e); Area *area = click_area(panel, e.xmotion.x, e.xmotion.y); if (area->_get_tooltip_text) tooltip_trigger_show(area, panel, &e); else tooltip_trigger_hide(); if (panel_config.mouse_effects) mouse_over(area, e.xmotion.state & button_mask); break; } case LeaveNotify: tooltip_trigger_hide(); if (panel_config.mouse_effects) mouse_out(); break; case Expose: event_expose(&e); break; case PropertyNotify: event_property_notify(&e); break; case ConfigureNotify: event_configure_notify(&e); break; case ConfigureRequest: { TrayWindow *traywin = systray_find_icon(e.xany.window); if (traywin) systray_reconfigure_event(traywin, &e); break; } case ResizeRequest: { TrayWindow *traywin = systray_find_icon(e.xany.window); if (traywin) systray_resize_request_event(traywin, &e); break; } case ReparentNotify: { if (!systray_enabled) break; Panel *systray_panel = (Panel *)systray.area.panel; if (e.xany.window == systray_panel->main_win) // don't care break; TrayWindow *traywin = systray_find_icon(e.xreparent.window); if (traywin) { if (traywin->win == e.xreparent.window) { if (traywin->parent == e.xreparent.parent) { embed_icon(traywin); } else { remove_icon(traywin); } break; } } break; } case UnmapNotify: break; case DestroyNotify: if (e.xany.window == server.composite_manager) { // Stop real_transparency fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to compositor shutdown" RESET "\n", __FILE__, __LINE__); signal_pending = SIGUSR1; break; } if (e.xany.window == g_tooltip.window || !systray_enabled) break; for (GSList *it = systray.list_icons; it; it = g_slist_next(it)) { if (((TrayWindow *)it->data)->win == e.xany.window) { systray_destroy_event((TrayWindow *)it->data); break; } } break; case ClientMessage: { XClientMessageEvent *ev = &e.xclient; if (ev->data.l[1] == server.atom._NET_WM_CM_S0) { if (ev->data.l[2] == None) { // Stop real_transparency fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n", __FILE__, __LINE__); signal_pending = SIGUSR1; } else { // Start real_transparency fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n", __FILE__, __LINE__); signal_pending = SIGUSR1; } } if (systray_enabled && e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE && e.xclient.format == 32 && e.xclient.window == net_sel_win) { net_message(&e.xclient); } else if (e.xclient.message_type == server.atom.XdndEnter) { dnd_enter(&e.xclient); } else if (e.xclient.message_type == server.atom.XdndPosition) { dnd_position(&e.xclient); } else if (e.xclient.message_type == server.atom.XdndDrop) { dnd_drop(&e.xclient); } break; } case SelectionNotify: { Atom target = e.xselection.target; fprintf(stderr, "DnD %s:%d: A selection notify has arrived!\n", __FILE__, __LINE__); fprintf(stderr, "DnD %s:%d: Requestor = %lu\n", __FILE__, __LINE__, e.xselectionrequest.requestor); fprintf(stderr, "DnD %s:%d: Selection atom = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e.xselection.selection)); fprintf(stderr, "DnD %s:%d: Target atom = %s\n", __FILE__, __LINE__, GetAtomName(server.display, target)); fprintf(stderr, "DnD %s:%d: Property atom = %s\n", __FILE__, __LINE__, GetAtomName(server.display, e.xselection.property)); if (e.xselection.property != None && dnd_launcher_exec) { Property prop = read_property(server.display, dnd_target_window, dnd_selection); // If we're being given a list of targets (possible conversions) if (target == server.atom.TARGETS && !dnd_sent_request) { dnd_sent_request = 1; dnd_atom = pick_target_from_targets(server.display, prop); if (dnd_atom == None) { fprintf(stderr, "No matching datatypes.\n"); } else { // Request the data type we are able to select fprintf(stderr, "Now requsting type %s", GetAtomName(server.display, dnd_atom)); XConvertSelection(server.display, dnd_selection, dnd_atom, dnd_selection, dnd_target_window, CurrentTime); } } else if (target == dnd_atom) { // Dump the binary data fprintf(stderr, "DnD %s:%d: Data begins:\n", __FILE__, __LINE__); fprintf(stderr, "--------\n"); for (int i = 0; i < prop.nitems * prop.format / 8; i++) fprintf(stderr, "%c", ((char *)prop.data)[i]); fprintf(stderr, "--------\n"); int cmd_length = 0; cmd_length += 1; // ( cmd_length += strlen(dnd_launcher_exec) + 1; // exec + space cmd_length += 1; // open double quotes for (int i = 0; i < prop.nitems * prop.format / 8; i++) { char c = ((char *)prop.data)[i]; if (c == '\n') { if (i < prop.nitems * prop.format / 8 - 1) { cmd_length += 3; // close double quotes, space, open double quotes } } else if (c == '\r') { // Nothing to do } else { cmd_length += 1; // 1 character if (c == '`' || c == '$' || c == '\\') { cmd_length += 1; // escape with one backslash } } } cmd_length += 1; // close double quotes cmd_length += 2; // &) cmd_length += 1; // terminator char *cmd = calloc(cmd_length, 1); cmd[0] = '\0'; strcat(cmd, "("); strcat(cmd, dnd_launcher_exec); strcat(cmd, " \""); for (int i = 0; i < prop.nitems * prop.format / 8; i++) { char c = ((char *)prop.data)[i]; if (c == '\n') { if (i < prop.nitems * prop.format / 8 - 1) { strcat(cmd, "\" \""); } } else if (c == '\r') { // Nothing to do } else { if (c == '`' || c == '$' || c == '\\') { strcat(cmd, "\\"); } char sc[2]; sc[0] = c; sc[1] = '\0'; strcat(cmd, sc); } } strcat(cmd, "\""); strcat(cmd, "&)"); fprintf(stderr, "DnD %s:%d: Running command: %s\n", __FILE__, __LINE__, cmd); tint_exec(cmd); free(cmd); // Reply OK. XClientMessageEvent m; memset(&m, 0, sizeof(m)); m.type = ClientMessage; m.display = server.display; m.window = dnd_source_window; m.message_type = server.atom.XdndFinished; m.format = 32; m.data.l[0] = dnd_target_window; m.data.l[1] = 1; m.data.l[2] = server.atom.XdndActionCopy; // We only ever copy. XSendEvent(server.display, dnd_source_window, False, NoEventMask, (XEvent *)&m); XSync(server.display, False); } XFree(prop.data); } break; } default: if (e.type == XDamageNotify + damage_event) { XDamageNotifyEvent *de = (XDamageNotifyEvent *)&e; TrayWindow *traywin = systray_find_icon(de->drawable); if (traywin) systray_render_icon(traywin); } } } } callback_timeout_expired(); if (signal_pending) { cleanup(); if (signal_pending == SIGUSR1) { fprintf(stderr, YELLOW "%s %d: restarting tint2..." RESET "\n", __FILE__, __LINE__); // restart tint2 // SIGUSR1 used when : user's signal, composite manager stop/start or xrandr goto start; } else { // SIGINT, SIGTERM, SIGHUP exit(0); } } } } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/000077500000000000000000000000001265276141000231475ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/CMakeLists.txt000066400000000000000000000052701265276141000257130ustar00rootroot00000000000000project(tint2conf) cmake_minimum_required(VERSION 2.6) include( FindPkgConfig ) pkg_check_modules( X11_T2C REQUIRED x11 xcomposite xdamage xinerama xrender xrandr>=1.3 ) pkg_check_modules( GLIB2 REQUIRED glib-2.0 ) pkg_check_modules( GOBJECT2 REQUIRED gobject-2.0 ) pkg_check_modules( IMLIB2 REQUIRED imlib2 ) pkg_check_modules( GTHREAD2 REQUIRED gthread-2.0 ) pkg_check_modules( GTK2 REQUIRED gtk+-x11-2.0 ) pkg_check_modules( RSVG librsvg-2.0>=2.36.0 ) include_directories( ../util ${X11_T2C_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${GOBJECT2_INCLUDE_DIRS} ${IMLIB2_INCLUDE_DIRS} ${GTHREAD2_INCLUDE_DIRS} ${GTK2_INCLUDE_DIRS} ${RSVG_INCLUDE_DIRS} ) set(SOURCES ../util/common.c ../util/strnatcmp.c ../config.c ../server.c ../launcher/apps-common.c ../launcher/icon-theme-common.c main.c properties.c properties_rw.c theme_view.c ) add_definitions( -DTINT2CONF ) option( ENABLE_RSVG "Rsvg support (launcher only)" ON ) if( ENABLE_RSVG ) if( RSVG_FOUND ) add_definitions( -DHAVE_RSVG ) endif( RSVG_FOUND ) endif( ENABLE_RSVG ) link_directories( ${X11_T2C_LIBRARY_DIRS} ${GLIB2_LIBRARY_DIRS} ${GOBJECT2_LIBRARY_DIRS} ${IMLIB2_LIBRARY_DIRS} ${GTHREAD2_LIBRARY_DIRS} ${GTK2_LIBRARY_DIRS} ${RSVG_LIBRARY_DIRS} ) add_executable( tint2conf ${SOURCES} ) target_link_libraries( tint2conf ${X11_T2C_LIBRARIES} ${GLIB2_LIBRARIES} ${GOBJECT2_LIBRARIES} ${IMLIB2_LIBRARIES} ${GTHREAD2_LIBRARIES} ${GTK2_LIBRARIES} ${RSVG_LIBRARIES} ) if ( NOT DATADIR ) set(DATADIR share) endif( NOT DATADIR ) add_definitions( -DINSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" ) add_definitions( -DLOCALEDIR=\"${CMAKE_INSTALL_PREFIX}/${DATADIR}/locale\" ) add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" ) set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -pthread -std=c99" ) set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" ) add_subdirectory(po) install( TARGETS tint2conf DESTINATION bin ) install( FILES tint2conf.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps ) install( FILES tint2conf.desktop DESTINATION ${DATADIR}/applications ) install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" ) tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/main.c000066400000000000000000000502031265276141000242370ustar00rootroot00000000000000/************************************************************************** * * Tint2conf * * Copyright (C) 2009 Thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #ifdef HAVE_VERSION_H #include "version.h" #endif #include "main.h" #include "common.h" #include "theme_view.h" #include "properties.h" #include "properties_rw.h" // ====== Utilities ====== gchar *get_default_config_path() { gchar *path = NULL; const gchar * const * system_dirs = g_get_system_config_dirs(); int i; for (i = 0; system_dirs[i]; i++) { path = g_build_filename(system_dirs[i], "tint2", "tint2rc", NULL); if (g_file_test(path, G_FILE_TEST_EXISTS)) return path; g_free(path); path = NULL; } return g_strdup("/dev/null"); } int endswith(const char *str, const char *suffix) { return strlen(str) >= strlen(suffix) && strcmp(str + strlen(str) - strlen(suffix), suffix) == 0; } static void menuAddWidget(GtkUIManager *ui_manager, GtkWidget *p_widget, GtkContainer *p_box) { gtk_box_pack_start(GTK_BOX(p_box), p_widget, FALSE, FALSE, 0); gtk_widget_show(p_widget); } static void menuAddWidget(GtkUIManager *, GtkWidget *, GtkContainer *); static void menuImport(); 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); static gboolean view_onButtonPressed(GtkWidget *treeview, GdkEventButton *event, gpointer userdata); static void viewRowActivated(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data); static gboolean theme_selected(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata); static void select_first_theme(); static void load_all_themes(); // ====== Globals ====== GtkWidget *g_window; static GtkUIManager *globalUIManager = NULL; GtkWidget *tint_cmd; static const char *global_ui = "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " ""; int main(int argc, char **argv) { setlocale(LC_ALL, ""); bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); GtkWidget *vBox = NULL, *scrollbar = NULL; GtkActionGroup *actionGroup; gtk_init(&argc, &argv); #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); if (!g_file_test(tint2_config_dir, G_FILE_TEST_IS_DIR)) g_mkdir(tint2_config_dir, 0777); g_free(tint2_config_dir); } g_set_application_name(_("tint2conf")); gtk_window_set_default_icon_name("taskbar"); // config file uses '.' as decimal separator setlocale(LC_NUMERIC, "POSIX"); // define main layout : container, menubar, toolbar g_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(g_window), _("Panel theming")); gtk_window_resize(GTK_WINDOW(g_window), 800, 600); g_signal_connect(G_OBJECT(g_window), "destroy", G_CALLBACK(gtk_main_quit), NULL); vBox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(g_window), vBox); actionGroup = gtk_action_group_new("menuActionGroup"); // Menubar and toolbar entries GtkActionEntry entries[] = { {"ThemeMenu", NULL, _("Theme"), NULL, NULL, NULL}, {"ThemeAdd", GTK_STOCK_ADD, _("_Import theme..."), "N", _("Import theme"), G_CALLBACK(menuImport)}, {"ThemeDefault", GTK_STOCK_NEW, _("_Import default theme..."), NULL, _("Import default theme"), G_CALLBACK(menuImportDefault)}, {"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"), "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)}, {"EditRefreshAll", GTK_STOCK_REFRESH, _("Refresh all"), NULL, _("Refresh all"), G_CALLBACK(load_all_themes)}, {"HelpMenu", NULL, _("Help"), NULL, NULL, NULL}, {"HelpAbout", GTK_STOCK_ABOUT, _("_About"), "A", _("About"), G_CALLBACK(menuAbout)} }; gtk_action_group_add_actions(actionGroup, entries, G_N_ELEMENTS(entries), NULL); globalUIManager = gtk_ui_manager_new(); gtk_ui_manager_insert_action_group(globalUIManager, actionGroup, 0); gtk_ui_manager_add_ui_from_string(globalUIManager, global_ui, -1, (NULL)); g_signal_connect(globalUIManager, "add_widget", G_CALLBACK(menuAddWidget), vBox); gtk_ui_manager_ensure_update(globalUIManager); GtkWidget *table, *label; int row, col; row = col = 0; table = gtk_table_new(1, 2, FALSE); gtk_widget_show(table); gtk_box_pack_start(GTK_BOX(vBox), table, FALSE, TRUE, 0); gtk_table_set_row_spacings(GTK_TABLE(table), 8); gtk_table_set_col_spacings(GTK_TABLE(table), 8); label = gtk_label_new(_("Command to run tint2: ")); 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++; tint_cmd = gtk_entry_new(); gtk_widget_show(tint_cmd); gtk_entry_set_text(GTK_ENTRY(tint_cmd), ""); gtk_table_attach(GTK_TABLE(table), tint_cmd, col, col+1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 0, 0); scrollbar = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollbar), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start(GTK_BOX(vBox), scrollbar, TRUE, TRUE, 0); // define theme view g_theme_view = create_view(); gtk_container_add(GTK_CONTAINER(scrollbar), g_theme_view); gtk_widget_show(g_theme_view); g_signal_connect(g_theme_view, "button-press-event", (GCallback)view_onButtonPressed, NULL); g_signal_connect(g_theme_view, "popup-menu", (GCallback)view_onPopupMenu, NULL); g_signal_connect(g_theme_view, "row-activated", G_CALLBACK(viewRowActivated), NULL); gtk_tree_selection_set_select_function(gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view)), theme_selected, NULL, NULL); // load themes load_all_themes(); gtk_widget_show_all(g_window); gtk_main(); return 0; } static void menuAbout() { const char *authors[] = { "Thierry Lorthiois ", "Andreas Fink ", "Christian Ruppert (Build system)", "Euan Freeman (tintwizard http://code.google.com/p/tintwizard)", (NULL) }; gtk_show_about_dialog(GTK_WINDOW(g_window), "name", g_get_application_name( ), "comments", _("Theming tool for tint2 panel"), "version", VERSION_STRING, "copyright", _("Copyright 2009-2015 tint2 team\nTint2 License GNU GPL version 2\nTintwizard License GNU GPL version 3"), "logo-icon-name", "taskbar", "authors", authors, /* Translators: translate "translator-credits" as your name to have it appear in the credits in the "About" dialog */ "translator-credits", _("translator-credits"), NULL); } // ====== Theme import/copy/delete ====== static void menuImport() { GtkWidget *dialog = gtk_file_chooser_dialog_new(_("Import theme(s)"), GTK_WINDOW(g_window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, NULL); GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog); gtk_file_chooser_set_select_multiple(chooser, TRUE); if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_ACCEPT) { gtk_widget_destroy(dialog); return; } GSList *list = gtk_file_chooser_get_filenames(chooser); GSList *l; for (l = list; l ; l = l->next) { gchar *file = (char *)l->data; gchar *pt1 = strrchr(file, '/'); if (!pt1) continue; pt1++; if (!*pt1) continue; gchar *name = pt1; gchar *path = g_build_filename(g_get_user_config_dir(), "tint2", name, NULL); if (g_file_test(path, G_FILE_TEST_EXISTS)) continue; copy_file(file, path); g_free(path); } g_slist_foreach(list, (GFunc)g_free, NULL); g_slist_free(list); gtk_widget_destroy(dialog); load_all_themes(); } static void menuImportDefault() { GtkWidget *dialog = gtk_file_chooser_dialog_new(_("Save default theme as"), GTK_WINDOW(g_window), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog); gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE); gchar *config_dir; config_dir = g_build_filename(g_get_home_dir(), ".config", "tint2", NULL); gtk_file_chooser_set_current_folder(chooser, config_dir); g_free(config_dir); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gchar *save_name = gtk_file_chooser_get_filename(chooser); gchar *path_default = get_default_config_path(); copy_file(path_default, save_name); g_free(path_default); g_free(save_name); } gtk_widget_destroy(dialog); load_all_themes(); } static void menuSaveAs() { GtkWidget *dialog; GtkFileChooser *chooser; GtkTreeSelection *sel; GtkTreeIter iter; GtkTreeModel *model; gchar *file, *pt1; sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view)); if (!gtk_tree_selection_get_selected(GTK_TREE_SELECTION(sel), &model, &iter)) { GtkWidget *w = gtk_message_dialog_new(GTK_WINDOW(g_window), 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Select the theme to be saved.")); g_signal_connect_swapped(w, "response", G_CALLBACK(gtk_widget_destroy), w); gtk_widget_show(w); return; } gtk_tree_model_get(model, &iter, COL_THEME_FILE, &file, -1); pt1 = strrchr(file, '/'); if (pt1) pt1++; dialog = gtk_file_chooser_dialog_new(_("Save theme as"), GTK_WINDOW(g_window), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); chooser = GTK_FILE_CHOOSER(dialog); gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE); gchar *config_dir; config_dir = g_build_filename(g_get_home_dir(), ".config", "tint2", NULL); gtk_file_chooser_set_current_folder(chooser, config_dir); g_free(config_dir); gtk_file_chooser_set_current_name(chooser, pt1); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char *filename = gtk_file_chooser_get_filename(chooser); copy_file(file, filename); g_free(filename); } g_free(file); gtk_widget_destroy(dialog); load_all_themes(); } static void menuDelete() { GtkTreeSelection *sel; GtkTreeIter iter; GtkTreeModel *model; gchar *filename; 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, &filename, -1); gtk_tree_selection_unselect_all(sel); // remove (gui and file) gtk_list_store_remove(GTK_LIST_STORE(model), &iter); GFile *file = g_file_new_for_path(filename); g_file_trash(file, NULL, NULL); g_object_unref(G_OBJECT(file)); g_free(filename); } } // ====== Theme popup menu ====== static void view_popup_menu(GtkWidget *treeview, GdkEventButton *event, gpointer userdata) { GtkWidget *w = gtk_ui_manager_get_widget(globalUIManager, "/ThemePopup"); gtk_menu_popup(GTK_MENU(w), NULL, NULL, NULL, NULL, (event != NULL) ? event->button : 0, gdk_event_get_time((GdkEvent*)event)); } static gboolean view_onButtonPressed(GtkWidget *treeview, GdkEventButton *event, gpointer userdata) { // single click with the right mouse button? if (event->type == GDK_BUTTON_PRESS && event->button == 3) { GtkTreeSelection *selection; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); if (gtk_tree_selection_count_selected_rows(selection) <= 1) { GtkTreePath *path; // Get tree path for row that was clicked if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview), (gint) event->x, (gint) event->y, &path, NULL, NULL, NULL)) { gtk_tree_selection_unselect_all(selection); gtk_tree_selection_select_path(selection, path); gtk_tree_path_free(path); } } view_popup_menu(treeview, event, userdata); return TRUE; } return FALSE; } static gboolean view_onPopupMenu(GtkWidget *treeview, gpointer userdata) { view_popup_menu(treeview, NULL, userdata); return TRUE; } // ====== Theme selection ====== gboolean theme_selected(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata) { GtkTreeIter iter; if (gtk_tree_model_get_iter(model, &iter, path)) { gchar *current_theme = NULL; gtk_tree_model_get(model, &iter, COL_THEME_FILE, ¤t_theme, -1); if (!path_currently_selected) { gchar *text = g_strdup_printf("tint2 -c %s", current_theme); gtk_entry_set_text(GTK_ENTRY(tint_cmd), text); g_free(text); } else { gtk_entry_set_text(GTK_ENTRY(tint_cmd), ""); } g_free(current_theme); } return TRUE; } void select_first_theme() { gboolean have_iter; GtkTreeIter iter; GtkTreeModel *model; model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view)); have_iter = gtk_tree_model_get_iter_first(model, &iter); if (have_iter) { GtkTreePath *path = gtk_tree_model_get_path(model, &iter); gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view)), &iter); gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(g_theme_view), path, NULL, FALSE, 0, 0); gtk_tree_path_free(path); } return; } char *get_current_theme_file_name() { GtkTreeSelection *sel; GtkTreeIter iter; GtkTreeModel *model; char *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); return file; } return NULL; } static void edit_current_theme() { GtkTreeSelection *sel; GtkTreeIter iter; GtkTreeModel *model; char *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); GtkWidget *prop; prop = create_properties(); config_read_file(file); gtk_window_present(GTK_WINDOW(prop)); g_free(file); } } 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(); } // ====== Theme load/reload ====== #if 0 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); } } #endif static void load_all_themes() { // We don't do this anymore since it has proven unpopular... #if 0 copy_default_themes(); #endif gtk_list_store_clear(GTK_LIST_STORE(g_store)); gchar *tint2_config_dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL); GDir *dir = g_dir_open(tint2_config_dir, 0, NULL); if (dir == NULL) { g_free(tint2_config_dir); 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) && !strstr(file_name, "backup") && !strstr(file_name, "copy") && !strstr(file_name, "~") && (endswith(file_name, "tint2rc") || endswith(file_name, ".conf"))) { found_theme = TRUE; gchar *name = g_build_filename(tint2_config_dir, file_name, NULL); custom_list_append(name); g_free(name); } } if (found_theme) { select_first_theme(); GtkTreeIter iter; GtkTreeModel *model; gboolean have_iter; model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view)); have_iter = gtk_tree_model_get_iter_first(model, &iter); while (have_iter) { gtk_list_store_set(g_store, &iter, COL_SNAPSHOT, NULL, -1); have_iter = gtk_tree_model_iter_next(model, &iter); } g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL); } g_dir_close(dir); g_free(tint2_config_dir); } static void refresh_current_theme() { GtkTreeSelection *sel; GtkTreeIter iter; GtkTreeModel *model; 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_list_store_set(g_store, &iter, COL_SNAPSHOT, NULL, -1); } g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/main.h000066400000000000000000000005531265276141000242470ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #ifdef GETTEXT_PACKAGE #include #else #define _(String) String #define GETTEXT_PACKAGE "tint2conf" #endif #define SNAPSHOT_TICK 190 gboolean update_snapshot(); void menuApply();tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/000077500000000000000000000000001265276141000235655ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/CMakeLists.txt000066400000000000000000000016431265276141000263310ustar00rootroot00000000000000include(FindGettext) if (GETTEXT_FOUND) set(GETTEXT_PACKAGE tint2conf) file(GLOB POTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.po") string(REPLACE ".po" " " LANGUAGES ${POTFILES}) message(STATUS "gettext found languages: ${LANGUAGES}") string(REPLACE " " ";" LANGUAGES ${LANGUAGES}) if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.8") GETTEXT_CREATE_TRANSLATIONS("${CMAKE_CURRENT_SOURCE_DIR}/tint2conf.pot" ALL ${POTFILES}) else() foreach(LANG ${LANGUAGES}) GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${LANG}.po) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DATADIR}/locale/${LANG}/LC_MESSAGES" RENAME "${GETTEXT_PACKAGE}.mo") endforeach () endif() else () message(STATUS "gettext not found") endif () tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/bs.po000066400000000000000000002213461265276141000245410ustar00rootroot00000000000000# Bosnian translation for tint2conf. # Copyright (C) 2015 tint2's copyright holder # This file is distributed under the same license as the tint2 package. # Dino Duratović , 2015. msgid "" msgstr "Project-Id-Version: tint2conf 0.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-17 13:33+0100\n" "PO-Revision-Date: 2015-06-14 13:32+0200\n" "Last-Translator: Dino Duratović \n" "Language-Team: \n" "Language: bs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 " "&& n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: ../properties.c:256 msgid "Properties" msgstr "Postavke" #: ../properties.c:290 msgid "Backgrounds" msgstr "Pozadine" #: ../properties.c:298 ../properties.c:1276 msgid "Panel" msgstr "Ploča" #: ../properties.c:306 msgid "Panel items" msgstr "Stavke ploče" #: ../properties.c:314 ../properties.c:1682 ../properties.c:1876 msgid "Taskbar" msgstr "Paleta poslova" #: ../properties.c:322 msgid "Task buttons" msgstr "Dugmad poslova" #: ../properties.c:330 ../properties.c:1687 ../properties.c:1879 #: ../properties.c:2625 msgid "Launcher" msgstr "Pokretač" #: ../properties.c:338 ../properties.c:1672 ../properties.c:1870 #: ../properties.c:4002 msgid "Clock" msgstr "Sat" #: ../properties.c:346 ../properties.c:1677 ../properties.c:1873 msgid "System tray" msgstr "Sistemska traka" #: ../properties.c:354 ../properties.c:1667 ../properties.c:1867 #: ../properties.c:5031 msgid "Battery" msgstr "Baterija" #: ../properties.c:362 ../properties.c:4495 ../properties.c:5211 msgid "Tooltip" msgstr "Opisi" #: ../properties.c:516 msgid "Background" msgstr "Pozadina" #: ../properties.c:527 msgid "Selects the background you would like to modify" msgstr "Odabir pozadine koju želite izmjeniti" #: ../properties.c:534 msgid "Creates a copy of the current background" msgstr "Pravi kopiju trenutne pozadine" #: ../properties.c:541 msgid "Deletes the current background" msgstr "Briše trenutnu pozadinu" #: ../properties.c:550 msgid "Fill color" msgstr "Boja" #: ../properties.c:561 msgid "The fill color of the current background" msgstr "Boja trenutne pozadine" #: ../properties.c:564 msgid "Border color" msgstr "Boja ivice" #: ../properties.c:575 msgid "The border color of the current background" msgstr "Boja ivice trenutne pozadine" #: ../properties.c:578 #, fuzzy msgid "Fill color (mouse over)" msgstr "Boja" #: ../properties.c:589 #, fuzzy msgid "The fill color of the current background on mouse over" msgstr "Boja trenutne pozadine" #: ../properties.c:592 #, fuzzy msgid "Border color (mouse over)" msgstr "Boja ivice" #: ../properties.c:603 #, fuzzy msgid "The border color of the current background on mouse over" msgstr "Boja ivice trenutne pozadine" #: ../properties.c:606 #, fuzzy msgid "Fill color (pressed)" msgstr "Boja" #: ../properties.c:617 #, fuzzy msgid "The fill color of the current background on mouse button press" msgstr "Boja trenutne pozadine" #: ../properties.c:620 #, fuzzy msgid "Border color (pressed)" msgstr "Boja ivice" #: ../properties.c:631 #, fuzzy msgid "The border color of the current background on mouse button press" msgstr "Boja ivice trenutne pozadine" #: ../properties.c:634 msgid "Border width" msgstr "Širina ivice" #: ../properties.c:644 msgid "The width of the border of the current background, in pixels" msgstr "Širina ivice trenutne pozadine, u pikselima" #: ../properties.c:647 msgid "Corner radius" msgstr "Prečnik ugla" #: ../properties.c:657 msgid "The corner radius of the current background" msgstr "Prečnik ugla trenutne pozadine" #: ../properties.c:1075 msgid "Geometry" msgstr "Geometrija" #: ../properties.c:1092 msgid "Position" msgstr "Pozicija" #: ../properties.c:1113 msgid "Position on screen: top-left, horizontal panel" msgstr "Pozicija na ekranu: gore-lijevo, horizontalna ploča" #: ../properties.c:1115 msgid "Position on screen: top-center, horizontal panel" msgstr "Pozicija na ekranu: gore-sredina, horizontalna ploča" #: ../properties.c:1117 msgid "Position on screen: top-right, horizontal panel" msgstr "Pozicija na ekranu: gore-desno, horizontalna ploča" #: ../properties.c:1119 msgid "Position on screen: top-left, vertical panel" msgstr "Pozicija na ekranu: gore-lijevo, vertikalna ploča" #: ../properties.c:1121 msgid "Position on screen: center-left, vertical panel" msgstr "Pozicija na ekranu: sredina-lijevo, vertikalna ploča" #: ../properties.c:1123 msgid "Position on screen: bottom-left, vertical panel" msgstr "Pozicija na ekranu: dole-lijevo, vertikalna ploča" #: ../properties.c:1125 msgid "Position on screen: top-right, vertical panel" msgstr "Pozicija na ekranu: gore-desno, vertikalna ploča" #: ../properties.c:1127 msgid "Position on screen: center-right, vertical panel" msgstr "Pozicija na ekranu: sredina-desno, vertikalna ploča" #: ../properties.c:1129 msgid "Position on screen: bottom-right, vertical panel" msgstr "Pozicija na ekranu: dole-desno, vertikalna ploča" #: ../properties.c:1131 msgid "Position on screen: bottom-left, horizontal panel" msgstr "Pozicija na ekranu: dole-lijevo, horizontalna ploča" #: ../properties.c:1133 msgid "Position on screen: bottom-center, horizontal panel" msgstr "Pozicija na ekranu: dole-sredina, horizontalna ploča" #: ../properties.c:1135 msgid "Position on screen: bottom-right, horizontal panel" msgstr "Pozicija na ekranu: dole-desno, horizontalna ploča" #: ../properties.c:1140 ../properties.c:4634 msgid "Monitor" msgstr "Monitor" #: ../properties.c:1150 msgid "All" msgstr "Svi" #: ../properties.c:1151 ../properties.c:4644 msgid "1" msgstr "1" #: ../properties.c:1152 ../properties.c:4645 msgid "2" msgstr "2" #: ../properties.c:1153 ../properties.c:4646 msgid "3" msgstr "3" #: ../properties.c:1154 ../properties.c:4647 msgid "4" msgstr "4" #: ../properties.c:1155 ../properties.c:4648 msgid "5" msgstr "5" #: ../properties.c:1156 ../properties.c:4649 msgid "6" msgstr "6" #: ../properties.c:1158 msgid "The monitor on which the panel is placed" msgstr "Monitor na kojem je ploča" #: ../properties.c:1162 msgid "Primary monitor first" msgstr "" #: ../properties.c:1172 msgid "If enabled, the primary monitor will have index 1 in the monitor " "list even if it is not top-left." msgstr "" #: ../properties.c:1176 msgid "Length" msgstr "Dužina" #: ../properties.c:1186 msgid "The length of the panel (width for horizontal panels, height for " "vertical panels)" msgstr "Dužina ploče (širina za horizontalne, visina za vertikalne ploče)" #: ../properties.c:1192 ../properties.c:1215 msgid "Percent" msgstr "Postotak" #: ../properties.c:1193 ../properties.c:1216 msgid "Pixels" msgstr "Piksela" #: ../properties.c:1195 msgid "The units used to specify the length of the panel: pixels or " "percentage of the monitor size" msgstr "Jedinica za određivanje dužine ploče: pikseli ili postotak veličine " "monitora" #: ../properties.c:1199 msgid "Size" msgstr "Veličina" #: ../properties.c:1209 msgid "The size of the panel (height for horizontal panels, width for " "vertical panels)" msgstr "Veličina ploče (visina za horizontalne, širina za vertikalne ploče" #: ../properties.c:1218 msgid "The units used to specify the size of the panel: pixels or " "percentage of the monitor size" msgstr "Jedinica za određivanje veličine ploče: pikseli ili postotak " "veličine minotora" #: ../properties.c:1222 msgid "Horizontal margin" msgstr "Horizontalna margina" #: ../properties.c:1232 msgid "Creates a space between the panel and the edge of the monitor. For " "left-aligned panels, the space is created on the right of the panel; " "for right-aligned panels, it is created on the left; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Pravi prostor između ploče i ivice monitora. Za ploče poravnate " "prema lijevo prostor se pravi desno od ploče; za ploče poravnate " "prema desno, prostor je lijevo; za centrirane ploče, jednako je " "podijeljen sa obe strane." #: ../properties.c:1239 msgid "Vertical margin" msgstr "Vertikalna margina" #: ../properties.c:1249 msgid "Creates a space between the panel and the edge of the monitor. For " "top-aligned panels, the space is created on the bottom of the panel; " "for bottom-aligned panels, it is created on the top; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Pravi prostor između ploče i ivice monitora. Za ploče poravnate " "prema gore prostor se pravi na dnu ploče; za ploče poravnate prema " "dole, prostor je gore; za centrirane ploče, jednako je podijeljen sa " "obe strane." #: ../properties.c:1256 ../properties.c:2606 ../properties.c:2973 #: ../properties.c:3407 ../properties.c:3983 ../properties.c:4368 #: ../properties.c:4656 ../properties.c:5012 ../properties.c:5192 msgid "Appearance" msgstr "Izgled" #: ../properties.c:1270 ../properties.c:2619 ../properties.c:3775 #: ../properties.c:3996 ../properties.c:4381 ../properties.c:4669 #: ../properties.c:5025 ../properties.c:5205 msgid "Background" msgstr "Pozadina" #: ../properties.c:1280 msgid "Selects the background used to display the panel. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Odabir pozadine za ploču. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:1285 ../properties.c:2647 ../properties.c:2987 #: ../properties.c:3090 ../properties.c:3498 ../properties.c:4010 #: ../properties.c:4395 ../properties.c:4684 ../properties.c:5039 #: ../properties.c:5219 msgid "Horizontal padding" msgstr "Horizontalna popuna" #: ../properties.c:1295 msgid "Specifies the horizontal padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Određuje horizontalno popunjivanje ploče. To je prostor između ivice " "ploče i unutrašnjih elemenata." #: ../properties.c:1300 ../properties.c:2661 ../properties.c:3002 #: ../properties.c:3105 ../properties.c:3512 ../properties.c:4024 #: ../properties.c:4409 ../properties.c:4699 ../properties.c:5053 #: ../properties.c:5233 msgid "Vertical padding" msgstr "Vertikalna popuna" #: ../properties.c:1310 msgid "Specifies the vertical padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Određuje verikalno popunjivanje ploče. To je prostor između ivice " "ploče i unutrašnjih elemenata." #: ../properties.c:1315 ../properties.c:2675 ../properties.c:3017 #: ../properties.c:3526 ../properties.c:4714 msgid "Spacing" msgstr "Razmak" #: ../properties.c:1325 msgid "Specifies the spacing between elements inside the panel." msgstr "Određuje razmak između elemenata unutar ploče." #: ../properties.c:1329 msgid "Ignore compositor" msgstr "Ignoriši kompozitor" #: ../properties.c:1339 msgid "If enabled, the compositor will not be used to draw a transparent " "panel. May fix display corruption problems on broken graphics stacks." msgstr "Ako je uključeno, kompozitor se neće koristiti za prikazivanje " "transparentne ploče. Može pomoći kod pokvarenih grafičkih sistema." #: ../properties.c:1343 msgid "Font shadows" msgstr "Sjena fonta" #: ../properties.c:1353 msgid "If enabled, a shadow will be drawn behind text. This may improve " "legibility on transparent panels." msgstr "Ako je uključeno, svi tekstovi će imati sjenu. Ovo može poboljšati " "čitljivost kod prozirnih ploča." #: ../properties.c:1358 #, fuzzy msgid "Mouse effects" msgstr "Radnje miša" #: ../properties.c:1368 msgid "Clickable interface items change appearance when the mouse is moved " "over them." msgstr "" #: ../properties.c:1372 #, fuzzy msgid "Icon opacity (hovered)" msgstr "Prozirnost ikona" #: ../properties.c:1383 #, fuzzy msgid "Specifies the opacity adjustment of the icons under the mouse, in " "percent." msgstr "Određuje zasićenost boja u ikonama pokretača, u postotcima." #: ../properties.c:1387 #, fuzzy msgid "Icon saturation (hovered)" msgstr "Zasićenost ikona" #: ../properties.c:1398 #, fuzzy msgid "Specifies the saturation adjustment of the icons under the mouse, in " "percent." msgstr "Određuje zasićenost boja u ikonama pokretača, u postotcima." #: ../properties.c:1402 #, fuzzy msgid "Icon brightness (hovered)" msgstr "Svjetloća ikona" #: ../properties.c:1413 #, fuzzy msgid "Specifies the brightness adjustment of the icons under the mouse, in " "percent." msgstr "Određuje svjetloću ikona u pokretaču, u postotcima." #: ../properties.c:1417 #, fuzzy msgid "Icon opacity (pressed)" msgstr "Prozirnost ikona" #: ../properties.c:1428 #, fuzzy msgid "Specifies the opacity adjustment of the icons on mouse button press, " "in percent." msgstr "Određuje zasićenost boja ikona u sistemskoj traci, u postotcima." #: ../properties.c:1432 #, fuzzy msgid "Icon saturation (pressed)" msgstr "Zasićenost ikona" #: ../properties.c:1443 #, fuzzy msgid "Specifies the saturation adjustment of the icons on mouse button " "press, in percent." msgstr "Određuje zasićenost boja ikona u sistemskoj traci, u postotcima." #: ../properties.c:1447 #, fuzzy msgid "Icon brightness (pressed)" msgstr "Svjetloća ikona" #: ../properties.c:1458 #, fuzzy msgid "Specifies the brightness adjustment of the icons on mouse button " "press, in percent." msgstr "Određuje svjetlost ikona u sistemskoj traci, u postotcima." #: ../properties.c:1462 msgid "Autohide" msgstr "Automatsko skrivanje" #: ../properties.c:1476 msgid "Autohide" msgstr "Automatsko skrivanje" #: ../properties.c:1486 msgid "If enabled, the panel is hidden when the mouse cursor leaves the " "panel." msgstr "Ako je uključeno, ploča se skriva kada kursor miša napusti ploču." #: ../properties.c:1490 msgid "Show panel after" msgstr "Prikaži ploču nakon" #: ../properties.c:1500 msgid "Specifies a delay after which the panel is shown when the mouse " "cursor enters the panel." msgstr "Određuje vrijeme nakon kojeg se ploča prikazuje kad kursor miša " "pređe preko ploče." #: ../properties.c:1502 ../properties.c:1536 ../properties.c:5165 #: ../properties.c:5184 msgid "seconds" msgstr "sekunde" #: ../properties.c:1510 msgid "Hidden size" msgstr "Veličina skrivene" #: ../properties.c:1520 msgid "Specifies the size of the panel when hidden, in pixels." msgstr "Određuje veličinu ploče kad je skrivena, u pikselima" #: ../properties.c:1524 msgid "Hide panel after" msgstr "Sakrij ploču nakon" #: ../properties.c:1534 msgid "Specifies a delay after which the panel is hidden when the mouse " "cursor leaves the panel." msgstr "Određuje vrijeme nakon kojeg se ploča skriva kad kursor miša napusti " "ploču." #: ../properties.c:1544 msgid "Window manager interaction" msgstr "Interakcija sa upravljačem prozora" #: ../properties.c:1558 msgid "Forward mouse events" msgstr "Proslijedi radnje miša" #: ../properties.c:1568 msgid "If enabled, mouse events not handled by panel elements are forwarded " "to the desktop. Useful on desktop environments that show a start " "menu when right clicking the desktop, or switch the desktop when " "rotating the mouse wheel over the desktop." msgstr "Ako je uključeno, radnje miša nisu rukovane od strane ploče, već se " "proslijede radnoj površini. Korisno je kod radnih okruženja koja " "prikazuju startni meni pri desnom kliku na površinu ili koji " "mijenjaju površinu rotiranjem kolutića miša." #: ../properties.c:1574 msgid "Place panel in dock" msgstr "Usidri ploču" #: ../properties.c:1584 msgid "If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than " "normal windows. The exact behavior depends on the window manager and " "its configuration." msgstr "Ako je uključeno, postavlja ploču u prostor za sidro (dock) " "upravljača prozora. Prozori postavljeni u sidro (dock) su obično " "posebno tretirani od strane upravljača prozora. Tačno ponašanje " "zavisi od upravljača prozora." #: ../properties.c:1590 msgid "Panel layer" msgstr "Sloj ploče" #: ../properties.c:1600 msgid "Top" msgstr "Vrh" #: ../properties.c:1601 msgid "Normal" msgstr "Normalno" #: ../properties.c:1602 msgid "Bottom" msgstr "Ispod" #: ../properties.c:1604 msgid "Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, " "depending on which has focus. \n" "Note that some window managers prevent this option from working " "correctly if the panel is placed in the dock." msgstr "Određuje sloj za postavljanje ploče. \n" "Vrh: ploča uvijek pokriva druge prozore. \n" "Ispod: drugi prozori uvijek pokrivaju plоču. \n" "Normalno: drugi prozori mogu pokriti ploču, zavisno od toga koji je " "fokusiran. \n" "Napomena: neki upravljači prozora spriječavaju da ovo radi pravilno " "ako se ploča usidri (postavi u dock)." #: ../properties.c:1612 msgid "Maximized windows" msgstr "Uvećani prozori" #: ../properties.c:1622 msgid "Match the panel size" msgstr "Upari sa veličinom ploče" #: ../properties.c:1623 msgid "Match the hidden panel size" msgstr "Upari sa veličinom skrivene ploče" #: ../properties.c:1624 msgid "Fill the screen" msgstr "Popuni ekran" #: ../properties.c:1626 msgid "Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to " "the edge of the panel. \n" "Match the hidden panel size means that maximized windows should " "extend to the edge of the panel when hidden; when visible, the panel " "and the windows will overlap. \n" "Fill the screen means that maximized windows will always have the " "same size as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed " "at the edge (not in the middle) of the virtual screen for this to " "work correctly." msgstr "Određuje veličinu uvećanih prozora. \n" "Upari sa veličinom ploče: uvećani prozori se protežu do ivice " "ploče. \n" "Upari sa veličinom srivene ploče: uvećani prozori se protežu do " "ivice ploče dok je skrivena; ako je vidljiva prozori i ploča će se " "preklapati. \n" "Popuni ekran: uvećani prozori će uvijek prekrivati cijeli ekran. \n" "Napomena: u slučaju višestrukih monitora (Xinerama), ploča se mora " "postaviti uz ivicu (ne u sredinu) virtualnog ekrana da bi ovo radilo " "ispravno." #: ../properties.c:1637 msgid "Window name" msgstr "Ime prozora" #: ../properties.c:1649 msgid "Specifies the name of the panel window. This is useful if you want " "to configure special treatment of tint2 windows in your window " "manager or compositor." msgstr "Određuje ime prozora ploče. Ovo je korisno ako želite da tint2 " "prozori imaju poseban tretman kod upravljača prozora ili kompozitora." #: ../properties.c:1692 ../properties.c:1882 msgid "Free space" msgstr "Slobodni prostor" #: ../properties.c:1697 ../properties.c:1886 ../properties.c:4159 #: ../properties.c:4387 ../properties.c:4557 ../properties.c:4578 msgid "Executor" msgstr "" #: ../properties.c:1712 msgid "Specifies the elements that will appear in the panel and their " "order. Elements can be added by selecting them in the list of " "available elements, then clicking on the add left button." msgstr "Određuje elemente i njihov redoslijed u ploči. Elementi se mogu " "dodati odabirom iz liste dostupnih elemenata, a zatim klikom na " "Dodaj dugme." #: ../properties.c:1728 msgid "Lists all the possible elements that can appear in the panel. " "Elements can be added to the panel by selecting them, then clicking " "on the add left button." msgstr "Prikazuje sve moguće elemente ploče. Elementi se mogu dodati na " "ploču odabirom, a zatim klikom na Dodaj dugme." #: ../properties.c:1738 msgid "Elements selected" msgstr "Odabrani elementi" #: ../properties.c:1744 msgid "Elements available" msgstr "Dostupni elementi" #: ../properties.c:1761 msgid "Moves up the current element in the list of selected elements." msgstr "Pomijera trenutni element gore u listi odabranih elemenata." #: ../properties.c:1769 msgid "Moves down the current element in the list of selected elements." msgstr "Pomijera trenutni element dole u listi odabranih elemenata." #: ../properties.c:1771 ../properties.c:2563 msgid " " msgstr " " #: ../properties.c:1782 msgid "Copies the current element in the list of available elements to the " "list of selected elements." msgstr "Kopira trenutni element iz liste elemenata u listu odabranih " "elemenata." #: ../properties.c:1790 msgid "Removes the current element from the list of selected elements." msgstr "Uklanja trenutni element iz liste odabranih elemenata." #: ../properties.c:2496 msgid "Specifies the application launchers that will appear in the launcher " "and their order. Launchers can be added by selecting an item in the " "list of available applications, then clicking on the add left button." msgstr "Određuje pokretače aplikacija koji će biti u pokretaču i njihov " "redoslijed. Pokretači se mogu dodati odabirom iz liste dostupnih " "aplikacija, pa klikom na Dodaj dugme." #: ../properties.c:2517 msgid "Lists all the applications detected on the system. Launchers can be " "added to the launcher by selecting an application, then clicking on " "the add left button." msgstr "Prikazuje sve aplikacije pronađene u sistemu. Pokretači se mogu " "dodati odabirom iz liste dostupnih aplikacija, pa klikom na Dodaj " "dugme. " #: ../properties.c:2530 msgid "Applications selected" msgstr "Odabrane aplikacije" #: ../properties.c:2536 msgid "Applications available" msgstr "Dostupne aplikacije" #: ../properties.c:2553 msgid "Moves up the current launcher in the list of selected applications." msgstr "Pomjera trenutni pokretač u listi odabranih aplikacija gore." #: ../properties.c:2561 msgid "Moves down the current launcher in the list of selected applications." msgstr "Pomjera trenutni pokretač u listi odabranih aplikacija dole." #: ../properties.c:2574 msgid "Copies the current application in the list of available applications " "to the list of selected applications." msgstr "Kopira trenutnu aplikaciju iz liste dostupnih aplikacija u listu " "odabranih aplikacija." #: ../properties.c:2582 msgid "Removes the current application from the list of selected " "application." msgstr "Uklanja trenutnu aplikaciju iz liste odabranih aplikacija." #: ../properties.c:2594 msgid "Additional application directories" msgstr "Dodatni direktorijumi za aplikacije" #: ../properties.c:2603 msgid "Specifies a path to a directory from which the launcher is loading " "all .desktop files (all subdirectories are explored recursively). " "Can be used multiple times, in which case the paths must be " "separated by commas. Leading ~ is expaned to the path of the user's " "home directory." msgstr "Određuje putanju do direktorijuma (fascikle, foldera) gdje se " "nalaze .desktop fajlovi (zalazi rekurzivno u poddirektorijume). Može " "se dodati više njih, a u tom slučaju se putanje trebaju odvojiti sa " "zarezom. ~ prefiks se proširuje u putanju korinikovog Home " "direktorija." #: ../properties.c:2629 msgid "Selects the background used to display the launcher. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine za pokretač. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:2633 #, fuzzy msgid "Icon background" msgstr "Neaktivna pozadina" #: ../properties.c:2639 #, fuzzy msgid "Launcher icon" msgstr "Pokretač" #: ../properties.c:2643 #, fuzzy msgid "Selects the background used to display the launcher icon. " "Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za pokretač. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:2657 msgid "Specifies the horizontal padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Određuje horizontalno popunjivanje pokretača. To je prostor između " "ivice i unutrašnjih elemenata." #: ../properties.c:2671 msgid "Specifies the vertical padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Određuje vertikalno popunjivanje pokretača. To je prostor između " "ivice i unutrašnjih elemenata." #: ../properties.c:2685 msgid "Specifies the spacing between the elements inside the launcher." msgstr "Određuje razmak između elemenata unutar pokretača." #: ../properties.c:2688 ../properties.c:4728 msgid "Icon size" msgstr "Veličina ikone" #: ../properties.c:2698 msgid "Specifies the size of the launcher icons, in pixels." msgstr "Određuje veličinu ikona u pokretaču, u pikselima." #: ../properties.c:2702 ../properties.c:3736 ../properties.c:4742 msgid "Icon opacity" msgstr "Prozirnost ikona" #: ../properties.c:2713 msgid "Specifies the opacity of the launcher icons, in percent." msgstr "Određuje prozirnost ikona u pokretaču, u postotcima." #: ../properties.c:2717 ../properties.c:3747 ../properties.c:4757 msgid "Icon saturation" msgstr "Zasićenost ikona" #: ../properties.c:2728 msgid "Specifies the saturation adjustment of the launcher icons, in " "percent." msgstr "Određuje zasićenost boja u ikonama pokretača, u postotcima." #: ../properties.c:2732 ../properties.c:3758 ../properties.c:4772 msgid "Icon brightness" msgstr "Svjetloća ikona" #: ../properties.c:2743 msgid "Specifies the brightness adjustment of the launcher icons, in " "percent." msgstr "Određuje svjetloću ikona u pokretaču, u postotcima." #: ../properties.c:2746 msgid "Icon theme" msgstr "Tema ikona" #: ../properties.c:2760 msgid "The icon theme used to display launcher icons. If left blank, tint2 " "will detect and use the icon theme of your desktop as long as you " "have an XSETTINGS manager running (most desktop environments do)." msgstr "Tema ikona koja se koristi u pokretaču. Ako se ostavi prazno, tint2 " "će otrkiti i koristiti temu koju koristi okruženje ako postoji neki " "XSETTINGS upravljač (ima u većini radnih okruženja)." #: ../properties.c:2764 msgid "Overrides XSETTINGS" msgstr "Zanemari XSETTINGS" #: ../properties.c:2768 msgid "If enabled, the icon theme selected here will override the one " "provided by XSETTINGS." msgstr "Ako je uključeno, izabrana tema će zamjeniti onu iz XSETTINGSa." #: ../properties.c:2771 msgid "Startup notifications" msgstr "Obavještenja o pokretanju" #: ../properties.c:2781 msgid "If enabled, startup notifications are shown when starting " "applications from the launcher. The appearance may vary depending on " "your desktop environment configuration; normally, a busy mouse " "cursor is displayed until the application starts." msgstr "Ako je uključeno, obavještenje o pokretanju aplikacije se prikazuje " "tokom pokretanja. Izgled zavisi od radnog okruženja; obično se " "koristi zauzeti kursor miša dok se aplikacija ne pokrene." #: ../properties.c:2785 ../properties.c:4922 msgid "Tooltips" msgstr "Opisi" #: ../properties.c:2795 msgid "If enabled, shows a tooltip with the application name when the mouse " "is moved over an application launcher." msgstr "Ako je uključeno, prikazuje ime aplikacije ako se mišom pređe preko " "pokretača aplikacije." #: ../properties.c:2842 ../properties.c:4597 msgid "Options" msgstr "Mogućnosti" #: ../properties.c:2857 msgid "Show a taskbar for each desktop" msgstr "Prikaži paletu za svaku radnu površinu" #: ../properties.c:2867 msgid "If enabled, the taskbar is split into multiple smaller taskbars, one " "for each virtual desktop." msgstr "Ako je uključeno, paleta poslova je podijeljena na dijelove, jedan " "dio za svaku virtuelnu radnu površinu." #: ../properties.c:2871 msgid "Distribute size between taskbars" msgstr "Raspodijeli prostor ravnomjerno" #: ../properties.c:2881 msgid "If enabled and 'Show a taskbar for each desktop' is also enabled, " "the available size is distributed between taskbars proportionally to " "the number of tasks." msgstr "Ako je 'Prikaži paletu za svaku radnu površinu' i ovo uključeno, " "prostor će biti raspodijeljen među trakama proporcionalno broju " "njihovih zadataka." #: ../properties.c:2886 msgid "Hide inactive tasks" msgstr "Sakrij neaktivne zadatke" #: ../properties.c:2896 msgid "If enabled, only the active task will be shown in the taskbar." msgstr "Ako je uključeno, samo će aktivni zadatak biti prikazan na traci." #: ../properties.c:2900 msgid "Hide tasks from different monitors" msgstr "Sakrij zadatke sa različitih monitora" #: ../properties.c:2910 msgid "If enabled, tasks that are not on the same monitor as the panel will " "not be displayed. This behavior is enabled automatically if the " "panel monitor is set to 'All'." msgstr "Ako je uključeno, zadaci koji nisu na istom monitoru kao i ploča " "neće biti prikazani. Ovo ponašanje je uključeno automatski ako je " "monitor ploče postaljen na 'Svi'." #: ../properties.c:2916 msgid "Always show all desktop tasks" msgstr "" #: ../properties.c:2926 msgid "Has effect only if 'Show a taskbar for each desktop' is enabled. If " "enabled, tasks that appear on all desktops are shown on all " "taskbars. Otherwise, they are shown only on the taskbar of the " "current desktop." msgstr "" #: ../properties.c:2932 msgid "Task sorting" msgstr "Sortiranje zadataka" #: ../properties.c:2942 ../properties.c:3236 ../properties.c:3272 #: ../properties.c:3308 ../properties.c:3344 ../properties.c:3380 msgid "None" msgstr "Ništa" #: ../properties.c:2943 msgid "By title" msgstr "Po imenu" #: ../properties.c:2944 msgid "By center" msgstr "Po sredini" #: ../properties.c:2945 msgid "Most recently used first" msgstr "" #: ../properties.c:2946 msgid "Most recently used last" msgstr "" #: ../properties.c:2948 msgid "Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can " "also reorder task buttons by mouse dragging. \n" "'By title' means that tasks are sorted by their window titles. \n" "'By center' means that tasks are sorted geometrically by their " "window centers." msgstr "Određuje sortiranje zadataka u paleti. \n" "Ništa: novi zadaci se dodaju na kraj, korisnik ih može poredati " "klikom i pomjeranjem. \n" "Po imenu: zadaci su poredani po imenu njihovih prozora. \n" "Po sredini: zadaci su poredani geometrijski po središtima njihovih " "prozora." #: ../properties.c:2955 msgid "Task alignment" msgstr "Poravnanje zadataka" #: ../properties.c:2965 msgid "Left" msgstr "Lijevo" #: ../properties.c:2966 msgid "Center" msgstr "Sredina" #: ../properties.c:2967 msgid "Right" msgstr "Desno" #: ../properties.c:2969 msgid "Specifies how tasks should be positioned on the taskbar." msgstr "Određuje kako da se pozicioniraju zadaci u traci." #: ../properties.c:2997 msgid "Specifies the horizontal padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Određuje horizontalno popunjavanje trake. To je prostor između trake " "i unutrašnjih elemenata." #: ../properties.c:3012 msgid "Specifies the vertical padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Određuje vertikalno popunjavanje trake. To je prostor između trake i " "unutrašnjih elemenata." #: ../properties.c:3027 msgid "Specifies the spacing between the elements inside the taskbar." msgstr "Određuje razmak između elemenata unutar trake zadataka." #: ../properties.c:3031 ../properties.c:3176 msgid "Active background" msgstr "Aktivna pozadina" #: ../properties.c:3037 #, fuzzy msgid "Active taskbar" msgstr "Aktivni zadatak" #: ../properties.c:3041 msgid "Selects the background used to display the taskbar of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za traku aktivne radne površine. Pozadine se mogu " "uređivati u kartici za Pozadine." #: ../properties.c:3045 ../properties.c:3191 msgid "Inactive background" msgstr "Neaktivna pozadina" #: ../properties.c:3051 #, fuzzy msgid "Inactive taskbar" msgstr "Aktivni zadatak" #: ../properties.c:3055 msgid "Selects the background used to display taskbars of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za traku neaktivne radne površine. Pozadine se mogu " "uređivati u kartici za Pozadine." #: ../properties.c:3060 msgid "Desktop name" msgstr "Ime radne površine" #: ../properties.c:3075 msgid "Show desktop name" msgstr "Prikaži ime radne površine" #: ../properties.c:3085 msgid "If enabled, displays the name of the desktop at the top/left of the " "taskbar. The name is set by your window manager; you might be able " "to configure it there." msgstr "Ako je uključeno, prikazuje ime radne površine u gornjem-lijevom " "uglu trake. Ime određuje upravljač prozora; možda ga možete " "promijeniti u postavkama." #: ../properties.c:3100 msgid "Specifies the horizontal padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Određuje horizontalno popunjavanje imena radne površine. To je " "prostor između ivice i unutrašnjeg teksta." #: ../properties.c:3115 msgid "Specifies the vertical padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Određuje vertikalno popunjavanje imena radne površine. To je prostor " "između ivice i unutrašnjeg teksta." #: ../properties.c:3120 msgid "Active font color" msgstr "Boja aktivnog fonta" #: ../properties.c:3131 msgid "Specifies the font color used to display the name of the current " "desktop." msgstr "Određuje boju fonta koji se koristi za ime aktivne radne površine." #: ../properties.c:3135 msgid "Inactive font color" msgstr "Boja neaktivnog fonta" #: ../properties.c:3146 msgid "Specifies the font color used to display the name of inactive " "desktops." msgstr "Određuje boju fonta koji se koristi za ime neaktivne radne površine." #: ../properties.c:3153 ../properties.c:3542 ../properties.c:4041 #: ../properties.c:4067 ../properties.c:4426 ../properties.c:5070 #: ../properties.c:5095 ../properties.c:5250 msgid "If not checked, the desktop theme font is used. If checked, the " "custom font specified here is used." msgstr "" #: ../properties.c:3156 ../properties.c:3545 ../properties.c:4429 #: ../properties.c:5253 msgid "Font" msgstr "Font" #: ../properties.c:3170 msgid "Specifies the font used to display the desktop name." msgstr "Određuje font koji se koristi za prikaz imena radne površine." #: ../properties.c:3182 #, fuzzy msgid "Active desktop name" msgstr "Prikaži ime radne površine" #: ../properties.c:3186 msgid "Selects the background used to display the name of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za prikaz imena trenutne radne površine. Pozadine se " "mogu uređivati u kartici za Pozadine." #: ../properties.c:3197 #, fuzzy msgid "Inactive desktop name" msgstr "Prikaži ime radne površine" #: ../properties.c:3201 msgid "Selects the background used to display the name of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za prikaz imena neaktivne radne površine. Pozadine " "se mogu uređivati u kartici za Pozadine." #: ../properties.c:3213 ../properties.c:3894 ../properties.c:4279 #: ../properties.c:4909 msgid "Mouse events" msgstr "Radnje miša" #: ../properties.c:3226 msgid "Left click" msgstr "Lijevi klik" #: ../properties.c:3237 ../properties.c:3273 ../properties.c:3309 #: ../properties.c:3345 ../properties.c:3381 msgid "Close" msgstr "Zatvori" #: ../properties.c:3238 ../properties.c:3274 ../properties.c:3310 #: ../properties.c:3346 ../properties.c:3382 msgid "Toggle" msgstr "Prebaci" #: ../properties.c:3239 ../properties.c:3275 ../properties.c:3311 #: ../properties.c:3347 ../properties.c:3383 msgid "Iconify" msgstr "Umanji" #: ../properties.c:3240 ../properties.c:3276 ../properties.c:3348 #: ../properties.c:3384 #, fuzzy msgid "Shade" msgstr "Zatamni" #: ../properties.c:3241 ../properties.c:3277 ../properties.c:3313 #: ../properties.c:3349 ../properties.c:3385 msgid "Toggle or iconify" msgstr "Prebaci ili umanji" #: ../properties.c:3242 ../properties.c:3278 ../properties.c:3314 #: ../properties.c:3350 ../properties.c:3386 msgid "Maximize or restore" msgstr "Uvećaj ili povrati" #: ../properties.c:3243 ../properties.c:3279 ../properties.c:3315 #: ../properties.c:3351 ../properties.c:3387 msgid "Desktop left" msgstr "Lijeva radna površina" #: ../properties.c:3244 ../properties.c:3280 ../properties.c:3316 #: ../properties.c:3352 ../properties.c:3388 msgid "Desktop right" msgstr "Desna radna površina" #: ../properties.c:3245 ../properties.c:3281 ../properties.c:3317 #: ../properties.c:3353 ../properties.c:3389 msgid "Next task" msgstr "Sljedeći zadatak" #: ../properties.c:3246 ../properties.c:3282 ../properties.c:3318 #: ../properties.c:3354 ../properties.c:3390 msgid "Previous task" msgstr "Prethodni zadatak" #: ../properties.c:3248 #, fuzzy msgid "Specifies the action performed when task buttons receive a left " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon lijevog klika na zadatak: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3262 msgid "Wheel scroll up" msgstr "Kolutić miša gore" #: ../properties.c:3284 msgid "Specifies the action performed when task buttons receive a scroll up " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon pomijeranja kolutića miša gore na zadatku: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3298 msgid "Middle click" msgstr "Srednji klik" #: ../properties.c:3312 #, fuzzy msgid "sShade" msgstr "zZatamni" #: ../properties.c:3320 msgid "Specifies the action performed when task buttons receive a middle " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon srednjeg klika na zadatak: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3334 msgid "Wheel scroll down" msgstr "Kolutić miša dole" #: ../properties.c:3356 msgid "Specifies the action performed when task buttons receive a scroll " "down event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon pomijeranja kolutića miša dole na zadatku: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3370 msgid "Right click" msgstr "Desni klik" #: ../properties.c:3392 msgid "Specifies the action performed when task buttons receive a right " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon desnog klika na zadatak: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3420 ../properties.c:4218 msgid "Show icon" msgstr "Prikaži ikonu" #: ../properties.c:3430 msgid "If enabled, the window icon is shown on task buttons." msgstr "Ako je uključeno, prikazuje ikonu prozora na dugmetu zadatka." #: ../properties.c:3433 msgid "Show text" msgstr "Prikaži tekst" #: ../properties.c:3443 msgid "If enabled, the window title is shown on task buttons." msgstr "Ako je uključeno, prikazuje ime prоzora na dugmetu zadatka." #: ../properties.c:3446 msgid "Center text" msgstr "Centriraj tekst" #: ../properties.c:3456 msgid "If enabled, the text is centered on task buttons. Otherwise, it is " "left-aligned." msgstr "Ako je uključeno, tekst se centrira na dugmetu zadatka. U suprotnom " "je poredano ulijevo." #: ../properties.c:3459 msgid "Show tooltips" msgstr "Prikaži opise" #: ../properties.c:3469 msgid "If enabled, a tooltip showing the window title is displayed when the " "mouse cursor moves over task buttons." msgstr "Ako je uključeno, prikazuje ime prozora kad se mišom pređe preko " "dugmeta zadatka." #: ../properties.c:3472 msgid "Maximum width" msgstr "Maksimalna širina" #: ../properties.c:3482 msgid "Specifies the maximum width of the task buttons." msgstr "Određuje maksimalnu širinu dugmadi zadataka." #: ../properties.c:3485 msgid "Maximum height" msgstr "Maksimalna visina" #: ../properties.c:3495 msgid "Specifies the maximum height of the task buttons." msgstr "Određuje maksimalnu visinu dugmadi zadataka." #: ../properties.c:3508 msgid "Specifies the horizontal padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Određuje horizontalno popunjavanje dugmadi. To je prostor između " "ivice i unutrašnjeg sadržaja." #: ../properties.c:3522 msgid "Specifies the vertical padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Određuje vertikalno popunjavanje dugmadi. To je prostor između ivice " "i unutrašnjeg sadržaja." #: ../properties.c:3536 msgid "Specifies the spacing between the icon and the text." msgstr "Određuje razmak između ikone i teksta." #: ../properties.c:3556 msgid "Specifies the font used to display the task button text." msgstr "Određuje font za prikaz teksta na dugmetu zadatka." #: ../properties.c:3568 msgid "Default style" msgstr "Standardni izgled" #: ../properties.c:3569 #, fuzzy msgid "Default task" msgstr "Standardni izgled" #: ../properties.c:3579 ../properties.c:3580 msgid "Normal task" msgstr "Normalni zadatak" #: ../properties.c:3590 ../properties.c:3591 msgid "Active task" msgstr "Aktivni zadatak" #: ../properties.c:3601 ../properties.c:3602 msgid "Urgent task" msgstr "Hitni zadatak" #: ../properties.c:3612 ../properties.c:3613 msgid "Iconified task" msgstr "Umanjeni zadatak" #: ../properties.c:3717 msgid "If enabled, a custom font color is used to display the task text." msgstr "Ako je uključeno, koristi izabranu boju fonta za prikaz teksta " "zadatka." #: ../properties.c:3719 ../properties.c:4089 ../properties.c:4444 #: ../properties.c:5117 ../properties.c:5269 msgid "Font color" msgstr "Boja fonta" #: ../properties.c:3728 msgid "Specifies the font color used to display the task text." msgstr "Određuje boju fonta koja se koristi za prikaz teksta zadatka." #: ../properties.c:3734 msgid "If enabled, a custom opacity/saturation/brightness is used to " "display the task icon." msgstr "Ako je uključeno, koriste se vrijednost izabrane od korisnika za " "prozirnost/zasićenje/svjetlost ikone zadatka." #: ../properties.c:3745 msgid "Specifies the opacity (in %) used to display the task icon." msgstr "Određuje prozirnost (u %) za prikaz ikone zadatka." #: ../properties.c:3756 msgid "Specifies the saturation adjustment (in %) used to display the task " "icon." msgstr "Određuje zasićenost boja (u %) za prikaz ikone zadatka" #: ../properties.c:3767 msgid "Specifies the brightness adjustment (in %) used to display the task " "icon." msgstr "Određuje svjetlost (u %) za prikaz ikone zadatka." #: ../properties.c:3773 msgid "If enabled, a custom background is used to display the task." msgstr "Ako je uključeno, posebna pozadina se koristi pri prikazu zadatka." #: ../properties.c:3783 msgid "Selects the background used to display the task. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Odabir pozadine za zadatak. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:3787 msgid "Blinks" msgstr "Treptanje" #: ../properties.c:3795 msgid "Specifies how many times urgent tasks blink." msgstr "Određuje koliko će puta trepnuti hitni zadaci." #: ../properties.c:3817 ../properties.c:4177 msgid "Format" msgstr "Format" #: ../properties.c:3829 msgid "First line format" msgstr "Format prve linije" #: ../properties.c:3841 msgid "Specifies the format used to display the first line of the clock " "text. See 'man strftime' for all the available options." msgstr "Određuje format za prikaz prve linije sata. Pogledaj 'man strftime' " "za sve dostupne mogućnosti." #: ../properties.c:3845 msgid "Second line format" msgstr "Format druge linije" #: ../properties.c:3857 msgid "Specifies the format used to display the second line of the clock " "text. See 'man strftime' for all the available options." msgstr "Određuje format za prikaz druge linije sata. Pogledaj 'man strftime' " "za sve dostupne mogućnosti." #: ../properties.c:3861 msgid "First line timezone" msgstr "Vremenska zona prve linije" #: ../properties.c:3873 msgid "Specifies the timezone used to display the first line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Određuje vremensku zonu pri prikazu vremena prve linije. Ako je " "prazno koristi se trenutna vremenska zona. U suprotnom, mora biti " "unešena u obliku važeće TZ promjenljive okruženja (environment " "variable)." #: ../properties.c:3877 msgid "Second line timezone" msgstr "Vremenska zona druge linije" #: ../properties.c:3889 msgid "Specifies the timezone used to display the second line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Određuje vremensku zonu pri prikazu vremena druge linije. Ako je " "prazno koristi se trenutna vremenska zona. U suprotnom, mora biti " "unešena u obliku važeće TZ promjenljive okruženja (environment " "variable)." #: ../properties.c:3907 ../properties.c:4292 ../properties.c:4936 msgid "Left click command" msgstr "Komanda lijevog klika" #: ../properties.c:3919 msgid "Specifies a command that will be executed when the clock receives a " "left click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:3922 ../properties.c:4307 ../properties.c:4951 msgid "Right click command" msgstr "Komanda desnog klika" #: ../properties.c:3934 msgid "Specifies a command that will be executed when the clock receives a " "right click." msgstr "Određuje komandu koja će biti izvršena nakon desnog klika na sat." #: ../properties.c:3937 ../properties.c:4322 ../properties.c:4966 #, fuzzy msgid "Middle click command" msgstr "Komanda lijevog klika" #: ../properties.c:3949 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "middle click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:3952 ../properties.c:4337 ../properties.c:4981 #, fuzzy msgid "Wheel scroll up command" msgstr "Kolutić miša gore" #: ../properties.c:3964 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll up." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:3967 ../properties.c:4352 ../properties.c:4996 #, fuzzy msgid "Wheel scroll down command" msgstr "Kolutić miša dole" #: ../properties.c:3979 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll down." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4006 msgid "Selects the background used to display the clock. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Odabir pozadine za sat. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:4020 msgid "Specifies the horizontal padding of the clock. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4034 msgid "Specifies the vertical padding of the clock. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4044 ../properties.c:5073 msgid "Font first line" msgstr "Font prve linije" #: ../properties.c:4059 msgid "Specifies the font used to display the first line of the clock." msgstr "Određuje font korišten za prikaz prve linije sata." #: ../properties.c:4070 ../properties.c:5098 msgid "Font second line" msgstr "Font druge linije" #: ../properties.c:4084 msgid "Specifies the font used to display the second line of the clock." msgstr "Određuje font korišten za prikaz druge linije sata." #: ../properties.c:4100 msgid "Specifies the font color used to display the clock." msgstr "Određuje boju fonta korištenog za prikaz sata." #: ../properties.c:4104 msgid "Tooltip" msgstr "Opisi" #: ../properties.c:4117 msgid "Format" msgstr "Format" #: ../properties.c:4128 msgid "Specifies the format used to display the clock tooltip. See 'man " "strftime' for the available options." msgstr "Određuje format korišten pri prikazivanju opisa sata. Pogledaj 'man " "strftime' za sve mogućnosti." #: ../properties.c:4132 msgid "Timezone" msgstr "Vremenska zona" #: ../properties.c:4143 msgid "Specifies the timezone used to display the clock tooltip. If empty, " "the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "Određuje vremensku zonu prikazanu u opisu sata. Ako je prazno, " "trenutna vremenska zona se koristi. U suprotnom, mora biti unešena u " "obliku važeće TZ promjenljive okruženja (environment variable)." #: ../properties.c:4189 #, fuzzy msgid "Command" msgstr "Komanda upozorenja" #: ../properties.c:4201 #, fuzzy msgid "Specifies the command to execute." msgstr "Određuje font koji se koristi za prikaz imena radne površine." #: ../properties.c:4204 msgid "Interval" msgstr "" #: ../properties.c:4214 msgid "Specifies the interval at which the command is executed, in seconds. " "If zero, the command is executed only once." msgstr "" #: ../properties.c:4228 msgid "If enabled, the first line printed by the command is interpreted as " "a path to an image file." msgstr "" #: ../properties.c:4232 #, fuzzy msgid "Cache icon" msgstr "Pokretač" #: ../properties.c:4243 msgid "If enabled, the image is not reloaded from disk every time the " "command is executed if the path remains unchanged. Enabling this is " "recommended." msgstr "" #: ../properties.c:4246 msgid "Continuous output" msgstr "" #: ../properties.c:4256 msgid "If non-zero, the last execp_continuous lines from the output of the " "command are displayed, every execp_continuous lines; this is useful " "for showing the output of commands that run indefinitely, such as " "'ping 127.0.0.1'. If zero, the output of the command is displayed " "after it finishes executing." msgstr "" #: ../properties.c:4262 msgid "Display markup" msgstr "" #: ../properties.c:4273 msgid "If enabled, the output of the command is treated as Pango markup, " "which allows rich text formatting. Note that using this with " "commands that print data downloaded from the Internet is a potential " "security risk." msgstr "" #: ../properties.c:4304 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a left click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4319 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a right click." msgstr "Određuje komandu koja će biti izvršena nakon desnog klika na sat." #: ../properties.c:4334 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a middle click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4349 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll up." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4364 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll down." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4391 #, fuzzy msgid "Selects the background used to display the executor. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine za sat. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:4405 #, fuzzy msgid "Specifies the horizontal padding of the executor. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4419 #, fuzzy msgid "Specifies the vertical padding of the executor. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4457 #, fuzzy msgid "Centered" msgstr "Sredina" #: ../properties.c:4469 #, fuzzy msgid "Icon width" msgstr "Tema ikona" #: ../properties.c:4479 msgid "If non-zero, the image is resized to this width." msgstr "" #: ../properties.c:4482 #, fuzzy msgid "Icon height" msgstr "Svjetloća ikona" #: ../properties.c:4492 msgid "If non-zero, the image is resized to this height." msgstr "" #: ../properties.c:4508 #, fuzzy msgid "Tooltip text" msgstr "Opisi" #: ../properties.c:4520 msgid "The tooltip text to display. Leave this empty to display an " "automatically generated tooltip with information about when the " "command was last executed." msgstr "" #: ../properties.c:4611 msgid "Icon ordering" msgstr "Redoslijed ikona" #: ../properties.c:4621 msgid "Ascending" msgstr "Uzlazno" #: ../properties.c:4622 msgid "Descending" msgstr "Silazno" #: ../properties.c:4623 msgid "Left to right" msgstr "Lijevo prema desno" #: ../properties.c:4624 msgid "Right to left" msgstr "Desno prema lijevo" #: ../properties.c:4626 msgid "Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their " "window names. \n" "'Descending' means that icons are sorted in descending order of " "their window names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right." msgstr "Određuje redoslijed kojim se aranžiraju ikone u alatnoj traci. \n" "Uzlazno: poredane su uzlazno po imenu njihovog prozora. \n" "Silazno: poredane su silazno po imenu njihovog prozora. \n" "Lijevo prema desno: ikone se uvijek dodaju s lijeva nadesno. \n" "Desno prema lijevo: ikone se uvijek dodaju s desna nalijevo." #: ../properties.c:4651 msgid "Specifies the monitor on which to place the system tray. Due to " "technical limitations, the system tray cannot be displayed on " "multiple monitors." msgstr "Određuje mоnitor na kom da se prikaže sistemska traka. Zbog tehnički " "ograničenja, traka ne može biti prikazana na više monitora." #: ../properties.c:4675 #, fuzzy msgid "Systray" msgstr "Sistemska traka" #: ../properties.c:4679 msgid "Selects the background used to display the system tray. Backgrounds " "can be edited in the Backgrounds tab." msgstr "Odabir pozadine za sistemsku traku. Pozadine se mogu uređivati u " "kartici za Pozadine." #: ../properties.c:4694 msgid "Specifies the horizontal padding of the system tray. This is the " "space between the border and the content inside." msgstr "Određuje horizontalno popunjavanje sistemske trake. To je prostor " "između ivice i unutrašnjeg sadržaja." #: ../properties.c:4709 msgid "Specifies the vertical padding of the system tray. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje sistemske trake. To je prostor " "između ivice i unutrašnjeg sadržaja." #: ../properties.c:4724 msgid "Specifies the spacing between system tray icons." msgstr "Određuje razmak između ikona u sistemskoj traci." #: ../properties.c:4738 msgid "Specifies the size of the system tray icons, in pixels." msgstr "Određuje veličinu ikona u traci, u pikselima." #: ../properties.c:4753 msgid "Specifies the opacity of the system tray icons, in percent." msgstr "Određuje prozirnost ikona u sistemskoj traci, u postotcima." #: ../properties.c:4768 msgid "Specifies the saturation adjustment of the system tray icons, in " "percent." msgstr "Određuje zasićenost boja ikona u sistemskoj traci, u postotcima." #: ../properties.c:4783 msgid "Specifies the brightness adjustment of the system tray icons, in " "percent." msgstr "Određuje svjetlost ikona u sistemskoj traci, u postotcima." #: ../properties.c:4799 msgid "Thresholds" msgstr "Prag" #: ../properties.c:4812 msgid "Hide if charge higher than" msgstr "Sakrij ako je punija od" #: ../properties.c:4822 msgid "Minimum battery level for which to hide the batter applet. Use 101 " "to always show the batter applet." msgstr "Najmanji nivo baterijе kod kojeg da se sakrije aplet (prikaz). " "Koristi 101 da se uvijek prikazuje." #: ../properties.c:4824 ../properties.c:4843 msgid "%" msgstr "%" #: ../properties.c:4831 msgid "Alert if charge lower than" msgstr "Upozori ako spane ispod" #: ../properties.c:4841 msgid "Battery level for which to display an alert." msgstr "Nivo baterije za prikaz upozorenja." #: ../properties.c:4850 msgid "Alert command" msgstr "Komanda upozorenja" #: ../properties.c:4861 msgid "Command to be executed when the alert threshold is reached." msgstr "Komanda koja se izvodi kad se dostigne prag." #: ../properties.c:4865 #, fuzzy msgid "AC connection events" msgstr "Radnje miša" #: ../properties.c:4878 #, fuzzy msgid "AC connected command" msgstr "Komanda upozorenja" #: ../properties.c:4890 #, fuzzy msgid "Specifies a command that will be executed when AC is connected to " "the system." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4893 #, fuzzy msgid "AC disconnected command" msgstr "Komanda upozorenja" #: ../properties.c:4905 #, fuzzy msgid "Specifies a command that will be executed when AC is disconnected to " "the system." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4933 #, fuzzy msgid "If enabled, shows a tooltip with detailed battery information when " "the mouse is moved over the battery widget." msgstr "Ako je uključeno, prikazuje ime aplikacije ako se mišom pređe preko " "pokretača aplikacije." #: ../properties.c:4948 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a left click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4963 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a right click." msgstr "Određuje komandu koja će biti izvršena nakon desnog klika na sat." #: ../properties.c:4978 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a middle click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4993 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll up." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:5008 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll down." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:5035 msgid "Selects the background used to display the battery. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine za prikaz nivoa baterije. Pozadine se mogu uređivati " "u kartici za Pozadine. " #: ../properties.c:5049 msgid "Specifies the horizontal padding of the battery. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje oko baterije. To je prostor " "između ivice i unutrašnjeg sadržaja." #: ../properties.c:5063 msgid "Specifies the vertical padding of the battery. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje oko baterije. To je prostor između " "ivice i unutrašnjeg sadržaja." #: ../properties.c:5087 msgid "Specifies the font used to display the first line of the battery " "text." msgstr "Određuje font za prikaz prve linije baterijskog teksta." #: ../properties.c:5112 msgid "Specifies the font used to display the second line of the battery " "text." msgstr "Određuje font za prikaz druge linije baterijskog teksta." #: ../properties.c:5128 msgid "Specifies the font clor used to display the battery text." msgstr "Određuje boju fonta za prikaz baterijskog teksta." #: ../properties.c:5140 #, fuzzy msgid "Timing" msgstr "Tajming" #: ../properties.c:5153 msgid "Show delay" msgstr "Zakašnjenje prikazivanja" #: ../properties.c:5163 msgid "Specifies a delay after which to show the tooltip when moving the " "mouse over an element." msgstr "Određuje zakašnjenje nakon kojeg će se prikazati opis tokom " "pomjeranja kursora preko elementa." #: ../properties.c:5172 msgid "Hide delay" msgstr "Zakašnjenje skrivanja" #: ../properties.c:5181 msgid "Specifies a delay after which to hide the tooltip when moving the " "mouse outside an element." msgstr "Određuje zakašnjenje nakon kojeg da se sakrije opis nakon pomjeranja " "kursora van nekog elementa." #: ../properties.c:5215 msgid "Selects the background used to display the tooltip. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine opisa. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:5229 msgid "Specifies the horizontal padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje za opis. To je prostor između " "ivice i unutrašnjeg sadržaja." #: ../properties.c:5243 msgid "Specifies the vertical padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje za opis. To je prostor između ivice " "i unutrašnjeg sadržaja." #: ../properties.c:5264 msgid "Specifies the font used to display the text of the tooltip." msgstr "Određuje font za prikaz teksta unutar opisa." #: ../properties.c:5280 msgid "Specifies the font color used to display the text of the tooltip." msgstr "Određuje boju fonta za prikaz teksta unutar opisa." #: ../main.c:148 msgid "tint2conf" msgstr "tint2conf" #: ../main.c:156 msgid "Panel theming" msgstr "Izgled ploče" #: ../main.c:166 msgid "Theme" msgstr "Tema" #: ../main.c:167 msgid "_Import theme..." msgstr "_Importuj temu..." #: ../main.c:167 msgid "Import theme" msgstr "Importuj temu" #: ../main.c:168 msgid "_Import default theme..." msgstr "_Importuj standardnu temu..." #: ../main.c:168 msgid "Import default theme" msgstr "Importuj standardnu temu" #: ../main.c:169 msgid "_Save as..." msgstr "_Snimiti kao..." #: ../main.c:169 ../main.c:335 msgid "Save theme as" msgstr "Snimiti temu kao" #: ../main.c:170 msgid "_Delete" msgstr "Iz_briši" #: ../main.c:170 msgid "Delete theme" msgstr "Izbriši temu" #: ../main.c:171 msgid "_Edit theme..." msgstr "Ur_edi temu..." #: ../main.c:171 msgid "Edit selected theme" msgstr "Uredi odabranu temu" #: ../main.c:172 msgid "_Make default" msgstr "" #: ../main.c:172 msgid "Replace the default theme with the selected one" msgstr "" #: ../main.c:173 msgid "_Quit" msgstr "_Napusti" #: ../main.c:173 msgid "Quit" msgstr "Napusti" #: ../main.c:174 msgid "Edit" msgstr "Uredi" #: ../main.c:175 msgid "Refresh" msgstr "Osvježi" #: ../main.c:176 msgid "Refresh all" msgstr "Osvježi sve" #: ../main.c:177 msgid "Help" msgstr "Pomoć" #: ../main.c:178 msgid "_About" msgstr "_O programu" #: ../main.c:178 msgid "About" msgstr "O programu" #: ../main.c:198 msgid "Command to run tint2: " msgstr "Komanda za pokretanje tint2: " #: ../main.c:242 msgid "Theming tool for tint2 panel" msgstr "Alat za uređivanje tint2 tema" #: ../main.c:244 msgid "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" msgstr "Autorska prava 2009-2015 tint2 tim\n" "Tint2 licenca GNU GPL verzija 2\n" "Tintwizard licenca GNU GPL verzija 3" #: ../main.c:249 msgid "translator-credits" msgstr "Dino Duratović " #: ../main.c:258 msgid "Import theme(s)" msgstr "Importuj temu(e)" #: ../main.c:293 msgid "Save default theme as" msgstr "Snimiti standardnu temu kao" #: ../main.c:325 msgid "Select the theme to be saved." msgstr "Izaberi temu za snimanje." tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/fr.po000066400000000000000000002412241265276141000245410ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "Project-Id-Version: tint2conf 0.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-17 13:33+0100\n" "PO-Revision-Date: 2015-11-01 13:40+0100\n" "Last-Translator: Jocelyn \n" "Language-Team: Bento \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.6.10\n" #: ../properties.c:256 msgid "Properties" msgstr "Propriétés" #: ../properties.c:290 msgid "Backgrounds" msgstr "Arrières-plans" #: ../properties.c:298 ../properties.c:1276 msgid "Panel" msgstr "Panel" #: ../properties.c:306 msgid "Panel items" msgstr "Éléments du panel" #: ../properties.c:314 ../properties.c:1682 ../properties.c:1876 msgid "Taskbar" msgstr "Barre des tâches" #: ../properties.c:322 msgid "Task buttons" msgstr "Raccourcis" #: ../properties.c:330 ../properties.c:1687 ../properties.c:1879 #: ../properties.c:2625 msgid "Launcher" msgstr "Lanceur" #: ../properties.c:338 ../properties.c:1672 ../properties.c:1870 #: ../properties.c:4002 msgid "Clock" msgstr "Horloge" #: ../properties.c:346 ../properties.c:1677 ../properties.c:1873 msgid "System tray" msgstr "Zone de notification" #: ../properties.c:354 ../properties.c:1667 ../properties.c:1867 #: ../properties.c:5031 msgid "Battery" msgstr "Batterie" #: ../properties.c:362 ../properties.c:4495 ../properties.c:5211 msgid "Tooltip" msgstr "Infobulle" #: ../properties.c:516 msgid "Background" msgstr "Arrière-plan" #: ../properties.c:527 msgid "Selects the background you would like to modify" msgstr "Sélectionne l'arrière plan que vous souhaitez modifier" #: ../properties.c:534 msgid "Creates a copy of the current background" msgstr "Crée une copie de l'actuel arrière-plan" #: ../properties.c:541 msgid "Deletes the current background" msgstr "Supprime l'arrière-plan actuel" #: ../properties.c:550 msgid "Fill color" msgstr "Couleur de remplissage" #: ../properties.c:561 msgid "The fill color of the current background" msgstr "Couleur de remplissage de l'actuel arrière-plan" #: ../properties.c:564 msgid "Border color" msgstr "Couleur de la bordure" #: ../properties.c:575 msgid "The border color of the current background" msgstr "Couleur de bordure de l'actuel arrière-plan" #: ../properties.c:578 msgid "Fill color (mouse over)" msgstr "Couleur de remplissage (rollover)" #: ../properties.c:589 msgid "The fill color of the current background on mouse over" msgstr "Couleur de remplissage de l'actuel arrière-plan au passage de la " "souris" #: ../properties.c:592 msgid "Border color (mouse over)" msgstr "Couleur de la bordure (rollover)" #: ../properties.c:603 msgid "The border color of the current background on mouse over" msgstr "Couleur de bordure de l'actuel arrière-plan au passage de la souris" #: ../properties.c:606 msgid "Fill color (pressed)" msgstr "Couleur de remplissage (cliqué)" #: ../properties.c:617 msgid "The fill color of the current background on mouse button press" msgstr "Couleur de remplissage de l'actuel arrière-plan lorsque " "l'utilisateur presse le bouton de la souris" #: ../properties.c:620 msgid "Border color (pressed)" msgstr "Couleur de la bordure (cliqué)" #: ../properties.c:631 msgid "The border color of the current background on mouse button press" msgstr "Couleur de bordure de l'actuel arrière-plan lorsque l'utilisateur " "presse le bouton de la souris" #: ../properties.c:634 msgid "Border width" msgstr "Largeur de la bordure" #: ../properties.c:644 msgid "The width of the border of the current background, in pixels" msgstr "Largeur de la bordure de l'actuel arrière-plan, en pixels" #: ../properties.c:647 msgid "Corner radius" msgstr "Rayon d'angle" #: ../properties.c:657 msgid "The corner radius of the current background" msgstr "Rayon d'angle de l'actuel arrière-plan" #: ../properties.c:1075 msgid "Geometry" msgstr "Géometrie" #: ../properties.c:1092 msgid "Position" msgstr "Position" #: ../properties.c:1113 msgid "Position on screen: top-left, horizontal panel" msgstr "Position sur l'écran: panel horizontal, en haut à gauche" #: ../properties.c:1115 msgid "Position on screen: top-center, horizontal panel" msgstr "Position sur l'écran: panel horizontal, en haut au centre" #: ../properties.c:1117 msgid "Position on screen: top-right, horizontal panel" msgstr "Position sur l'écran: panel horizontal, en haut à droite" #: ../properties.c:1119 msgid "Position on screen: top-left, vertical panel" msgstr "Position sur l'écran: panel vertical, en haut à gauche" #: ../properties.c:1121 msgid "Position on screen: center-left, vertical panel" msgstr "Position sur l'écran: panel vertical, en haut au centre" #: ../properties.c:1123 msgid "Position on screen: bottom-left, vertical panel" msgstr "Position sur l'écran: panel vertical, en bas à gauche" #: ../properties.c:1125 msgid "Position on screen: top-right, vertical panel" msgstr "Position sur l'écran: panel vertical, en haut à droite" #: ../properties.c:1127 msgid "Position on screen: center-right, vertical panel" msgstr "Position sur l'écran: panel vertical, en haut au centre" #: ../properties.c:1129 msgid "Position on screen: bottom-right, vertical panel" msgstr "Position sur l'écran: panel vertical, en bas à droite" #: ../properties.c:1131 msgid "Position on screen: bottom-left, horizontal panel" msgstr "Position sur l'écran: panel horizontal, en bas à gauche" #: ../properties.c:1133 msgid "Position on screen: bottom-center, horizontal panel" msgstr "Position sur l'écran: panel horizontal, en bas au centre" #: ../properties.c:1135 msgid "Position on screen: bottom-right, horizontal panel" msgstr "Position sur l'écran: panel horizontal, en bas à droite" #: ../properties.c:1140 ../properties.c:4634 msgid "Monitor" msgstr "Moniteur" #: ../properties.c:1150 msgid "All" msgstr "Tous" #: ../properties.c:1151 ../properties.c:4644 msgid "1" msgstr "1" #: ../properties.c:1152 ../properties.c:4645 msgid "2" msgstr "2" #: ../properties.c:1153 ../properties.c:4646 msgid "3" msgstr "3" #: ../properties.c:1154 ../properties.c:4647 msgid "4" msgstr "4" #: ../properties.c:1155 ../properties.c:4648 msgid "5" msgstr "5" #: ../properties.c:1156 ../properties.c:4649 msgid "6" msgstr "6" #: ../properties.c:1158 msgid "The monitor on which the panel is placed" msgstr "Moniteur sur lequel se trouve le panel" #: ../properties.c:1162 msgid "Primary monitor first" msgstr "Moniteur principal en premier" #: ../properties.c:1172 msgid "If enabled, the primary monitor will have index 1 in the monitor " "list even if it is not top-left." msgstr "Si cette option est activée, le moniteur principal est le premier " "dans la liste des moniteurs, même s'il est pas au top-gauche." #: ../properties.c:1176 msgid "Length" msgstr "Longueur" #: ../properties.c:1186 msgid "The length of the panel (width for horizontal panels, height for " "vertical panels)" msgstr "Longueur du panel (largeur pour les panels horizontaux, hauteur pour " "les verticaux)" #: ../properties.c:1192 ../properties.c:1215 msgid "Percent" msgstr "Pourcentage" #: ../properties.c:1193 ../properties.c:1216 msgid "Pixels" msgstr "Pixels" #: ../properties.c:1195 msgid "The units used to specify the length of the panel: pixels or " "percentage of the monitor size" msgstr "Unités utilisées pour spécifier la longueur du panel: pixels ou " "pourcentage de la taille du moniteur" #: ../properties.c:1199 msgid "Size" msgstr "Taille" #: ../properties.c:1209 msgid "The size of the panel (height for horizontal panels, width for " "vertical panels)" msgstr "Taille du panel (hauteur pour les panels horizontaux, largeur pour " "les verticaux) " #: ../properties.c:1218 msgid "The units used to specify the size of the panel: pixels or " "percentage of the monitor size" msgstr "Unités utilisées pour spécifier la taille du panel: pixels ou " "pourcentage de la taille du moniteur" #: ../properties.c:1222 msgid "Horizontal margin" msgstr "Marge horizontale" #: ../properties.c:1232 msgid "Creates a space between the panel and the edge of the monitor. For " "left-aligned panels, the space is created on the right of the panel; " "for right-aligned panels, it is created on the left; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Crée un espace entre le panel et le bord du moniteur. Pour les " "panels alignés à gauche, l'espace est créé à droite du panel; pour " "ceux alignés à droite, il est créé sur sa gauche; pour les panels " "centrés, il est réparti uniformément des deux côtés du panel." #: ../properties.c:1239 msgid "Vertical margin" msgstr "Marge verticale" #: ../properties.c:1249 msgid "Creates a space between the panel and the edge of the monitor. For " "top-aligned panels, the space is created on the bottom of the panel; " "for bottom-aligned panels, it is created on the top; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Crée un espace entre le panel et le bord du moniteur. Pour les " "panels alignés en haut, l'espace est créé à la base du panel; pour " "ceux alignés en bas, il est créé à son sommet; pour les panels " "centrés, il est réparti uniformément des deux côtés du panel." #: ../properties.c:1256 ../properties.c:2606 ../properties.c:2973 #: ../properties.c:3407 ../properties.c:3983 ../properties.c:4368 #: ../properties.c:4656 ../properties.c:5012 ../properties.c:5192 msgid "Appearance" msgstr "Apparence" #: ../properties.c:1270 ../properties.c:2619 ../properties.c:3775 #: ../properties.c:3996 ../properties.c:4381 ../properties.c:4669 #: ../properties.c:5025 ../properties.c:5205 msgid "Background" msgstr "Arrière-plan" #: ../properties.c:1280 msgid "Selects the background used to display the panel. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher le panel. Les " "arrières-plans peuvent être édités dans l'onglet Arrières-plans." #: ../properties.c:1285 ../properties.c:2647 ../properties.c:2987 #: ../properties.c:3090 ../properties.c:3498 ../properties.c:4010 #: ../properties.c:4395 ../properties.c:4684 ../properties.c:5039 #: ../properties.c:5219 msgid "Horizontal padding" msgstr "Remplissage horizontal" #: ../properties.c:1295 msgid "Specifies the horizontal padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Spécifie le remplissage horizontal du panel. C'est l'espace entre la " "bordure du panel et les éléments qu'il contient." #: ../properties.c:1300 ../properties.c:2661 ../properties.c:3002 #: ../properties.c:3105 ../properties.c:3512 ../properties.c:4024 #: ../properties.c:4409 ../properties.c:4699 ../properties.c:5053 #: ../properties.c:5233 msgid "Vertical padding" msgstr "Remplissage vertical" #: ../properties.c:1310 msgid "Specifies the vertical padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Spécifie le remplissage vertical du panel. C'est l'espace entre la " "bordure du panel et les éléments qu'il contient." #: ../properties.c:1315 ../properties.c:2675 ../properties.c:3017 #: ../properties.c:3526 ../properties.c:4714 msgid "Spacing" msgstr "Espacement" #: ../properties.c:1325 msgid "Specifies the spacing between elements inside the panel." msgstr "Spécifie l'espacement entre les éléments à l'intérieur du panel." #: ../properties.c:1329 msgid "Ignore compositor" msgstr "Ignorer le compositeur" #: ../properties.c:1339 msgid "If enabled, the compositor will not be used to draw a transparent " "panel. May fix display corruption problems on broken graphics stacks." msgstr "Si l'option est activée, le compositeur ne sera pas utilisé pour " "dessiner un panel transparent. Ceci peut régler des erreurs " "d'affichage sur des configurations graphiques cassées." #: ../properties.c:1343 msgid "Font shadows" msgstr "Ombres" #: ../properties.c:1353 msgid "If enabled, a shadow will be drawn behind text. This may improve " "legibility on transparent panels." msgstr "Si l'option est activée, une ombre sera dessinée derrière le texte. " "Ceci peut améliorer la lisibilité sur des panels transparents." #: ../properties.c:1358 msgid "Mouse effects" msgstr "Effet de rollover" #: ../properties.c:1368 msgid "Clickable interface items change appearance when the mouse is moved " "over them." msgstr "Les éléments de l'interface cliquables changent d'aspect lorsque la " "souris est déplacée sur eux." #: ../properties.c:1372 msgid "Icon opacity (hovered)" msgstr "Opacité de l'icône (rollover)" #: ../properties.c:1383 msgid "Specifies the opacity adjustment of the icons under the mouse, in " "percent." msgstr "Spécifie l'ajustement de l'opacité des icônes, en pourcents, au " "passage de la souris." #: ../properties.c:1387 msgid "Icon saturation (hovered)" msgstr "Saturation de l'icône (rollover)" #: ../properties.c:1398 msgid "Specifies the saturation adjustment of the icons under the mouse, in " "percent." msgstr "Spécifie l'ajustement de la saturation des icônes, en pourcents, au " "passage de la souris." #: ../properties.c:1402 msgid "Icon brightness (hovered)" msgstr "Luminosité de l'icône (rollover)" #: ../properties.c:1413 msgid "Specifies the brightness adjustment of the icons under the mouse, in " "percent." msgstr "Spécifie l'ajustement de la luminosité des icônes, en pourcents, au " "passage de la souris." #: ../properties.c:1417 msgid "Icon opacity (pressed)" msgstr "Opacité de l'icône (cliqué)" #: ../properties.c:1428 msgid "Specifies the opacity adjustment of the icons on mouse button press, " "in percent." msgstr "Spécifie l'ajustement de l'opacité des icônes, en pourcents, lorsque " "l'utilisateur presse le bouton de la souris." #: ../properties.c:1432 msgid "Icon saturation (pressed)" msgstr "Saturation de l'icône (cliqué)" #: ../properties.c:1443 msgid "Specifies the saturation adjustment of the icons on mouse button " "press, in percent." msgstr "Spécifie l'ajustement de la saturation des icônes, en pourcents, " "lorsque l'utilisateur presse le bouton de la souris." #: ../properties.c:1447 msgid "Icon brightness (pressed)" msgstr "Luminosité de l'icône (cliqué)" #: ../properties.c:1458 msgid "Specifies the brightness adjustment of the icons on mouse button " "press, in percent." msgstr "Spécifie l'ajustement de la luminosité des icônes, en pourcents, " "lorsque l'utilisateur presse le bouton de la souris." #: ../properties.c:1462 msgid "Autohide" msgstr "Masquage automatique" #: ../properties.c:1476 msgid "Autohide" msgstr "Masquage automatique" #: ../properties.c:1486 msgid "If enabled, the panel is hidden when the mouse cursor leaves the " "panel." msgstr "Si l'option est activée, le panel disparaît quand le curseur en sort." #: ../properties.c:1490 msgid "Show panel after" msgstr "Montrer le panel au bout de" #: ../properties.c:1500 msgid "Specifies a delay after which the panel is shown when the mouse " "cursor enters the panel." msgstr "Spécifie un délai au bout duquel le panel apparaît quand le curseur " "y entre." #: ../properties.c:1502 ../properties.c:1536 ../properties.c:5165 #: ../properties.c:5184 msgid "seconds" msgstr "secondes" #: ../properties.c:1510 msgid "Hidden size" msgstr "Taille du panel masqué" #: ../properties.c:1520 msgid "Specifies the size of the panel when hidden, in pixels." msgstr "Spécifie la taille du panel lors qu'il est masqué, en pixels." #: ../properties.c:1524 msgid "Hide panel after" msgstr "Cacher le panel au bout de" #: ../properties.c:1534 msgid "Specifies a delay after which the panel is hidden when the mouse " "cursor leaves the panel." msgstr "Spécifie un délai au bout duquel le panel disparait quand le curseur " "en sort." #: ../properties.c:1544 msgid "Window manager interaction" msgstr "Interactions du gestionnaire de fenêtres" #: ../properties.c:1558 msgid "Forward mouse events" msgstr "Transmettre les événements souris" #: ../properties.c:1568 msgid "If enabled, mouse events not handled by panel elements are forwarded " "to the desktop. Useful on desktop environments that show a start " "menu when right clicking the desktop, or switch the desktop when " "rotating the mouse wheel over the desktop." msgstr "Si l'option est activée, les événements souris non pris en charge " "par les éléments du panel sont transmis au bureau. Utile pour les " "environnements de bureau qui affichent un menu lors d'un clic droit " "sur le bureau, ou qui changent de bureau lorsqu'on fait tourner la " "molette sur le fond du bureau." #: ../properties.c:1574 msgid "Place panel in dock" msgstr "Placer le panel dans le dock" #: ../properties.c:1584 msgid "If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than " "normal windows. The exact behavior depends on the window manager and " "its configuration." msgstr "Si l'option est activée, le panel sera placé dans la zone de dock du " "gestionnaire de fenêtres. Les fenêtres placées dans le dock sont " "généralement traités différemment des fenêtres classiques. Leur " "comportement exact dépend du gestionnaire de fenêtres et de sa " "configuration." #: ../properties.c:1590 msgid "Panel layer" msgstr "Position du panel" #: ../properties.c:1600 msgid "Top" msgstr "Au dessus" #: ../properties.c:1601 msgid "Normal" msgstr "Normal" #: ../properties.c:1602 msgid "Bottom" msgstr "Au dessous" #: ../properties.c:1604 msgid "Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, " "depending on which has focus. \n" "Note that some window managers prevent this option from working " "correctly if the panel is placed in the dock." msgstr "Spécifie à quel niveau la fenêtre du panel doit être placée. \n" "Au dessus signifie que le panel recouvrira toujours les autres " "fenêtres. \n" "Au dessous signifie que toutes les fenêtres recouvriront le panel. \n" "Normal signifie que les autres fenêtres recouvriront ou pas le " "panel, en fonction de ce qui sera sélectionné. \n" "NB: Certains gestionnaires n'ont pas besoin de cette option car ils " "fonctionnent correctement si le panel est dans le dock." #: ../properties.c:1612 msgid "Maximized windows" msgstr "Fenêtres maximisées" #: ../properties.c:1622 msgid "Match the panel size" msgstr "Adapté au panel" #: ../properties.c:1623 msgid "Match the hidden panel size" msgstr "Adapté au panel masqué" #: ../properties.c:1624 msgid "Fill the screen" msgstr "Remplir l'écran" #: ../properties.c:1626 msgid "Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to " "the edge of the panel. \n" "Match the hidden panel size means that maximized windows should " "extend to the edge of the panel when hidden; when visible, the panel " "and the windows will overlap. \n" "Fill the screen means that maximized windows will always have the " "same size as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed " "at the edge (not in the middle) of the virtual screen for this to " "work correctly." msgstr "Spécifie la taille des fenêtres maximisées. \n" "Adapté au panel signifie que les fenêtres maximisées s'étendront " "jusqu'au bord du panel. \n" "Adapté au panel masqué signifie que les fenêtres maximisées " "s'étendront jusqu'au bord du panel en position masquée; s'il " "devient visible, le panel et les fenêtres se superposent. \n" "Remplir l'écran signifie que les fenêtres maximisées utilisent " "toujours l'ensemble de l'écran. \n" "\n" "NB: sur des configurations multi-moniteurs (Xinerama), il faut " "placer le panel au bord de l'écran virtuel (et non au milieu) pour " "qu'il fonctionne correctement." #: ../properties.c:1637 msgid "Window name" msgstr "Nom de la fenêtre" #: ../properties.c:1649 msgid "Specifies the name of the panel window. This is useful if you want " "to configure special treatment of tint2 windows in your window " "manager or compositor." msgstr "Spécifie un nom à la fenêtre du panel. Cela peut être utile si vous " "souhaitez attribuer un comportement spécifique aux fenêtres tint2 " "dans votre gestionnaire de fenêtres ou compositeur." #: ../properties.c:1692 ../properties.c:1882 msgid "Free space" msgstr "Espace libre" #: ../properties.c:1697 ../properties.c:1886 ../properties.c:4159 #: ../properties.c:4387 ../properties.c:4557 ../properties.c:4578 msgid "Executor" msgstr "Exécuteur" #: ../properties.c:1712 msgid "Specifies the elements that will appear in the panel and their " "order. Elements can be added by selecting them in the list of " "available elements, then clicking on the add left button." msgstr "Spécifie les éléments qui apparaîtront dans le panel et leur ordre. " "Les éléments peuvent être ajoutés en les sélectionnant parmi ceux " "disponibles, puis en cliquant sur le bouton d'ajout à gauche." #: ../properties.c:1728 msgid "Lists all the possible elements that can appear in the panel. " "Elements can be added to the panel by selecting them, then clicking " "on the add left button." msgstr "Liste les éléments qui peuvent apparaître dans le panel. Ces " "éléments peuvent être ajoutés en les sélectionnant parmi leur liste, " "puis en cliquant sur le bouton d'ajout à gauche." #: ../properties.c:1738 msgid "Elements selected" msgstr "Éléments sélectionnés" #: ../properties.c:1744 msgid "Elements available" msgstr "Éléments disponibles" #: ../properties.c:1761 msgid "Moves up the current element in the list of selected elements." msgstr "Monte l'élément choisi dans la liste de ceux sélectionnés." #: ../properties.c:1769 msgid "Moves down the current element in the list of selected elements." msgstr "Descend l'élément choisi dans la liste de ceux sélectionnés." #: ../properties.c:1771 ../properties.c:2563 msgid " " msgstr " " #: ../properties.c:1782 msgid "Copies the current element in the list of available elements to the " "list of selected elements." msgstr "Copie l'élément choisi parmi ceux disponibles vers la liste des " "éléments sélectionnés." #: ../properties.c:1790 msgid "Removes the current element from the list of selected elements." msgstr "Supprime l'élément actuel de la liste des éléments sélectionnés." #: ../properties.c:2496 msgid "Specifies the application launchers that will appear in the launcher " "and their order. Launchers can be added by selecting an item in the " "list of available applications, then clicking on the add left button." msgstr "Spécifie quel(s) lanceur(s) d'application apparaîtront et leur " "ordre. Les lanceurs peuvent être ajoutés en sélectionnant leur item " "dans la liste des applications disponibles, puis en cliquant sur le " "bouton d'ajout à gauche." #: ../properties.c:2517 msgid "Lists all the applications detected on the system. Launchers can be " "added to the launcher by selecting an application, then clicking on " "the add left button." msgstr "Liste les applications détectées sur le système. Les lanceurs " "peuvent être ajoutés en sélectionnant leur item dans la liste des " "applications disponibles, puis en cliquant sur le bouton d'ajout à " "gauche." #: ../properties.c:2530 msgid "Applications selected" msgstr "Applications choisies" #: ../properties.c:2536 msgid "Applications available" msgstr "Applications disponibles" #: ../properties.c:2553 msgid "Moves up the current launcher in the list of selected applications." msgstr "Remonte le lanceur actuel parmi la liste des applications " "sélectionnées." #: ../properties.c:2561 msgid "Moves down the current launcher in the list of selected applications." msgstr "Descend le lanceur actuel parmi la liste des applications " "sélectionnées." #: ../properties.c:2574 msgid "Copies the current application in the list of available applications " "to the list of selected applications." msgstr "Copie l'application actuelle de la liste des applications " "disponibles à celle des applications sélectionnées." #: ../properties.c:2582 msgid "Removes the current application from the list of selected " "application." msgstr "Retire l'application actuelle de la liste des applications " "sélectionnées." #: ../properties.c:2594 msgid "Additional application directories" msgstr "Répertoires d'applications supplémentaires" #: ../properties.c:2603 msgid "Specifies a path to a directory from which the launcher is loading " "all .desktop files (all subdirectories are explored recursively). " "Can be used multiple times, in which case the paths must be " "separated by commas. Leading ~ is expaned to the path of the user's " "home directory." msgstr "Spécifie un chemin vers un répertoire d'où le lanceur charge tous " "les fichiers .desktop (les sous-répertoires sont explorés " "récursivement). Cette option peut être utilisée à plusieurs " "reprises, en séparant les chemins par des virgules. Le symbole ~ mis " "en premier représente le chemin vers le répertoire utilisateur." #: ../properties.c:2629 msgid "Selects the background used to display the launcher. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher la barre des " "lanceurs. Les arrières-plans sont modifiables dans l'onglet Arrières-" "plans." #: ../properties.c:2633 msgid "Icon background" msgstr "Arrière-plan icône" #: ../properties.c:2639 msgid "Launcher icon" msgstr "L'icône du lanceur" #: ../properties.c:2643 msgid "Selects the background used to display the launcher icon. " "Backgrounds can be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher les icônes des " "lanceurs. Les arrières-plans sont modifiables dans l'onglet Arrières-" "plans." #: ../properties.c:2657 msgid "Specifies the horizontal padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Spécifie l'espacement horizontal de la barre des lanceurs. C'est " "l'espace entre la bordure et les éléments contenus." #: ../properties.c:2671 msgid "Specifies the vertical padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Spécifie l'espacement vertical de la barre des lanceurs. C'est " "l'espace entre la bordure et les éléments contenus." #: ../properties.c:2685 msgid "Specifies the spacing between the elements inside the launcher." msgstr "Spécifie l'espacement entre les éléments dans la zone des lanceurs. " #: ../properties.c:2688 ../properties.c:4728 msgid "Icon size" msgstr "Taille de l'icône" #: ../properties.c:2698 msgid "Specifies the size of the launcher icons, in pixels." msgstr "Spécifie la taille des icônes des lanceurs, en pixels." #: ../properties.c:2702 ../properties.c:3736 ../properties.c:4742 msgid "Icon opacity" msgstr "Opacité de l'icône" #: ../properties.c:2713 msgid "Specifies the opacity of the launcher icons, in percent." msgstr "Spécifie l'opacité des icônes des lanceurs, en pourcents." #: ../properties.c:2717 ../properties.c:3747 ../properties.c:4757 msgid "Icon saturation" msgstr "Saturation de l'icône" #: ../properties.c:2728 msgid "Specifies the saturation adjustment of the launcher icons, in " "percent." msgstr "Spécifie la saturation des couleurs des icônes des lanceurs, en " "pourcents." #: ../properties.c:2732 ../properties.c:3758 ../properties.c:4772 msgid "Icon brightness" msgstr "Luminosité de l'icône" #: ../properties.c:2743 msgid "Specifies the brightness adjustment of the launcher icons, in " "percent." msgstr "Spécifie la luminosité des icônes des lanceurs, en pourcents." #: ../properties.c:2746 msgid "Icon theme" msgstr "Thème de l'icône" #: ../properties.c:2760 msgid "The icon theme used to display launcher icons. If left blank, tint2 " "will detect and use the icon theme of your desktop as long as you " "have an XSETTINGS manager running (most desktop environments do)." msgstr "Thème d'icônes utilisé pour afficher les icônes des lanceurs. Laissé " "vide, tint2 détecte et utilise le thème de votre bureau tant qu'un " "gestionnaire de XSETTINGS est disponible (cas de la plupart des " "environnements de bureau)." #: ../properties.c:2764 msgid "Overrides XSETTINGS" msgstr "Neutralise XSETTINGS" #: ../properties.c:2768 msgid "If enabled, the icon theme selected here will override the one " "provided by XSETTINGS." msgstr "Si l'option est activée, le thème d'icônes choisi remplacera celui " "fourni par XSETTINGS." #: ../properties.c:2771 msgid "Startup notifications" msgstr "Notifications de démarrage" #: ../properties.c:2781 msgid "If enabled, startup notifications are shown when starting " "applications from the launcher. The appearance may vary depending on " "your desktop environment configuration; normally, a busy mouse " "cursor is displayed until the application starts." msgstr "Si l'option est activée, les notifications au démarrage s'affichent " "lors du lancement d'applications. L'apparence peut varier en " "fonction de la configuration de votre environnement de bureau; " "généralement, un curseur d'occupation est affiché jusqu'à ce que " "l'application démarre." #: ../properties.c:2785 ../properties.c:4922 msgid "Tooltips" msgstr "Infobulles" #: ../properties.c:2795 msgid "If enabled, shows a tooltip with the application name when the mouse " "is moved over an application launcher." msgstr "Si l'option est activée, une infobulle contenant le nom du programme " "s'affiche lorsque la souris passe au dessus du lanceur." #: ../properties.c:2842 ../properties.c:4597 msgid "Options" msgstr "Options" #: ../properties.c:2857 msgid "Show a taskbar for each desktop" msgstr "Affiche une barre des tâches pour chaque bureau" #: ../properties.c:2867 msgid "If enabled, the taskbar is split into multiple smaller taskbars, one " "for each virtual desktop." msgstr "Si l'option est activée, la barre des tâches est divisée en " "plusieurs petites barres, une pour chaque bureau virtuel." #: ../properties.c:2871 msgid "Distribute size between taskbars" msgstr "Répartit la place entre les barres des tâches. " #: ../properties.c:2881 msgid "If enabled and 'Show a taskbar for each desktop' is also enabled, " "the available size is distributed between taskbars proportionally to " "the number of tasks." msgstr "Si l'option est activée tout comme 'Affiche une barre des tâches " "pour chaque bureau', la place disponible est répartie entre les " "barres proportionnellement au nombre de tâches. " #: ../properties.c:2886 msgid "Hide inactive tasks" msgstr "Cache les tâches inactives" #: ../properties.c:2896 msgid "If enabled, only the active task will be shown in the taskbar." msgstr "Si l'option est activée, seules les tâches actives sont visibles " "dans la barre des tâches." #: ../properties.c:2900 msgid "Hide tasks from different monitors" msgstr "Cache les tâches des différents moniteurs " #: ../properties.c:2910 msgid "If enabled, tasks that are not on the same monitor as the panel will " "not be displayed. This behavior is enabled automatically if the " "panel monitor is set to 'All'." msgstr "Si l'option est activée, les tâches qui ne sont pas sur le même " "moniteur que le panel n'apparaîtront pas. Ce comportement est activé " "automatiquement si le réglage du panel est sur 'Tous'." #: ../properties.c:2916 msgid "Always show all desktop tasks" msgstr "Affiche toujours les tâches visible sur tous les bureaux" #: ../properties.c:2926 msgid "Has effect only if 'Show a taskbar for each desktop' is enabled. If " "enabled, tasks that appear on all desktops are shown on all " "taskbars. Otherwise, they are shown only on the taskbar of the " "current desktop." msgstr "N'a d'effet que si «Affiche une barre des tâches pour chaque bureau» " "est activée. Si cette option est activée, les tâches qui apparaissent " "sur tous les bureaux sont affichés sur toutes les barres de tâches. " "Sinon, ils sont affichés uniquement sur la barre des tâches du bureau " "actuel." #: ../properties.c:2932 msgid "Task sorting" msgstr "Tri des tâches" #: ../properties.c:2942 ../properties.c:3236 ../properties.c:3272 #: ../properties.c:3308 ../properties.c:3344 ../properties.c:3380 msgid "None" msgstr "Aucun" #: ../properties.c:2943 msgid "By title" msgstr "Par titre" #: ../properties.c:2944 msgid "By center" msgstr "Par position" #: ../properties.c:2945 msgid "Most recently used first" msgstr "Plus récemment utilisé en premier" #: ../properties.c:2946 msgid "Most recently used last" msgstr "Plus récemment utilisé en dernier" #: ../properties.c:2948 msgid "Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can " "also reorder task buttons by mouse dragging. \n" "'By title' means that tasks are sorted by their window titles. \n" "'By center' means that tasks are sorted geometrically by their " "window centers." msgstr "Spécifie comment les tâches doivent se répartir sur la barre des " "tâches. \n" "'Aucun' signifie que les nouvelles tâches sont ajoutées à la suite, " "et que l'on peut réorganiser les boutons en les faisant glisser à la " "souris. \n" "'Par titre' signifie que les tâches sont triées selon le titre de la " "fenêtre. \n" "' Par position' signifie que les tâches sont triées en fonction de " "l'emplacement du centre de leur fenêtre." #: ../properties.c:2955 msgid "Task alignment" msgstr "Alignement des tâches" #: ../properties.c:2965 msgid "Left" msgstr "À gauche" #: ../properties.c:2966 msgid "Center" msgstr "Centrées" #: ../properties.c:2967 msgid "Right" msgstr "À droite" #: ../properties.c:2969 msgid "Specifies how tasks should be positioned on the taskbar." msgstr "Spécifie comment les tâches doivent être placées sur la barre des " "tâches." #: ../properties.c:2997 msgid "Specifies the horizontal padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Spécifie l'espacement horizontal de la barre des tâches. C'est " "l'espace entre la bordure et les éléments contenus." #: ../properties.c:3012 msgid "Specifies the vertical padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Spécifie l'espacement vertical de la barre des tâches. C'est " "l'espace entre la bordure et les éléments contenus." #: ../properties.c:3027 msgid "Specifies the spacing between the elements inside the taskbar." msgstr "Spécifie l'espacement entre les éléments de la barre des tâches." #: ../properties.c:3031 ../properties.c:3176 msgid "Active background" msgstr "Arrière-plan actif" # #: ../properties.c:3037 msgid "Active taskbar" msgstr "Barre des tâches active" #: ../properties.c:3041 msgid "Selects the background used to display the taskbar of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher la barre des tâches " "du bureau actuel. Les arrières-plans sont modifiables dans l'onglet " "Arrières-plans." #: ../properties.c:3045 ../properties.c:3191 msgid "Inactive background" msgstr "Arrière-plan inactif" # #: ../properties.c:3051 msgid "Inactive taskbar" msgstr "Barre des tâches inactive" #: ../properties.c:3055 msgid "Selects the background used to display taskbars of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher les barres des " "tâches des bureaux inactifs. Les arrières-plans sont modifiables " "dans l'onglet Arrières-plans." #: ../properties.c:3060 msgid "Desktop name" msgstr "Nom du bureau" #: ../properties.c:3075 msgid "Show desktop name" msgstr "Affiche le nom du bureau" #: ../properties.c:3085 msgid "If enabled, displays the name of the desktop at the top/left of the " "taskbar. The name is set by your window manager; you might be able " "to configure it there." msgstr "Si l'option est activée, le nom du bureau s'affiche en haut à gauche " "de la barre des tâches. Le nom est choisi par votre gestionnaire de " "fenêtres, qui doit vous permettre de le configurer." #: ../properties.c:3100 msgid "Specifies the horizontal padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Spécifie l'espacement horizontal du nom du bureau. C'est l'espace " "entre la bordure et le texte." #: ../properties.c:3115 msgid "Specifies the vertical padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Spécifie l'espacement vertical du nom du bureau. C'est l'espace " "entre la bordure et le texte." #: ../properties.c:3120 msgid "Active font color" msgstr "Couleur de police active" #: ../properties.c:3131 msgid "Specifies the font color used to display the name of the current " "desktop." msgstr "Spécifie la couleur de la police utilisée pour afficher le nom du " "bureau actif." #: ../properties.c:3135 msgid "Inactive font color" msgstr "Couleur de police inactive" #: ../properties.c:3146 msgid "Specifies the font color used to display the name of inactive " "desktops." msgstr "Spécifie la couleur de la police utilisée pour afficher le nom des " "bureaux inactifs." #: ../properties.c:3153 ../properties.c:3542 ../properties.c:4041 #: ../properties.c:4067 ../properties.c:4426 ../properties.c:5070 #: ../properties.c:5095 ../properties.c:5250 msgid "If not checked, the desktop theme font is used. If checked, the " "custom font specified here is used." msgstr "Si non coché, la police du thème de bureau est utilisée. Si oui, " "la police indiquée ici est utilisé." #: ../properties.c:3156 ../properties.c:3545 ../properties.c:4429 #: ../properties.c:5253 msgid "Font" msgstr "Police " #: ../properties.c:3170 msgid "Specifies the font used to display the desktop name." msgstr "Spécifie la police utilisée pour afficher le nom du bureau." # #: ../properties.c:3182 msgid "Active desktop name" msgstr "Nom du bureau actif" #: ../properties.c:3186 msgid "Selects the background used to display the name of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher le nom du bureau " "actif. Les arrières-plans sont modifiables dans l'onglet Arrières-" "plans." # #: ../properties.c:3197 msgid "Inactive desktop name" msgstr "Nom du bureau inactif" #: ../properties.c:3201 msgid "Selects the background used to display the name of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher le nom des bureaux " "inactifs. Les arrières-plans sont modifiables dans l'onglet Arrières-" "plans." #: ../properties.c:3213 ../properties.c:3894 ../properties.c:4279 #: ../properties.c:4909 msgid "Mouse events" msgstr "Événements souris" #: ../properties.c:3226 msgid "Left click" msgstr "Clic gauche" #: ../properties.c:3237 ../properties.c:3273 ../properties.c:3309 #: ../properties.c:3345 ../properties.c:3381 msgid "Close" msgstr "Fermer" #: ../properties.c:3238 ../properties.c:3274 ../properties.c:3310 #: ../properties.c:3346 ../properties.c:3382 msgid "Toggle" msgstr "Basculer les tâches" #: ../properties.c:3239 ../properties.c:3275 ../properties.c:3311 #: ../properties.c:3347 ../properties.c:3383 msgid "Iconify" msgstr "Icônifier " #: ../properties.c:3240 ../properties.c:3276 ../properties.c:3348 #: ../properties.c:3384 msgid "Shade" msgstr "Réduire" #: ../properties.c:3241 ../properties.c:3277 ../properties.c:3313 #: ../properties.c:3349 ../properties.c:3385 msgid "Toggle or iconify" msgstr "Afficher ou réduire" #: ../properties.c:3242 ../properties.c:3278 ../properties.c:3314 #: ../properties.c:3350 ../properties.c:3386 msgid "Maximize or restore" msgstr "Maximiser ou restaurer" #: ../properties.c:3243 ../properties.c:3279 ../properties.c:3315 #: ../properties.c:3351 ../properties.c:3387 msgid "Desktop left" msgstr "Bureau gauche" #: ../properties.c:3244 ../properties.c:3280 ../properties.c:3316 #: ../properties.c:3352 ../properties.c:3388 msgid "Desktop right" msgstr "Bureau droit" #: ../properties.c:3245 ../properties.c:3281 ../properties.c:3317 #: ../properties.c:3353 ../properties.c:3389 msgid "Next task" msgstr "Tâche suivante" #: ../properties.c:3246 ../properties.c:3282 ../properties.c:3318 #: ../properties.c:3354 ../properties.c:3390 msgid "Previous task" msgstr "Tâche précédente" #: ../properties.c:3248 msgid "Specifies the action performed when task buttons receive a left " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Spécifie l'action à engager lorsque les boutons de tâches reçoivent " "un clic gauche: \n" "'Aucun' signifie qu'aucune action n'a lieu. \n" "'Fermer' arrête la tâche. \n" "'Basculer les tâches' fait passer d'une tâche à l'autre. \n" "'Icônifier' minimise la tâche. \n" "'Réduire' réduit la tâche. \n" "'Afficher ou réduire' affiche ou réduit la tâche. \n" "'Maximiser ou restaurer' maximise ou réduit la tâche. \n" "'Bureau gauche' envoie la tâche au bureau précédent. \n" "'Bureau droit' envoie la tâche au bureau suivant. \n" "'Tâche suivante' sélectionne la tâche suivante. \n" "'Tâche précédente' sélectionne la tâche précédente. " #: ../properties.c:3262 msgid "Wheel scroll up" msgstr "Molette haut" #: ../properties.c:3284 msgid "Specifies the action performed when task buttons receive a scroll up " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Spécifie l'action à engager lorsque les boutons de tâches reçoivent " "une molette haut: \n" "'Aucun' signifie qu'aucune action n'a lieu. \n" "'Fermer' arrête la tâche. \n" "'Basculer les tâches' fait passer d'une tâche à l'autre. \n" "'Icônifier' minimise la tâche. \n" "'Réduire' réduit la tâche. \n" "'Afficher ou réduire' affiche ou réduit la tâche. \n" "'Maximiser ou restaurer' maximise ou réduit la tâche. \n" "'Bureau gauche' envoie la tâche au bureau précédent. \n" "'Bureau droit' envoie la tâche au bureau suivant. \n" "'Tâche suivante' sélectionne la tâche suivante. \n" "'Tâche précédente' sélectionne la tâche précédente. " #: ../properties.c:3298 msgid "Middle click" msgstr "Clic milieu" #: ../properties.c:3312 msgid "sShade" msgstr "Réduire" #: ../properties.c:3320 msgid "Specifies the action performed when task buttons receive a middle " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Spécifie l'action à engager lorsque les boutons de tâches reçoivent " "un clic milieu: \n" "'Aucun' signifie qu'aucune action n'a lieu. \n" "'Fermer' arrête la tâche. \n" "'Basculer les tâches' fait passer d'une tâche à l'autre. \n" "'Icônifier' minimise la tâche. \n" "'Réduire' réduit la tâche. \n" "'Afficher ou réduire' affiche ou réduit la tâche. \n" "'Maximiser ou restaurer' maximise ou réduit la tâche. \n" "'Bureau gauche' envoie la tâche au bureau précédent. \n" "'Bureau droit' envoie la tâche au bureau suivant. \n" "'Tâche suivante' sélectionne la tâche suivante. \n" "'Tâche précédente' sélectionne la tâche précédente. " #: ../properties.c:3334 msgid "Wheel scroll down" msgstr "Molette bas" #: ../properties.c:3356 msgid "Specifies the action performed when task buttons receive a scroll " "down event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Spécifie l'action à engager lorsque les boutons de tâches reçoivent " "une molette bas: \n" "'Aucun' signifie qu'aucune action n'a lieu. \n" "'Fermer' arrête la tâche. \n" "'Basculer les tâches' fait passer d'une tâche à l'autre. \n" "'Icônifier' minimise la tâche. \n" "'Réduire' réduit la tâche. \n" "'Afficher ou réduire' affiche ou réduit la tâche. \n" "'Maximiser ou restaurer' maximise ou réduit la tâche. \n" "'Bureau gauche' envoie la tâche au bureau précédent. \n" "'Bureau droit' envoie la tâche au bureau suivant. \n" "'Tâche suivante' sélectionne la tâche suivante. \n" "'Tâche précédente' sélectionne la tâche précédente. " #: ../properties.c:3370 msgid "Right click" msgstr "Clic droit" #: ../properties.c:3392 msgid "Specifies the action performed when task buttons receive a right " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Spécifie l'action à engager lorsque les boutons de tâches reçoivent " "un clic droit: \n" "'Aucun' signifie qu'aucune action n'a lieu. \n" "'Fermer' arrête la tâche. \n" "'Basculer les tâches' fait passer d'une tâche à l'autre. \n" "'Icônifier' minimise la tâche. \n" "'Réduire' réduit la tâche. \n" "'Afficher ou réduire' affiche ou réduit la tâche. \n" "'Maximiser ou restaurer' maximise ou réduit la tâche. \n" "'Bureau gauche' envoie la tâche au bureau précédent. \n" "'Bureau droit' envoie la tâche au bureau suivant. \n" "'Tâche suivante' sélectionne la tâche suivante. \n" "'Tâche précédente' sélectionne la tâche précédente. " #: ../properties.c:3420 ../properties.c:4218 msgid "Show icon" msgstr "Afficher l'icône" #: ../properties.c:3430 msgid "If enabled, the window icon is shown on task buttons." msgstr "Si activée, l'icône de fenêtre apparaît comme bouton de tâche." #: ../properties.c:3433 msgid "Show text" msgstr "Afficher le texte" #: ../properties.c:3443 msgid "If enabled, the window title is shown on task buttons." msgstr "Si activée, le titre de la fenêtre apparaît comme bouton de tâche." #: ../properties.c:3446 msgid "Center text" msgstr "Centrer le texte" #: ../properties.c:3456 msgid "If enabled, the text is centered on task buttons. Otherwise, it is " "left-aligned." msgstr "Si activée, le texte est centré sur les boutons de tâche. sinon, il " "est aligné à gauche." #: ../properties.c:3459 msgid "Show tooltips" msgstr "Afficher les infobulles" #: ../properties.c:3469 msgid "If enabled, a tooltip showing the window title is displayed when the " "mouse cursor moves over task buttons." msgstr "Si activée, une infobulle contenant le nom de la fenêtre s'affiche " "lorsque la souris passe sur les boutons des tâches." #: ../properties.c:3472 msgid "Maximum width" msgstr "Largeur maximale" #: ../properties.c:3482 msgid "Specifies the maximum width of the task buttons." msgstr "Spécifie la largeur maximale des boutons des tâches." #: ../properties.c:3485 msgid "Maximum height" msgstr "Hauteur maximale" #: ../properties.c:3495 msgid "Specifies the maximum height of the task buttons." msgstr "Spécifie la hauteur maximale des boutons des tâches." #: ../properties.c:3508 msgid "Specifies the horizontal padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Spécifie l'espacement horizontal des boutons de tâches. C'est " "l'espace entre la bordure et le contenu." #: ../properties.c:3522 msgid "Specifies the vertical padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Spécifie l'espacement vertical de l'horloge. C'est l'espace entre la " "bordure et le contenu." #: ../properties.c:3536 msgid "Specifies the spacing between the icon and the text." msgstr "Spécifie l'espacement entre l'icône et le texte." #: ../properties.c:3556 msgid "Specifies the font used to display the task button text." msgstr "Spécifie la police utilisée pour afficher le texte du bouton des " "tâches." #: ../properties.c:3568 msgid "Default style" msgstr "Style par défaut" # #: ../properties.c:3569 msgid "Default task" msgstr "Tâche par défaut" #: ../properties.c:3579 ../properties.c:3580 msgid "Normal task" msgstr "Tâche normale" #: ../properties.c:3590 ../properties.c:3591 msgid "Active task" msgstr "Tâche active" #: ../properties.c:3601 ../properties.c:3602 msgid "Urgent task" msgstr "Tâche urgente" #: ../properties.c:3612 ../properties.c:3613 msgid "Iconified task" msgstr "Tâche icônifiée" #: ../properties.c:3717 msgid "If enabled, a custom font color is used to display the task text." msgstr "Si activée, la police de couleur personnalisée est utilisée pour " "afficher le texte des tâches. " #: ../properties.c:3719 ../properties.c:4089 ../properties.c:4444 #: ../properties.c:5117 ../properties.c:5269 msgid "Font color" msgstr "Couleur de police" #: ../properties.c:3728 msgid "Specifies the font color used to display the task text." msgstr "Spécifie la couleur de police utilisée pour afficher le texte des " "tâches." #: ../properties.c:3734 msgid "If enabled, a custom opacity/saturation/brightness is used to " "display the task icon." msgstr "Si activée, une opacité/saturation/luminosité personnalisée est " "utilisée pour afficher l'icône de la tâche." #: ../properties.c:3745 msgid "Specifies the opacity (in %) used to display the task icon." msgstr "Spécifie l'opacité (en %) utilisée pour afficher l'icône de la tâche." #: ../properties.c:3756 msgid "Specifies the saturation adjustment (in %) used to display the task " "icon." msgstr "Spécifie le réglage de saturation (en %) utilisé pour afficher " "l'icône de la tâche." #: ../properties.c:3767 msgid "Specifies the brightness adjustment (in %) used to display the task " "icon." msgstr "Spécifie le réglage de luminosité (en %) utilisé pour afficher " "l'icône de la tâche." #: ../properties.c:3773 msgid "If enabled, a custom background is used to display the task." msgstr "Si activée, un arrière-plan personnalisé est utilisé pour afficher " "la tâche." #: ../properties.c:3783 msgid "Selects the background used to display the task. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher la tâche. Les " "arrières-plans sont modifiables dans l'onglet Arrières-plans." #: ../properties.c:3787 msgid "Blinks" msgstr "Clignote" #: ../properties.c:3795 msgid "Specifies how many times urgent tasks blink." msgstr "Spécifie combien de fois les tâches urgentes doivent clignoter." #: ../properties.c:3817 ../properties.c:4177 msgid "Format" msgstr "Format" #: ../properties.c:3829 msgid "First line format" msgstr "Format de la première ligne" #: ../properties.c:3841 msgid "Specifies the format used to display the first line of the clock " "text. See 'man strftime' for all the available options." msgstr "Spécifie le format utilisé pour afficher la première ligne de " "l'horloge texte. Voir 'man strftime' pour les options disponibles." #: ../properties.c:3845 msgid "Second line format" msgstr "Format de la seconde ligne" #: ../properties.c:3857 msgid "Specifies the format used to display the second line of the clock " "text. See 'man strftime' for all the available options." msgstr "Spécifie le format utilisé pour afficher la seconde ligne de " "l'horloge texte. Voir 'man strftime' pour les options disponibles." #: ../properties.c:3861 msgid "First line timezone" msgstr "Fuseau horaire de la première ligne" #: ../properties.c:3873 msgid "Specifies the timezone used to display the first line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Spécifie le fuseau horaire utilisé pour afficher la première ligne " "de l'horloge texte. Si le champ est laissé vide, le fuseau horaire " "actuel est utilisé. Autrement, il doit prendre une valeur valide " "(variable d'environnement TZ)" #: ../properties.c:3877 msgid "Second line timezone" msgstr "Fuseau horaire de la seconde ligne" #: ../properties.c:3889 msgid "Specifies the timezone used to display the second line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Spécifie le fuseau horaire utilisé pour afficher la seconde ligne de " "l'horloge texte. Si le champ est laissé vide, le fuseau horaire " "actuel est utilisé. Autrement, il doit prendre une valeur valide " "(variable d'environnement TZ)." #: ../properties.c:3907 ../properties.c:4292 ../properties.c:4936 msgid "Left click command" msgstr "Commande du clic gauche" #: ../properties.c:3919 msgid "Specifies a command that will be executed when the clock receives a " "left click." msgstr "Spécifie la commande à exécuter lors d'un clic gauche sur l'horloge." #: ../properties.c:3922 ../properties.c:4307 ../properties.c:4951 msgid "Right click command" msgstr "Commande du clic droit" #: ../properties.c:3934 msgid "Specifies a command that will be executed when the clock receives a " "right click." msgstr "Spécifie la commande à exécuter lors d'un clic droit sur l'horloge." # #: ../properties.c:3937 ../properties.c:4322 ../properties.c:4966 msgid "Middle click command" msgstr "Commande du clic du milieu" # #: ../properties.c:3949 msgid "Specifies a command that will be executed when the clock receives a " "middle click." msgstr "Spécifie la commande à exécuter lors d'un clic du milieu sur " "l'horloge." # #: ../properties.c:3952 ../properties.c:4337 ../properties.c:4981 msgid "Wheel scroll up command" msgstr "Commande de la molette vers le haut" # #: ../properties.c:3964 msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll up." msgstr "Spécifie la commande à exécuter lorsqu'on fait tourner la molette " "sur l'horloge." # #: ../properties.c:3967 ../properties.c:4352 ../properties.c:4996 msgid "Wheel scroll down command" msgstr "Commande de la molette du bas" # #: ../properties.c:3979 msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll down." msgstr "Spécifie la commande à exécuter lorsqu'on fait tourner la molette " "sur l'horloge vers le bas." #: ../properties.c:4006 msgid "Selects the background used to display the clock. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher l'horloge. Les " "arrières-plans sont modifiables dans l'onglet Arrières-plans." #: ../properties.c:4020 msgid "Specifies the horizontal padding of the clock. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement horizontal de l'horloge. C'est l'espace entre " "la bordure et le contenu." #: ../properties.c:4034 msgid "Specifies the vertical padding of the clock. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement vertical de l'horloge. C'est l'espace entre la " "bordure et le contenu." #: ../properties.c:4044 ../properties.c:5073 msgid "Font first line" msgstr "Police de la première ligne" #: ../properties.c:4059 msgid "Specifies the font used to display the first line of the clock." msgstr "Spécifie la police utilisée pour afficher la première ligne de " "l'horloge." #: ../properties.c:4070 ../properties.c:5098 msgid "Font second line" msgstr "Police de la seconde ligne" #: ../properties.c:4084 msgid "Specifies the font used to display the second line of the clock." msgstr "Spécifie la police utilisée pour afficher la seconde ligne de " "l'horloge." #: ../properties.c:4100 msgid "Specifies the font color used to display the clock." msgstr "Spécifie la couleur de la police utilisée pour afficher l'horloge." #: ../properties.c:4104 msgid "Tooltip" msgstr "Infobulle" #: ../properties.c:4117 msgid "Format" msgstr "Format" #: ../properties.c:4128 msgid "Specifies the format used to display the clock tooltip. See 'man " "strftime' for the available options." msgstr "Spécifie le format utilisé pour afficher l'infobulle de l'horloge. " "Voir 'man strftime' pour les options disponibles." #: ../properties.c:4132 msgid "Timezone" msgstr "Fuseau horaire" #: ../properties.c:4143 msgid "Specifies the timezone used to display the clock tooltip. If empty, " "the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "Spécifie le fuseau horaire utilisé pour afficher l'infobulle de " "l'horloge. Si le champ est laissé vide, le fuseau horaire actuel est " "utilisé. Autrement, il doit prendre une valeur valide (variable " "d'environnement TZ)." #: ../properties.c:4189 msgid "Command" msgstr "Commande" #: ../properties.c:4201 msgid "Specifies the command to execute." msgstr "Indique la commande à exécuter." #: ../properties.c:4204 msgid "Interval" msgstr "Intervalle" #: ../properties.c:4214 msgid "Specifies the interval at which the command is executed, in seconds. " "If zero, the command is executed only once." msgstr "Indique la fréquence à laquelle la commande est exécutée, en secondes. " "Si zéro, la commande est exécutée une seule fois." #: ../properties.c:4228 msgid "If enabled, the first line printed by the command is interpreted as " "a path to an image file." msgstr "Si cette option est activée, la première ligne imprimée par la commande " "est interprété comme un chemin vers un fichier d'icône." #: ../properties.c:4232 msgid "Cache icon" msgstr "Cache l'icône" #: ../properties.c:4243 msgid "If enabled, the image is not reloaded from disk every time the " "command is executed if the path remains unchanged. Enabling this is " "recommended." msgstr "Si cette option est activée, l'image n'est pas rechargé à partir du disque " "chaque fois que la commande est exécutée si le chemin reste inchangé. " "L'activation de cette option est recommandée." #: ../properties.c:4246 msgid "Continuous output" msgstr "Sortie continue" #: ../properties.c:4256 msgid "If non-zero, the last execp_continuous lines from the output of the " "command are displayed, every execp_continuous lines; this is useful " "for showing the output of commands that run indefinitely, such as " "'ping 127.0.0.1'. If zero, the output of the command is displayed " "after it finishes executing." msgstr "Si non nulle, les n dernières lignes de la sortie de la commande sont " "affichés, tous les n lignes; ceci est utile pour montrer la sortie des " "commandes qui exécutent indéfiniment, comme «ping 127.0.0.1». Si zéro, " "la sortie de la commande est affichée après la fin de l'exécution." #: ../properties.c:4262 msgid "Display markup" msgstr "Affiche balisage" #: ../properties.c:4273 msgid "If enabled, the output of the command is treated as Pango markup, " "which allows rich text formatting. Note that using this with " "commands that print data downloaded from the Internet is a potential " "security risk." msgstr "Si cette option est activée, la sortie de la commande est traitée comme " "du balisage Pango, qui permet formatage de texte enrichi. Notez que " "l'utilisation de cette option avec les commandes qui impriment des données " "téléchargées à partir de l'Internet est un risque potentiel de sécurité." #: ../properties.c:4304 msgid "Specifies a command that will be executed when the executor receives " "a left click." msgstr "Spécifie la commande à exécuter lors d'un clic gauche." #: ../properties.c:4319 msgid "Specifies a command that will be executed when the executor receives " "a right click." msgstr "Spécifie la commande à exécuter lors d'un clic droit." #: ../properties.c:4334 msgid "Specifies a command that will be executed when the executor receives " "a middle click." msgstr "Spécifie la commande à exécuter lors d'un clic du milieu." #: ../properties.c:4349 msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll up." msgstr "Spécifie la commande à exécuter lorsqu'on fait tourner la molette vers le haut." #: ../properties.c:4364 msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll down." msgstr "Spécifie la commande à exécuter lorsqu'on fait tourner la molette " "vers le bas." #: ../properties.c:4391 msgid "Selects the background used to display the executor. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Sélectionne l'arrière-plan utilisé pour afficher l'exécuteur. Les " "arrières-plans sont modifiables dans l'onglet Arrières-plans." #: ../properties.c:4405 msgid "Specifies the horizontal padding of the executor. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement horizontal de l'exécuteur. C'est l'espace entre " "la bordure et le contenu." #: ../properties.c:4419 msgid "Specifies the vertical padding of the executor. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement vertical de l'exécuteur. C'est l'espace entre la " "bordure et le contenu." #: ../properties.c:4457 msgid "Centered" msgstr "Centré" #: ../properties.c:4469 msgid "Icon width" msgstr "Largeur d'icône" #: ../properties.c:4479 msgid "If non-zero, the image is resized to this width." msgstr "Si non nul, l'image est redimensionnée à cette largeur." #: ../properties.c:4482 msgid "Icon height" msgstr "Hauteur de l'icône" #: ../properties.c:4492 msgid "If non-zero, the image is resized to this height." msgstr "Si non nul, l'image est redimensionnée à cette hauteur." #: ../properties.c:4508 msgid "Tooltip text" msgstr "Texte infobulle" #: ../properties.c:4520 msgid "The tooltip text to display. Leave this empty to display an " "automatically generated tooltip with information about when the " "command was last executed." msgstr "Le texte de l'infobulle a afficher. Laissez ce champ vide pour afficher " "une info-bulle générée automatiquement indiquant quand la " "commande a été exécutée la dernière fois." #: ../properties.c:4611 msgid "Icon ordering" msgstr "Tri des icônes" #: ../properties.c:4621 msgid "Ascending" msgstr "Croissant" #: ../properties.c:4622 msgid "Descending" msgstr "Décroissant" #: ../properties.c:4623 msgid "Left to right" msgstr "De gauche à droite" #: ../properties.c:4624 msgid "Right to left" msgstr "De droite à gauche" #: ../properties.c:4626 msgid "Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their " "window names. \n" "'Descending' means that icons are sorted in descending order of " "their window names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right." msgstr "Spécifie la façon d'organiser les icônes de la zone de " "notification. \n" "'Croissant' signifie que les icônes sont triés par ordre " "alphabétique. \n" "'Décroissant' signifie que les icônes sont triés par ordre " "alphabétique inverse. \n" "'De gauche à droite' signifie que les icônes sont toujours ajoutées " "à gauche. \n" "'De droite à gauche' signifie que les icônes sont toujours ajoutées " "à droite." #: ../properties.c:4651 msgid "Specifies the monitor on which to place the system tray. Due to " "technical limitations, the system tray cannot be displayed on " "multiple monitors." msgstr "Spécifie le moniteur sur lequel placer la zone de notification. Pour " "des raisons techniques, celle-ci ne peut être affichée simultanément " "sur plusieurs moniteurs." # #: ../properties.c:4675 msgid "Systray" msgstr "Zone de notification" #: ../properties.c:4679 msgid "Selects the background used to display the system tray. Backgrounds " "can be edited in the Backgrounds tab." msgstr "Choisis l'arrière-plan utilisé pour afficher la zone de " "notification. Les arrières-plans sont modifiables dans l'onglet " "Arrières-plans." #: ../properties.c:4694 msgid "Specifies the horizontal padding of the system tray. This is the " "space between the border and the content inside." msgstr "Spécifie l'espacement horizontal de la zone de notification. C'est " "l'espace entre la bordure et le contenu." #: ../properties.c:4709 msgid "Specifies the vertical padding of the system tray. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement vertical de la zone de notification. C'est " "l'espace entre la bordure et le contenu." #: ../properties.c:4724 msgid "Specifies the spacing between system tray icons." msgstr "Spécifie l'espacement entre les icones de la zone de notification " "système." #: ../properties.c:4738 msgid "Specifies the size of the system tray icons, in pixels." msgstr "Spécifie la taille des icones de la zone de notification système, en " "pourcents." #: ../properties.c:4753 msgid "Specifies the opacity of the system tray icons, in percent." msgstr "Spécifie l'opacité des icones de la zone de notification système, en " "pourcents." #: ../properties.c:4768 msgid "Specifies the saturation adjustment of the system tray icons, in " "percent." msgstr "Spécifie le réglage de la saturation des icones de la zone de " "notification système, en pourcents." #: ../properties.c:4783 msgid "Specifies the brightness adjustment of the system tray icons, in " "percent." msgstr "Spécifie le réglage de la luminosité des icones de la zone de " "notification système, en pourcents." #: ../properties.c:4799 msgid "Thresholds" msgstr "Limites" #: ../properties.c:4812 msgid "Hide if charge higher than" msgstr "Cache si la charge est au dessus de" #: ../properties.c:4822 msgid "Minimum battery level for which to hide the batter applet. Use 101 " "to always show the batter applet." msgstr "Niveau minimum de la batterie pour lequel cacher l'applet batterie. " "Utilisez 101 pour la garder constamment visible." #: ../properties.c:4824 ../properties.c:4843 msgid "%" msgstr "%" #: ../properties.c:4831 msgid "Alert if charge lower than" msgstr "Alerte si la charge descend sous" #: ../properties.c:4841 msgid "Battery level for which to display an alert." msgstr "Niveau de batterie sous lequel afficher une alerte." #: ../properties.c:4850 msgid "Alert command" msgstr "Commande d'alerte" #: ../properties.c:4861 msgid "Command to be executed when the alert threshold is reached." msgstr "Commande à exécuter lorsque le niveau d'alerte est atteint." # #: ../properties.c:4865 msgid "AC connection events" msgstr "Événements branchement/débranchement de l'alimentation secteur" # #: ../properties.c:4878 msgid "AC connected command" msgstr "Commande alimentation secteur branchée" # #: ../properties.c:4890 msgid "Specifies a command that will be executed when AC is connected to " "the system." msgstr "Spécifie la commande à exécuter lorsque l'alimentation est branchée." # #: ../properties.c:4893 msgid "AC disconnected command" msgstr "Commande alimentation secteur débranchée" # #: ../properties.c:4905 msgid "Specifies a command that will be executed when AC is disconnected to " "the system." msgstr "Spécifie la commande à exécuter lorsque l'alimentation est " "débranchée." # #: ../properties.c:4933 msgid "If enabled, shows a tooltip with detailed battery information when " "the mouse is moved over the battery widget." msgstr "Si l'option est activée, une infobulle contenant informations sur la " "batterie s'affiche lorsque la souris passe au dessus la batterie." # #: ../properties.c:4948 msgid "Specifies a command that will be executed when the battery receives " "a left click." msgstr "Spécifie la commande à exécuter lors d'un clic gauche sur la " "batterie." # #: ../properties.c:4963 msgid "Specifies a command that will be executed when the battery receives " "a right click." msgstr "Spécifie la commande à exécuter lors d'un clic droit sur la batterie." # #: ../properties.c:4978 msgid "Specifies a command that will be executed when the battery receives " "a middle click." msgstr "Spécifie la commande à exécuter lors d'un clic du milieu sur la " "batterie." # #: ../properties.c:4993 msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll up." msgstr "Spécifie la commande à exécuter lorsqu'on fait tourner la molette " "sur la batterie vers le haut." # #: ../properties.c:5008 msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll down." msgstr "Spécifie la commande à exécuter lorsqu'on fait tourner la molette " "sur la batterie vers le bas." #: ../properties.c:5035 msgid "Selects the background used to display the battery. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Choisis l'arrière-plan utilisé pour afficher la batterie. Les " "arrières-plans sont modifiables dans l'onglet Arrières-plans." #: ../properties.c:5049 msgid "Specifies the horizontal padding of the battery. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement horizontal de l'icone batterie. C'est l'espace " "entre la bordure et le contenu." #: ../properties.c:5063 msgid "Specifies the vertical padding of the battery. This is the space " "between the border and the content inside." msgstr "Spécifie l'espacement vertical de l'icone batterie. C'est l'espace " "entre la bordure et le contenu." #: ../properties.c:5087 msgid "Specifies the font used to display the first line of the battery " "text." msgstr "Spécifie la police utilisée pour afficher la première ligne de la " "légende de la batterie." #: ../properties.c:5112 msgid "Specifies the font used to display the second line of the battery " "text." msgstr "Spécifie la police utilisée pour afficher la seconde ligne de la " "légende de la batterie." #: ../properties.c:5128 msgid "Specifies the font clor used to display the battery text." msgstr "Spécifie la couleur de la police utilisée pour afficher la légende " "de la batterie." #: ../properties.c:5140 msgid "Timing" msgstr "Synchronisation" #: ../properties.c:5153 msgid "Show delay" msgstr "Délai d'apparition" #: ../properties.c:5163 msgid "Specifies a delay after which to show the tooltip when moving the " "mouse over an element." msgstr "Spécifie un délai au bout duquel l'infobulle apparaît lorsque on " "place la souris sur un élément." #: ../properties.c:5172 msgid "Hide delay" msgstr "Délai de persistance" #: ../properties.c:5181 msgid "Specifies a delay after which to hide the tooltip when moving the " "mouse outside an element." msgstr "Spécifie un délai au bout duquel l'infobulle disparaît lorsque on " "éloigne la souris d'un élément." #: ../properties.c:5215 msgid "Selects the background used to display the tooltip. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Spécifie l'arrière-plan utilisé pour afficher l'infobulle. Les " "arrières-plans sont modifiables dans l'onglet Arrières-plans." #: ../properties.c:5229 msgid "Specifies the horizontal padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Spécifie le remplissage horizontal de l'infobulle. C'est l'espace " "situé entre la bordure et le contenu." #: ../properties.c:5243 msgid "Specifies the vertical padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Spécifie le remplissage vertical de l'infobulle. C'est l'espace " "situé entre la bordure et le contenu." #: ../properties.c:5264 msgid "Specifies the font used to display the text of the tooltip." msgstr "Spécifie la police utlilisée pour afficher le texte de l'infobulle." #: ../properties.c:5280 msgid "Specifies the font color used to display the text of the tooltip." msgstr "Spécifie la couleur de police utilisée pour afficher le texte de " "l'infobulle." #: ../main.c:148 msgid "tint2conf" msgstr "tint2conf" #: ../main.c:156 msgid "Panel theming" msgstr "Thème du panel" #: ../main.c:166 msgid "Theme" msgstr "Thème" #: ../main.c:167 msgid "_Import theme..." msgstr "_Importer un thème..." #: ../main.c:167 msgid "Import theme" msgstr "Importer un thème" #: ../main.c:168 msgid "_Import default theme..." msgstr "_Importer le thème par défaut..." #: ../main.c:168 msgid "Import default theme" msgstr "Importer le thème par défaut" #: ../main.c:169 msgid "_Save as..." msgstr "_Enregistrer sous..." #: ../main.c:169 ../main.c:335 msgid "Save theme as" msgstr "Enregistrer le thème sous" #: ../main.c:170 msgid "_Delete" msgstr "_Supprimer" #: ../main.c:170 msgid "Delete theme" msgstr "Supprimer le thème" #: ../main.c:171 msgid "_Edit theme..." msgstr "_Éditer le thème..." #: ../main.c:171 msgid "Edit selected theme" msgstr "Éditer le thème choisi" #: ../main.c:172 msgid "_Make default" msgstr "_Définir par défaut" #: ../main.c:172 msgid "Replace the default theme with the selected one" msgstr "Remplacer le thème par défaut par celui sélectionné" #: ../main.c:173 msgid "_Quit" msgstr "_Quitter" #: ../main.c:173 msgid "Quit" msgstr "Quitter" #: ../main.c:174 msgid "Edit" msgstr "Editer" #: ../main.c:175 msgid "Refresh" msgstr "Rafraîchir" #: ../main.c:176 msgid "Refresh all" msgstr "Tout rafraîchir" #: ../main.c:177 msgid "Help" msgstr "Aide" #: ../main.c:178 msgid "_About" msgstr "_À propos" #: ../main.c:178 msgid "About" msgstr "À propos" #: ../main.c:198 msgid "Command to run tint2: " msgstr "Commande pour lancer tint2:" #: ../main.c:242 msgid "Theming tool for tint2 panel" msgstr "Outil de personnalisation pour le panel tint2" #: ../main.c:244 msgid "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" msgstr "Copyright 2009-2015 équipe tint2\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" #: ../main.c:249 msgid "translator-credits" msgstr "Crédits pour la traduction" #: ../main.c:258 msgid "Import theme(s)" msgstr "Importer le(s) thème(s)" #: ../main.c:293 msgid "Save default theme as" msgstr "Enregistrer le thème par défaut sous" #: ../main.c:325 msgid "Select the theme to be saved." msgstr "Sélectionner le thème à sauvegarder." tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/hr.po000066400000000000000000002213471265276141000245470ustar00rootroot00000000000000# Croatian translation for tint2conf. # Copyright (C) 2015 tint2's copyright holder # This file is distributed under the same license as the tint2 package. # Dino Duratović , 2015. msgid "" msgstr "Project-Id-Version: tint2conf 0.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-17 13:33+0100\n" "PO-Revision-Date: 2015-06-14 13:32+0200\n" "Last-Translator: Dino Duratović \n" "Language-Team: \n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 " "&& n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: ../properties.c:256 msgid "Properties" msgstr "Postavke" #: ../properties.c:290 msgid "Backgrounds" msgstr "Pozadine" #: ../properties.c:298 ../properties.c:1276 msgid "Panel" msgstr "Ploča" #: ../properties.c:306 msgid "Panel items" msgstr "Stavke ploče" #: ../properties.c:314 ../properties.c:1682 ../properties.c:1876 msgid "Taskbar" msgstr "Paleta poslova" #: ../properties.c:322 msgid "Task buttons" msgstr "Dugmad poslova" #: ../properties.c:330 ../properties.c:1687 ../properties.c:1879 #: ../properties.c:2625 msgid "Launcher" msgstr "Pokretač" #: ../properties.c:338 ../properties.c:1672 ../properties.c:1870 #: ../properties.c:4002 msgid "Clock" msgstr "Sat" #: ../properties.c:346 ../properties.c:1677 ../properties.c:1873 msgid "System tray" msgstr "Sistemska traka" #: ../properties.c:354 ../properties.c:1667 ../properties.c:1867 #: ../properties.c:5031 msgid "Battery" msgstr "Baterija" #: ../properties.c:362 ../properties.c:4495 ../properties.c:5211 msgid "Tooltip" msgstr "Opisi" #: ../properties.c:516 msgid "Background" msgstr "Pozadina" #: ../properties.c:527 msgid "Selects the background you would like to modify" msgstr "Odabir pozadine koju želite izmjeniti" #: ../properties.c:534 msgid "Creates a copy of the current background" msgstr "Pravi kopiju trenutne pozadine" #: ../properties.c:541 msgid "Deletes the current background" msgstr "Briše trenutnu pozadinu" #: ../properties.c:550 msgid "Fill color" msgstr "Boja" #: ../properties.c:561 msgid "The fill color of the current background" msgstr "Boja trenutne pozadine" #: ../properties.c:564 msgid "Border color" msgstr "Boja ivice" #: ../properties.c:575 msgid "The border color of the current background" msgstr "Boja ivice trenutne pozadine" #: ../properties.c:578 #, fuzzy msgid "Fill color (mouse over)" msgstr "Boja" #: ../properties.c:589 #, fuzzy msgid "The fill color of the current background on mouse over" msgstr "Boja trenutne pozadine" #: ../properties.c:592 #, fuzzy msgid "Border color (mouse over)" msgstr "Boja ivice" #: ../properties.c:603 #, fuzzy msgid "The border color of the current background on mouse over" msgstr "Boja ivice trenutne pozadine" #: ../properties.c:606 #, fuzzy msgid "Fill color (pressed)" msgstr "Boja" #: ../properties.c:617 #, fuzzy msgid "The fill color of the current background on mouse button press" msgstr "Boja trenutne pozadine" #: ../properties.c:620 #, fuzzy msgid "Border color (pressed)" msgstr "Boja ivice" #: ../properties.c:631 #, fuzzy msgid "The border color of the current background on mouse button press" msgstr "Boja ivice trenutne pozadine" #: ../properties.c:634 msgid "Border width" msgstr "Širina ivice" #: ../properties.c:644 msgid "The width of the border of the current background, in pixels" msgstr "Širina ivice trenutne pozadine, u pikselima" #: ../properties.c:647 msgid "Corner radius" msgstr "Prečnik ugla" #: ../properties.c:657 msgid "The corner radius of the current background" msgstr "Prečnik ugla trenutne pozadine" #: ../properties.c:1075 msgid "Geometry" msgstr "Geometrija" #: ../properties.c:1092 msgid "Position" msgstr "Pozicija" #: ../properties.c:1113 msgid "Position on screen: top-left, horizontal panel" msgstr "Pozicija na ekranu: gore-lijevo, horizontalna ploča" #: ../properties.c:1115 msgid "Position on screen: top-center, horizontal panel" msgstr "Pozicija na ekranu: gore-sredina, horizontalna ploča" #: ../properties.c:1117 msgid "Position on screen: top-right, horizontal panel" msgstr "Pozicija na ekranu: gore-desno, horizontalna ploča" #: ../properties.c:1119 msgid "Position on screen: top-left, vertical panel" msgstr "Pozicija na ekranu: gore-lijevo, vertikalna ploča" #: ../properties.c:1121 msgid "Position on screen: center-left, vertical panel" msgstr "Pozicija na ekranu: sredina-lijevo, vertikalna ploča" #: ../properties.c:1123 msgid "Position on screen: bottom-left, vertical panel" msgstr "Pozicija na ekranu: dole-lijevo, vertikalna ploča" #: ../properties.c:1125 msgid "Position on screen: top-right, vertical panel" msgstr "Pozicija na ekranu: gore-desno, vertikalna ploča" #: ../properties.c:1127 msgid "Position on screen: center-right, vertical panel" msgstr "Pozicija na ekranu: sredina-desno, vertikalna ploča" #: ../properties.c:1129 msgid "Position on screen: bottom-right, vertical panel" msgstr "Pozicija na ekranu: dole-desno, vertikalna ploča" #: ../properties.c:1131 msgid "Position on screen: bottom-left, horizontal panel" msgstr "Pozicija na ekranu: dole-lijevo, horizontalna ploča" #: ../properties.c:1133 msgid "Position on screen: bottom-center, horizontal panel" msgstr "Pozicija na ekranu: dole-sredina, horizontalna ploča" #: ../properties.c:1135 msgid "Position on screen: bottom-right, horizontal panel" msgstr "Pozicija na ekranu: dole-desno, horizontalna ploča" #: ../properties.c:1140 ../properties.c:4634 msgid "Monitor" msgstr "Monitor" #: ../properties.c:1150 msgid "All" msgstr "Svi" #: ../properties.c:1151 ../properties.c:4644 msgid "1" msgstr "1" #: ../properties.c:1152 ../properties.c:4645 msgid "2" msgstr "2" #: ../properties.c:1153 ../properties.c:4646 msgid "3" msgstr "3" #: ../properties.c:1154 ../properties.c:4647 msgid "4" msgstr "4" #: ../properties.c:1155 ../properties.c:4648 msgid "5" msgstr "5" #: ../properties.c:1156 ../properties.c:4649 msgid "6" msgstr "6" #: ../properties.c:1158 msgid "The monitor on which the panel is placed" msgstr "Monitor na kojem je ploča" #: ../properties.c:1162 msgid "Primary monitor first" msgstr "" #: ../properties.c:1172 msgid "If enabled, the primary monitor will have index 1 in the monitor " "list even if it is not top-left." msgstr "" #: ../properties.c:1176 msgid "Length" msgstr "Dužina" #: ../properties.c:1186 msgid "The length of the panel (width for horizontal panels, height for " "vertical panels)" msgstr "Dužina ploče (širina za horizontalne, visina za vertikalne ploče)" #: ../properties.c:1192 ../properties.c:1215 msgid "Percent" msgstr "Postotak" #: ../properties.c:1193 ../properties.c:1216 msgid "Pixels" msgstr "Piksela" #: ../properties.c:1195 msgid "The units used to specify the length of the panel: pixels or " "percentage of the monitor size" msgstr "Jedinica za određivanje dužine ploče: pikseli ili postotak veličine " "monitora" #: ../properties.c:1199 msgid "Size" msgstr "Veličina" #: ../properties.c:1209 msgid "The size of the panel (height for horizontal panels, width for " "vertical panels)" msgstr "Veličina ploče (visina za horizontalne, širina za vertikalne ploče" #: ../properties.c:1218 msgid "The units used to specify the size of the panel: pixels or " "percentage of the monitor size" msgstr "Jedinica za određivanje veličine ploče: pikseli ili postotak " "veličine minotora" #: ../properties.c:1222 msgid "Horizontal margin" msgstr "Horizontalna margina" #: ../properties.c:1232 msgid "Creates a space between the panel and the edge of the monitor. For " "left-aligned panels, the space is created on the right of the panel; " "for right-aligned panels, it is created on the left; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Pravi prostor između ploče i ivice monitora. Za ploče poravnate " "prema lijevo prostor se pravi desno od ploče; za ploče poravnate " "prema desno, prostor je lijevo; za centrirane ploče, jednako je " "podijeljen sa obe strane." #: ../properties.c:1239 msgid "Vertical margin" msgstr "Vertikalna margina" #: ../properties.c:1249 msgid "Creates a space between the panel and the edge of the monitor. For " "top-aligned panels, the space is created on the bottom of the panel; " "for bottom-aligned panels, it is created on the top; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Pravi prostor između ploče i ivice monitora. Za ploče poravnate " "prema gore prostor se pravi na dnu ploče; za ploče poravnate prema " "dole, prostor je gore; za centrirane ploče, jednako je podijeljen sa " "obe strane." #: ../properties.c:1256 ../properties.c:2606 ../properties.c:2973 #: ../properties.c:3407 ../properties.c:3983 ../properties.c:4368 #: ../properties.c:4656 ../properties.c:5012 ../properties.c:5192 msgid "Appearance" msgstr "Izgled" #: ../properties.c:1270 ../properties.c:2619 ../properties.c:3775 #: ../properties.c:3996 ../properties.c:4381 ../properties.c:4669 #: ../properties.c:5025 ../properties.c:5205 msgid "Background" msgstr "Pozadina" #: ../properties.c:1280 msgid "Selects the background used to display the panel. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Odabir pozadine za ploču. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:1285 ../properties.c:2647 ../properties.c:2987 #: ../properties.c:3090 ../properties.c:3498 ../properties.c:4010 #: ../properties.c:4395 ../properties.c:4684 ../properties.c:5039 #: ../properties.c:5219 msgid "Horizontal padding" msgstr "Horizontalna popuna" #: ../properties.c:1295 msgid "Specifies the horizontal padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Određuje horizontalno popunjivanje ploče. To je prostor između ivice " "ploče i unutrašnjih elemenata." #: ../properties.c:1300 ../properties.c:2661 ../properties.c:3002 #: ../properties.c:3105 ../properties.c:3512 ../properties.c:4024 #: ../properties.c:4409 ../properties.c:4699 ../properties.c:5053 #: ../properties.c:5233 msgid "Vertical padding" msgstr "Vertikalna popuna" #: ../properties.c:1310 msgid "Specifies the vertical padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Određuje verikalno popunjivanje ploče. To je prostor između ivice " "ploče i unutrašnjih elemenata." #: ../properties.c:1315 ../properties.c:2675 ../properties.c:3017 #: ../properties.c:3526 ../properties.c:4714 msgid "Spacing" msgstr "Razmak" #: ../properties.c:1325 msgid "Specifies the spacing between elements inside the panel." msgstr "Određuje razmak između elemenata unutar ploče." #: ../properties.c:1329 msgid "Ignore compositor" msgstr "Ignoriši kompozitor" #: ../properties.c:1339 msgid "If enabled, the compositor will not be used to draw a transparent " "panel. May fix display corruption problems on broken graphics stacks." msgstr "Ako je uključeno, kompozitor se neće koristiti za prikazivanje " "transparentne ploče. Može pomoći kod pokvarenih grafičkih sistema." #: ../properties.c:1343 msgid "Font shadows" msgstr "Sjena fonta" #: ../properties.c:1353 msgid "If enabled, a shadow will be drawn behind text. This may improve " "legibility on transparent panels." msgstr "Ako je uključeno, svi tekstovi će imati sjenu. Ovo može poboljšati " "čitljivost kod prozirnih ploča." #: ../properties.c:1358 #, fuzzy msgid "Mouse effects" msgstr "Radnje miša" #: ../properties.c:1368 msgid "Clickable interface items change appearance when the mouse is moved " "over them." msgstr "" #: ../properties.c:1372 #, fuzzy msgid "Icon opacity (hovered)" msgstr "Prozirnost ikona" #: ../properties.c:1383 #, fuzzy msgid "Specifies the opacity adjustment of the icons under the mouse, in " "percent." msgstr "Određuje zasićenost boja u ikonama pokretača, u postotcima." #: ../properties.c:1387 #, fuzzy msgid "Icon saturation (hovered)" msgstr "Zasićenost ikona" #: ../properties.c:1398 #, fuzzy msgid "Specifies the saturation adjustment of the icons under the mouse, in " "percent." msgstr "Određuje zasićenost boja u ikonama pokretača, u postotcima." #: ../properties.c:1402 #, fuzzy msgid "Icon brightness (hovered)" msgstr "Svjetloća ikona" #: ../properties.c:1413 #, fuzzy msgid "Specifies the brightness adjustment of the icons under the mouse, in " "percent." msgstr "Određuje svjetloću ikona u pokretaču, u postotcima." #: ../properties.c:1417 #, fuzzy msgid "Icon opacity (pressed)" msgstr "Prozirnost ikona" #: ../properties.c:1428 #, fuzzy msgid "Specifies the opacity adjustment of the icons on mouse button press, " "in percent." msgstr "Određuje zasićenost boja ikona u sistemskoj traci, u postotcima." #: ../properties.c:1432 #, fuzzy msgid "Icon saturation (pressed)" msgstr "Zasićenost ikona" #: ../properties.c:1443 #, fuzzy msgid "Specifies the saturation adjustment of the icons on mouse button " "press, in percent." msgstr "Određuje zasićenost boja ikona u sistemskoj traci, u postotcima." #: ../properties.c:1447 #, fuzzy msgid "Icon brightness (pressed)" msgstr "Svjetloća ikona" #: ../properties.c:1458 #, fuzzy msgid "Specifies the brightness adjustment of the icons on mouse button " "press, in percent." msgstr "Određuje svjetlost ikona u sistemskoj traci, u postotcima." #: ../properties.c:1462 msgid "Autohide" msgstr "Automatsko skrivanje" #: ../properties.c:1476 msgid "Autohide" msgstr "Automatsko skrivanje" #: ../properties.c:1486 msgid "If enabled, the panel is hidden when the mouse cursor leaves the " "panel." msgstr "Ako je uključeno, ploča se skriva kada kursor miša napusti ploču." #: ../properties.c:1490 msgid "Show panel after" msgstr "Prikaži ploču nakon" #: ../properties.c:1500 msgid "Specifies a delay after which the panel is shown when the mouse " "cursor enters the panel." msgstr "Određuje vrijeme nakon kojeg se ploča prikazuje kad kursor miša " "pređe preko ploče." #: ../properties.c:1502 ../properties.c:1536 ../properties.c:5165 #: ../properties.c:5184 msgid "seconds" msgstr "sekunde" #: ../properties.c:1510 msgid "Hidden size" msgstr "Veličina skrivene" #: ../properties.c:1520 msgid "Specifies the size of the panel when hidden, in pixels." msgstr "Određuje veličinu ploče kad je skrivena, u pikselima" #: ../properties.c:1524 msgid "Hide panel after" msgstr "Sakrij ploču nakon" #: ../properties.c:1534 msgid "Specifies a delay after which the panel is hidden when the mouse " "cursor leaves the panel." msgstr "Određuje vrijeme nakon kojeg se ploča skriva kad kursor miša napusti " "ploču." #: ../properties.c:1544 msgid "Window manager interaction" msgstr "Interakcija sa upravljačem prozora" #: ../properties.c:1558 msgid "Forward mouse events" msgstr "Proslijedi radnje miša" #: ../properties.c:1568 msgid "If enabled, mouse events not handled by panel elements are forwarded " "to the desktop. Useful on desktop environments that show a start " "menu when right clicking the desktop, or switch the desktop when " "rotating the mouse wheel over the desktop." msgstr "Ako je uključeno, radnje miša nisu rukovane od strane ploče, već se " "proslijede radnoj površini. Korisno je kod radnih okruženja koja " "prikazuju startni meni pri desnom kliku na površinu ili koji " "mijenjaju površinu rotiranjem kolutića miša." #: ../properties.c:1574 msgid "Place panel in dock" msgstr "Usidri ploču" #: ../properties.c:1584 msgid "If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than " "normal windows. The exact behavior depends on the window manager and " "its configuration." msgstr "Ako je uključeno, postavlja ploču u prostor za sidro (dock) " "upravljača prozora. Prozori postavljeni u sidro (dock) su obično " "posebno tretirani od strane upravljača prozora. Tačno ponašanje " "zavisi od upravljača prozora." #: ../properties.c:1590 msgid "Panel layer" msgstr "Sloj ploče" #: ../properties.c:1600 msgid "Top" msgstr "Vrh" #: ../properties.c:1601 msgid "Normal" msgstr "Normalno" #: ../properties.c:1602 msgid "Bottom" msgstr "Ispod" #: ../properties.c:1604 msgid "Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, " "depending on which has focus. \n" "Note that some window managers prevent this option from working " "correctly if the panel is placed in the dock." msgstr "Određuje sloj za postavljanje ploče. \n" "Vrh: ploča uvijek pokriva druge prozore. \n" "Ispod: drugi prozori uvijek pokrivaju plоču. \n" "Normalno: drugi prozori mogu pokriti ploču, zavisno od toga koji je " "fokusiran. \n" "Napomena: neki upravljači prozora spriječavaju da ovo radi pravilno " "ako se ploča usidri (postavi u dock)." #: ../properties.c:1612 msgid "Maximized windows" msgstr "Uvećani prozori" #: ../properties.c:1622 msgid "Match the panel size" msgstr "Upari sa veličinom ploče" #: ../properties.c:1623 msgid "Match the hidden panel size" msgstr "Upari sa veličinom skrivene ploče" #: ../properties.c:1624 msgid "Fill the screen" msgstr "Popuni ekran" #: ../properties.c:1626 msgid "Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to " "the edge of the panel. \n" "Match the hidden panel size means that maximized windows should " "extend to the edge of the panel when hidden; when visible, the panel " "and the windows will overlap. \n" "Fill the screen means that maximized windows will always have the " "same size as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed " "at the edge (not in the middle) of the virtual screen for this to " "work correctly." msgstr "Određuje veličinu uvećanih prozora. \n" "Upari sa veličinom ploče: uvećani prozori se protežu do ivice " "ploče. \n" "Upari sa veličinom srivene ploče: uvećani prozori se protežu do " "ivice ploče dok je skrivena; ako je vidljiva prozori i ploča će se " "preklapati. \n" "Popuni ekran: uvećani prozori će uvijek prekrivati cijeli ekran. \n" "Napomena: u slučaju višestrukih monitora (Xinerama), ploča se mora " "postaviti uz ivicu (ne u sredinu) virtualnog ekrana da bi ovo radilo " "ispravno." #: ../properties.c:1637 msgid "Window name" msgstr "Ime prozora" #: ../properties.c:1649 msgid "Specifies the name of the panel window. This is useful if you want " "to configure special treatment of tint2 windows in your window " "manager or compositor." msgstr "Određuje ime prozora ploče. Ovo je korisno ako želite da tint2 " "prozori imaju poseban tretman kod upravljača prozora ili kompozitora." #: ../properties.c:1692 ../properties.c:1882 msgid "Free space" msgstr "Slobodni prostor" #: ../properties.c:1697 ../properties.c:1886 ../properties.c:4159 #: ../properties.c:4387 ../properties.c:4557 ../properties.c:4578 msgid "Executor" msgstr "" #: ../properties.c:1712 msgid "Specifies the elements that will appear in the panel and their " "order. Elements can be added by selecting them in the list of " "available elements, then clicking on the add left button." msgstr "Određuje elemente i njihov redoslijed u ploči. Elementi se mogu " "dodati odabirom iz liste dostupnih elemenata, a zatim klikom na " "Dodaj dugme." #: ../properties.c:1728 msgid "Lists all the possible elements that can appear in the panel. " "Elements can be added to the panel by selecting them, then clicking " "on the add left button." msgstr "Prikazuje sve moguće elemente ploče. Elementi se mogu dodati na " "ploču odabirom, a zatim klikom na Dodaj dugme." #: ../properties.c:1738 msgid "Elements selected" msgstr "Odabrani elementi" #: ../properties.c:1744 msgid "Elements available" msgstr "Dostupni elementi" #: ../properties.c:1761 msgid "Moves up the current element in the list of selected elements." msgstr "Pomijera trenutni element gore u listi odabranih elemenata." #: ../properties.c:1769 msgid "Moves down the current element in the list of selected elements." msgstr "Pomijera trenutni element dole u listi odabranih elemenata." #: ../properties.c:1771 ../properties.c:2563 msgid " " msgstr " " #: ../properties.c:1782 msgid "Copies the current element in the list of available elements to the " "list of selected elements." msgstr "Kopira trenutni element iz liste elemenata u listu odabranih " "elemenata." #: ../properties.c:1790 msgid "Removes the current element from the list of selected elements." msgstr "Uklanja trenutni element iz liste odabranih elemenata." #: ../properties.c:2496 msgid "Specifies the application launchers that will appear in the launcher " "and their order. Launchers can be added by selecting an item in the " "list of available applications, then clicking on the add left button." msgstr "Određuje pokretače aplikacija koji će biti u pokretaču i njihov " "redoslijed. Pokretači se mogu dodati odabirom iz liste dostupnih " "aplikacija, pa klikom na Dodaj dugme." #: ../properties.c:2517 msgid "Lists all the applications detected on the system. Launchers can be " "added to the launcher by selecting an application, then clicking on " "the add left button." msgstr "Prikazuje sve aplikacije pronađene u sistemu. Pokretači se mogu " "dodati odabirom iz liste dostupnih aplikacija, pa klikom na Dodaj " "dugme. " #: ../properties.c:2530 msgid "Applications selected" msgstr "Odabrane aplikacije" #: ../properties.c:2536 msgid "Applications available" msgstr "Dostupne aplikacije" #: ../properties.c:2553 msgid "Moves up the current launcher in the list of selected applications." msgstr "Pomjera trenutni pokretač u listi odabranih aplikacija gore." #: ../properties.c:2561 msgid "Moves down the current launcher in the list of selected applications." msgstr "Pomjera trenutni pokretač u listi odabranih aplikacija dole." #: ../properties.c:2574 msgid "Copies the current application in the list of available applications " "to the list of selected applications." msgstr "Kopira trenutnu aplikaciju iz liste dostupnih aplikacija u listu " "odabranih aplikacija." #: ../properties.c:2582 msgid "Removes the current application from the list of selected " "application." msgstr "Uklanja trenutnu aplikaciju iz liste odabranih aplikacija." #: ../properties.c:2594 msgid "Additional application directories" msgstr "Dodatni direktorijumi za aplikacije" #: ../properties.c:2603 msgid "Specifies a path to a directory from which the launcher is loading " "all .desktop files (all subdirectories are explored recursively). " "Can be used multiple times, in which case the paths must be " "separated by commas. Leading ~ is expaned to the path of the user's " "home directory." msgstr "Određuje putanju do direktorijuma (fascikle, foldera) gdje se " "nalaze .desktop fajlovi (zalazi rekurzivno u poddirektorijume). Može " "se dodati više njih, a u tom slučaju se putanje trebaju odvojiti sa " "zarezom. ~ prefiks se proširuje u putanju korinikovog Home " "direktorija." #: ../properties.c:2629 msgid "Selects the background used to display the launcher. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine za pokretač. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:2633 #, fuzzy msgid "Icon background" msgstr "Neaktivna pozadina" #: ../properties.c:2639 #, fuzzy msgid "Launcher icon" msgstr "Pokretač" #: ../properties.c:2643 #, fuzzy msgid "Selects the background used to display the launcher icon. " "Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za pokretač. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:2657 msgid "Specifies the horizontal padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Određuje horizontalno popunjivanje pokretača. To je prostor između " "ivice i unutrašnjih elemenata." #: ../properties.c:2671 msgid "Specifies the vertical padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Određuje vertikalno popunjivanje pokretača. To je prostor između " "ivice i unutrašnjih elemenata." #: ../properties.c:2685 msgid "Specifies the spacing between the elements inside the launcher." msgstr "Određuje razmak između elemenata unutar pokretača." #: ../properties.c:2688 ../properties.c:4728 msgid "Icon size" msgstr "Veličina ikone" #: ../properties.c:2698 msgid "Specifies the size of the launcher icons, in pixels." msgstr "Određuje veličinu ikona u pokretaču, u pikselima." #: ../properties.c:2702 ../properties.c:3736 ../properties.c:4742 msgid "Icon opacity" msgstr "Prozirnost ikona" #: ../properties.c:2713 msgid "Specifies the opacity of the launcher icons, in percent." msgstr "Određuje prozirnost ikona u pokretaču, u postotcima." #: ../properties.c:2717 ../properties.c:3747 ../properties.c:4757 msgid "Icon saturation" msgstr "Zasićenost ikona" #: ../properties.c:2728 msgid "Specifies the saturation adjustment of the launcher icons, in " "percent." msgstr "Određuje zasićenost boja u ikonama pokretača, u postotcima." #: ../properties.c:2732 ../properties.c:3758 ../properties.c:4772 msgid "Icon brightness" msgstr "Svjetloća ikona" #: ../properties.c:2743 msgid "Specifies the brightness adjustment of the launcher icons, in " "percent." msgstr "Određuje svjetloću ikona u pokretaču, u postotcima." #: ../properties.c:2746 msgid "Icon theme" msgstr "Tema ikona" #: ../properties.c:2760 msgid "The icon theme used to display launcher icons. If left blank, tint2 " "will detect and use the icon theme of your desktop as long as you " "have an XSETTINGS manager running (most desktop environments do)." msgstr "Tema ikona koja se koristi u pokretaču. Ako se ostavi prazno, tint2 " "će otrkiti i koristiti temu koju koristi okruženje ako postoji neki " "XSETTINGS upravljač (ima u većini radnih okruženja)." #: ../properties.c:2764 msgid "Overrides XSETTINGS" msgstr "Zanemari XSETTINGS" #: ../properties.c:2768 msgid "If enabled, the icon theme selected here will override the one " "provided by XSETTINGS." msgstr "Ako je uključeno, izabrana tema će zamjeniti onu iz XSETTINGSa." #: ../properties.c:2771 msgid "Startup notifications" msgstr "Obavještenja o pokretanju" #: ../properties.c:2781 msgid "If enabled, startup notifications are shown when starting " "applications from the launcher. The appearance may vary depending on " "your desktop environment configuration; normally, a busy mouse " "cursor is displayed until the application starts." msgstr "Ako je uključeno, obavještenje o pokretanju aplikacije se prikazuje " "tokom pokretanja. Izgled zavisi od radnog okruženja; obično se " "koristi zauzeti kursor miša dok se aplikacija ne pokrene." #: ../properties.c:2785 ../properties.c:4922 msgid "Tooltips" msgstr "Opisi" #: ../properties.c:2795 msgid "If enabled, shows a tooltip with the application name when the mouse " "is moved over an application launcher." msgstr "Ako je uključeno, prikazuje ime aplikacije ako se mišom pređe preko " "pokretača aplikacije." #: ../properties.c:2842 ../properties.c:4597 msgid "Options" msgstr "Mogućnosti" #: ../properties.c:2857 msgid "Show a taskbar for each desktop" msgstr "Prikaži paletu za svaku radnu površinu" #: ../properties.c:2867 msgid "If enabled, the taskbar is split into multiple smaller taskbars, one " "for each virtual desktop." msgstr "Ako je uključeno, paleta poslova je podijeljena na dijelove, jedan " "dio za svaku virtuelnu radnu površinu." #: ../properties.c:2871 msgid "Distribute size between taskbars" msgstr "Raspodijeli prostor ravnomjerno" #: ../properties.c:2881 msgid "If enabled and 'Show a taskbar for each desktop' is also enabled, " "the available size is distributed between taskbars proportionally to " "the number of tasks." msgstr "Ako je 'Prikaži paletu za svaku radnu površinu' i ovo uključeno, " "prostor će biti raspodijeljen među trakama proporcionalno broju " "njihovih zadataka." #: ../properties.c:2886 msgid "Hide inactive tasks" msgstr "Sakrij neaktivne zadatke" #: ../properties.c:2896 msgid "If enabled, only the active task will be shown in the taskbar." msgstr "Ako je uključeno, samo će aktivni zadatak biti prikazan na traci." #: ../properties.c:2900 msgid "Hide tasks from different monitors" msgstr "Sakrij zadatke sa različitih monitora" #: ../properties.c:2910 msgid "If enabled, tasks that are not on the same monitor as the panel will " "not be displayed. This behavior is enabled automatically if the " "panel monitor is set to 'All'." msgstr "Ako je uključeno, zadaci koji nisu na istom monitoru kao i ploča " "neće biti prikazani. Ovo ponašanje je uključeno automatski ako je " "monitor ploče postaljen na 'Svi'." #: ../properties.c:2916 msgid "Always show all desktop tasks" msgstr "" #: ../properties.c:2926 msgid "Has effect only if 'Show a taskbar for each desktop' is enabled. If " "enabled, tasks that appear on all desktops are shown on all " "taskbars. Otherwise, they are shown only on the taskbar of the " "current desktop." msgstr "" #: ../properties.c:2932 msgid "Task sorting" msgstr "Sortiranje zadataka" #: ../properties.c:2942 ../properties.c:3236 ../properties.c:3272 #: ../properties.c:3308 ../properties.c:3344 ../properties.c:3380 msgid "None" msgstr "Ništa" #: ../properties.c:2943 msgid "By title" msgstr "Po imenu" #: ../properties.c:2944 msgid "By center" msgstr "Po sredini" #: ../properties.c:2945 msgid "Most recently used first" msgstr "" #: ../properties.c:2946 msgid "Most recently used last" msgstr "" #: ../properties.c:2948 msgid "Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can " "also reorder task buttons by mouse dragging. \n" "'By title' means that tasks are sorted by their window titles. \n" "'By center' means that tasks are sorted geometrically by their " "window centers." msgstr "Određuje sortiranje zadataka u paleti. \n" "Ništa: novi zadaci se dodaju na kraj, korisnik ih može poredati " "klikom i pomjeranjem. \n" "Po imenu: zadaci su poredani po imenu njihovih prozora. \n" "Po sredini: zadaci su poredani geometrijski po središtima njihovih " "prozora." #: ../properties.c:2955 msgid "Task alignment" msgstr "Poravnanje zadataka" #: ../properties.c:2965 msgid "Left" msgstr "Lijevo" #: ../properties.c:2966 msgid "Center" msgstr "Sredina" #: ../properties.c:2967 msgid "Right" msgstr "Desno" #: ../properties.c:2969 msgid "Specifies how tasks should be positioned on the taskbar." msgstr "Određuje kako da se pozicioniraju zadaci u traci." #: ../properties.c:2997 msgid "Specifies the horizontal padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Određuje horizontalno popunjavanje trake. To je prostor između trake " "i unutrašnjih elemenata." #: ../properties.c:3012 msgid "Specifies the vertical padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Određuje vertikalno popunjavanje trake. To je prostor između trake i " "unutrašnjih elemenata." #: ../properties.c:3027 msgid "Specifies the spacing between the elements inside the taskbar." msgstr "Određuje razmak između elemenata unutar trake zadataka." #: ../properties.c:3031 ../properties.c:3176 msgid "Active background" msgstr "Aktivna pozadina" #: ../properties.c:3037 #, fuzzy msgid "Active taskbar" msgstr "Aktivni zadatak" #: ../properties.c:3041 msgid "Selects the background used to display the taskbar of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za traku aktivne radne površine. Pozadine se mogu " "uređivati u kartici za Pozadine." #: ../properties.c:3045 ../properties.c:3191 msgid "Inactive background" msgstr "Neaktivna pozadina" #: ../properties.c:3051 #, fuzzy msgid "Inactive taskbar" msgstr "Aktivni zadatak" #: ../properties.c:3055 msgid "Selects the background used to display taskbars of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za traku neaktivne radne površine. Pozadine se mogu " "uređivati u kartici za Pozadine." #: ../properties.c:3060 msgid "Desktop name" msgstr "Ime radne površine" #: ../properties.c:3075 msgid "Show desktop name" msgstr "Prikaži ime radne površine" #: ../properties.c:3085 msgid "If enabled, displays the name of the desktop at the top/left of the " "taskbar. The name is set by your window manager; you might be able " "to configure it there." msgstr "Ako je uključeno, prikazuje ime radne površine u gornjem-lijevom " "uglu trake. Ime određuje upravljač prozora; možda ga možete " "promijeniti u postavkama." #: ../properties.c:3100 msgid "Specifies the horizontal padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Određuje horizontalno popunjavanje imena radne površine. To je " "prostor između ivice i unutrašnjeg teksta." #: ../properties.c:3115 msgid "Specifies the vertical padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Određuje vertikalno popunjavanje imena radne površine. To je prostor " "između ivice i unutrašnjeg teksta." #: ../properties.c:3120 msgid "Active font color" msgstr "Boja aktivnog fonta" #: ../properties.c:3131 msgid "Specifies the font color used to display the name of the current " "desktop." msgstr "Određuje boju fonta koji se koristi za ime aktivne radne površine." #: ../properties.c:3135 msgid "Inactive font color" msgstr "Boja neaktivnog fonta" #: ../properties.c:3146 msgid "Specifies the font color used to display the name of inactive " "desktops." msgstr "Određuje boju fonta koji se koristi za ime neaktivne radne površine." #: ../properties.c:3153 ../properties.c:3542 ../properties.c:4041 #: ../properties.c:4067 ../properties.c:4426 ../properties.c:5070 #: ../properties.c:5095 ../properties.c:5250 msgid "If not checked, the desktop theme font is used. If checked, the " "custom font specified here is used." msgstr "" #: ../properties.c:3156 ../properties.c:3545 ../properties.c:4429 #: ../properties.c:5253 msgid "Font" msgstr "Font" #: ../properties.c:3170 msgid "Specifies the font used to display the desktop name." msgstr "Određuje font koji se koristi za prikaz imena radne površine." #: ../properties.c:3182 #, fuzzy msgid "Active desktop name" msgstr "Prikaži ime radne površine" #: ../properties.c:3186 msgid "Selects the background used to display the name of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za prikaz imena trenutne radne površine. Pozadine se " "mogu uređivati u kartici za Pozadine." #: ../properties.c:3197 #, fuzzy msgid "Inactive desktop name" msgstr "Prikaži ime radne površine" #: ../properties.c:3201 msgid "Selects the background used to display the name of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Odabir pozadine za prikaz imena neaktivne radne površine. Pozadine " "se mogu uređivati u kartici za Pozadine." #: ../properties.c:3213 ../properties.c:3894 ../properties.c:4279 #: ../properties.c:4909 msgid "Mouse events" msgstr "Radnje miša" #: ../properties.c:3226 msgid "Left click" msgstr "Lijevi klik" #: ../properties.c:3237 ../properties.c:3273 ../properties.c:3309 #: ../properties.c:3345 ../properties.c:3381 msgid "Close" msgstr "Zatvori" #: ../properties.c:3238 ../properties.c:3274 ../properties.c:3310 #: ../properties.c:3346 ../properties.c:3382 msgid "Toggle" msgstr "Prebaci" #: ../properties.c:3239 ../properties.c:3275 ../properties.c:3311 #: ../properties.c:3347 ../properties.c:3383 msgid "Iconify" msgstr "Umanji" #: ../properties.c:3240 ../properties.c:3276 ../properties.c:3348 #: ../properties.c:3384 #, fuzzy msgid "Shade" msgstr "Zatamni" #: ../properties.c:3241 ../properties.c:3277 ../properties.c:3313 #: ../properties.c:3349 ../properties.c:3385 msgid "Toggle or iconify" msgstr "Prebaci ili umanji" #: ../properties.c:3242 ../properties.c:3278 ../properties.c:3314 #: ../properties.c:3350 ../properties.c:3386 msgid "Maximize or restore" msgstr "Uvećaj ili povrati" #: ../properties.c:3243 ../properties.c:3279 ../properties.c:3315 #: ../properties.c:3351 ../properties.c:3387 msgid "Desktop left" msgstr "Lijeva radna površina" #: ../properties.c:3244 ../properties.c:3280 ../properties.c:3316 #: ../properties.c:3352 ../properties.c:3388 msgid "Desktop right" msgstr "Desna radna površina" #: ../properties.c:3245 ../properties.c:3281 ../properties.c:3317 #: ../properties.c:3353 ../properties.c:3389 msgid "Next task" msgstr "Sljedeći zadatak" #: ../properties.c:3246 ../properties.c:3282 ../properties.c:3318 #: ../properties.c:3354 ../properties.c:3390 msgid "Previous task" msgstr "Prethodni zadatak" #: ../properties.c:3248 #, fuzzy msgid "Specifies the action performed when task buttons receive a left " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon lijevog klika na zadatak: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3262 msgid "Wheel scroll up" msgstr "Kolutić miša gore" #: ../properties.c:3284 msgid "Specifies the action performed when task buttons receive a scroll up " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon pomijeranja kolutića miša gore na zadatku: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3298 msgid "Middle click" msgstr "Srednji klik" #: ../properties.c:3312 #, fuzzy msgid "sShade" msgstr "zZatamni" #: ../properties.c:3320 msgid "Specifies the action performed when task buttons receive a middle " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon srednjeg klika na zadatak: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3334 msgid "Wheel scroll down" msgstr "Kolutić miša dole" #: ../properties.c:3356 msgid "Specifies the action performed when task buttons receive a scroll " "down event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon pomijeranja kolutića miša dole na zadatku: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3370 msgid "Right click" msgstr "Desni klik" #: ../properties.c:3392 msgid "Specifies the action performed when task buttons receive a right " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Određuje akciju nakon desnog klika na zadatak: \n" "Ništa: ništa se ne poduzme. \n" "Zatvori: zatvara zadatak. \n" "Prebaci: prebaci zadatak. \n" "Umanji: umanji (minimizira) zadatak. \n" "Zatamni: zatamni (urola) zadatak. \n" "Prebaci ili umanji: prebaci ili umanji zadatak. \n" "Uvećaj ili povrati: uvećava ili umanjuje zadatak. \n" "Lijeva radna površina: šalje zadatak na prethodnu površinu. \n" "Desna radna površina: šalje zadatak na sljedeću površinu. \n" "Sljedeći zadatak: fokusira sljedeći zadatak. \n" "Prethodni zadatak: fokusira prethodni zadatak." #: ../properties.c:3420 ../properties.c:4218 msgid "Show icon" msgstr "Prikaži ikonu" #: ../properties.c:3430 msgid "If enabled, the window icon is shown on task buttons." msgstr "Ako je uključeno, prikazuje ikonu prozora na dugmetu zadatka." #: ../properties.c:3433 msgid "Show text" msgstr "Prikaži tekst" #: ../properties.c:3443 msgid "If enabled, the window title is shown on task buttons." msgstr "Ako je uključeno, prikazuje ime prоzora na dugmetu zadatka." #: ../properties.c:3446 msgid "Center text" msgstr "Centriraj tekst" #: ../properties.c:3456 msgid "If enabled, the text is centered on task buttons. Otherwise, it is " "left-aligned." msgstr "Ako je uključeno, tekst se centrira na dugmetu zadatka. U suprotnom " "je poredano ulijevo." #: ../properties.c:3459 msgid "Show tooltips" msgstr "Prikaži opise" #: ../properties.c:3469 msgid "If enabled, a tooltip showing the window title is displayed when the " "mouse cursor moves over task buttons." msgstr "Ako je uključeno, prikazuje ime prozora kad se mišom pređe preko " "dugmeta zadatka." #: ../properties.c:3472 msgid "Maximum width" msgstr "Maksimalna širina" #: ../properties.c:3482 msgid "Specifies the maximum width of the task buttons." msgstr "Određuje maksimalnu širinu dugmadi zadataka." #: ../properties.c:3485 msgid "Maximum height" msgstr "Maksimalna visina" #: ../properties.c:3495 msgid "Specifies the maximum height of the task buttons." msgstr "Određuje maksimalnu visinu dugmadi zadataka." #: ../properties.c:3508 msgid "Specifies the horizontal padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Određuje horizontalno popunjavanje dugmadi. To je prostor između " "ivice i unutrašnjeg sadržaja." #: ../properties.c:3522 msgid "Specifies the vertical padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Određuje vertikalno popunjavanje dugmadi. To je prostor između ivice " "i unutrašnjeg sadržaja." #: ../properties.c:3536 msgid "Specifies the spacing between the icon and the text." msgstr "Određuje razmak između ikone i teksta." #: ../properties.c:3556 msgid "Specifies the font used to display the task button text." msgstr "Određuje font za prikaz teksta na dugmetu zadatka." #: ../properties.c:3568 msgid "Default style" msgstr "Standardni izgled" #: ../properties.c:3569 #, fuzzy msgid "Default task" msgstr "Standardni izgled" #: ../properties.c:3579 ../properties.c:3580 msgid "Normal task" msgstr "Normalni zadatak" #: ../properties.c:3590 ../properties.c:3591 msgid "Active task" msgstr "Aktivni zadatak" #: ../properties.c:3601 ../properties.c:3602 msgid "Urgent task" msgstr "Hitni zadatak" #: ../properties.c:3612 ../properties.c:3613 msgid "Iconified task" msgstr "Umanjeni zadatak" #: ../properties.c:3717 msgid "If enabled, a custom font color is used to display the task text." msgstr "Ako je uključeno, koristi izabranu boju fonta za prikaz teksta " "zadatka." #: ../properties.c:3719 ../properties.c:4089 ../properties.c:4444 #: ../properties.c:5117 ../properties.c:5269 msgid "Font color" msgstr "Boja fonta" #: ../properties.c:3728 msgid "Specifies the font color used to display the task text." msgstr "Određuje boju fonta koja se koristi za prikaz teksta zadatka." #: ../properties.c:3734 msgid "If enabled, a custom opacity/saturation/brightness is used to " "display the task icon." msgstr "Ako je uključeno, koriste se vrijednost izabrane od korisnika za " "prozirnost/zasićenje/svjetlost ikone zadatka." #: ../properties.c:3745 msgid "Specifies the opacity (in %) used to display the task icon." msgstr "Određuje prozirnost (u %) za prikaz ikone zadatka." #: ../properties.c:3756 msgid "Specifies the saturation adjustment (in %) used to display the task " "icon." msgstr "Određuje zasićenost boja (u %) za prikaz ikone zadatka" #: ../properties.c:3767 msgid "Specifies the brightness adjustment (in %) used to display the task " "icon." msgstr "Određuje svjetlost (u %) za prikaz ikone zadatka." #: ../properties.c:3773 msgid "If enabled, a custom background is used to display the task." msgstr "Ako je uključeno, posebna pozadina se koristi pri prikazu zadatka." #: ../properties.c:3783 msgid "Selects the background used to display the task. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Odabir pozadine za zadatak. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:3787 msgid "Blinks" msgstr "Treptanje" #: ../properties.c:3795 msgid "Specifies how many times urgent tasks blink." msgstr "Određuje koliko će puta trepnuti hitni zadaci." #: ../properties.c:3817 ../properties.c:4177 msgid "Format" msgstr "Format" #: ../properties.c:3829 msgid "First line format" msgstr "Format prve linije" #: ../properties.c:3841 msgid "Specifies the format used to display the first line of the clock " "text. See 'man strftime' for all the available options." msgstr "Određuje format za prikaz prve linije sata. Pogledaj 'man strftime' " "za sve dostupne mogućnosti." #: ../properties.c:3845 msgid "Second line format" msgstr "Format druge linije" #: ../properties.c:3857 msgid "Specifies the format used to display the second line of the clock " "text. See 'man strftime' for all the available options." msgstr "Određuje format za prikaz druge linije sata. Pogledaj 'man strftime' " "za sve dostupne mogućnosti." #: ../properties.c:3861 msgid "First line timezone" msgstr "Vremenska zona prve linije" #: ../properties.c:3873 msgid "Specifies the timezone used to display the first line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Određuje vremensku zonu pri prikazu vremena prve linije. Ako je " "prazno koristi se trenutna vremenska zona. U suprotnom, mora biti " "unešena u obliku važeće TZ promjenljive okruženja (environment " "variable)." #: ../properties.c:3877 msgid "Second line timezone" msgstr "Vremenska zona druge linije" #: ../properties.c:3889 msgid "Specifies the timezone used to display the second line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Određuje vremensku zonu pri prikazu vremena druge linije. Ako je " "prazno koristi se trenutna vremenska zona. U suprotnom, mora biti " "unešena u obliku važeće TZ promjenljive okruženja (environment " "variable)." #: ../properties.c:3907 ../properties.c:4292 ../properties.c:4936 msgid "Left click command" msgstr "Komanda lijevog klika" #: ../properties.c:3919 msgid "Specifies a command that will be executed when the clock receives a " "left click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:3922 ../properties.c:4307 ../properties.c:4951 msgid "Right click command" msgstr "Komanda desnog klika" #: ../properties.c:3934 msgid "Specifies a command that will be executed when the clock receives a " "right click." msgstr "Određuje komandu koja će biti izvršena nakon desnog klika na sat." #: ../properties.c:3937 ../properties.c:4322 ../properties.c:4966 #, fuzzy msgid "Middle click command" msgstr "Komanda lijevog klika" #: ../properties.c:3949 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "middle click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:3952 ../properties.c:4337 ../properties.c:4981 #, fuzzy msgid "Wheel scroll up command" msgstr "Kolutić miša gore" #: ../properties.c:3964 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll up." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:3967 ../properties.c:4352 ../properties.c:4996 #, fuzzy msgid "Wheel scroll down command" msgstr "Kolutić miša dole" #: ../properties.c:3979 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll down." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4006 msgid "Selects the background used to display the clock. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Odabir pozadine za sat. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:4020 msgid "Specifies the horizontal padding of the clock. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4034 msgid "Specifies the vertical padding of the clock. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4044 ../properties.c:5073 msgid "Font first line" msgstr "Font prve linije" #: ../properties.c:4059 msgid "Specifies the font used to display the first line of the clock." msgstr "Određuje font korišten za prikaz prve linije sata." #: ../properties.c:4070 ../properties.c:5098 msgid "Font second line" msgstr "Font druge linije" #: ../properties.c:4084 msgid "Specifies the font used to display the second line of the clock." msgstr "Određuje font korišten za prikaz druge linije sata." #: ../properties.c:4100 msgid "Specifies the font color used to display the clock." msgstr "Određuje boju fonta korištenog za prikaz sata." #: ../properties.c:4104 msgid "Tooltip" msgstr "Opisi" #: ../properties.c:4117 msgid "Format" msgstr "Format" #: ../properties.c:4128 msgid "Specifies the format used to display the clock tooltip. See 'man " "strftime' for the available options." msgstr "Određuje format korišten pri prikazivanju opisa sata. Pogledaj 'man " "strftime' za sve mogućnosti." #: ../properties.c:4132 msgid "Timezone" msgstr "Vremenska zona" #: ../properties.c:4143 msgid "Specifies the timezone used to display the clock tooltip. If empty, " "the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "Određuje vremensku zonu prikazanu u opisu sata. Ako je prazno, " "trenutna vremenska zona se koristi. U suprotnom, mora biti unešena u " "obliku važeće TZ promjenljive okruženja (environment variable)." #: ../properties.c:4189 #, fuzzy msgid "Command" msgstr "Komanda upozorenja" #: ../properties.c:4201 #, fuzzy msgid "Specifies the command to execute." msgstr "Određuje font koji se koristi za prikaz imena radne površine." #: ../properties.c:4204 msgid "Interval" msgstr "" #: ../properties.c:4214 msgid "Specifies the interval at which the command is executed, in seconds. " "If zero, the command is executed only once." msgstr "" #: ../properties.c:4228 msgid "If enabled, the first line printed by the command is interpreted as " "a path to an image file." msgstr "" #: ../properties.c:4232 #, fuzzy msgid "Cache icon" msgstr "Pokretač" #: ../properties.c:4243 msgid "If enabled, the image is not reloaded from disk every time the " "command is executed if the path remains unchanged. Enabling this is " "recommended." msgstr "" #: ../properties.c:4246 msgid "Continuous output" msgstr "" #: ../properties.c:4256 msgid "If non-zero, the last execp_continuous lines from the output of the " "command are displayed, every execp_continuous lines; this is useful " "for showing the output of commands that run indefinitely, such as " "'ping 127.0.0.1'. If zero, the output of the command is displayed " "after it finishes executing." msgstr "" #: ../properties.c:4262 msgid "Display markup" msgstr "" #: ../properties.c:4273 msgid "If enabled, the output of the command is treated as Pango markup, " "which allows rich text formatting. Note that using this with " "commands that print data downloaded from the Internet is a potential " "security risk." msgstr "" #: ../properties.c:4304 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a left click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4319 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a right click." msgstr "Određuje komandu koja će biti izvršena nakon desnog klika na sat." #: ../properties.c:4334 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a middle click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4349 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll up." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4364 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll down." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4391 #, fuzzy msgid "Selects the background used to display the executor. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine za sat. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:4405 #, fuzzy msgid "Specifies the horizontal padding of the executor. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4419 #, fuzzy msgid "Specifies the vertical padding of the executor. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje oko sata. To je prostor između " "ivica i unutrašnjeg sadržaja." #: ../properties.c:4457 #, fuzzy msgid "Centered" msgstr "Sredina" #: ../properties.c:4469 #, fuzzy msgid "Icon width" msgstr "Tema ikona" #: ../properties.c:4479 msgid "If non-zero, the image is resized to this width." msgstr "" #: ../properties.c:4482 #, fuzzy msgid "Icon height" msgstr "Svjetloća ikona" #: ../properties.c:4492 msgid "If non-zero, the image is resized to this height." msgstr "" #: ../properties.c:4508 #, fuzzy msgid "Tooltip text" msgstr "Opisi" #: ../properties.c:4520 msgid "The tooltip text to display. Leave this empty to display an " "automatically generated tooltip with information about when the " "command was last executed." msgstr "" #: ../properties.c:4611 msgid "Icon ordering" msgstr "Redoslijed ikona" #: ../properties.c:4621 msgid "Ascending" msgstr "Uzlazno" #: ../properties.c:4622 msgid "Descending" msgstr "Silazno" #: ../properties.c:4623 msgid "Left to right" msgstr "Lijevo prema desno" #: ../properties.c:4624 msgid "Right to left" msgstr "Desno prema lijevo" #: ../properties.c:4626 msgid "Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their " "window names. \n" "'Descending' means that icons are sorted in descending order of " "their window names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right." msgstr "Određuje redoslijed kojim se aranžiraju ikone u alatnoj traci. \n" "Uzlazno: poredane su uzlazno po imenu njihovog prozora. \n" "Silazno: poredane su silazno po imenu njihovog prozora. \n" "Lijevo prema desno: ikone se uvijek dodaju s lijeva nadesno. \n" "Desno prema lijevo: ikone se uvijek dodaju s desna nalijevo." #: ../properties.c:4651 msgid "Specifies the monitor on which to place the system tray. Due to " "technical limitations, the system tray cannot be displayed on " "multiple monitors." msgstr "Određuje mоnitor na kom da se prikaže sistemska traka. Zbog tehnički " "ograničenja, traka ne može biti prikazana na više monitora." #: ../properties.c:4675 #, fuzzy msgid "Systray" msgstr "Sistemska traka" #: ../properties.c:4679 msgid "Selects the background used to display the system tray. Backgrounds " "can be edited in the Backgrounds tab." msgstr "Odabir pozadine za sistemsku traku. Pozadine se mogu uređivati u " "kartici za Pozadine." #: ../properties.c:4694 msgid "Specifies the horizontal padding of the system tray. This is the " "space between the border and the content inside." msgstr "Određuje horizontalno popunjavanje sistemske trake. To je prostor " "između ivice i unutrašnjeg sadržaja." #: ../properties.c:4709 msgid "Specifies the vertical padding of the system tray. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje sistemske trake. To je prostor " "između ivice i unutrašnjeg sadržaja." #: ../properties.c:4724 msgid "Specifies the spacing between system tray icons." msgstr "Određuje razmak između ikona u sistemskoj traci." #: ../properties.c:4738 msgid "Specifies the size of the system tray icons, in pixels." msgstr "Određuje veličinu ikona u traci, u pikselima." #: ../properties.c:4753 msgid "Specifies the opacity of the system tray icons, in percent." msgstr "Određuje prozirnost ikona u sistemskoj traci, u postotcima." #: ../properties.c:4768 msgid "Specifies the saturation adjustment of the system tray icons, in " "percent." msgstr "Određuje zasićenost boja ikona u sistemskoj traci, u postotcima." #: ../properties.c:4783 msgid "Specifies the brightness adjustment of the system tray icons, in " "percent." msgstr "Određuje svjetlost ikona u sistemskoj traci, u postotcima." #: ../properties.c:4799 msgid "Thresholds" msgstr "Prag" #: ../properties.c:4812 msgid "Hide if charge higher than" msgstr "Sakrij ako je punija od" #: ../properties.c:4822 msgid "Minimum battery level for which to hide the batter applet. Use 101 " "to always show the batter applet." msgstr "Najmanji nivo baterijе kod kojeg da se sakrije aplet (prikaz). " "Koristi 101 da se uvijek prikazuje." #: ../properties.c:4824 ../properties.c:4843 msgid "%" msgstr "%" #: ../properties.c:4831 msgid "Alert if charge lower than" msgstr "Upozori ako spane ispod" #: ../properties.c:4841 msgid "Battery level for which to display an alert." msgstr "Nivo baterije za prikaz upozorenja." #: ../properties.c:4850 msgid "Alert command" msgstr "Komanda upozorenja" #: ../properties.c:4861 msgid "Command to be executed when the alert threshold is reached." msgstr "Komanda koja se izvodi kad se dostigne prag." #: ../properties.c:4865 #, fuzzy msgid "AC connection events" msgstr "Radnje miša" #: ../properties.c:4878 #, fuzzy msgid "AC connected command" msgstr "Komanda upozorenja" #: ../properties.c:4890 #, fuzzy msgid "Specifies a command that will be executed when AC is connected to " "the system." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4893 #, fuzzy msgid "AC disconnected command" msgstr "Komanda upozorenja" #: ../properties.c:4905 #, fuzzy msgid "Specifies a command that will be executed when AC is disconnected to " "the system." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4933 #, fuzzy msgid "If enabled, shows a tooltip with detailed battery information when " "the mouse is moved over the battery widget." msgstr "Ako je uključeno, prikazuje ime aplikacije ako se mišom pređe preko " "pokretača aplikacije." #: ../properties.c:4948 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a left click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4963 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a right click." msgstr "Određuje komandu koja će biti izvršena nakon desnog klika na sat." #: ../properties.c:4978 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a middle click." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:4993 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll up." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:5008 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll down." msgstr "Određuje komandu koja će biti izvršena nakon lijevog klika na sat." #: ../properties.c:5035 msgid "Selects the background used to display the battery. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine za prikaz nivoa baterije. Pozadine se mogu uređivati " "u kartici za Pozadine. " #: ../properties.c:5049 msgid "Specifies the horizontal padding of the battery. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje oko baterije. To je prostor " "između ivice i unutrašnjeg sadržaja." #: ../properties.c:5063 msgid "Specifies the vertical padding of the battery. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje oko baterije. To je prostor između " "ivice i unutrašnjeg sadržaja." #: ../properties.c:5087 msgid "Specifies the font used to display the first line of the battery " "text." msgstr "Određuje font za prikaz prve linije baterijskog teksta." #: ../properties.c:5112 msgid "Specifies the font used to display the second line of the battery " "text." msgstr "Određuje font za prikaz druge linije baterijskog teksta." #: ../properties.c:5128 msgid "Specifies the font clor used to display the battery text." msgstr "Određuje boju fonta za prikaz baterijskog teksta." #: ../properties.c:5140 #, fuzzy msgid "Timing" msgstr "Tajming" #: ../properties.c:5153 msgid "Show delay" msgstr "Zakašnjenje prikazivanja" #: ../properties.c:5163 msgid "Specifies a delay after which to show the tooltip when moving the " "mouse over an element." msgstr "Određuje zakašnjenje nakon kojeg će se prikazati opis tokom " "pomjeranja kursora preko elementa." #: ../properties.c:5172 msgid "Hide delay" msgstr "Zakašnjenje skrivanja" #: ../properties.c:5181 msgid "Specifies a delay after which to hide the tooltip when moving the " "mouse outside an element." msgstr "Određuje zakašnjenje nakon kojeg da se sakrije opis nakon pomjeranja " "kursora van nekog elementa." #: ../properties.c:5215 msgid "Selects the background used to display the tooltip. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Odabir pozadine opisa. Pozadine se mogu uređivati u kartici za " "Pozadine." #: ../properties.c:5229 msgid "Specifies the horizontal padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Određuje horizontalno popunjavanje za opis. To je prostor između " "ivice i unutrašnjeg sadržaja." #: ../properties.c:5243 msgid "Specifies the vertical padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Određuje vertikalno popunjavanje za opis. To je prostor između ivice " "i unutrašnjeg sadržaja." #: ../properties.c:5264 msgid "Specifies the font used to display the text of the tooltip." msgstr "Određuje font za prikaz teksta unutar opisa." #: ../properties.c:5280 msgid "Specifies the font color used to display the text of the tooltip." msgstr "Određuje boju fonta za prikaz teksta unutar opisa." #: ../main.c:148 msgid "tint2conf" msgstr "tint2conf" #: ../main.c:156 msgid "Panel theming" msgstr "Izgled ploče" #: ../main.c:166 msgid "Theme" msgstr "Tema" #: ../main.c:167 msgid "_Import theme..." msgstr "_Importuj temu..." #: ../main.c:167 msgid "Import theme" msgstr "Importuj temu" #: ../main.c:168 msgid "_Import default theme..." msgstr "_Importuj standardnu temu..." #: ../main.c:168 msgid "Import default theme" msgstr "Importuj standardnu temu" #: ../main.c:169 msgid "_Save as..." msgstr "_Snimiti kao..." #: ../main.c:169 ../main.c:335 msgid "Save theme as" msgstr "Snimiti temu kao" #: ../main.c:170 msgid "_Delete" msgstr "Iz_briši" #: ../main.c:170 msgid "Delete theme" msgstr "Izbriši temu" #: ../main.c:171 msgid "_Edit theme..." msgstr "Ur_edi temu..." #: ../main.c:171 msgid "Edit selected theme" msgstr "Uredi odabranu temu" #: ../main.c:172 msgid "_Make default" msgstr "" #: ../main.c:172 msgid "Replace the default theme with the selected one" msgstr "" #: ../main.c:173 msgid "_Quit" msgstr "_Napusti" #: ../main.c:173 msgid "Quit" msgstr "Napusti" #: ../main.c:174 msgid "Edit" msgstr "Uredi" #: ../main.c:175 msgid "Refresh" msgstr "Osvježi" #: ../main.c:176 msgid "Refresh all" msgstr "Osvježi sve" #: ../main.c:177 msgid "Help" msgstr "Pomoć" #: ../main.c:178 msgid "_About" msgstr "_O programu" #: ../main.c:178 msgid "About" msgstr "O programu" #: ../main.c:198 msgid "Command to run tint2: " msgstr "Komanda za pokretanje tint2: " #: ../main.c:242 msgid "Theming tool for tint2 panel" msgstr "Alat za uređivanje tint2 tema" #: ../main.c:244 msgid "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" msgstr "Autorska prava 2009-2015 tint2 tim\n" "Tint2 licenca GNU GPL verzija 2\n" "Tintwizard licenca GNU GPL verzija 3" #: ../main.c:249 msgid "translator-credits" msgstr "Dino Duratović " #: ../main.c:258 msgid "Import theme(s)" msgstr "Importuj temu(e)" #: ../main.c:293 msgid "Save default theme as" msgstr "Snimiti standardnu temu kao" #: ../main.c:325 msgid "Select the theme to be saved." msgstr "Izaberi temu za snimanje." tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/pl.po000066400000000000000000002260551265276141000245520ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "Project-Id-Version: tint2conf 0.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-17 13:33+0100\n" "PO-Revision-Date: 2015-05-28 21:01+0100\n" "Last-Translator: Daniel Napora \n" "Language-Team: \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.6.9\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n" "%100<10 || n%100>=20) ? 1 : 2);\n" #: ../properties.c:256 msgid "Properties" msgstr "Ustawienia" #: ../properties.c:290 msgid "Backgrounds" msgstr "Tła" #: ../properties.c:298 ../properties.c:1276 msgid "Panel" msgstr "Panel" #: ../properties.c:306 msgid "Panel items" msgstr "Elementy panelu" #: ../properties.c:314 ../properties.c:1682 ../properties.c:1876 msgid "Taskbar" msgstr "Pasek zadań" #: ../properties.c:322 msgid "Task buttons" msgstr "Przyciski paska zadań" #: ../properties.c:330 ../properties.c:1687 ../properties.c:1879 #: ../properties.c:2625 msgid "Launcher" msgstr "Programy" #: ../properties.c:338 ../properties.c:1672 ../properties.c:1870 #: ../properties.c:4002 msgid "Clock" msgstr "Zegar" #: ../properties.c:346 ../properties.c:1677 ../properties.c:1873 msgid "System tray" msgstr "Zasobnik systemowy" #: ../properties.c:354 ../properties.c:1667 ../properties.c:1867 #: ../properties.c:5031 msgid "Battery" msgstr "Bateria" #: ../properties.c:362 ../properties.c:4495 ../properties.c:5211 msgid "Tooltip" msgstr "Podpowiedzi" #: ../properties.c:516 msgid "Background" msgstr "Tło" #: ../properties.c:527 msgid "Selects the background you would like to modify" msgstr "Wybiera tło, które chcesz edytować" #: ../properties.c:534 msgid "Creates a copy of the current background" msgstr "Tworzy kopię zaznaczonego tła" #: ../properties.c:541 msgid "Deletes the current background" msgstr "Usuwa zaznaczone tło" #: ../properties.c:550 msgid "Fill color" msgstr "Kolor wypelnienia" #: ../properties.c:561 msgid "The fill color of the current background" msgstr "Kolor wypełnienia zaznaczonego tła" #: ../properties.c:564 msgid "Border color" msgstr "Kolor obramowania" #: ../properties.c:575 msgid "The border color of the current background" msgstr "Kolor obramowania zaznaczonego tła" #: ../properties.c:578 #, fuzzy msgid "Fill color (mouse over)" msgstr "Kolor wypelnienia" #: ../properties.c:589 #, fuzzy msgid "The fill color of the current background on mouse over" msgstr "Kolor wypełnienia zaznaczonego tła" #: ../properties.c:592 #, fuzzy msgid "Border color (mouse over)" msgstr "Kolor obramowania" #: ../properties.c:603 #, fuzzy msgid "The border color of the current background on mouse over" msgstr "Kolor obramowania zaznaczonego tła" #: ../properties.c:606 #, fuzzy msgid "Fill color (pressed)" msgstr "Kolor wypelnienia" #: ../properties.c:617 #, fuzzy msgid "The fill color of the current background on mouse button press" msgstr "Kolor wypełnienia zaznaczonego tła" #: ../properties.c:620 #, fuzzy msgid "Border color (pressed)" msgstr "Kolor obramowania" #: ../properties.c:631 #, fuzzy msgid "The border color of the current background on mouse button press" msgstr "Kolor obramowania zaznaczonego tła" #: ../properties.c:634 msgid "Border width" msgstr "Szerokość obramowania" #: ../properties.c:644 msgid "The width of the border of the current background, in pixels" msgstr "Szerokość obramowania zaznaczonego tła, w pikselach" #: ../properties.c:647 msgid "Corner radius" msgstr "Zaokrąglone rogi" #: ../properties.c:657 msgid "The corner radius of the current background" msgstr "Zaokrąglenie rogów zaznaczonego tła" #: ../properties.c:1075 msgid "Geometry" msgstr "Geometria" #: ../properties.c:1092 msgid "Position" msgstr "Pozycja" #: ../properties.c:1113 msgid "Position on screen: top-left, horizontal panel" msgstr "Pozycja: góra-lewo, poziomy panel" #: ../properties.c:1115 msgid "Position on screen: top-center, horizontal panel" msgstr "Pozycja: góra-środek, poziomy panel" #: ../properties.c:1117 msgid "Position on screen: top-right, horizontal panel" msgstr "Pozycja: góra-prawo, poziomy panel" #: ../properties.c:1119 msgid "Position on screen: top-left, vertical panel" msgstr "Pozycja: góra-lewo, pionowy panel" #: ../properties.c:1121 msgid "Position on screen: center-left, vertical panel" msgstr "Pozycja: środek-lewo, pionowy panel" #: ../properties.c:1123 msgid "Position on screen: bottom-left, vertical panel" msgstr "Pozycja: dół-lewo, pionowy panel" #: ../properties.c:1125 msgid "Position on screen: top-right, vertical panel" msgstr "Pozycja: góra-prawo, pionowy panel" #: ../properties.c:1127 msgid "Position on screen: center-right, vertical panel" msgstr "Pozycja: środek-prawo, pionowy panel" #: ../properties.c:1129 msgid "Position on screen: bottom-right, vertical panel" msgstr "Pozycja: dół-prawo, pionowy panel" #: ../properties.c:1131 msgid "Position on screen: bottom-left, horizontal panel" msgstr "Pozycja: dół-lewo, poziomy panel" #: ../properties.c:1133 msgid "Position on screen: bottom-center, horizontal panel" msgstr "Pozycja: dół-środek, poziomy panel" #: ../properties.c:1135 msgid "Position on screen: bottom-right, horizontal panel" msgstr "Pozycja: dół-prawo, poziomy panel" #: ../properties.c:1140 ../properties.c:4634 msgid "Monitor" msgstr "Monitor" #: ../properties.c:1150 msgid "All" msgstr "Wszystkie" #: ../properties.c:1151 ../properties.c:4644 msgid "1" msgstr "1" #: ../properties.c:1152 ../properties.c:4645 msgid "2" msgstr "2" #: ../properties.c:1153 ../properties.c:4646 msgid "3" msgstr "3" #: ../properties.c:1154 ../properties.c:4647 msgid "4" msgstr "4" #: ../properties.c:1155 ../properties.c:4648 msgid "5" msgstr "5" #: ../properties.c:1156 ../properties.c:4649 msgid "6" msgstr "6" #: ../properties.c:1158 msgid "The monitor on which the panel is placed" msgstr "Monitor na którym ma być umieszczony panel" #: ../properties.c:1162 msgid "Primary monitor first" msgstr "" #: ../properties.c:1172 msgid "If enabled, the primary monitor will have index 1 in the monitor " "list even if it is not top-left." msgstr "" #: ../properties.c:1176 msgid "Length" msgstr "Długość" #: ../properties.c:1186 msgid "The length of the panel (width for horizontal panels, height for " "vertical panels)" msgstr "Długość panelu (szerokość dla panelu poziomego, wysokość dla panelu " "pionowego)" #: ../properties.c:1192 ../properties.c:1215 msgid "Percent" msgstr "procent" #: ../properties.c:1193 ../properties.c:1216 msgid "Pixels" msgstr "piksel(e)" #: ../properties.c:1195 msgid "The units used to specify the length of the panel: pixels or " "percentage of the monitor size" msgstr "Jednostka używana do określenia długości panelu: piksele lub " "procenty wielkości monitora" #: ../properties.c:1199 msgid "Size" msgstr "Rozmiar" #: ../properties.c:1209 msgid "The size of the panel (height for horizontal panels, width for " "vertical panels)" msgstr "Rozmiar panelu (wysokość dla panelu poziomego, szerokość dla panelu " "pionowego)" #: ../properties.c:1218 msgid "The units used to specify the size of the panel: pixels or " "percentage of the monitor size" msgstr "Jednostka używana do określenia rozmiaru panelu: piksele lub " "procenty wielkości monitora" #: ../properties.c:1222 msgid "Horizontal margin" msgstr "Margines poziomy" #: ../properties.c:1232 msgid "Creates a space between the panel and the edge of the monitor. For " "left-aligned panels, the space is created on the right of the panel; " "for right-aligned panels, it is created on the left; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Tworzy przestrzeń pomiędzy panelem a krawędzią monitora. Dla panelu " "wyrównanego do lewej, odstęp jest tworzony po prawej stronie; dla " "panelu wyrównanego do prawej, odstęp tworzony jest po lewej stronie; " "dla panelu wycentrowanego, wartość jest dzielona dla obu stron " "panelu." #: ../properties.c:1239 msgid "Vertical margin" msgstr "Margines pionowy" #: ../properties.c:1249 msgid "Creates a space between the panel and the edge of the monitor. For " "top-aligned panels, the space is created on the bottom of the panel; " "for bottom-aligned panels, it is created on the top; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Tworzy przestrzeń pomiędzy panelem a krawędzią monitora. Dla panelu " "wyrównanego do góry, odstęp jest tworzony na dole panelu; dla panelu " "wyrównanego do dołu, odstęp tworzony jest na górze panelu; dla " "panelu wycentrowanego, wartość jest dzielona dla obu stron panelu." #: ../properties.c:1256 ../properties.c:2606 ../properties.c:2973 #: ../properties.c:3407 ../properties.c:3983 ../properties.c:4368 #: ../properties.c:4656 ../properties.c:5012 ../properties.c:5192 msgid "Appearance" msgstr "Wygląd" #: ../properties.c:1270 ../properties.c:2619 ../properties.c:3775 #: ../properties.c:3996 ../properties.c:4381 ../properties.c:4669 #: ../properties.c:5025 ../properties.c:5205 msgid "Background" msgstr "Tło" #: ../properties.c:1280 msgid "Selects the background used to display the panel. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Wybierz tło dla panelu. Tła mogą być edytowane na karcie \"Tła\"." #: ../properties.c:1285 ../properties.c:2647 ../properties.c:2987 #: ../properties.c:3090 ../properties.c:3498 ../properties.c:4010 #: ../properties.c:4395 ../properties.c:4684 ../properties.c:5039 #: ../properties.c:5219 msgid "Horizontal padding" msgstr "Poziomy margines wewnętrzny" #: ../properties.c:1295 msgid "Specifies the horizontal padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Wyznacza poziomy margines wewnętrzny dla panelu. Jest to odstęp " "pomiędzy krawędzią panelu, a elementami na nim umieszczonymi." #: ../properties.c:1300 ../properties.c:2661 ../properties.c:3002 #: ../properties.c:3105 ../properties.c:3512 ../properties.c:4024 #: ../properties.c:4409 ../properties.c:4699 ../properties.c:5053 #: ../properties.c:5233 msgid "Vertical padding" msgstr "Pionowy margines wewnętrzny" #: ../properties.c:1310 msgid "Specifies the vertical padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Wyznacza pionowy margines wewnętrzny dla panelu. Jest to odstęp " "pomiędzy krawędzią panelu, a elementami na nim umieszczonymi" #: ../properties.c:1315 ../properties.c:2675 ../properties.c:3017 #: ../properties.c:3526 ../properties.c:4714 msgid "Spacing" msgstr "Odstęp" #: ../properties.c:1325 msgid "Specifies the spacing between elements inside the panel." msgstr "Wyznacza odstep pomiędzy elementami umieszczonymi na panelu." #: ../properties.c:1329 msgid "Ignore compositor" msgstr "Ignoruj menedżer kompozycji" #: ../properties.c:1339 msgid "If enabled, the compositor will not be used to draw a transparent " "panel. May fix display corruption problems on broken graphics stacks." msgstr "Jeśli zaznaczone, menedżer kompozycji nie będzie używany do " "wyświetlania przezroczystego panelu. Może pomóc w przypadku błędów " "wyświetlania." #: ../properties.c:1343 msgid "Font shadows" msgstr "Cieniowane czcionki" #: ../properties.c:1353 msgid "If enabled, a shadow will be drawn behind text. This may improve " "legibility on transparent panels." msgstr "Jeśli zaznaczone, tekst na panelu będzie cieniowany. To może pomoc " "uzyskać lepszą czytelność na panelach z przezroczystością." #: ../properties.c:1358 #, fuzzy msgid "Mouse effects" msgstr "Zdarzenia myszy" #: ../properties.c:1368 msgid "Clickable interface items change appearance when the mouse is moved " "over them." msgstr "" #: ../properties.c:1372 #, fuzzy msgid "Icon opacity (hovered)" msgstr "Przeźroczystość ikon" #: ../properties.c:1383 #, fuzzy msgid "Specifies the opacity adjustment of the icons under the mouse, in " "percent." msgstr "Określa poziom nasycenia kolorów dla ikon, w procentach." #: ../properties.c:1387 #, fuzzy msgid "Icon saturation (hovered)" msgstr "Nasycenie kolor ikon" #: ../properties.c:1398 #, fuzzy msgid "Specifies the saturation adjustment of the icons under the mouse, in " "percent." msgstr "Określa poziom nasycenia kolorów dla ikon, w procentach." #: ../properties.c:1402 #, fuzzy msgid "Icon brightness (hovered)" msgstr "Jasność ikon" #: ../properties.c:1413 #, fuzzy msgid "Specifies the brightness adjustment of the icons under the mouse, in " "percent." msgstr "Określa jasność ikon, w procentach." #: ../properties.c:1417 #, fuzzy msgid "Icon opacity (pressed)" msgstr "Przeźroczystość ikon" #: ../properties.c:1428 #, fuzzy msgid "Specifies the opacity adjustment of the icons on mouse button press, " "in percent." msgstr "Określa nasycenie koloru ikon w zasobniku systemowym, w procentach." #: ../properties.c:1432 #, fuzzy msgid "Icon saturation (pressed)" msgstr "Nasycenie kolor ikon" #: ../properties.c:1443 #, fuzzy msgid "Specifies the saturation adjustment of the icons on mouse button " "press, in percent." msgstr "Określa nasycenie koloru ikon w zasobniku systemowym, w procentach." #: ../properties.c:1447 #, fuzzy msgid "Icon brightness (pressed)" msgstr "Jasność ikon" #: ../properties.c:1458 #, fuzzy msgid "Specifies the brightness adjustment of the icons on mouse button " "press, in percent." msgstr "Określa jasność ikon w zasobniku systemowym, w procentach." #: ../properties.c:1462 msgid "Autohide" msgstr "Autoukrywanie" #: ../properties.c:1476 msgid "Autohide" msgstr "Ukryj automatycznie" #: ../properties.c:1486 msgid "If enabled, the panel is hidden when the mouse cursor leaves the " "panel." msgstr "Jeśli zaznaczone, panel będzie ukrywany, po opuszczeniu go przez " "kursor myszy" #: ../properties.c:1490 msgid "Show panel after" msgstr "Pokaż panel po " #: ../properties.c:1500 msgid "Specifies a delay after which the panel is shown when the mouse " "cursor enters the panel." msgstr "Opóźnienie pojawiania się panelu po najechaniu nań kursorem myszy" #: ../properties.c:1502 ../properties.c:1536 ../properties.c:5165 #: ../properties.c:5184 msgid "seconds" msgstr "sekundy" #: ../properties.c:1510 msgid "Hidden size" msgstr "Rozmiar gdy ukryty" #: ../properties.c:1520 msgid "Specifies the size of the panel when hidden, in pixels." msgstr "Rozmiar panelu gdy ukryty, w pikselach." #: ../properties.c:1524 msgid "Hide panel after" msgstr "Ukryj panel po" #: ../properties.c:1534 msgid "Specifies a delay after which the panel is hidden when the mouse " "cursor leaves the panel." msgstr "Opóznienie ukrywania panelu, gdy kursor myszy opuści panel." #: ../properties.c:1544 msgid "Window manager interaction" msgstr "Interakcje z menedżerem okien" #: ../properties.c:1558 msgid "Forward mouse events" msgstr "Przekazywanie zdarzeń myszy" #: ../properties.c:1568 msgid "If enabled, mouse events not handled by panel elements are forwarded " "to the desktop. Useful on desktop environments that show a start " "menu when right clicking the desktop, or switch the desktop when " "rotating the mouse wheel over the desktop." msgstr "Jeśli zaznaczone, zdarzenia myszy nie przypisane do elementów panelu " "będą przekazywane do menedżera okien. Użyteczne dla środowisk " "graficznych, które pokazują menu po prawym kliknięciu na pulpit lub " "które przełączają obszar roboczy za pomocą kołka myszy." #: ../properties.c:1574 msgid "Place panel in dock" msgstr "Umieść panel w doku" #: ../properties.c:1584 msgid "If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than " "normal windows. The exact behavior depends on the window manager and " "its configuration." msgstr "Jeśli zaznaczone, panel zostanie umieszczony w obszarze zwanym " "dokiem menedżera okien. Okna umieszczone w doku są zazwyczaj " "traktowane inaczej niż zwykłe okna. Dokładne zachowanie zależy od " "menedżera okien i jego konfiguracji." #: ../properties.c:1590 msgid "Panel layer" msgstr "Warstwa panelu" #: ../properties.c:1600 msgid "Top" msgstr "Góra" #: ../properties.c:1601 msgid "Normal" msgstr "Normalna" #: ../properties.c:1602 msgid "Bottom" msgstr "Dół" #: ../properties.c:1604 msgid "Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, " "depending on which has focus. \n" "Note that some window managers prevent this option from working " "correctly if the panel is placed in the dock." msgstr "Warstwa na której umieszczony będzie panel. \n" "Góra - panel zawsze przykrywa inne okna. \n" "Doł - inne okna mogą przykrywać panel. \n" "Normalna - inne okna mogą lub nie przykrywać panel, w zależności od " "tego które okno jest aktywne. \n" "Niektóre menedźery okien nie pozwalają na poprawne działanie tej " "opcji, gdy panel jest umieszczony w doku." #: ../properties.c:1612 msgid "Maximized windows" msgstr "Zmaksymalizowane okna" #: ../properties.c:1622 msgid "Match the panel size" msgstr "Dopasowane do rozmiaru panelu" #: ../properties.c:1623 msgid "Match the hidden panel size" msgstr "Dopasowane do rozmiaru ukrytego panelu" #: ../properties.c:1624 msgid "Fill the screen" msgstr "Wypełniają ekran" #: ../properties.c:1626 msgid "Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to " "the edge of the panel. \n" "Match the hidden panel size means that maximized windows should " "extend to the edge of the panel when hidden; when visible, the panel " "and the windows will overlap. \n" "Fill the screen means that maximized windows will always have the " "same size as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed " "at the edge (not in the middle) of the virtual screen for this to " "work correctly." msgstr "Rozmiar zmaksymalizowanych okien. \n" "Dopasowane do rozmiaru panelu - zmaksymalizowane okna powiększają " "się do krawędzi panelu. \n" "Dopasowane do rozmiaru ukrytego panelu - zmaksymalizowane okna " "powiększają się do krawędzi ukrytego panelu; gdy panel jest " "widoczny, okna i panel będą się pokrywać. \n" "Wypełniają ekran - zmaksymalizowane okna zawsze będą miały ten sam " "rozmiar co ekran. \n" "\n" "Notka: w przypadku użycia wielu monitorów (Xinerama), panel musi być " "umieszczony na krawędzi (nie po środku) wirtualnego ekranu, aby ta " "opcja działała poprawnie." #: ../properties.c:1637 msgid "Window name" msgstr "Nazwa okna" #: ../properties.c:1649 msgid "Specifies the name of the panel window. This is useful if you want " "to configure special treatment of tint2 windows in your window " "manager or compositor." msgstr "Nazwa \"okna\" panelu. Może być użyteczne jeśli chcesz skonfigurować " "specjalne traktowanie tint2 przez menedżer okien lub kompozycji." #: ../properties.c:1692 ../properties.c:1882 msgid "Free space" msgstr "" #: ../properties.c:1697 ../properties.c:1886 ../properties.c:4159 #: ../properties.c:4387 ../properties.c:4557 ../properties.c:4578 msgid "Executor" msgstr "" #: ../properties.c:1712 msgid "Specifies the elements that will appear in the panel and their " "order. Elements can be added by selecting them in the list of " "available elements, then clicking on the add left button." msgstr "Określa, które elementy zostaną umieszczone na panelu oraz ich " "uporządkowanie. Elementy można dodać poprzez ich zaznaczenie na " "liście dostępnych elementów, oraz kliknięcie na przycisk dodawania " "(strzałka w lewo)." #: ../properties.c:1728 msgid "Lists all the possible elements that can appear in the panel. " "Elements can be added to the panel by selecting them, then clicking " "on the add left button." msgstr "Wszystkie dostępne elementy, które mogą być umieszczone na panelu. " "Elementy można dodać do panelu poprzez zaznaczenie oraz kliknięcie " "strzałki w lewo." #: ../properties.c:1738 msgid "Elements selected" msgstr "Wybrane elementy" #: ../properties.c:1744 msgid "Elements available" msgstr "Dostępne elementy" #: ../properties.c:1761 msgid "Moves up the current element in the list of selected elements." msgstr "Przesuwa do góry wybrany element." #: ../properties.c:1769 msgid "Moves down the current element in the list of selected elements." msgstr "Przesuwa w dół wybrany element." #: ../properties.c:1771 ../properties.c:2563 msgid " " msgstr " " #: ../properties.c:1782 msgid "Copies the current element in the list of available elements to the " "list of selected elements." msgstr "Kopije zaznaczony element z listy dostępnych na listę wybranych." #: ../properties.c:1790 msgid "Removes the current element from the list of selected elements." msgstr "Usuwa zaznaczony element z listy wybranych." #: ../properties.c:2496 msgid "Specifies the application launchers that will appear in the launcher " "and their order. Launchers can be added by selecting an item in the " "list of available applications, then clicking on the add left button." msgstr "Określa jakie ikony aplikacji zostaną umieszczone na panelu oraz ich " "kolejność. Programy można dodać poprzez wybranie ich na liście " "dostępnych oraz kliknięcie strzałki w lewo. " #: ../properties.c:2517 msgid "Lists all the applications detected on the system. Launchers can be " "added to the launcher by selecting an application, then clicking on " "the add left button." msgstr "Wyświetla wszystkie aplikacje wykryte w systemie. Można je dodać do " "panelu poprzez zaznaczenie i kliknięcie strzałki w lewo." #: ../properties.c:2530 msgid "Applications selected" msgstr "Wybrane aplikacje" #: ../properties.c:2536 msgid "Applications available" msgstr "Dostepne aplikacje" #: ../properties.c:2553 msgid "Moves up the current launcher in the list of selected applications." msgstr "Przesuwa do góry wybrany program " #: ../properties.c:2561 msgid "Moves down the current launcher in the list of selected applications." msgstr "Przesuwa w dól wybrany program." #: ../properties.c:2574 msgid "Copies the current application in the list of available applications " "to the list of selected applications." msgstr "Umieszcza zaznaczony program na liście wybranych aplikacji." #: ../properties.c:2582 msgid "Removes the current application from the list of selected " "application." msgstr "Usuwa zaznaczony program z listy wybranych aplikacji." #: ../properties.c:2594 msgid "Additional application directories" msgstr "Dodatkowe katalogi aplikacji" #: ../properties.c:2603 msgid "Specifies a path to a directory from which the launcher is loading " "all .desktop files (all subdirectories are explored recursively). " "Can be used multiple times, in which case the paths must be " "separated by commas. Leading ~ is expaned to the path of the user's " "home directory." msgstr "Ścieżka do katalogu, z którego będą wczytywane wszystkie pliki ." "desktop (rekurencyjne również z podkatalogów). Można podać wiele " "ścieżek, w takim przypadku rozdzielamy je za pomocą przecinka. Znak " "~ oznacza katalog domowy użytkownika." #: ../properties.c:2629 msgid "Selects the background used to display the launcher. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Wybiera tło które, będzie użyte jako tło pod programami. Tła mogą " "być edytowane w karcie Tła." #: ../properties.c:2633 #, fuzzy msgid "Icon background" msgstr "Tło dla nazw nieaktywnych pulpitów" #: ../properties.c:2639 #, fuzzy msgid "Launcher icon" msgstr "Programy" #: ../properties.c:2643 #, fuzzy msgid "Selects the background used to display the launcher icon. " "Backgrounds can be edited in the Backgrounds tab." msgstr "Wybiera tło które, będzie użyte jako tło pod programami. Tła mogą " "być edytowane w karcie Tła." #: ../properties.c:2657 msgid "Specifies the horizontal padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Określa poziomy margines wewnętrzny. Jest to obszar pomiędzy " "obramowaniem, a elementami znajdującymi się w środku." #: ../properties.c:2671 msgid "Specifies the vertical padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Określa pionowy margines wewnętrzny. Jest to obszar pomiędzy " "obramowaniem, a elementami znajdującymi się w środku." #: ../properties.c:2685 msgid "Specifies the spacing between the elements inside the launcher." msgstr "Określa odstęp pomiędzy elementami (ikonami)." #: ../properties.c:2688 ../properties.c:4728 msgid "Icon size" msgstr "Rozmiar ikon" #: ../properties.c:2698 msgid "Specifies the size of the launcher icons, in pixels." msgstr "Określa rozmiar ikon, w pikselach." #: ../properties.c:2702 ../properties.c:3736 ../properties.c:4742 msgid "Icon opacity" msgstr "Przeźroczystość ikon" #: ../properties.c:2713 msgid "Specifies the opacity of the launcher icons, in percent." msgstr "Określa stopień przeźroczystości ikon, w procentach." #: ../properties.c:2717 ../properties.c:3747 ../properties.c:4757 msgid "Icon saturation" msgstr "Nasycenie kolor ikon" #: ../properties.c:2728 msgid "Specifies the saturation adjustment of the launcher icons, in " "percent." msgstr "Określa poziom nasycenia kolorów dla ikon, w procentach." #: ../properties.c:2732 ../properties.c:3758 ../properties.c:4772 msgid "Icon brightness" msgstr "Jasność ikon" #: ../properties.c:2743 msgid "Specifies the brightness adjustment of the launcher icons, in " "percent." msgstr "Określa jasność ikon, w procentach." #: ../properties.c:2746 msgid "Icon theme" msgstr "Motyw ikon" #: ../properties.c:2760 msgid "The icon theme used to display launcher icons. If left blank, tint2 " "will detect and use the icon theme of your desktop as long as you " "have an XSETTINGS manager running (most desktop environments do)." msgstr "Motyw ikon używany do ich wyświetlania. Jeśli pozostawione puste, " "tint2 sam określi i użyje motywu ikon dla twojego pulpitu, jeśli " "menedżer XSETTINGS jest uruchomiony (w przypadku większości " "środowisk tak jest)." #: ../properties.c:2764 msgid "Overrides XSETTINGS" msgstr "Nadpisz XSETTINGS" #: ../properties.c:2768 msgid "If enabled, the icon theme selected here will override the one " "provided by XSETTINGS." msgstr "Jeśli zaznaczone, wybrany motyw ikon nadpisze ustawienia dostarczone " "przez XSETTINGS." #: ../properties.c:2771 msgid "Startup notifications" msgstr "Powiadomienia startowe" #: ../properties.c:2781 msgid "If enabled, startup notifications are shown when starting " "applications from the launcher. The appearance may vary depending on " "your desktop environment configuration; normally, a busy mouse " "cursor is displayed until the application starts." msgstr "Jeśli zaznaczone, powiadomienia startowe będą pokazywana podczas " "uruchamiania aplikacji. Zachowanie może być różne w zależności od " "konfiguracji środowiska graficznego; zwykle, pokazywany jest \"zajęty" "\" kursor myszy dopóki aplikacja nie uruchomi się." #: ../properties.c:2785 ../properties.c:4922 msgid "Tooltips" msgstr "Podpowiedzi" #: ../properties.c:2795 msgid "If enabled, shows a tooltip with the application name when the mouse " "is moved over an application launcher." msgstr "Jeśli zaznaczone, pokazywane będą podpowiedzi w momencie gdy kursor " "myszy znajdzie się nad ikoną aplikacji." #: ../properties.c:2842 ../properties.c:4597 msgid "Options" msgstr "Opcje" #: ../properties.c:2857 msgid "Show a taskbar for each desktop" msgstr "Pokaż pasek zadań dla każdego pulpitu" #: ../properties.c:2867 msgid "If enabled, the taskbar is split into multiple smaller taskbars, one " "for each virtual desktop." msgstr "Jeśli zaznaczone, pasek zadań zostanie podzielony na wiele pasków " "zadań, po jednym dla każdego wirtualnego pulpitu." #: ../properties.c:2871 msgid "Distribute size between taskbars" msgstr "Rozdzielaj miejsce pomiądzy paskami zadań" #: ../properties.c:2881 msgid "If enabled and 'Show a taskbar for each desktop' is also enabled, " "the available size is distributed between taskbars proportionally to " "the number of tasks." msgstr "Jeśli zaznaczone oraz 'Pokaż pasek zadań dla każdego pulpitu' " "również zaznaczone, dostępny obszar będzie rozdzielony pomiędzy " "paski zadań proporcjonalnie do ilości zadan na każdym z nich." #: ../properties.c:2886 msgid "Hide inactive tasks" msgstr "Ukryj nieaktywne zadnia" #: ../properties.c:2896 msgid "If enabled, only the active task will be shown in the taskbar." msgstr "Jeśli zaznaczone, tylko aktywne zadania będą pokazywane na pasku " "zadań." #: ../properties.c:2900 msgid "Hide tasks from different monitors" msgstr "Ukryj zadania z innych ekranów" #: ../properties.c:2910 msgid "If enabled, tasks that are not on the same monitor as the panel will " "not be displayed. This behavior is enabled automatically if the " "panel monitor is set to 'All'." msgstr "Jeśli zaznaczone, zadania z innych pulpitów nie będą wyświetlane. " "Takie zachowanie jest włączone automatycznie, gdy wybrana jest opcja " "Monitor - Wszystkie w konfiguracji panelu." #: ../properties.c:2916 msgid "Always show all desktop tasks" msgstr "" #: ../properties.c:2926 msgid "Has effect only if 'Show a taskbar for each desktop' is enabled. If " "enabled, tasks that appear on all desktops are shown on all " "taskbars. Otherwise, they are shown only on the taskbar of the " "current desktop." msgstr "" #: ../properties.c:2932 msgid "Task sorting" msgstr "Sortowanie zadań" #: ../properties.c:2942 ../properties.c:3236 ../properties.c:3272 #: ../properties.c:3308 ../properties.c:3344 ../properties.c:3380 msgid "None" msgstr "Brak" #: ../properties.c:2943 msgid "By title" msgstr "Wg tytułu" #: ../properties.c:2944 msgid "By center" msgstr "Wg środka okna" #: ../properties.c:2945 msgid "Most recently used first" msgstr "" #: ../properties.c:2946 msgid "Most recently used last" msgstr "" #: ../properties.c:2948 msgid "Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can " "also reorder task buttons by mouse dragging. \n" "'By title' means that tasks are sorted by their window titles. \n" "'By center' means that tasks are sorted geometrically by their " "window centers." msgstr "Określa sposób sortowania zadań na pasku. \n" "'Brak' - oznacza że nowe zadania są dodawane na końcu, użytkownik " "może zmieniać kolejność poprzez przeciąganie. \n" "'Wg tytułu' - zadania są sortowane według tytułu okna. \n" "'Wg środka okna' - zadania są sortowane wg geometrii okien, a " "dokładnie ich środka." #: ../properties.c:2955 msgid "Task alignment" msgstr "" #: ../properties.c:2965 msgid "Left" msgstr "" #: ../properties.c:2966 #, fuzzy msgid "Center" msgstr "Tekst wycentrowany" #: ../properties.c:2967 #, fuzzy msgid "Right" msgstr "Prawy klik" #: ../properties.c:2969 msgid "Specifies how tasks should be positioned on the taskbar." msgstr "" #: ../properties.c:2997 msgid "Specifies the horizontal padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Wyznacza poziomy margines wewnętrzny dla paska zadań. Jest to odstęp " "pomiędzy krawędzią a elementami umieszczonymi wewnątrz." #: ../properties.c:3012 msgid "Specifies the vertical padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Wyznacza pionowy margines wewnętrzny dla paska zadań. Jest to odstęp " "pomiędzy krawędzią a elementami umieszczonymi wewnątrz." #: ../properties.c:3027 msgid "Specifies the spacing between the elements inside the taskbar." msgstr "Wyznacza odstęp pomiędzy elementami umieszczonymi na pasku zadań." #: ../properties.c:3031 ../properties.c:3176 msgid "Active background" msgstr "Tło dla nazwy aktywnego pulpitu" #: ../properties.c:3037 #, fuzzy msgid "Active taskbar" msgstr "Aktywne" #: ../properties.c:3041 msgid "Selects the background used to display the taskbar of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Wybiera tło, które będzie użyte do wyświetlania paska zadań dla " "bieżącego pulpitu. Tła mogą być edytowane na karcie Tła." #: ../properties.c:3045 ../properties.c:3191 msgid "Inactive background" msgstr "Tło dla nazw nieaktywnych pulpitów" #: ../properties.c:3051 #, fuzzy msgid "Inactive taskbar" msgstr "Aktywne" #: ../properties.c:3055 msgid "Selects the background used to display taskbars of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Wybiera tło, które będzie użyte do wyświetlania pasków zadań dla " "nieaktywnych pulpitów. Tła mogą być edytowane na karcie Tła." #: ../properties.c:3060 msgid "Desktop name" msgstr "Nazwa pulpitu" #: ../properties.c:3075 msgid "Show desktop name" msgstr "Pokaż nazwy pulpitów" #: ../properties.c:3085 msgid "If enabled, displays the name of the desktop at the top/left of the " "taskbar. The name is set by your window manager; you might be able " "to configure it there." msgstr "Jeśli zaznaczone, nazwy pulpitów będą wyświetlane na górze lub po " "lewej stronie pasków zadań. Nazwy pulpitów są ustawiane przez " "menedżer okien; można je konfigurować w jego ustawieniach." #: ../properties.c:3100 msgid "Specifies the horizontal padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Wyznacza poziomy margines wewnętrzny dla nazwy pulpitu. Jest to " "odstęp pomiędzy krawędzią, a tekstem znajdującym się w środku." #: ../properties.c:3115 msgid "Specifies the vertical padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Wyznacza pionowy margines wewnętrzny dla nazwy pulpitu. Jest to " "odstęp pomiędzy krawędzią, a tekstem znajdującym się w środku." #: ../properties.c:3120 msgid "Active font color" msgstr "Kolor czcionki aktywnego pulpitu" #: ../properties.c:3131 msgid "Specifies the font color used to display the name of the current " "desktop." msgstr "Określa kolor czcionki używany do wyświetlania nazwy aktywnego " "pulpitu." #: ../properties.c:3135 msgid "Inactive font color" msgstr "Kolor czcionki nieaktywnego pulpitu" #: ../properties.c:3146 msgid "Specifies the font color used to display the name of inactive " "desktops." msgstr "Określa kolor czcionki używany do wyświetlania nazwy nieaktywnego " "pulpitu." #: ../properties.c:3153 ../properties.c:3542 ../properties.c:4041 #: ../properties.c:4067 ../properties.c:4426 ../properties.c:5070 #: ../properties.c:5095 ../properties.c:5250 msgid "If not checked, the desktop theme font is used. If checked, the " "custom font specified here is used." msgstr "" #: ../properties.c:3156 ../properties.c:3545 ../properties.c:4429 #: ../properties.c:5253 msgid "Font" msgstr "Czcionka" #: ../properties.c:3170 msgid "Specifies the font used to display the desktop name." msgstr "Określa czcionkę używaną do wyświetlania nazw pulpitów." #: ../properties.c:3182 #, fuzzy msgid "Active desktop name" msgstr "Pokaż nazwy pulpitów" #: ../properties.c:3186 msgid "Selects the background used to display the name of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Wybiera tło, które zostanie użyte do wyświetlania nazwy aktywnego " "pulpitu. Tła mogą być edytowane na karcie Tła." #: ../properties.c:3197 #, fuzzy msgid "Inactive desktop name" msgstr "Pokaż nazwy pulpitów" #: ../properties.c:3201 msgid "Selects the background used to display the name of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Wybiera tło, które zostanie użyte do wyświetlania nazw nieaktywnych " "pulpitów. Tła mogą być edytowane na karcie Tła." #: ../properties.c:3213 ../properties.c:3894 ../properties.c:4279 #: ../properties.c:4909 msgid "Mouse events" msgstr "Zdarzenia myszy" #: ../properties.c:3226 msgid "Left click" msgstr "Lewy klik" #: ../properties.c:3237 ../properties.c:3273 ../properties.c:3309 #: ../properties.c:3345 ../properties.c:3381 msgid "Close" msgstr "Zamknij" #: ../properties.c:3238 ../properties.c:3274 ../properties.c:3310 #: ../properties.c:3346 ../properties.c:3382 msgid "Toggle" msgstr "Przełącz" #: ../properties.c:3239 ../properties.c:3275 ../properties.c:3311 #: ../properties.c:3347 ../properties.c:3383 msgid "Iconify" msgstr "Zminimalizuj" #: ../properties.c:3240 ../properties.c:3276 ../properties.c:3348 #: ../properties.c:3384 msgid "Shade" msgstr "Zwiń" #: ../properties.c:3241 ../properties.c:3277 ../properties.c:3313 #: ../properties.c:3349 ../properties.c:3385 msgid "Toggle or iconify" msgstr "Przełącz lub minimalizuj" #: ../properties.c:3242 ../properties.c:3278 ../properties.c:3314 #: ../properties.c:3350 ../properties.c:3386 msgid "Maximize or restore" msgstr "Maksymalizuj lub przywróć" #: ../properties.c:3243 ../properties.c:3279 ../properties.c:3315 #: ../properties.c:3351 ../properties.c:3387 msgid "Desktop left" msgstr "Wyślij na pulpit po lewej" #: ../properties.c:3244 ../properties.c:3280 ../properties.c:3316 #: ../properties.c:3352 ../properties.c:3388 msgid "Desktop right" msgstr "Wyślij na pulpit po prawej" #: ../properties.c:3245 ../properties.c:3281 ../properties.c:3317 #: ../properties.c:3353 ../properties.c:3389 msgid "Next task" msgstr "Następne zadanie" #: ../properties.c:3246 ../properties.c:3282 ../properties.c:3318 #: ../properties.c:3354 ../properties.c:3390 msgid "Previous task" msgstr "Poprzednie zadanie" #: ../properties.c:3248 msgid "Specifies the action performed when task buttons receive a left " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Określa akcję, która zostanie wykonana po lewym kliknięciu w " "przycisk zadania: \n" "'Brak\" - brak akcji. \n" "'Zamknij' - zamyka zadanie. \n" "'Przełącz' - przełącza stan zadania. \n" "'Zminimalizuj' - minimalizuje zadanie. \n" "'Zwiń' - zwija okno, tak że widoczny pozostaje tylko pasek " "tytułowy. \n" "'Przełącz lub minimalizuj' - przełącza lub minimalizuje zadanie. \n" "'Maksymalizuj lub przywróć' - maksymalizuje lub przywraca zadanie. \n" "'Wyślij na pulpit po prawej' - przenosi zadanie na następny " "pulpit. \n" "'Wyślij na pulpit po lewej' - przenosi zadanie na poprzedni " "pulpit. \n" "'Następne zadanie' - przenosi fokus na następne zadanie. \n" "'Poprzednie zadanie' - przenosi fokus na poprzednie zadanie." #: ../properties.c:3262 msgid "Wheel scroll up" msgstr "Kółko myszy w górę" #: ../properties.c:3284 msgid "Specifies the action performed when task buttons receive a scroll up " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Określa akcję, która zostanie wykonana po poruszeniu kółka myszy w " "górę : \n" "'Brak\" - brak akcji. \n" "'Zamknij' - zamyka zadanie. \n" "'Przełącz' - przełącza stan zadania. \n" "'Zminimalizuj' - minimalizuje zadanie. \n" "'Przełącz lub minimalizuj' - przełącza lub minimalizuje zadanie. \n" "'Maksymalizuj lub przywróć' - maksymalizuje lub przywraca zadanie. \n" "'Wyślij na pulpit po prawej' - przenosi zadanie na następny " "pulpit. \n" "'Wyślij na pulpit po lewej' - przenosi zadanie na poprzedni " "pulpit. \n" "'Następne zadanie' - przenosi fokus na następne zadanie. \n" "Poprzednie zadanie' - przenosi fokus na poprzednie zadanie." #: ../properties.c:3298 msgid "Middle click" msgstr "Klik środkowym" #: ../properties.c:3312 msgid "sShade" msgstr "Zwiń" #: ../properties.c:3320 msgid "Specifies the action performed when task buttons receive a middle " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Określa akcję, która zostanie wykonana po środkowym kliknięciu w " "przycisk zadania: \n" "'Brak\" - brak akcji. \n" "'Zamknij' - zamyka zadanie. \n" "'Przełącz' - przełącza stan zadania. \n" "'Zminimalizuj' - minimalizuje zadanie. \n" "'Przełącz lub minimalizuj' - przełącza lub minimalizuje zadanie. \n" "'Maksymalizuj lub przywróć' - maksymalizuje lub przywraca zadanie. \n" "'Wyślij na pulpit po prawej' - przenosi zadanie na następny " "pulpit. \n" "'Wyślij na pulpit po lewej' - przenosi zadanie na poprzedni " "pulpit. \n" "'Następne zadanie' - przenosi fokus na następne zadanie. \n" "Poprzednie zadanie' - przenosi fokus na poprzednie zadanie." #: ../properties.c:3334 msgid "Wheel scroll down" msgstr "Kółko myszy w dół" #: ../properties.c:3356 msgid "Specifies the action performed when task buttons receive a scroll " "down event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Określa akcję, która zostanie wykonana po poruszeniu kółka myszy w " "dół : \n" "'Brak\" - brak akcji. \n" "'Zamknij' - zamyka zadanie. \n" "'Przełącz' - przełącza stan zadania. \n" "'Zminimalizuj' - minimalizuje zadanie. \n" "'Przełącz lub minimalizuj' - przełącza lub minimalizuje zadanie. \n" "'Maksymalizuj lub przywróć' - maksymalizuje lub przywraca zadanie. \n" "'Wyślij na pulpit po prawej' - przenosi zadanie na następny " "pulpit. \n" "'Wyślij na pulpit po lewej' - przenosi zadanie na poprzedni " "pulpit. \n" "'Następne zadanie' - przenosi fokus na następne zadanie. \n" "Poprzednie zadanie' - przenosi fokus na poprzednie zadanie." #: ../properties.c:3370 msgid "Right click" msgstr "Prawy klik" #: ../properties.c:3392 msgid "Specifies the action performed when task buttons receive a right " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Określa akcję, która zostanie wykonana po prawym kliknięciu w " "przycisk zadania: \n" "'Brak\" - brak akcji. \n" "'Zamknij' - zamyka zadanie. \n" "'Przełącz' - przełącza stan zadania. \n" "'Zminimalizuj' - minimalizuje zadanie. \n" "'Przełącz lub minimalizuj' - przełącza lub minimalizuje zadanie. \n" "'Maksymalizuj lub przywróć' - maksymalizuje lub przywraca zadanie. \n" "'Wyślij na pulpit po prawej' - przenosi zadanie na następny " "pulpit. \n" "'Wyślij na pulpit po lewej' - przenosi zadanie na poprzedni " "pulpit. \n" "'Następne zadanie' - przenosi fokus na następne zadanie. \n" "Poprzednie zadanie' - przenosi fokus na poprzednie zadanie." #: ../properties.c:3420 ../properties.c:4218 msgid "Show icon" msgstr "Pokaż ikony" #: ../properties.c:3430 msgid "If enabled, the window icon is shown on task buttons." msgstr "Jeśli zaznaczone, ikona okna jest pokazywana na panelu." #: ../properties.c:3433 msgid "Show text" msgstr "Pokaż tekst" #: ../properties.c:3443 msgid "If enabled, the window title is shown on task buttons." msgstr "Jeśli zaznaczone, tytuł okna jest pokazywany na przyciskach zadań." #: ../properties.c:3446 msgid "Center text" msgstr "Tekst wycentrowany" #: ../properties.c:3456 msgid "If enabled, the text is centered on task buttons. Otherwise, it is " "left-aligned." msgstr "Jeśli zaznaczone, tekst na przyciskach zadań jest wyśrodkowany. " "Jeśli nie, tekst jest wyrównany do lewej." #: ../properties.c:3459 msgid "Show tooltips" msgstr "Pokaż podpowiedzi" #: ../properties.c:3469 msgid "If enabled, a tooltip showing the window title is displayed when the " "mouse cursor moves over task buttons." msgstr "Jeśli zaznaczone, po najechaniu myszą nad przycisk zadania " "wyświetlane będą podpowiedzi." #: ../properties.c:3472 msgid "Maximum width" msgstr "Maksymalna szerokość" #: ../properties.c:3482 msgid "Specifies the maximum width of the task buttons." msgstr "Określa maksymalną szerokość przycisku zadania." #: ../properties.c:3485 msgid "Maximum height" msgstr "Maksymalna wysokość" #: ../properties.c:3495 msgid "Specifies the maximum height of the task buttons." msgstr "Określa maksymalną wysokość przycisku zadania." #: ../properties.c:3508 msgid "Specifies the horizontal padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Określa poziomy margines wewnętrzny dla przycisków zadań. To " "odległość między krawędzią, a zawartością." #: ../properties.c:3522 msgid "Specifies the vertical padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Określa pionowy margines wewnętrzny dla przycisków zadań. To " "odległość między krawędzią, a zawartością." #: ../properties.c:3536 msgid "Specifies the spacing between the icon and the text." msgstr "Określa odstęp pomiędzy ikoną a tekstem." #: ../properties.c:3556 msgid "Specifies the font used to display the task button text." msgstr "Określa czcionkę używaną do wyświetlania tekstu na przyciskach zadań." #: ../properties.c:3568 msgid "Default style" msgstr "Domyślny styl" #: ../properties.c:3569 #, fuzzy msgid "Default task" msgstr "Domyślny styl" #: ../properties.c:3579 ../properties.c:3580 msgid "Normal task" msgstr "Normalne zadanie" #: ../properties.c:3590 ../properties.c:3591 msgid "Active task" msgstr "Aktywne" #: ../properties.c:3601 ../properties.c:3602 msgid "Urgent task" msgstr "Pilne" #: ../properties.c:3612 ../properties.c:3613 msgid "Iconified task" msgstr "Zminimalizowane" #: ../properties.c:3717 msgid "If enabled, a custom font color is used to display the task text." msgstr "Jeśli zaznaczone, wybrany kolor jest użyty do wyświetlania tekstu." #: ../properties.c:3719 ../properties.c:4089 ../properties.c:4444 #: ../properties.c:5117 ../properties.c:5269 msgid "Font color" msgstr "Kolor czcionki" #: ../properties.c:3728 msgid "Specifies the font color used to display the task text." msgstr "Określa kolor czcionki użyty do wyświetlenia tekstu." #: ../properties.c:3734 msgid "If enabled, a custom opacity/saturation/brightness is used to " "display the task icon." msgstr "Jeśli zaznaczone, można określić własne wartości dla " "przeźroczystości/nasycenia/jasności ikon." #: ../properties.c:3745 msgid "Specifies the opacity (in %) used to display the task icon." msgstr "Określa przeźroczystość (w %) użytą do wyświetlania ikon." #: ../properties.c:3756 msgid "Specifies the saturation adjustment (in %) used to display the task " "icon." msgstr "Określa nasycenie koloru (w %) użyte do wyświetlania ikon." #: ../properties.c:3767 msgid "Specifies the brightness adjustment (in %) used to display the task " "icon." msgstr "Określa jasność (w %) użytą dla wyświetlania ikon." #: ../properties.c:3773 msgid "If enabled, a custom background is used to display the task." msgstr "Jeśli zaznaczone, wybrane tło zostanie użyte do wyświetlenia zadania." #: ../properties.c:3783 msgid "Selects the background used to display the task. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Wybiera tło, które będzie użyte do wyświetlenia zadania. Tła można " "edytować na karcie Tła." #: ../properties.c:3787 msgid "Blinks" msgstr "Miganie" #: ../properties.c:3795 msgid "Specifies how many times urgent tasks blink." msgstr "Określa ile razy pilne zadanie ma zamigać." #: ../properties.c:3817 ../properties.c:4177 msgid "Format" msgstr "Format" #: ../properties.c:3829 msgid "First line format" msgstr "Format pierwszej linii" #: ../properties.c:3841 msgid "Specifies the format used to display the first line of the clock " "text. See 'man strftime' for all the available options." msgstr "Określa format używany do wyświetlania pierwszej linii zegara. " "Zobacz 'man strftime', aby dowiedzieć się o opcjach." #: ../properties.c:3845 msgid "Second line format" msgstr "Format drugiej linii" #: ../properties.c:3857 msgid "Specifies the format used to display the second line of the clock " "text. See 'man strftime' for all the available options." msgstr "Określa format używany do wyświetlania drugiej linii zegara. Zobacz " "'man strftime', aby dowiedzieć się o opcjach." #: ../properties.c:3861 msgid "First line timezone" msgstr "Strefa czasowa pierwszej linii" #: ../properties.c:3873 msgid "Specifies the timezone used to display the first line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Określa strefę czasową używaną do wyświetlania pierwszej linii " "tekstu zegara. Jeśli puste, użyta będzie obecna strefa czasowa." #: ../properties.c:3877 msgid "Second line timezone" msgstr "Strefa czasowa drugiej linii" #: ../properties.c:3889 msgid "Specifies the timezone used to display the second line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Określa strefę czasową używaną do wyświetlania pierwszej linii " "tekstu zegara. Jeśli puste, użyta będzie obecna strefa czasowa." #: ../properties.c:3907 ../properties.c:4292 ../properties.c:4936 msgid "Left click command" msgstr "Komenda po lewym kliknięciu" #: ../properties.c:3919 msgid "Specifies a command that will be executed when the clock receives a " "left click." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:3922 ../properties.c:4307 ../properties.c:4951 msgid "Right click command" msgstr "Komenda po prawym kliknięciu" #: ../properties.c:3934 msgid "Specifies a command that will be executed when the clock receives a " "right click." msgstr "Określa komendę, która będzie uruchamiana po prawym kliknięciu w " "zegar." #: ../properties.c:3937 ../properties.c:4322 ../properties.c:4966 #, fuzzy msgid "Middle click command" msgstr "Komenda po lewym kliknięciu" #: ../properties.c:3949 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "middle click." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:3952 ../properties.c:4337 ../properties.c:4981 #, fuzzy msgid "Wheel scroll up command" msgstr "Kółko myszy w górę" #: ../properties.c:3964 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll up." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:3967 ../properties.c:4352 ../properties.c:4996 #, fuzzy msgid "Wheel scroll down command" msgstr "Kółko myszy w dół" #: ../properties.c:3979 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll down." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4006 msgid "Selects the background used to display the clock. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Wybiera tło, które będzie użyte jako tło zegara. Tła można edytować " "na karcie tła." #: ../properties.c:4020 msgid "Specifies the horizontal padding of the clock. This is the space " "between the border and the content inside." msgstr "Określa poziomy margines wewnętrzny dla zegara. To odstęp pomiędzy " "krawędzią a zawartością." #: ../properties.c:4034 msgid "Specifies the vertical padding of the clock. This is the space " "between the border and the content inside." msgstr "Określa pionowy margines wewnętrzny dla zegara. To odstęp pomiędzy " "krawędzią a zawartością." #: ../properties.c:4044 ../properties.c:5073 msgid "Font first line" msgstr "Czcionka pierwszej linii" #: ../properties.c:4059 msgid "Specifies the font used to display the first line of the clock." msgstr "Określa czcionkę używaną w pierwszej linii zegara." #: ../properties.c:4070 ../properties.c:5098 msgid "Font second line" msgstr "Czcionka drugiej linii" #: ../properties.c:4084 msgid "Specifies the font used to display the second line of the clock." msgstr "Określa czcionkę używaną w drugiej linii zegara." #: ../properties.c:4100 msgid "Specifies the font color used to display the clock." msgstr "Określa kolor czcionki dla zegara." #: ../properties.c:4104 msgid "Tooltip" msgstr "Podpowiedź" #: ../properties.c:4117 msgid "Format" msgstr "Format" #: ../properties.c:4128 msgid "Specifies the format used to display the clock tooltip. See 'man " "strftime' for the available options." msgstr "Określa format w jakim pokazywana ma być podpowiedź dla zegara. " "Zobacz 'man strftime' aby dowiedzieć się o dostepnych opcjach." #: ../properties.c:4132 msgid "Timezone" msgstr "Strefa czasowa" #: ../properties.c:4143 msgid "Specifies the timezone used to display the clock tooltip. If empty, " "the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "Określa strefę czasową użytą do wyświetlania podpowiedzi dla zegara. " "Jeśli puste, użyta zostanie strefa czasowa obecnie ustawiona w " "systemie. " #: ../properties.c:4189 #, fuzzy msgid "Command" msgstr "Komenda alarmu" #: ../properties.c:4201 #, fuzzy msgid "Specifies the command to execute." msgstr "Określa czcionkę używaną do wyświetlania nazw pulpitów." #: ../properties.c:4204 msgid "Interval" msgstr "" #: ../properties.c:4214 msgid "Specifies the interval at which the command is executed, in seconds. " "If zero, the command is executed only once." msgstr "" #: ../properties.c:4228 msgid "If enabled, the first line printed by the command is interpreted as " "a path to an image file." msgstr "" #: ../properties.c:4232 #, fuzzy msgid "Cache icon" msgstr "Programy" #: ../properties.c:4243 msgid "If enabled, the image is not reloaded from disk every time the " "command is executed if the path remains unchanged. Enabling this is " "recommended." msgstr "" #: ../properties.c:4246 msgid "Continuous output" msgstr "" #: ../properties.c:4256 msgid "If non-zero, the last execp_continuous lines from the output of the " "command are displayed, every execp_continuous lines; this is useful " "for showing the output of commands that run indefinitely, such as " "'ping 127.0.0.1'. If zero, the output of the command is displayed " "after it finishes executing." msgstr "" #: ../properties.c:4262 msgid "Display markup" msgstr "" #: ../properties.c:4273 msgid "If enabled, the output of the command is treated as Pango markup, " "which allows rich text formatting. Note that using this with " "commands that print data downloaded from the Internet is a potential " "security risk." msgstr "" #: ../properties.c:4304 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a left click." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4319 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a right click." msgstr "Określa komendę, która będzie uruchamiana po prawym kliknięciu w " "zegar." #: ../properties.c:4334 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a middle click." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4349 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll up." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4364 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll down." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4391 #, fuzzy msgid "Selects the background used to display the executor. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Wybiera tło, które będzie użyte jako tło zegara. Tła można edytować " "na karcie tła." #: ../properties.c:4405 #, fuzzy msgid "Specifies the horizontal padding of the executor. This is the space " "between the border and the content inside." msgstr "Określa poziomy margines wewnętrzny dla zegara. To odstęp pomiędzy " "krawędzią a zawartością." #: ../properties.c:4419 #, fuzzy msgid "Specifies the vertical padding of the executor. This is the space " "between the border and the content inside." msgstr "Określa pionowy margines wewnętrzny dla zegara. To odstęp pomiędzy " "krawędzią a zawartością." #: ../properties.c:4457 #, fuzzy msgid "Centered" msgstr "Tekst wycentrowany" #: ../properties.c:4469 #, fuzzy msgid "Icon width" msgstr "Motyw ikon" #: ../properties.c:4479 msgid "If non-zero, the image is resized to this width." msgstr "" #: ../properties.c:4482 #, fuzzy msgid "Icon height" msgstr "Jasność ikon" #: ../properties.c:4492 msgid "If non-zero, the image is resized to this height." msgstr "" #: ../properties.c:4508 #, fuzzy msgid "Tooltip text" msgstr "Podpowiedzi" #: ../properties.c:4520 msgid "The tooltip text to display. Leave this empty to display an " "automatically generated tooltip with information about when the " "command was last executed." msgstr "" #: ../properties.c:4611 msgid "Icon ordering" msgstr "Sortowanie ikon" #: ../properties.c:4621 msgid "Ascending" msgstr "Rosnąco" #: ../properties.c:4622 msgid "Descending" msgstr "Malejąco" #: ../properties.c:4623 msgid "Left to right" msgstr "Od lewej do prawej" #: ../properties.c:4624 msgid "Right to left" msgstr "Od prawej do lewej" #: ../properties.c:4626 msgid "Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their " "window names. \n" "'Descending' means that icons are sorted in descending order of " "their window names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right." msgstr "Określa porządek wyświetlania ikon w zasobniku systemowym. \n" "'Rosnąco' - alfabetycznie według nazw okien. \n" "'Malejąco' - według nazw okien od Z do A. \n" "'Od lewej do prawej' - ikony zawsze będą dodawane po lewej. \n" "'Od prawej do lewej' - ikony zawsze będą dodawane po prawej." #: ../properties.c:4651 msgid "Specifies the monitor on which to place the system tray. Due to " "technical limitations, the system tray cannot be displayed on " "multiple monitors." msgstr "Określa monitor na którym będzie umieszczony zasobnik systemowy. Z " "powodu ograniczeń technicznych zasobnik systemowy nie może być " "wyświetlany na wielu monitorach." #: ../properties.c:4675 #, fuzzy msgid "Systray" msgstr "Zasobnik systemowy" #: ../properties.c:4679 msgid "Selects the background used to display the system tray. Backgrounds " "can be edited in the Backgrounds tab." msgstr "Wybiera tło używane do wyświetlania zasobnika systemowego. Tła mogą " "być edytowane na karcie Tła." #: ../properties.c:4694 msgid "Specifies the horizontal padding of the system tray. This is the " "space between the border and the content inside." msgstr "Określa poziomy margines wewnętrzny dla zasobnik systemowego. To " "jest odstęp pomiędzy krawędzią a zawartością." #: ../properties.c:4709 msgid "Specifies the vertical padding of the system tray. This is the space " "between the border and the content inside." msgstr "Określa pionowy margines wewnętrzny dla zasobnik systemowego. To " "jest odstęp pomiędzy krawędzią a zawartością." #: ../properties.c:4724 msgid "Specifies the spacing between system tray icons." msgstr "Określa odstęp pomiędzy ikonami w zasobniku systemowym." #: ../properties.c:4738 msgid "Specifies the size of the system tray icons, in pixels." msgstr "Określa rozmiar ikon w zasobniku systemowym, w pikselach." #: ../properties.c:4753 msgid "Specifies the opacity of the system tray icons, in percent." msgstr "Określa przeźroczystość ikon w zasobniku systemowym, w procentach." #: ../properties.c:4768 msgid "Specifies the saturation adjustment of the system tray icons, in " "percent." msgstr "Określa nasycenie koloru ikon w zasobniku systemowym, w procentach." #: ../properties.c:4783 msgid "Specifies the brightness adjustment of the system tray icons, in " "percent." msgstr "Określa jasność ikon w zasobniku systemowym, w procentach." #: ../properties.c:4799 msgid "Thresholds" msgstr "Progi" #: ../properties.c:4812 msgid "Hide if charge higher than" msgstr "Ukryj jeśli poziom naładowania wyższy od" #: ../properties.c:4822 msgid "Minimum battery level for which to hide the batter applet. Use 101 " "to always show the batter applet." msgstr "Minimalny poziom naładowania baterii, dla którego aplet baterii " "będzie ukrywany. Użyj 101, aby aplet baterii był zawsze widoczny." #: ../properties.c:4824 ../properties.c:4843 msgid "%" msgstr "%" #: ../properties.c:4831 msgid "Alert if charge lower than" msgstr "Alert jeśli poziom baterii niższy niż" #: ../properties.c:4841 msgid "Battery level for which to display an alert." msgstr "Poziom naładowania baterii, dla którego wyświetlany będzie alert." #: ../properties.c:4850 msgid "Alert command" msgstr "Komenda alarmu" #: ../properties.c:4861 msgid "Command to be executed when the alert threshold is reached." msgstr "Komenda do wykonania, gdy zostanie osiągnięty próg dla alertu." #: ../properties.c:4865 #, fuzzy msgid "AC connection events" msgstr "Zdarzenia myszy" #: ../properties.c:4878 #, fuzzy msgid "AC connected command" msgstr "Komenda alarmu" #: ../properties.c:4890 #, fuzzy msgid "Specifies a command that will be executed when AC is connected to " "the system." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4893 #, fuzzy msgid "AC disconnected command" msgstr "Komenda alarmu" #: ../properties.c:4905 #, fuzzy msgid "Specifies a command that will be executed when AC is disconnected to " "the system." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4933 #, fuzzy msgid "If enabled, shows a tooltip with detailed battery information when " "the mouse is moved over the battery widget." msgstr "Jeśli zaznaczone, pokazywane będą podpowiedzi w momencie gdy kursor " "myszy znajdzie się nad ikoną aplikacji." #: ../properties.c:4948 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a left click." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4963 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a right click." msgstr "Określa komendę, która będzie uruchamiana po prawym kliknięciu w " "zegar." #: ../properties.c:4978 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a middle click." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:4993 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll up." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:5008 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll down." msgstr "Określa komendę, która będzie uruchamiana po lewym kliknięciu w " "zegar." #: ../properties.c:5035 msgid "Selects the background used to display the battery. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Wybiera tło, które będzie użyte do wyświetlania apletu baterii. Tła " "mogą być edytowane na karcie Tła." #: ../properties.c:5049 msgid "Specifies the horizontal padding of the battery. This is the space " "between the border and the content inside." msgstr "Określa poziomy margines wewnętrzny dla apletu baterii. Jest to " "odstęp pomiędzy krawędzią a zawartością." #: ../properties.c:5063 msgid "Specifies the vertical padding of the battery. This is the space " "between the border and the content inside." msgstr "Określa pionowy margines wewnętrzny dla apletu baterii. Jest to " "odstęp pomiędzy krawędzią a zawartością." #: ../properties.c:5087 msgid "Specifies the font used to display the first line of the battery " "text." msgstr "Określa czcionkę użytą do wyświetlania pierwszej linii tekstu w " "aplecie baterii." #: ../properties.c:5112 msgid "Specifies the font used to display the second line of the battery " "text." msgstr "Określa czcionkę użytą do wyświetlania drugiej linii tekstu w " "aplecie baterii." #: ../properties.c:5128 msgid "Specifies the font clor used to display the battery text." msgstr "Określa kolor czcionki dla apletu baterii." #: ../properties.c:5140 msgid "Timing" msgstr "Czasy" #: ../properties.c:5153 msgid "Show delay" msgstr "Opóźnienie pokazywania" #: ../properties.c:5163 msgid "Specifies a delay after which to show the tooltip when moving the " "mouse over an element." msgstr "Określa czas po jakim pokazana zostanie podpowiedź, gdy kursor myszy " "znajduje się nad elementem." #: ../properties.c:5172 msgid "Hide delay" msgstr "Opóźnienie ukrywania" #: ../properties.c:5181 msgid "Specifies a delay after which to hide the tooltip when moving the " "mouse outside an element." msgstr "Określa czas po jakim ukryta zostanie podpowiedź, gdy kursor myszy " "znajdzie się poza elementem." #: ../properties.c:5215 msgid "Selects the background used to display the tooltip. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Wybiera tło dla podpowiedzi. Tła mogą być edytowane na karcie tła." #: ../properties.c:5229 msgid "Specifies the horizontal padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Określa poziomy margines wewnętrzny dla podpowiedzi. Jest to odstęp " "pomiędzy krawędzią a zawartością." #: ../properties.c:5243 msgid "Specifies the vertical padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Określa pionowy margines wewnętrzny dla podpowiedzi. Jest to odstęp " "pomiędzy krawędzią a zawartością." #: ../properties.c:5264 msgid "Specifies the font used to display the text of the tooltip." msgstr "Określa czcionkę użytą do wyświetlania tekstu w podpowiedziach." #: ../properties.c:5280 msgid "Specifies the font color used to display the text of the tooltip." msgstr "Określa kolor czcionki użyty w podpowiedziach." #: ../main.c:148 msgid "tint2conf" msgstr "tint2conf" #: ../main.c:156 msgid "Panel theming" msgstr "Wygląd panelu" #: ../main.c:166 msgid "Theme" msgstr "Motyw" #: ../main.c:167 msgid "_Import theme..." msgstr "_Importuj motyw..." #: ../main.c:167 msgid "Import theme" msgstr "Import motywu" #: ../main.c:168 msgid "_Import default theme..." msgstr "_Importuj domyślny motyw..." #: ../main.c:168 msgid "Import default theme" msgstr "Import domyślnego motywu" #: ../main.c:169 msgid "_Save as..." msgstr "_Zapisz jako..." #: ../main.c:169 ../main.c:335 msgid "Save theme as" msgstr "Zapisz motyw jako" #: ../main.c:170 msgid "_Delete" msgstr "_Usuń" #: ../main.c:170 msgid "Delete theme" msgstr "Usuń motyw" #: ../main.c:171 msgid "_Edit theme..." msgstr "_Edytuj motyw..." #: ../main.c:171 msgid "Edit selected theme" msgstr "Edycja wybranego motywu" #: ../main.c:172 msgid "_Make default" msgstr "" #: ../main.c:172 msgid "Replace the default theme with the selected one" msgstr "" #: ../main.c:173 msgid "_Quit" msgstr "_Zakończ" #: ../main.c:173 msgid "Quit" msgstr "Wyjdź" #: ../main.c:174 msgid "Edit" msgstr "Edytuj" #: ../main.c:175 msgid "Refresh" msgstr "Odśwież" #: ../main.c:176 msgid "Refresh all" msgstr "Odśwież wszystkie" #: ../main.c:177 msgid "Help" msgstr "Pomoc" #: ../main.c:178 msgid "_About" msgstr "_O programie" #: ../main.c:178 msgid "About" msgstr "O programie" #: ../main.c:198 msgid "Command to run tint2: " msgstr "Polecenie uruchamiające tint2:" #: ../main.c:242 msgid "Theming tool for tint2 panel" msgstr "Narzędzie do edycji motywów tint2" #: ../main.c:244 msgid "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" msgstr "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" #: ../main.c:249 msgid "translator-credits" msgstr "Daniel Napora " #: ../main.c:258 msgid "Import theme(s)" msgstr "Importuj motyw(y)" #: ../main.c:293 msgid "Save default theme as" msgstr "Zapisz domyślny motyw jako" #: ../main.c:325 msgid "Select the theme to be saved." msgstr "Wybierz motyw do zapisu" tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/readme.txt000066400000000000000000000006651265276141000255720ustar00rootroot00000000000000Updating pot file: find .. -name '*.c' | sort -r | 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 tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/sr.po000066400000000000000000002600001265276141000245470ustar00rootroot00000000000000# Serbian translation for tint2conf. # Copyright (C) 2015 tint2's copyright holder # This file is distributed under the same license as the tint2 package. # Dino Duratović , 2015. msgid "" msgstr "Project-Id-Version: tint2conf 0.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-17 13:33+0100\n" "PO-Revision-Date: 2015-06-14 13:32+0200\n" "Last-Translator: Dino Duratović \n" "Language-Team: \n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 " "&& n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: ../properties.c:256 msgid "Properties" msgstr "Поставке" #: ../properties.c:290 msgid "Backgrounds" msgstr "Позаадине" #: ../properties.c:298 ../properties.c:1276 msgid "Panel" msgstr "Плоча" #: ../properties.c:306 msgid "Panel items" msgstr "Ставке плоче" #: ../properties.c:314 ../properties.c:1682 ../properties.c:1876 msgid "Taskbar" msgstr "Палета послова" #: ../properties.c:322 msgid "Task buttons" msgstr "Дугмад послова" #: ../properties.c:330 ../properties.c:1687 ../properties.c:1879 #: ../properties.c:2625 msgid "Launcher" msgstr "Покретач" #: ../properties.c:338 ../properties.c:1672 ../properties.c:1870 #: ../properties.c:4002 msgid "Clock" msgstr "Сат" #: ../properties.c:346 ../properties.c:1677 ../properties.c:1873 msgid "System tray" msgstr "Системска трака" #: ../properties.c:354 ../properties.c:1667 ../properties.c:1867 #: ../properties.c:5031 msgid "Battery" msgstr "Батерија" #: ../properties.c:362 ../properties.c:4495 ../properties.c:5211 msgid "Tooltip" msgstr "Описи" #: ../properties.c:516 msgid "Background" msgstr "Позадина" #: ../properties.c:527 msgid "Selects the background you would like to modify" msgstr "Одабир позадине коју желите именити" #: ../properties.c:534 msgid "Creates a copy of the current background" msgstr "Прави копију тренутне позадине" #: ../properties.c:541 msgid "Deletes the current background" msgstr "Брише тренутну позадину" #: ../properties.c:550 msgid "Fill color" msgstr "Боја" #: ../properties.c:561 msgid "The fill color of the current background" msgstr "Боја тренутне позадине" #: ../properties.c:564 msgid "Border color" msgstr "Боја ивице" #: ../properties.c:575 msgid "The border color of the current background" msgstr "Боја ивице тренутне позадине" #: ../properties.c:578 #, fuzzy msgid "Fill color (mouse over)" msgstr "Боја" #: ../properties.c:589 #, fuzzy msgid "The fill color of the current background on mouse over" msgstr "Боја тренутне позадине" #: ../properties.c:592 #, fuzzy msgid "Border color (mouse over)" msgstr "Боја ивице" #: ../properties.c:603 #, fuzzy msgid "The border color of the current background on mouse over" msgstr "Боја ивице тренутне позадине" #: ../properties.c:606 #, fuzzy msgid "Fill color (pressed)" msgstr "Боја" #: ../properties.c:617 #, fuzzy msgid "The fill color of the current background on mouse button press" msgstr "Боја тренутне позадине" #: ../properties.c:620 #, fuzzy msgid "Border color (pressed)" msgstr "Боја ивице" #: ../properties.c:631 #, fuzzy msgid "The border color of the current background on mouse button press" msgstr "Боја ивице тренутне позадине" #: ../properties.c:634 msgid "Border width" msgstr "Ширина ивице" #: ../properties.c:644 msgid "The width of the border of the current background, in pixels" msgstr "Ширина ивице тренутне позадине, у пикселима" #: ../properties.c:647 msgid "Corner radius" msgstr "Пречник угла" #: ../properties.c:657 msgid "The corner radius of the current background" msgstr "Пречник угла тренутне позадине" #: ../properties.c:1075 msgid "Geometry" msgstr "Геометрија" #: ../properties.c:1092 msgid "Position" msgstr "Позиција" #: ../properties.c:1113 msgid "Position on screen: top-left, horizontal panel" msgstr "Позиција на екрану: горе-лево, хоризонтална плоча" #: ../properties.c:1115 msgid "Position on screen: top-center, horizontal panel" msgstr "Позиција на екрану: горе-средина, хоризонтална плоча" #: ../properties.c:1117 msgid "Position on screen: top-right, horizontal panel" msgstr "Позиција на екрану: горе-десно, хоризонтална плоча" #: ../properties.c:1119 msgid "Position on screen: top-left, vertical panel" msgstr "Позиција на екрану: горе-лево, вертикална плоча" #: ../properties.c:1121 msgid "Position on screen: center-left, vertical panel" msgstr "Позиција на екрану: средина-лево, вертикална плоча" #: ../properties.c:1123 msgid "Position on screen: bottom-left, vertical panel" msgstr "Позиција на екрану: доле-лево, вертикална плоча" #: ../properties.c:1125 msgid "Position on screen: top-right, vertical panel" msgstr "Позиција на екрану: горе-десно, вертикална плоча" #: ../properties.c:1127 msgid "Position on screen: center-right, vertical panel" msgstr "Позиција на екрану: средина-десно, вертикална плоча" #: ../properties.c:1129 msgid "Position on screen: bottom-right, vertical panel" msgstr "Позиција на екрану: доле-десно, вертикална плоча" #: ../properties.c:1131 msgid "Position on screen: bottom-left, horizontal panel" msgstr "Позиција на екрану: доле-лево, хоризонтална плоча" #: ../properties.c:1133 msgid "Position on screen: bottom-center, horizontal panel" msgstr "Позиција на екрану: доле-средина, хоризонтална плоча" #: ../properties.c:1135 msgid "Position on screen: bottom-right, horizontal panel" msgstr "Позиција на екрану: доле-десно, хоризонтална плоча" #: ../properties.c:1140 ../properties.c:4634 msgid "Monitor" msgstr "Монитор" #: ../properties.c:1150 msgid "All" msgstr "Сви" #: ../properties.c:1151 ../properties.c:4644 msgid "1" msgstr "1" #: ../properties.c:1152 ../properties.c:4645 msgid "2" msgstr "2" #: ../properties.c:1153 ../properties.c:4646 msgid "3" msgstr "3" #: ../properties.c:1154 ../properties.c:4647 msgid "4" msgstr "4" #: ../properties.c:1155 ../properties.c:4648 msgid "5" msgstr "5" #: ../properties.c:1156 ../properties.c:4649 msgid "6" msgstr "6" #: ../properties.c:1158 msgid "The monitor on which the panel is placed" msgstr "Монитор на којем је плоча" #: ../properties.c:1162 msgid "Primary monitor first" msgstr "" #: ../properties.c:1172 msgid "If enabled, the primary monitor will have index 1 in the monitor " "list even if it is not top-left." msgstr "" #: ../properties.c:1176 msgid "Length" msgstr "Дужина" #: ../properties.c:1186 msgid "The length of the panel (width for horizontal panels, height for " "vertical panels)" msgstr "Дужина плоче (ширина за хоризонталне, висина за вертикалне плоче)" #: ../properties.c:1192 ../properties.c:1215 msgid "Percent" msgstr "Постотак" #: ../properties.c:1193 ../properties.c:1216 msgid "Pixels" msgstr "Пиксела" #: ../properties.c:1195 msgid "The units used to specify the length of the panel: pixels or " "percentage of the monitor size" msgstr "Јединица за одређивање дужине плоче: пиксели или постотак величине " "монитора" #: ../properties.c:1199 msgid "Size" msgstr "Величина" #: ../properties.c:1209 msgid "The size of the panel (height for horizontal panels, width for " "vertical panels)" msgstr "Величина плоче (висина за хоризонталне, ширина за вертикалне плоче)" #: ../properties.c:1218 msgid "The units used to specify the size of the panel: pixels or " "percentage of the monitor size" msgstr "Јединица за одређивање величине плоче: пиксели или постотак величине " "монитора" #: ../properties.c:1222 msgid "Horizontal margin" msgstr "Хоризонтална маргина" #: ../properties.c:1232 msgid "Creates a space between the panel and the edge of the monitor. For " "left-aligned panels, the space is created on the right of the panel; " "for right-aligned panels, it is created on the left; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Прави простор између плоче и ивице монитора. За плоче поравнате " "према лево простор се прави десно од плоче; за плоче поравнате према " "десно, простор је лево; за центриране плоче, једнако је подељен са " "обе стране." #: ../properties.c:1239 msgid "Vertical margin" msgstr "Вертикална маргина" #: ../properties.c:1249 msgid "Creates a space between the panel and the edge of the monitor. For " "top-aligned panels, the space is created on the bottom of the panel; " "for bottom-aligned panels, it is created on the top; for centered " "panels, it is evenly distributed on both sides of the panel." msgstr "Прави простор између плоче и ивице монитора. За плоче поравнате " "према горе простор се прави на дну плоче; за плоче поравнате према " "доле, простор је горе; за центриране плоче, једнако је подељен са " "обе стране." #: ../properties.c:1256 ../properties.c:2606 ../properties.c:2973 #: ../properties.c:3407 ../properties.c:3983 ../properties.c:4368 #: ../properties.c:4656 ../properties.c:5012 ../properties.c:5192 msgid "Appearance" msgstr "Изглед" #: ../properties.c:1270 ../properties.c:2619 ../properties.c:3775 #: ../properties.c:3996 ../properties.c:4381 ../properties.c:4669 #: ../properties.c:5025 ../properties.c:5205 msgid "Background" msgstr "Позадина" #: ../properties.c:1280 msgid "Selects the background used to display the panel. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Одабир позадине за плочу. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:1285 ../properties.c:2647 ../properties.c:2987 #: ../properties.c:3090 ../properties.c:3498 ../properties.c:4010 #: ../properties.c:4395 ../properties.c:4684 ../properties.c:5039 #: ../properties.c:5219 msgid "Horizontal padding" msgstr "Хоризонтална попуна" #: ../properties.c:1295 msgid "Specifies the horizontal padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Одређује хоризонтално попуњивање плоче. То је простор између ивице " "плоче и унутрашњих елемената." #: ../properties.c:1300 ../properties.c:2661 ../properties.c:3002 #: ../properties.c:3105 ../properties.c:3512 ../properties.c:4024 #: ../properties.c:4409 ../properties.c:4699 ../properties.c:5053 #: ../properties.c:5233 msgid "Vertical padding" msgstr "Вертикална попуна" #: ../properties.c:1310 msgid "Specifies the vertical padding of the panel. This is the space " "between the border of the panel and the elements inside." msgstr "Одређује вертикално попуњивање плоче. То је простор између ивице " "плоче и унутрашњих елемената." #: ../properties.c:1315 ../properties.c:2675 ../properties.c:3017 #: ../properties.c:3526 ../properties.c:4714 msgid "Spacing" msgstr "Размак" #: ../properties.c:1325 msgid "Specifies the spacing between elements inside the panel." msgstr "Одређује размак између елемената унутар плоче." #: ../properties.c:1329 msgid "Ignore compositor" msgstr "Игнориши композитор" #: ../properties.c:1339 msgid "If enabled, the compositor will not be used to draw a transparent " "panel. May fix display corruption problems on broken graphics stacks." msgstr "Ако је укључено, композитор се неће користири за приказивање " "транспарентне плоче. Може помоћи код покварених графичких система." #: ../properties.c:1343 msgid "Font shadows" msgstr "Сена фонта" #: ../properties.c:1353 msgid "If enabled, a shadow will be drawn behind text. This may improve " "legibility on transparent panels." msgstr "Ако је укључено, сви текстови ће имати сену. Ово може побољшати " "читљивост код прозирних плоча." #: ../properties.c:1358 #, fuzzy msgid "Mouse effects" msgstr "Радње миша" #: ../properties.c:1368 msgid "Clickable interface items change appearance when the mouse is moved " "over them." msgstr "" #: ../properties.c:1372 #, fuzzy msgid "Icon opacity (hovered)" msgstr "Прозирност икона" #: ../properties.c:1383 #, fuzzy msgid "Specifies the opacity adjustment of the icons under the mouse, in " "percent." msgstr "Одређује засићеност боја икона у покретачу, у постотцима." #: ../properties.c:1387 #, fuzzy msgid "Icon saturation (hovered)" msgstr "Засићеност икона" #: ../properties.c:1398 #, fuzzy msgid "Specifies the saturation adjustment of the icons under the mouse, in " "percent." msgstr "Одређује засићеност боја икона у покретачу, у постотцима." #: ../properties.c:1402 #, fuzzy msgid "Icon brightness (hovered)" msgstr "Светлоћа икона" #: ../properties.c:1413 #, fuzzy msgid "Specifies the brightness adjustment of the icons under the mouse, in " "percent." msgstr "Одређује светлоћу икона у покретачу, у постотцима." #: ../properties.c:1417 #, fuzzy msgid "Icon opacity (pressed)" msgstr "Прозирност икона" #: ../properties.c:1428 #, fuzzy msgid "Specifies the opacity adjustment of the icons on mouse button press, " "in percent." msgstr "Одређује засићеност боја икона у системској траци, у постотцима." #: ../properties.c:1432 #, fuzzy msgid "Icon saturation (pressed)" msgstr "Засићеност икона" #: ../properties.c:1443 #, fuzzy msgid "Specifies the saturation adjustment of the icons on mouse button " "press, in percent." msgstr "Одређује засићеност боја икона у системској траци, у постотцима." #: ../properties.c:1447 #, fuzzy msgid "Icon brightness (pressed)" msgstr "Светлоћа икона" #: ../properties.c:1458 #, fuzzy msgid "Specifies the brightness adjustment of the icons on mouse button " "press, in percent." msgstr "Одређује светлост икона у системској траци, у постотцима." #: ../properties.c:1462 msgid "Autohide" msgstr "Аутоматско скривање" #: ../properties.c:1476 msgid "Autohide" msgstr "Аутоматско скривање" #: ../properties.c:1486 msgid "If enabled, the panel is hidden when the mouse cursor leaves the " "panel." msgstr "Ако је укључено, плоча се скрива када курсор миша напусти плочу." #: ../properties.c:1490 msgid "Show panel after" msgstr "Прикажи плочу након" #: ../properties.c:1500 msgid "Specifies a delay after which the panel is shown when the mouse " "cursor enters the panel." msgstr "Одређује време након којег се плоча приказује кад курсор миша пређе " "преко плоче." #: ../properties.c:1502 ../properties.c:1536 ../properties.c:5165 #: ../properties.c:5184 msgid "seconds" msgstr "секунде" #: ../properties.c:1510 msgid "Hidden size" msgstr "Величина скривене" #: ../properties.c:1520 msgid "Specifies the size of the panel when hidden, in pixels." msgstr "Одређује величину плоче кад је скривена, у пикселима." #: ../properties.c:1524 msgid "Hide panel after" msgstr "Сакриј плочу након" #: ../properties.c:1534 msgid "Specifies a delay after which the panel is hidden when the mouse " "cursor leaves the panel." msgstr "Одређује време након којег се плоча скрива кад курсор миша напусти " "плочу." #: ../properties.c:1544 msgid "Window manager interaction" msgstr "Интеракција са управљачем прозора" #: ../properties.c:1558 msgid "Forward mouse events" msgstr "Проследи радње миша" #: ../properties.c:1568 msgid "If enabled, mouse events not handled by panel elements are forwarded " "to the desktop. Useful on desktop environments that show a start " "menu when right clicking the desktop, or switch the desktop when " "rotating the mouse wheel over the desktop." msgstr "Ако је укључено, радње миша нису руковане од стране плоче, већ се " "проследе радној површини. Корисно је код радних окружења која " "приказују стартни мени при десном клику на површину или који мењају " "површину ротирањем колутића миша." #: ../properties.c:1574 msgid "Place panel in dock" msgstr "Усидри плочу" #: ../properties.c:1584 msgid "If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than " "normal windows. The exact behavior depends on the window manager and " "its configuration." msgstr "Ако је укључено, потавља плочу у простор за сидро (dock) управљача " "прозора. Прозори постављени у сидро су обично посебно третирани од " "стране управљача прозора. Тачно понашање зависи од управљача прозора." #: ../properties.c:1590 msgid "Panel layer" msgstr "Слој плоче" #: ../properties.c:1600 msgid "Top" msgstr "Врх" #: ../properties.c:1601 msgid "Normal" msgstr "Нормално" #: ../properties.c:1602 msgid "Bottom" msgstr "Испод" #: ../properties.c:1604 msgid "Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, " "depending on which has focus. \n" "Note that some window managers prevent this option from working " "correctly if the panel is placed in the dock." msgstr "Одређује слој за постављање плоче. \n" "Врх: плоча увек покрива друге прозоре. \n" "Испод: други прозори увек покривају плочу. \n" "Нормално: други прозори могу покрити плочу, зависно од тога који је " "фокусиран. \n" "Напомена: неки управљачи прозора спречавају да ово ради правилно ако " "се плоча усидри (постави у dock)." #: ../properties.c:1612 msgid "Maximized windows" msgstr "Увећани прозори" #: ../properties.c:1622 msgid "Match the panel size" msgstr "Упари са величином плоче" #: ../properties.c:1623 msgid "Match the hidden panel size" msgstr "Упари са величином скривене плоче" #: ../properties.c:1624 msgid "Fill the screen" msgstr "Попуни екран" #: ../properties.c:1626 msgid "Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to " "the edge of the panel. \n" "Match the hidden panel size means that maximized windows should " "extend to the edge of the panel when hidden; when visible, the panel " "and the windows will overlap. \n" "Fill the screen means that maximized windows will always have the " "same size as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed " "at the edge (not in the middle) of the virtual screen for this to " "work correctly." msgstr "Одређује величину увећаниих прозора. \n" "Упари са величином плоче: увећани прозори се протежу до ивице " "плоче. \n" "Упари са величином скривене плоче: увећани прозори се протежу до " "ивице плоче док је скривена; ако је видљива прозори и плоча ће се " "преклапати. \n" "Попуни екран: увећани прозори ће увијек прекривати цели екран. \n" "Напомена: у случају вишеструких монитора (Xinerama), плоча се мора " "поставити уз ивицу (не у средину) виртуалног екрана да би ово радило " "исправно." #: ../properties.c:1637 msgid "Window name" msgstr "Име прозора" #: ../properties.c:1649 msgid "Specifies the name of the panel window. This is useful if you want " "to configure special treatment of tint2 windows in your window " "manager or compositor." msgstr "Одређује име прозора плоче. Ово је корисно ако желите да тинт2 " "прозори имају посебан третман код управљача прозора или композитора." #: ../properties.c:1692 ../properties.c:1882 msgid "Free space" msgstr "Слободни простор" #: ../properties.c:1697 ../properties.c:1886 ../properties.c:4159 #: ../properties.c:4387 ../properties.c:4557 ../properties.c:4578 msgid "Executor" msgstr "" #: ../properties.c:1712 msgid "Specifies the elements that will appear in the panel and their " "order. Elements can be added by selecting them in the list of " "available elements, then clicking on the add left button." msgstr "Одређује елементе и њихов редослед у плочи. Елементи се могу додати " "одабиром из листе доступних елемената, а затим кликом на Додај дугме." #: ../properties.c:1728 msgid "Lists all the possible elements that can appear in the panel. " "Elements can be added to the panel by selecting them, then clicking " "on the add left button." msgstr "Приказује све могуће елементе плоче. Елементи се могу додати на " "плочу одабиром, а затим кликом на Додај дугме." #: ../properties.c:1738 msgid "Elements selected" msgstr "Одабрани елементи" #: ../properties.c:1744 msgid "Elements available" msgstr "Доступни елементи" #: ../properties.c:1761 msgid "Moves up the current element in the list of selected elements." msgstr "Помера тренутни елемент горе у листи одабраних елемената." #: ../properties.c:1769 msgid "Moves down the current element in the list of selected elements." msgstr "Помера тренутни елемент доле у листи одабраних елемената." #: ../properties.c:1771 ../properties.c:2563 msgid " " msgstr " " #: ../properties.c:1782 msgid "Copies the current element in the list of available elements to the " "list of selected elements." msgstr "Копира тренутни елемент из листе доступних у листу одабраних " "елемената." #: ../properties.c:1790 msgid "Removes the current element from the list of selected elements." msgstr "Уклања тренутни елемент из листе одабраних елемената." #: ../properties.c:2496 msgid "Specifies the application launchers that will appear in the launcher " "and their order. Launchers can be added by selecting an item in the " "list of available applications, then clicking on the add left button." msgstr "Одређује покретаче апликација који ће бити у покретачу и њихов " "редослед. Покретачи се могу додати одабиром из листе доступних " "апликација, па кликом на Додај дугме." #: ../properties.c:2517 msgid "Lists all the applications detected on the system. Launchers can be " "added to the launcher by selecting an application, then clicking on " "the add left button." msgstr "Приказује све апликације пронађене у систему. Покретачи се могу " "додати одабиром из листе доступних апликација, па кликом на Додај " "дугме." #: ../properties.c:2530 msgid "Applications selected" msgstr "Одабране апликације" #: ../properties.c:2536 msgid "Applications available" msgstr "Доступне апликације" #: ../properties.c:2553 msgid "Moves up the current launcher in the list of selected applications." msgstr "Помера тренутни покретач у листи одабраних апликација горе." #: ../properties.c:2561 msgid "Moves down the current launcher in the list of selected applications." msgstr "Помера тренутни покретач у листи одабраних апликација доле." #: ../properties.c:2574 msgid "Copies the current application in the list of available applications " "to the list of selected applications." msgstr "Копира тренутно апликацију из листе доступних апликација у листу " "одабраних апликација." #: ../properties.c:2582 msgid "Removes the current application from the list of selected " "application." msgstr "Уклања тренутну апликацију из листе одабраних апликација." #: ../properties.c:2594 msgid "Additional application directories" msgstr "Додатни директоријум за апликаације" #: ../properties.c:2603 msgid "Specifies a path to a directory from which the launcher is loading " "all .desktop files (all subdirectories are explored recursively). " "Can be used multiple times, in which case the paths must be " "separated by commas. Leading ~ is expaned to the path of the user's " "home directory." msgstr "Одређује путању до директоријума (фасцикле, фолдера) гдје се налазе ." "desktop фајлови (залази рекурзивно у поддиректоријуме). Може се " "додати више њих, а у том случају се путање требају одвојити са " "зарезом. ~ префикс се проширује у путању корисниковог Home " "директорија." #: ../properties.c:2629 msgid "Selects the background used to display the launcher. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Одабир позадине за покретач. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:2633 #, fuzzy msgid "Icon background" msgstr "Неактивна позадина" #: ../properties.c:2639 #, fuzzy msgid "Launcher icon" msgstr "Покретач" #: ../properties.c:2643 #, fuzzy msgid "Selects the background used to display the launcher icon. " "Backgrounds can be edited in the Backgrounds tab." msgstr "Одабир позадине за покретач. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:2657 msgid "Specifies the horizontal padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Одређује хоризонтално пупуњивање покретача. То је простор између " "ивице и унутрашњих елемената." #: ../properties.c:2671 msgid "Specifies the vertical padding of the launcher. This is the space " "between the border and the elements inside." msgstr "Одређује вертикално попуњивање покретача. То је простор између ивице " "и унутрашњих елемената." #: ../properties.c:2685 msgid "Specifies the spacing between the elements inside the launcher." msgstr "Одређује размак између елемената унутар покретача." #: ../properties.c:2688 ../properties.c:4728 msgid "Icon size" msgstr "Величина иконе" #: ../properties.c:2698 msgid "Specifies the size of the launcher icons, in pixels." msgstr "Одређује величину икона у покретачу, у пикселима." #: ../properties.c:2702 ../properties.c:3736 ../properties.c:4742 msgid "Icon opacity" msgstr "Прозирност икона" #: ../properties.c:2713 msgid "Specifies the opacity of the launcher icons, in percent." msgstr "Одређује прозирност икона у покретачу, у постотцима." #: ../properties.c:2717 ../properties.c:3747 ../properties.c:4757 msgid "Icon saturation" msgstr "Засићеност икона" #: ../properties.c:2728 msgid "Specifies the saturation adjustment of the launcher icons, in " "percent." msgstr "Одређује засићеност боја икона у покретачу, у постотцима." #: ../properties.c:2732 ../properties.c:3758 ../properties.c:4772 msgid "Icon brightness" msgstr "Светлоћа икона" #: ../properties.c:2743 msgid "Specifies the brightness adjustment of the launcher icons, in " "percent." msgstr "Одређује светлоћу икона у покретачу, у постотцима." #: ../properties.c:2746 msgid "Icon theme" msgstr "Тема икона" #: ../properties.c:2760 msgid "The icon theme used to display launcher icons. If left blank, tint2 " "will detect and use the icon theme of your desktop as long as you " "have an XSETTINGS manager running (most desktop environments do)." msgstr "Тема икона која се користи у покретачу. Ако се остави празно, тинт2 " "ће открити и користити тему коју користи окружење ако постоји неки " "XSETTINGS управљач (има у већини радних окружења)." #: ../properties.c:2764 msgid "Overrides XSETTINGS" msgstr "Занемари XSETTINGS" #: ../properties.c:2768 msgid "If enabled, the icon theme selected here will override the one " "provided by XSETTINGS." msgstr "Ако је укључено, изабрана тема ће заменити ону из XSETTINGSа." #: ../properties.c:2771 msgid "Startup notifications" msgstr "Обавештења о покретању" #: ../properties.c:2781 msgid "If enabled, startup notifications are shown when starting " "applications from the launcher. The appearance may vary depending on " "your desktop environment configuration; normally, a busy mouse " "cursor is displayed until the application starts." msgstr "Ако је укључено, обавештење о покретању апликације се приказује " "током покретања. Изглед зависи од радног окружења; обично се користи " "заузети курсор миша док се апликација не покрене." #: ../properties.c:2785 ../properties.c:4922 msgid "Tooltips" msgstr "Описи" #: ../properties.c:2795 msgid "If enabled, shows a tooltip with the application name when the mouse " "is moved over an application launcher." msgstr "Ако је укључено, приказује име апликације ако се мишом пређе преко " "покретача апликације." #: ../properties.c:2842 ../properties.c:4597 msgid "Options" msgstr "Могућности" #: ../properties.c:2857 msgid "Show a taskbar for each desktop" msgstr "Прикажи палету за сваку радну површину" #: ../properties.c:2867 msgid "If enabled, the taskbar is split into multiple smaller taskbars, one " "for each virtual desktop." msgstr "Ако је укључено, палета послове је подељена на делове, један дио за " "сваку виртуелну радну површину." #: ../properties.c:2871 msgid "Distribute size between taskbars" msgstr "Расподели простор равномерно" #: ../properties.c:2881 msgid "If enabled and 'Show a taskbar for each desktop' is also enabled, " "the available size is distributed between taskbars proportionally to " "the number of tasks." msgstr "Ако је 'Прикажи палету за сваку радну површину' и ово укључено, " "простор ће бити расподељен међу тракама пропорционално броју њихових " "задатака." #: ../properties.c:2886 msgid "Hide inactive tasks" msgstr "Сакриј неактивне задатке" #: ../properties.c:2896 msgid "If enabled, only the active task will be shown in the taskbar." msgstr "Ако је укључено, само ће активни задатак бити приказан на траци." #: ../properties.c:2900 msgid "Hide tasks from different monitors" msgstr "Сакриј задатке са различитих монитора" #: ../properties.c:2910 msgid "If enabled, tasks that are not on the same monitor as the panel will " "not be displayed. This behavior is enabled automatically if the " "panel monitor is set to 'All'." msgstr "Ако је укључено, задаци који нису на истом монитору као и плоча неће " "бити приказани. Ово понашање је укључено аутоматски ако је монитор " "плоче постављен на 'Сви'." #: ../properties.c:2916 msgid "Always show all desktop tasks" msgstr "" #: ../properties.c:2926 msgid "Has effect only if 'Show a taskbar for each desktop' is enabled. If " "enabled, tasks that appear on all desktops are shown on all " "taskbars. Otherwise, they are shown only on the taskbar of the " "current desktop." msgstr "" #: ../properties.c:2932 msgid "Task sorting" msgstr "Сортирање задатака" #: ../properties.c:2942 ../properties.c:3236 ../properties.c:3272 #: ../properties.c:3308 ../properties.c:3344 ../properties.c:3380 msgid "None" msgstr "Ништа" #: ../properties.c:2943 msgid "By title" msgstr "По имену" #: ../properties.c:2944 msgid "By center" msgstr "По средини" #: ../properties.c:2945 msgid "Most recently used first" msgstr "" #: ../properties.c:2946 msgid "Most recently used last" msgstr "" #: ../properties.c:2948 msgid "Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can " "also reorder task buttons by mouse dragging. \n" "'By title' means that tasks are sorted by their window titles. \n" "'By center' means that tasks are sorted geometrically by their " "window centers." msgstr "Одређује сортирање задатака у палети. \n" "Ништа: нови задаци се додају на крај, корисник их може поредати " "кликом и померањем. \n" "По имену: задаци су поредани по имену њихових прозора. \n" "По средини: задаци су поредани геометријски по средиштима њихових " "прозора." #: ../properties.c:2955 msgid "Task alignment" msgstr "Поравнање задатака" #: ../properties.c:2965 msgid "Left" msgstr "Лево" #: ../properties.c:2966 msgid "Center" msgstr "Средина" #: ../properties.c:2967 msgid "Right" msgstr "Десно" #: ../properties.c:2969 msgid "Specifies how tasks should be positioned on the taskbar." msgstr "Одређује како да се позиционирају задаци на траци." #: ../properties.c:2997 msgid "Specifies the horizontal padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Одређује хоризонтално попуњавање траке. То је простор између траке и " "унутрашњих елемената." #: ../properties.c:3012 msgid "Specifies the vertical padding of the taskbar. This is the space " "between the border and the elements inside." msgstr "Одређује вертикално попуњавање траке. То је простор између траке и " "унутрашњих елемената." #: ../properties.c:3027 msgid "Specifies the spacing between the elements inside the taskbar." msgstr "Одређује размак између елемената унутар траке задатака." #: ../properties.c:3031 ../properties.c:3176 msgid "Active background" msgstr "Активна позадина" #: ../properties.c:3037 #, fuzzy msgid "Active taskbar" msgstr "Активни задатак" #: ../properties.c:3041 msgid "Selects the background used to display the taskbar of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Одабир позадине за траку активне радне површине. Позадине се могу " "уређивати у картици за Позадине." #: ../properties.c:3045 ../properties.c:3191 msgid "Inactive background" msgstr "Неактивна позадина" #: ../properties.c:3051 #, fuzzy msgid "Inactive taskbar" msgstr "Активни задатак" #: ../properties.c:3055 msgid "Selects the background used to display taskbars of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Одабир позадине за траку неактивне радне површине. Позадине се могу " "уређивати у картици за Позадине." #: ../properties.c:3060 msgid "Desktop name" msgstr "Име радне површине" #: ../properties.c:3075 msgid "Show desktop name" msgstr "Прикажи име радне површине" #: ../properties.c:3085 msgid "If enabled, displays the name of the desktop at the top/left of the " "taskbar. The name is set by your window manager; you might be able " "to configure it there." msgstr "Ако је укључено, приказује име радне површине у горњем-левом углу " "траке. Име одређује управљач прозора; можда га можете променити у " "поставкама." #: ../properties.c:3100 msgid "Specifies the horizontal padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Одређује хоризонтално попуњавање имена радне површине. То је простор " "између ивице и унутрашњег текста." #: ../properties.c:3115 msgid "Specifies the vertical padding of the desktop name. This is the " "space between the border and the text inside." msgstr "Одређује вертикално попуњавање имена радне површине. То је простор " "између ивице и унутрашњег текста." #: ../properties.c:3120 msgid "Active font color" msgstr "Боја активног фонта" #: ../properties.c:3131 msgid "Specifies the font color used to display the name of the current " "desktop." msgstr "Одређује боју фонта који се користи за име активне радне површине." #: ../properties.c:3135 msgid "Inactive font color" msgstr "Боја неактивног фонта" #: ../properties.c:3146 msgid "Specifies the font color used to display the name of inactive " "desktops." msgstr "Одређује боју фонта који се користи за име неактивне радне површине." #: ../properties.c:3153 ../properties.c:3542 ../properties.c:4041 #: ../properties.c:4067 ../properties.c:4426 ../properties.c:5070 #: ../properties.c:5095 ../properties.c:5250 msgid "If not checked, the desktop theme font is used. If checked, the " "custom font specified here is used." msgstr "" #: ../properties.c:3156 ../properties.c:3545 ../properties.c:4429 #: ../properties.c:5253 msgid "Font" msgstr "Фонт" #: ../properties.c:3170 msgid "Specifies the font used to display the desktop name." msgstr "Оређује фонт који се користи за приказ имена радне површине." #: ../properties.c:3182 #, fuzzy msgid "Active desktop name" msgstr "Прикажи име радне површине" #: ../properties.c:3186 msgid "Selects the background used to display the name of the current " "desktop. Backgrounds can be edited in the Backgrounds tab." msgstr "Одабир позадине за приказ имена тренутне радне површине. Позадине се " "могу уређивати у картитци за Позадине." #: ../properties.c:3197 #, fuzzy msgid "Inactive desktop name" msgstr "Прикажи име радне површине" #: ../properties.c:3201 msgid "Selects the background used to display the name of inactive " "desktops. Backgrounds can be edited in the Backgrounds tab." msgstr "Одабир позадине за приказ имена неактивне радне површине. Позадине " "се могу уређивати у картици за Позадине." #: ../properties.c:3213 ../properties.c:3894 ../properties.c:4279 #: ../properties.c:4909 msgid "Mouse events" msgstr "Радње миша" #: ../properties.c:3226 msgid "Left click" msgstr "Леви клик" #: ../properties.c:3237 ../properties.c:3273 ../properties.c:3309 #: ../properties.c:3345 ../properties.c:3381 msgid "Close" msgstr "Затвори" #: ../properties.c:3238 ../properties.c:3274 ../properties.c:3310 #: ../properties.c:3346 ../properties.c:3382 msgid "Toggle" msgstr "Пребаци" #: ../properties.c:3239 ../properties.c:3275 ../properties.c:3311 #: ../properties.c:3347 ../properties.c:3383 msgid "Iconify" msgstr "Умањи" #: ../properties.c:3240 ../properties.c:3276 ../properties.c:3348 #: ../properties.c:3384 #, fuzzy msgid "Shade" msgstr "Затамни" #: ../properties.c:3241 ../properties.c:3277 ../properties.c:3313 #: ../properties.c:3349 ../properties.c:3385 msgid "Toggle or iconify" msgstr "Пребаци или умањи" #: ../properties.c:3242 ../properties.c:3278 ../properties.c:3314 #: ../properties.c:3350 ../properties.c:3386 msgid "Maximize or restore" msgstr "Увећај или поврати" #: ../properties.c:3243 ../properties.c:3279 ../properties.c:3315 #: ../properties.c:3351 ../properties.c:3387 msgid "Desktop left" msgstr "Лева радна површина" #: ../properties.c:3244 ../properties.c:3280 ../properties.c:3316 #: ../properties.c:3352 ../properties.c:3388 msgid "Desktop right" msgstr "Десна радна површина" #: ../properties.c:3245 ../properties.c:3281 ../properties.c:3317 #: ../properties.c:3353 ../properties.c:3389 msgid "Next task" msgstr "Следећи задатак" #: ../properties.c:3246 ../properties.c:3282 ../properties.c:3318 #: ../properties.c:3354 ../properties.c:3390 msgid "Previous task" msgstr "Претходни задатак" #: ../properties.c:3248 #, fuzzy msgid "Specifies the action performed when task buttons receive a left " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Одређује акцију након левог клика на задатак: \n" "Ништа: ништа се не подузме. \n" "Затвори: затвара задатак. \n" "Пребаци: пребаци задатак. \n" "Умањи: умањи (минимизира) задатак. \n" "Затамни: затамни (урола) задатак. \n" "Пребаци или умањи: пребаци или умањи задатак. \n" "Увећај или поврати: увећава или умањује задатак. \n" "Лева радна површина: шаље задатак на претходну површину. \n" "Десна радна површина: шаље задатак на следећу површину. \n" "Следећи задатак: фокусира следећи задатак. \n" "Претходни задатак: фокусира претходни задатак." #: ../properties.c:3262 msgid "Wheel scroll up" msgstr "Колутић миша горе" #: ../properties.c:3284 msgid "Specifies the action performed when task buttons receive a scroll up " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Одређује акцију након померања колутића миша горе на задатку: \n" "Ништа: ништа се не подузме. \n" "Затвори: затвара задатак. \n" "Пребаци: пребаци задатак. \n" "Умањи: умањи (минимизира) задатак. \n" "Затамни: затамни (урола) задатак. \n" "Пребаци или умањи: пребаци или умањи задатак. \n" "Увећај или поврати: увећава или умањује задатак. \n" "Лева радна површина: шаље задатак на претходну површину. \n" "Десна радна површина: шаље задатак на следећу површину. \n" "Следећи задатак: фокусира следећи задатак. \n" "Претходни задатак: фокусира претходни задатак." #: ../properties.c:3298 msgid "Middle click" msgstr "Средњи клик" #: ../properties.c:3312 #, fuzzy msgid "sShade" msgstr "зЗатамни" #: ../properties.c:3320 msgid "Specifies the action performed when task buttons receive a middle " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Одређује акцију након средњег клика на задатак: \n" "Ништа: ништа се не подузме. \n" "Затвори: затвара задатак. \n" "Пребаци: пребаци задатак. \n" "Умањи: умањи (минимизира) задатак. \n" "Затамни: затамни (урола) задатак. \n" "Пребаци или умањи: пребаци или умањи задатак. \n" "Увећај или поврати: увећава или умањује задатак. \n" "Лева радна површина: шаље задатак на претходну површину. \n" "Десна радна површина: шаље задатак на следећу површину. \n" "Следећи задатак: фокусира следећи задатак. \n" "Претходни задатак: фокусира претходни задатак." #: ../properties.c:3334 msgid "Wheel scroll down" msgstr "Колутић миша доле" #: ../properties.c:3356 msgid "Specifies the action performed when task buttons receive a scroll " "down event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Одређује акцију након pomeraња колутића миша доле на задатку: \n" "Ништа: ништа се не подузме. \n" "Затвори: затвара задатак. \n" "Пребаци: пребаци задатак. \n" "Умањи: умањи (минимизира) задатак. \n" "Затамни: затамни (урола) задатак. \n" "Пребаци или умањи: пребаци или умањи задатак. \n" "Увећај или поврати: увећава или умањује задатак. \n" "Лева радна површина: шаље задатак на претходну површину. \n" "Десна радна површина: шаље задатак на следећу површину. \n" "Следећи задатак: фокусира следећи задатак. \n" "Претходни задатак: фокусира претходни задатак." #: ../properties.c:3370 msgid "Right click" msgstr "Десни клик" #: ../properties.c:3392 msgid "Specifies the action performed when task buttons receive a right " "click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "Одређује акцију након десног клика на задатак: \n" "Ништа: ништа се не подузме. \n" "Затвори: затвара задатак. \n" "Пребаци: пребаци задатак. \n" "Умањи: умањи (минимизира) задатак. \n" "Затамни: затамни (урола) задатак. \n" "Пребаци или умањи: пребаци или умањи задатак. \n" "Увећај или поврати: увећава или умањује задатак. \n" "Лева радна површина: шаље задатак на претходну површину. \n" "Десна радна површина: шаље задатак на следећу површину. \n" "Следећи задатак: фокусира следећи задатак. \n" "Претходни задатак: фокусира претходни задатак." #: ../properties.c:3420 ../properties.c:4218 msgid "Show icon" msgstr "Прикажи икону" #: ../properties.c:3430 msgid "If enabled, the window icon is shown on task buttons." msgstr "Ако је укључено, приказује икону прозора на дугмету задатка." #: ../properties.c:3433 msgid "Show text" msgstr "Прикажи текст" #: ../properties.c:3443 msgid "If enabled, the window title is shown on task buttons." msgstr "Ако је укључено, приказује име прозора на дугмету задатка." #: ../properties.c:3446 msgid "Center text" msgstr "Центрирај текст" #: ../properties.c:3456 msgid "If enabled, the text is centered on task buttons. Otherwise, it is " "left-aligned." msgstr "Ако је укључено, текст се центрира на дугмету задатка. У супротном " "је поредано улево." #: ../properties.c:3459 msgid "Show tooltips" msgstr "Прикажи описе" #: ../properties.c:3469 msgid "If enabled, a tooltip showing the window title is displayed when the " "mouse cursor moves over task buttons." msgstr "Ако је укључено, приказује име прозора кад се мишом пређе преко " "дугмета задатка." #: ../properties.c:3472 msgid "Maximum width" msgstr "Максимална ширина" #: ../properties.c:3482 msgid "Specifies the maximum width of the task buttons." msgstr "Одређује максималну ширину дугмади задатка." #: ../properties.c:3485 msgid "Maximum height" msgstr "Максимална висина" #: ../properties.c:3495 msgid "Specifies the maximum height of the task buttons." msgstr "Одређује максималну висину дугмади задатка." #: ../properties.c:3508 msgid "Specifies the horizontal padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Одређује хоризонталну попуњавање дугмади. То је простор између ивице " "и унутрашњег садржаја." #: ../properties.c:3522 msgid "Specifies the vertical padding of the task buttons. This is the " "space between the border and the content inside." msgstr "Одређује вертикално попуњавање дугмади. То је простор између ивице и " "унутрашњег садржаја." #: ../properties.c:3536 msgid "Specifies the spacing between the icon and the text." msgstr "Одређује размак између иконе и текста." #: ../properties.c:3556 msgid "Specifies the font used to display the task button text." msgstr "Одређује фонт за приказ текста на дугмету задатка." #: ../properties.c:3568 msgid "Default style" msgstr "Стандардни изглед" #: ../properties.c:3569 #, fuzzy msgid "Default task" msgstr "Стандардни изглед" #: ../properties.c:3579 ../properties.c:3580 msgid "Normal task" msgstr "Нормални задатак" #: ../properties.c:3590 ../properties.c:3591 msgid "Active task" msgstr "Активни задатак" #: ../properties.c:3601 ../properties.c:3602 msgid "Urgent task" msgstr "Хитни задатак" #: ../properties.c:3612 ../properties.c:3613 msgid "Iconified task" msgstr "Умањени задатак" #: ../properties.c:3717 msgid "If enabled, a custom font color is used to display the task text." msgstr "Ако је укључено, користи изабранu бојu фонта за приказ текста " "задатка." #: ../properties.c:3719 ../properties.c:4089 ../properties.c:4444 #: ../properties.c:5117 ../properties.c:5269 msgid "Font color" msgstr "Боја фонта" #: ../properties.c:3728 msgid "Specifies the font color used to display the task text." msgstr "Одређује боју фонта која се користи за приказ текста задатка." #: ../properties.c:3734 msgid "If enabled, a custom opacity/saturation/brightness is used to " "display the task icon." msgstr "Ако је укључено, користе се вредности изабране од корисника за " "прозирност/засићење/светлост иконе задатка." #: ../properties.c:3745 msgid "Specifies the opacity (in %) used to display the task icon." msgstr "Одређује прозирност (у %) за приказ иконе задатка." #: ../properties.c:3756 msgid "Specifies the saturation adjustment (in %) used to display the task " "icon." msgstr "Одређује засићеност боја (у %) за приказ иконе задатка." #: ../properties.c:3767 msgid "Specifies the brightness adjustment (in %) used to display the task " "icon." msgstr "Одређује светлост (у %) за приказ иконе задатка." #: ../properties.c:3773 msgid "If enabled, a custom background is used to display the task." msgstr "Ако је укључено, посебна позадина се користи при приказу задатка." #: ../properties.c:3783 msgid "Selects the background used to display the task. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Одабир позадине за задатак. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:3787 msgid "Blinks" msgstr "Трептање" #: ../properties.c:3795 msgid "Specifies how many times urgent tasks blink." msgstr "Одређује колико ће пута трепнути хитни задаци." #: ../properties.c:3817 ../properties.c:4177 msgid "Format" msgstr "Формат" #: ../properties.c:3829 msgid "First line format" msgstr "формат прве линије" #: ../properties.c:3841 msgid "Specifies the format used to display the first line of the clock " "text. See 'man strftime' for all the available options." msgstr "Одређује формат за приказ прве линије сата. Погледај 'man strftime' " "за све доступне могућности." #: ../properties.c:3845 msgid "Second line format" msgstr "Формат друге линије" #: ../properties.c:3857 msgid "Specifies the format used to display the second line of the clock " "text. See 'man strftime' for all the available options." msgstr "Одређује формат за приказ друге линије сата. Погледај 'man strftime' " "за све доступне могућности." #: ../properties.c:3861 msgid "First line timezone" msgstr "Временска зона прве линије" #: ../properties.c:3873 msgid "Specifies the timezone used to display the first line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Одређује временску зони при приказу времена прве линије. Ако је " "празно користи се тренутна временска зона. У супротном, мора бити " "унешена у облику важеће TЗ (eng. TZ) промењљиве оркужења " "(environment variable)." #: ../properties.c:3877 msgid "Second line timezone" msgstr "Временска зона друге линије" #: ../properties.c:3889 msgid "Specifies the timezone used to display the second line of the clock " "text. If empty, the current timezone is used. Otherwise, it must be " "set to a valid value of the TZ environment variable." msgstr "Одређује временску зони при приказу времена друге линије. Ако је " "празно користи се тренутна временска зона. У супротном, мора бити " "унешена у облику важеће TЗ (eng. TZ) промењљиве оркужења " "(environment variable)." #: ../properties.c:3907 ../properties.c:4292 ../properties.c:4936 msgid "Left click command" msgstr "Команда левог клика" #: ../properties.c:3919 msgid "Specifies a command that will be executed when the clock receives a " "left click." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:3922 ../properties.c:4307 ../properties.c:4951 msgid "Right click command" msgstr "Команда десног клика" #: ../properties.c:3934 msgid "Specifies a command that will be executed when the clock receives a " "right click." msgstr "Одређује команду која ће бити извршена након десног клика на сат." #: ../properties.c:3937 ../properties.c:4322 ../properties.c:4966 #, fuzzy msgid "Middle click command" msgstr "Команда левог клика" #: ../properties.c:3949 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "middle click." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:3952 ../properties.c:4337 ../properties.c:4981 #, fuzzy msgid "Wheel scroll up command" msgstr "Колутић миша горе" #: ../properties.c:3964 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll up." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:3967 ../properties.c:4352 ../properties.c:4996 #, fuzzy msgid "Wheel scroll down command" msgstr "Колутић миша доле" #: ../properties.c:3979 #, fuzzy msgid "Specifies a command that will be executed when the clock receives a " "mouse scroll down." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4006 msgid "Selects the background used to display the clock. Backgrounds can be " "edited in the Backgrounds tab." msgstr "Одабир позадине за сат. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:4020 msgid "Specifies the horizontal padding of the clock. This is the space " "between the border and the content inside." msgstr "Одређује хоризонтално попуњавање око сата. То је простор између " "ивица и унутрашњег садржаја." #: ../properties.c:4034 msgid "Specifies the vertical padding of the clock. This is the space " "between the border and the content inside." msgstr "Одређује вертикално попуњавање око сата. То је простор између ивица " "и унутрашњег садржаја." #: ../properties.c:4044 ../properties.c:5073 msgid "Font first line" msgstr "Фонт прве линије" #: ../properties.c:4059 msgid "Specifies the font used to display the first line of the clock." msgstr "Одређује фонт кориштен за приказ прве линије сата." #: ../properties.c:4070 ../properties.c:5098 msgid "Font second line" msgstr "Фонт друге линије" #: ../properties.c:4084 msgid "Specifies the font used to display the second line of the clock." msgstr "Одређује фонт кориштен за приказ друге линије сата." #: ../properties.c:4100 msgid "Specifies the font color used to display the clock." msgstr "Одређује боју фонта кориштеног за приказ сата." #: ../properties.c:4104 msgid "Tooltip" msgstr "Описи" #: ../properties.c:4117 msgid "Format" msgstr "Формат" #: ../properties.c:4128 msgid "Specifies the format used to display the clock tooltip. See 'man " "strftime' for the available options." msgstr "Одређује формат кориштен при приказивању описа сата. Погледај 'man " "strftime' за све могућности." #: ../properties.c:4132 msgid "Timezone" msgstr "Временска зона" #: ../properties.c:4143 msgid "Specifies the timezone used to display the clock tooltip. If empty, " "the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "Одређује временску зону приказану у опосу сата. Ако је празно, " "тренутна временска зона се користи. У супротном, мора бити унешена у " "облику важеће ТЗ (eng. TZ) промењљиве оркужења (environment " "variable)." #: ../properties.c:4189 #, fuzzy msgid "Command" msgstr "Команда упозорења" #: ../properties.c:4201 #, fuzzy msgid "Specifies the command to execute." msgstr "Оређује фонт који се користи за приказ имена радне површине." #: ../properties.c:4204 msgid "Interval" msgstr "" #: ../properties.c:4214 msgid "Specifies the interval at which the command is executed, in seconds. " "If zero, the command is executed only once." msgstr "" #: ../properties.c:4228 msgid "If enabled, the first line printed by the command is interpreted as " "a path to an image file." msgstr "" #: ../properties.c:4232 #, fuzzy msgid "Cache icon" msgstr "Покретач" #: ../properties.c:4243 msgid "If enabled, the image is not reloaded from disk every time the " "command is executed if the path remains unchanged. Enabling this is " "recommended." msgstr "" #: ../properties.c:4246 msgid "Continuous output" msgstr "" #: ../properties.c:4256 msgid "If non-zero, the last execp_continuous lines from the output of the " "command are displayed, every execp_continuous lines; this is useful " "for showing the output of commands that run indefinitely, such as " "'ping 127.0.0.1'. If zero, the output of the command is displayed " "after it finishes executing." msgstr "" #: ../properties.c:4262 msgid "Display markup" msgstr "" #: ../properties.c:4273 msgid "If enabled, the output of the command is treated as Pango markup, " "which allows rich text formatting. Note that using this with " "commands that print data downloaded from the Internet is a potential " "security risk." msgstr "" #: ../properties.c:4304 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a left click." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4319 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a right click." msgstr "Одређује команду која ће бити извршена након десног клика на сат." #: ../properties.c:4334 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a middle click." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4349 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll up." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4364 #, fuzzy msgid "Specifies a command that will be executed when the executor receives " "a mouse scroll down." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4391 #, fuzzy msgid "Selects the background used to display the executor. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Одабир позадине за сат. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:4405 #, fuzzy msgid "Specifies the horizontal padding of the executor. This is the space " "between the border and the content inside." msgstr "Одређује хоризонтално попуњавање око сата. То је простор између " "ивица и унутрашњег садржаја." #: ../properties.c:4419 #, fuzzy msgid "Specifies the vertical padding of the executor. This is the space " "between the border and the content inside." msgstr "Одређује вертикално попуњавање око сата. То је простор између ивица " "и унутрашњег садржаја." #: ../properties.c:4457 #, fuzzy msgid "Centered" msgstr "Средина" #: ../properties.c:4469 #, fuzzy msgid "Icon width" msgstr "Тема икона" #: ../properties.c:4479 msgid "If non-zero, the image is resized to this width." msgstr "" #: ../properties.c:4482 #, fuzzy msgid "Icon height" msgstr "Светлоћа икона" #: ../properties.c:4492 msgid "If non-zero, the image is resized to this height." msgstr "" #: ../properties.c:4508 #, fuzzy msgid "Tooltip text" msgstr "Описи" #: ../properties.c:4520 msgid "The tooltip text to display. Leave this empty to display an " "automatically generated tooltip with information about when the " "command was last executed." msgstr "" #: ../properties.c:4611 msgid "Icon ordering" msgstr "Редослед икона" #: ../properties.c:4621 msgid "Ascending" msgstr "Узлазно" #: ../properties.c:4622 msgid "Descending" msgstr "Силазно" #: ../properties.c:4623 msgid "Left to right" msgstr "Лево према десно" #: ../properties.c:4624 msgid "Right to left" msgstr "Десно према лево" #: ../properties.c:4626 msgid "Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their " "window names. \n" "'Descending' means that icons are sorted in descending order of " "their window names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right." msgstr "Одређује редослед којим се аранжирају иконе у алатној траци. \n" "Узлазно: поредане су узлазно по имену њиховог прозора. \n" "Силазно: поредане су силазно по имену њиховог прозора. \n" "Лево према десно: иконе се увек додају с лева надесно. \n" "Десно према лево: иконе се увек додају с десна на лево." #: ../properties.c:4651 msgid "Specifies the monitor on which to place the system tray. Due to " "technical limitations, the system tray cannot be displayed on " "multiple monitors." msgstr "Одређује монитор на ком да се прикаже системска трака. Због технички " "ограничења, трака не може бити приказана на више монитора." #: ../properties.c:4675 #, fuzzy msgid "Systray" msgstr "Системска трака" #: ../properties.c:4679 msgid "Selects the background used to display the system tray. Backgrounds " "can be edited in the Backgrounds tab." msgstr "Одабир позадине за системску траку. Позадине се могу уређивати у " "картици за Позадине." #: ../properties.c:4694 msgid "Specifies the horizontal padding of the system tray. This is the " "space between the border and the content inside." msgstr "Одређује хоризонтално попуњавање системске траке. То је простор " "између ивице и унутрашњег садржаја." #: ../properties.c:4709 msgid "Specifies the vertical padding of the system tray. This is the space " "between the border and the content inside." msgstr "Одређује вертилано попуњавање системске траке. То је простор између " "ивице и унутрашњег садржаја." #: ../properties.c:4724 msgid "Specifies the spacing between system tray icons." msgstr "Одређује размак између икона у системској траци." #: ../properties.c:4738 msgid "Specifies the size of the system tray icons, in pixels." msgstr "Одређује величину икона у системској траци, у пикселима." #: ../properties.c:4753 msgid "Specifies the opacity of the system tray icons, in percent." msgstr "Одређује прозирност икона у системској траци, у постотцима." #: ../properties.c:4768 msgid "Specifies the saturation adjustment of the system tray icons, in " "percent." msgstr "Одређује засићеност боја икона у системској траци, у постотцима." #: ../properties.c:4783 msgid "Specifies the brightness adjustment of the system tray icons, in " "percent." msgstr "Одређује светлост икона у системској траци, у постотцима." #: ../properties.c:4799 msgid "Thresholds" msgstr "Праг" #: ../properties.c:4812 msgid "Hide if charge higher than" msgstr "Сакриј ако је пунија од" #: ../properties.c:4822 msgid "Minimum battery level for which to hide the batter applet. Use 101 " "to always show the batter applet." msgstr "Најмањи ниво батерије код којег да се сакрије аплет (приказ). " "Користи 101 да се увек приказује." #: ../properties.c:4824 ../properties.c:4843 msgid "%" msgstr "%" #: ../properties.c:4831 msgid "Alert if charge lower than" msgstr "Упозори ако спане испод" #: ../properties.c:4841 msgid "Battery level for which to display an alert." msgstr "Ниво батерије за приказ упозорења." #: ../properties.c:4850 msgid "Alert command" msgstr "Команда упозорења" #: ../properties.c:4861 msgid "Command to be executed when the alert threshold is reached." msgstr "Команда која се изводи кад се достигне праг." #: ../properties.c:4865 #, fuzzy msgid "AC connection events" msgstr "Радње миша" #: ../properties.c:4878 #, fuzzy msgid "AC connected command" msgstr "Команда упозорења" #: ../properties.c:4890 #, fuzzy msgid "Specifies a command that will be executed when AC is connected to " "the system." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4893 #, fuzzy msgid "AC disconnected command" msgstr "Команда упозорења" #: ../properties.c:4905 #, fuzzy msgid "Specifies a command that will be executed when AC is disconnected to " "the system." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4933 #, fuzzy msgid "If enabled, shows a tooltip with detailed battery information when " "the mouse is moved over the battery widget." msgstr "Ако је укључено, приказује име апликације ако се мишом пређе преко " "покретача апликације." #: ../properties.c:4948 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a left click." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4963 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a right click." msgstr "Одређује команду која ће бити извршена након десног клика на сат." #: ../properties.c:4978 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a middle click." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:4993 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll up." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:5008 #, fuzzy msgid "Specifies a command that will be executed when the battery receives " "a mouse scroll down." msgstr "Одређује команду која ће бити извршена након левог клика на сат." #: ../properties.c:5035 msgid "Selects the background used to display the battery. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Одабир позадине за приказ нивоа батерије. Позадине се могу уређивати " "у картици за Позадине." #: ../properties.c:5049 msgid "Specifies the horizontal padding of the battery. This is the space " "between the border and the content inside." msgstr "Одређује хоризонтално попуњавање око батерије. То је простор између " "ивице и унутрашњег садржаја." #: ../properties.c:5063 msgid "Specifies the vertical padding of the battery. This is the space " "between the border and the content inside." msgstr "Одређује вертикално попуњавање око батерије. То је простор између " "ивице и унутрашњег садржаја." #: ../properties.c:5087 msgid "Specifies the font used to display the first line of the battery " "text." msgstr "Одређује фонт за приказ прве линије батеријског текста." #: ../properties.c:5112 msgid "Specifies the font used to display the second line of the battery " "text." msgstr "Одређује фонт за приказ друге линије батеријског текста." #: ../properties.c:5128 msgid "Specifies the font clor used to display the battery text." msgstr "Одређује боју фонта за приказ батеријског текста.." #: ../properties.c:5140 #, fuzzy msgid "Timing" msgstr "Тајминг" #: ../properties.c:5153 msgid "Show delay" msgstr "Закашњење приказа" #: ../properties.c:5163 msgid "Specifies a delay after which to show the tooltip when moving the " "mouse over an element." msgstr "Одређује закашњење након којег ће се приказати опис током померања " "курсора преко елемента." #: ../properties.c:5172 msgid "Hide delay" msgstr "Закашњење скривања" #: ../properties.c:5181 msgid "Specifies a delay after which to hide the tooltip when moving the " "mouse outside an element." msgstr "Одређује закашњење након којег да се сакрије опис након померања " "курсора ван неког елемента." #: ../properties.c:5215 msgid "Selects the background used to display the tooltip. Backgrounds can " "be edited in the Backgrounds tab." msgstr "Одабир позадине описа. Позадине се могу уређивати у картици за " "Позадине." #: ../properties.c:5229 msgid "Specifies the horizontal padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Одређује хоризонтално попуњавање за опис. То је простор између ивице " "и унутрашњег садржаја." #: ../properties.c:5243 msgid "Specifies the vertical padding of the tooltip. This is the space " "between the border and the content inside." msgstr "Одређује вертикално попуњавање за опис. То је простор између ивице и " "унутрашњег садржаја." #: ../properties.c:5264 msgid "Specifies the font used to display the text of the tooltip." msgstr "Одређује фонт за приказ текста унутар описа." #: ../properties.c:5280 msgid "Specifies the font color used to display the text of the tooltip." msgstr "Одређује боју фонта за приказ текста унутар описа." #: ../main.c:148 msgid "tint2conf" msgstr "тинт2конф" #: ../main.c:156 msgid "Panel theming" msgstr "Изглед плоче" #: ../main.c:166 msgid "Theme" msgstr "Тема" #: ../main.c:167 msgid "_Import theme..." msgstr "_Импортуј тему..." #: ../main.c:167 msgid "Import theme" msgstr "Импортуј тему" #: ../main.c:168 msgid "_Import default theme..." msgstr "_Импортуј стандардну тему..." #: ../main.c:168 msgid "Import default theme" msgstr "Импортуј стандардну тему" #: ../main.c:169 msgid "_Save as..." msgstr "_Снимити као..." #: ../main.c:169 ../main.c:335 msgid "Save theme as" msgstr "Снимити тему као" #: ../main.c:170 msgid "_Delete" msgstr "Из_бриши" #: ../main.c:170 msgid "Delete theme" msgstr "Избриши тему" #: ../main.c:171 msgid "_Edit theme..." msgstr "Ур_еди тему..." #: ../main.c:171 msgid "Edit selected theme" msgstr "Уреди одабрану тему" #: ../main.c:172 msgid "_Make default" msgstr "" #: ../main.c:172 msgid "Replace the default theme with the selected one" msgstr "" #: ../main.c:173 msgid "_Quit" msgstr "_Напусти" #: ../main.c:173 msgid "Quit" msgstr "Напусти" #: ../main.c:174 msgid "Edit" msgstr "Уреди" #: ../main.c:175 msgid "Refresh" msgstr "Освежи" #: ../main.c:176 msgid "Refresh all" msgstr "Освежи све" #: ../main.c:177 msgid "Help" msgstr "Помоћ" #: ../main.c:178 msgid "_About" msgstr "_О програму" #: ../main.c:178 msgid "About" msgstr "О програму" #: ../main.c:198 msgid "Command to run tint2: " msgstr "Команда за покретање тинт2: " #: ../main.c:242 msgid "Theming tool for tint2 panel" msgstr "Алат за уређивање тинт2 тема" #: ../main.c:244 msgid "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" msgstr "Ауторска права 2009-2015 тинт2 тим\n" "Тинт2 лиценца GNU GPL верзија 2\n" "Тинтвизард лиценца GNU GPL верзија 3" #: ../main.c:249 msgid "translator-credits" msgstr "Dino Duratović " #: ../main.c:258 msgid "Import theme(s)" msgstr "Импортуј тему(е)" #: ../main.c:293 msgid "Save default theme as" msgstr "Снимити стандардну тему као" #: ../main.c:325 msgid "Select the theme to be saved." msgstr "Изабери тему за снимање." tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/po/tint2conf.pot000066400000000000000000001347311265276141000262300ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: tint2conf 0.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-17 13:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../properties.c:256 msgid "Properties" msgstr "" #: ../properties.c:290 msgid "Backgrounds" msgstr "" #: ../properties.c:298 ../properties.c:1276 msgid "Panel" msgstr "" #: ../properties.c:306 msgid "Panel items" msgstr "" #: ../properties.c:314 ../properties.c:1682 ../properties.c:1876 msgid "Taskbar" msgstr "" #: ../properties.c:322 msgid "Task buttons" msgstr "" #: ../properties.c:330 ../properties.c:1687 ../properties.c:1879 #: ../properties.c:2625 msgid "Launcher" msgstr "" #: ../properties.c:338 ../properties.c:1672 ../properties.c:1870 #: ../properties.c:4002 msgid "Clock" msgstr "" #: ../properties.c:346 ../properties.c:1677 ../properties.c:1873 msgid "System tray" msgstr "" #: ../properties.c:354 ../properties.c:1667 ../properties.c:1867 #: ../properties.c:5031 msgid "Battery" msgstr "" #: ../properties.c:362 ../properties.c:4495 ../properties.c:5211 msgid "Tooltip" msgstr "" #: ../properties.c:516 msgid "Background" msgstr "" #: ../properties.c:527 msgid "Selects the background you would like to modify" msgstr "" #: ../properties.c:534 msgid "Creates a copy of the current background" msgstr "" #: ../properties.c:541 msgid "Deletes the current background" msgstr "" #: ../properties.c:550 msgid "Fill color" msgstr "" #: ../properties.c:561 msgid "The fill color of the current background" msgstr "" #: ../properties.c:564 msgid "Border color" msgstr "" #: ../properties.c:575 msgid "The border color of the current background" msgstr "" #: ../properties.c:578 msgid "Fill color (mouse over)" msgstr "" #: ../properties.c:589 msgid "The fill color of the current background on mouse over" msgstr "" #: ../properties.c:592 msgid "Border color (mouse over)" msgstr "" #: ../properties.c:603 msgid "The border color of the current background on mouse over" msgstr "" #: ../properties.c:606 msgid "Fill color (pressed)" msgstr "" #: ../properties.c:617 msgid "The fill color of the current background on mouse button press" msgstr "" #: ../properties.c:620 msgid "Border color (pressed)" msgstr "" #: ../properties.c:631 msgid "The border color of the current background on mouse button press" msgstr "" #: ../properties.c:634 msgid "Border width" msgstr "" #: ../properties.c:644 msgid "The width of the border of the current background, in pixels" msgstr "" #: ../properties.c:647 msgid "Corner radius" msgstr "" #: ../properties.c:657 msgid "The corner radius of the current background" msgstr "" #: ../properties.c:1075 msgid "Geometry" msgstr "" #: ../properties.c:1092 msgid "Position" msgstr "" #: ../properties.c:1113 msgid "Position on screen: top-left, horizontal panel" msgstr "" #: ../properties.c:1115 msgid "Position on screen: top-center, horizontal panel" msgstr "" #: ../properties.c:1117 msgid "Position on screen: top-right, horizontal panel" msgstr "" #: ../properties.c:1119 msgid "Position on screen: top-left, vertical panel" msgstr "" #: ../properties.c:1121 msgid "Position on screen: center-left, vertical panel" msgstr "" #: ../properties.c:1123 msgid "Position on screen: bottom-left, vertical panel" msgstr "" #: ../properties.c:1125 msgid "Position on screen: top-right, vertical panel" msgstr "" #: ../properties.c:1127 msgid "Position on screen: center-right, vertical panel" msgstr "" #: ../properties.c:1129 msgid "Position on screen: bottom-right, vertical panel" msgstr "" #: ../properties.c:1131 msgid "Position on screen: bottom-left, horizontal panel" msgstr "" #: ../properties.c:1133 msgid "Position on screen: bottom-center, horizontal panel" msgstr "" #: ../properties.c:1135 msgid "Position on screen: bottom-right, horizontal panel" msgstr "" #: ../properties.c:1140 ../properties.c:4634 msgid "Monitor" msgstr "" #: ../properties.c:1150 msgid "All" msgstr "" #: ../properties.c:1151 ../properties.c:4644 msgid "1" msgstr "" #: ../properties.c:1152 ../properties.c:4645 msgid "2" msgstr "" #: ../properties.c:1153 ../properties.c:4646 msgid "3" msgstr "" #: ../properties.c:1154 ../properties.c:4647 msgid "4" msgstr "" #: ../properties.c:1155 ../properties.c:4648 msgid "5" msgstr "" #: ../properties.c:1156 ../properties.c:4649 msgid "6" msgstr "" #: ../properties.c:1158 msgid "The monitor on which the panel is placed" msgstr "" #: ../properties.c:1162 msgid "Primary monitor first" msgstr "" #: ../properties.c:1172 msgid "" "If enabled, the primary monitor will have index 1 in the monitor list even " "if it is not top-left." msgstr "" #: ../properties.c:1176 msgid "Length" msgstr "" #: ../properties.c:1186 msgid "" "The length of the panel (width for horizontal panels, height for vertical " "panels)" msgstr "" #: ../properties.c:1192 ../properties.c:1215 msgid "Percent" msgstr "" #: ../properties.c:1193 ../properties.c:1216 msgid "Pixels" msgstr "" #: ../properties.c:1195 msgid "" "The units used to specify the length of the panel: pixels or percentage of " "the monitor size" msgstr "" #: ../properties.c:1199 msgid "Size" msgstr "" #: ../properties.c:1209 msgid "" "The size of the panel (height for horizontal panels, width for vertical " "panels)" msgstr "" #: ../properties.c:1218 msgid "" "The units used to specify the size of the panel: pixels or percentage of the " "monitor size" msgstr "" #: ../properties.c:1222 msgid "Horizontal margin" msgstr "" #: ../properties.c:1232 msgid "" "Creates a space between the panel and the edge of the monitor. For left-" "aligned panels, the space is created on the right of the panel; for right-" "aligned panels, it is created on the left; for centered panels, it is evenly " "distributed on both sides of the panel." msgstr "" #: ../properties.c:1239 msgid "Vertical margin" msgstr "" #: ../properties.c:1249 msgid "" "Creates a space between the panel and the edge of the monitor. For top-" "aligned panels, the space is created on the bottom of the panel; for bottom-" "aligned panels, it is created on the top; for centered panels, it is evenly " "distributed on both sides of the panel." msgstr "" #: ../properties.c:1256 ../properties.c:2606 ../properties.c:2973 #: ../properties.c:3407 ../properties.c:3983 ../properties.c:4368 #: ../properties.c:4656 ../properties.c:5012 ../properties.c:5192 msgid "Appearance" msgstr "" #: ../properties.c:1270 ../properties.c:2619 ../properties.c:3775 #: ../properties.c:3996 ../properties.c:4381 ../properties.c:4669 #: ../properties.c:5025 ../properties.c:5205 msgid "Background" msgstr "" #: ../properties.c:1280 msgid "" "Selects the background used to display the panel. Backgrounds can be edited " "in the Backgrounds tab." msgstr "" #: ../properties.c:1285 ../properties.c:2647 ../properties.c:2987 #: ../properties.c:3090 ../properties.c:3498 ../properties.c:4010 #: ../properties.c:4395 ../properties.c:4684 ../properties.c:5039 #: ../properties.c:5219 msgid "Horizontal padding" msgstr "" #: ../properties.c:1295 msgid "" "Specifies the horizontal padding of the panel. This is the space between the " "border of the panel and the elements inside." msgstr "" #: ../properties.c:1300 ../properties.c:2661 ../properties.c:3002 #: ../properties.c:3105 ../properties.c:3512 ../properties.c:4024 #: ../properties.c:4409 ../properties.c:4699 ../properties.c:5053 #: ../properties.c:5233 msgid "Vertical padding" msgstr "" #: ../properties.c:1310 msgid "" "Specifies the vertical padding of the panel. This is the space between the " "border of the panel and the elements inside." msgstr "" #: ../properties.c:1315 ../properties.c:2675 ../properties.c:3017 #: ../properties.c:3526 ../properties.c:4714 msgid "Spacing" msgstr "" #: ../properties.c:1325 msgid "Specifies the spacing between elements inside the panel." msgstr "" #: ../properties.c:1329 msgid "Ignore compositor" msgstr "" #: ../properties.c:1339 msgid "" "If enabled, the compositor will not be used to draw a transparent panel. May " "fix display corruption problems on broken graphics stacks." msgstr "" #: ../properties.c:1343 msgid "Font shadows" msgstr "" #: ../properties.c:1353 msgid "" "If enabled, a shadow will be drawn behind text. This may improve legibility " "on transparent panels." msgstr "" #: ../properties.c:1358 msgid "Mouse effects" msgstr "" #: ../properties.c:1368 msgid "" "Clickable interface items change appearance when the mouse is moved over " "them." msgstr "" #: ../properties.c:1372 msgid "Icon opacity (hovered)" msgstr "" #: ../properties.c:1383 msgid "" "Specifies the opacity adjustment of the icons under the mouse, in percent." msgstr "" #: ../properties.c:1387 msgid "Icon saturation (hovered)" msgstr "" #: ../properties.c:1398 msgid "" "Specifies the saturation adjustment of the icons under the mouse, in percent." msgstr "" #: ../properties.c:1402 msgid "Icon brightness (hovered)" msgstr "" #: ../properties.c:1413 msgid "" "Specifies the brightness adjustment of the icons under the mouse, in percent." msgstr "" #: ../properties.c:1417 msgid "Icon opacity (pressed)" msgstr "" #: ../properties.c:1428 msgid "" "Specifies the opacity adjustment of the icons on mouse button press, in " "percent." msgstr "" #: ../properties.c:1432 msgid "Icon saturation (pressed)" msgstr "" #: ../properties.c:1443 msgid "" "Specifies the saturation adjustment of the icons on mouse button press, in " "percent." msgstr "" #: ../properties.c:1447 msgid "Icon brightness (pressed)" msgstr "" #: ../properties.c:1458 msgid "" "Specifies the brightness adjustment of the icons on mouse button press, in " "percent." msgstr "" #: ../properties.c:1462 msgid "Autohide" msgstr "" #: ../properties.c:1476 msgid "Autohide" msgstr "" #: ../properties.c:1486 msgid "If enabled, the panel is hidden when the mouse cursor leaves the panel." msgstr "" #: ../properties.c:1490 msgid "Show panel after" msgstr "" #: ../properties.c:1500 msgid "" "Specifies a delay after which the panel is shown when the mouse cursor " "enters the panel." msgstr "" #: ../properties.c:1502 ../properties.c:1536 ../properties.c:5165 #: ../properties.c:5184 msgid "seconds" msgstr "" #: ../properties.c:1510 msgid "Hidden size" msgstr "" #: ../properties.c:1520 msgid "Specifies the size of the panel when hidden, in pixels." msgstr "" #: ../properties.c:1524 msgid "Hide panel after" msgstr "" #: ../properties.c:1534 msgid "" "Specifies a delay after which the panel is hidden when the mouse cursor " "leaves the panel." msgstr "" #: ../properties.c:1544 msgid "Window manager interaction" msgstr "" #: ../properties.c:1558 msgid "Forward mouse events" msgstr "" #: ../properties.c:1568 msgid "" "If enabled, mouse events not handled by panel elements are forwarded to the " "desktop. Useful on desktop environments that show a start menu when right " "clicking the desktop, or switch the desktop when rotating the mouse wheel " "over the desktop." msgstr "" #: ../properties.c:1574 msgid "Place panel in dock" msgstr "" #: ../properties.c:1584 msgid "" "If enabled, places the panel in the dock area of the window manager. Windows " "placed in the dock are usually treated differently than normal windows. The " "exact behavior depends on the window manager and its configuration." msgstr "" #: ../properties.c:1590 msgid "Panel layer" msgstr "" #: ../properties.c:1600 msgid "Top" msgstr "" #: ../properties.c:1601 msgid "Normal" msgstr "" #: ../properties.c:1602 msgid "Bottom" msgstr "" #: ../properties.c:1604 msgid "" "Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, depending on " "which has focus. \n" "Note that some window managers prevent this option from working correctly if " "the panel is placed in the dock." msgstr "" #: ../properties.c:1612 msgid "Maximized windows" msgstr "" #: ../properties.c:1622 msgid "Match the panel size" msgstr "" #: ../properties.c:1623 msgid "Match the hidden panel size" msgstr "" #: ../properties.c:1624 msgid "Fill the screen" msgstr "" #: ../properties.c:1626 msgid "" "Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to the edge " "of the panel. \n" "Match the hidden panel size means that maximized windows should extend to " "the edge of the panel when hidden; when visible, the panel and the windows " "will overlap. \n" "Fill the screen means that maximized windows will always have the same size " "as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed at the " "edge (not in the middle) of the virtual screen for this to work correctly." msgstr "" #: ../properties.c:1637 msgid "Window name" msgstr "" #: ../properties.c:1649 msgid "" "Specifies the name of the panel window. This is useful if you want to " "configure special treatment of tint2 windows in your window manager or " "compositor." msgstr "" #: ../properties.c:1692 ../properties.c:1882 msgid "Free space" msgstr "" #: ../properties.c:1697 ../properties.c:1886 ../properties.c:4159 #: ../properties.c:4387 ../properties.c:4557 ../properties.c:4578 msgid "Executor" msgstr "" #: ../properties.c:1712 msgid "" "Specifies the elements that will appear in the panel and their order. " "Elements can be added by selecting them in the list of available elements, " "then clicking on the add left button." msgstr "" #: ../properties.c:1728 msgid "" "Lists all the possible elements that can appear in the panel. Elements can " "be added to the panel by selecting them, then clicking on the add left " "button." msgstr "" #: ../properties.c:1738 msgid "Elements selected" msgstr "" #: ../properties.c:1744 msgid "Elements available" msgstr "" #: ../properties.c:1761 msgid "Moves up the current element in the list of selected elements." msgstr "" #: ../properties.c:1769 msgid "Moves down the current element in the list of selected elements." msgstr "" #: ../properties.c:1771 ../properties.c:2563 msgid " " msgstr "" #: ../properties.c:1782 msgid "" "Copies the current element in the list of available elements to the list of " "selected elements." msgstr "" #: ../properties.c:1790 msgid "Removes the current element from the list of selected elements." msgstr "" #: ../properties.c:2496 msgid "" "Specifies the application launchers that will appear in the launcher and " "their order. Launchers can be added by selecting an item in the list of " "available applications, then clicking on the add left button." msgstr "" #: ../properties.c:2517 msgid "" "Lists all the applications detected on the system. Launchers can be added to " "the launcher by selecting an application, then clicking on the add left " "button." msgstr "" #: ../properties.c:2530 msgid "Applications selected" msgstr "" #: ../properties.c:2536 msgid "Applications available" msgstr "" #: ../properties.c:2553 msgid "Moves up the current launcher in the list of selected applications." msgstr "" #: ../properties.c:2561 msgid "Moves down the current launcher in the list of selected applications." msgstr "" #: ../properties.c:2574 msgid "" "Copies the current application in the list of available applications to the " "list of selected applications." msgstr "" #: ../properties.c:2582 msgid "Removes the current application from the list of selected application." msgstr "" #: ../properties.c:2594 msgid "Additional application directories" msgstr "" #: ../properties.c:2603 msgid "" "Specifies a path to a directory from which the launcher is loading all ." "desktop files (all subdirectories are explored recursively). Can be used " "multiple times, in which case the paths must be separated by commas. Leading " "~ is expaned to the path of the user's home directory." msgstr "" #: ../properties.c:2629 msgid "" "Selects the background used to display the launcher. Backgrounds can be " "edited in the Backgrounds tab." msgstr "" #: ../properties.c:2633 msgid "Icon background" msgstr "" #: ../properties.c:2639 msgid "Launcher icon" msgstr "" #: ../properties.c:2643 msgid "" "Selects the background used to display the launcher icon. Backgrounds can be " "edited in the Backgrounds tab." msgstr "" #: ../properties.c:2657 msgid "" "Specifies the horizontal padding of the launcher. This is the space between " "the border and the elements inside." msgstr "" #: ../properties.c:2671 msgid "" "Specifies the vertical padding of the launcher. This is the space between " "the border and the elements inside." msgstr "" #: ../properties.c:2685 msgid "Specifies the spacing between the elements inside the launcher." msgstr "" #: ../properties.c:2688 ../properties.c:4728 msgid "Icon size" msgstr "" #: ../properties.c:2698 msgid "Specifies the size of the launcher icons, in pixels." msgstr "" #: ../properties.c:2702 ../properties.c:3736 ../properties.c:4742 msgid "Icon opacity" msgstr "" #: ../properties.c:2713 msgid "Specifies the opacity of the launcher icons, in percent." msgstr "" #: ../properties.c:2717 ../properties.c:3747 ../properties.c:4757 msgid "Icon saturation" msgstr "" #: ../properties.c:2728 msgid "Specifies the saturation adjustment of the launcher icons, in percent." msgstr "" #: ../properties.c:2732 ../properties.c:3758 ../properties.c:4772 msgid "Icon brightness" msgstr "" #: ../properties.c:2743 msgid "Specifies the brightness adjustment of the launcher icons, in percent." msgstr "" #: ../properties.c:2746 msgid "Icon theme" msgstr "" #: ../properties.c:2760 msgid "" "The icon theme used to display launcher icons. If left blank, tint2 will " "detect and use the icon theme of your desktop as long as you have an " "XSETTINGS manager running (most desktop environments do)." msgstr "" #: ../properties.c:2764 msgid "Overrides XSETTINGS" msgstr "" #: ../properties.c:2768 msgid "" "If enabled, the icon theme selected here will override the one provided by " "XSETTINGS." msgstr "" #: ../properties.c:2771 msgid "Startup notifications" msgstr "" #: ../properties.c:2781 msgid "" "If enabled, startup notifications are shown when starting applications from " "the launcher. The appearance may vary depending on your desktop environment " "configuration; normally, a busy mouse cursor is displayed until the " "application starts." msgstr "" #: ../properties.c:2785 ../properties.c:4922 msgid "Tooltips" msgstr "" #: ../properties.c:2795 msgid "" "If enabled, shows a tooltip with the application name when the mouse is " "moved over an application launcher." msgstr "" #: ../properties.c:2842 ../properties.c:4597 msgid "Options" msgstr "" #: ../properties.c:2857 msgid "Show a taskbar for each desktop" msgstr "" #: ../properties.c:2867 msgid "" "If enabled, the taskbar is split into multiple smaller taskbars, one for " "each virtual desktop." msgstr "" #: ../properties.c:2871 msgid "Distribute size between taskbars" msgstr "" #: ../properties.c:2881 msgid "" "If enabled and 'Show a taskbar for each desktop' is also enabled, the " "available size is distributed between taskbars proportionally to the number " "of tasks." msgstr "" #: ../properties.c:2886 msgid "Hide inactive tasks" msgstr "" #: ../properties.c:2896 msgid "If enabled, only the active task will be shown in the taskbar." msgstr "" #: ../properties.c:2900 msgid "Hide tasks from different monitors" msgstr "" #: ../properties.c:2910 msgid "" "If enabled, tasks that are not on the same monitor as the panel will not be " "displayed. This behavior is enabled automatically if the panel monitor is " "set to 'All'." msgstr "" #: ../properties.c:2916 msgid "Always show all desktop tasks" msgstr "" #: ../properties.c:2926 msgid "" "Has effect only if 'Show a taskbar for each desktop' is enabled. If enabled, " "tasks that appear on all desktops are shown on all taskbars. Otherwise, they " "are shown only on the taskbar of the current desktop." msgstr "" #: ../properties.c:2932 msgid "Task sorting" msgstr "" #: ../properties.c:2942 ../properties.c:3236 ../properties.c:3272 #: ../properties.c:3308 ../properties.c:3344 ../properties.c:3380 msgid "None" msgstr "" #: ../properties.c:2943 msgid "By title" msgstr "" #: ../properties.c:2944 msgid "By center" msgstr "" #: ../properties.c:2945 msgid "Most recently used first" msgstr "" #: ../properties.c:2946 msgid "Most recently used last" msgstr "" #: ../properties.c:2948 msgid "" "Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can also " "reorder task buttons by mouse dragging. \n" "'By title' means that tasks are sorted by their window titles. \n" "'By center' means that tasks are sorted geometrically by their window " "centers." msgstr "" #: ../properties.c:2955 msgid "Task alignment" msgstr "" #: ../properties.c:2965 msgid "Left" msgstr "" #: ../properties.c:2966 msgid "Center" msgstr "" #: ../properties.c:2967 msgid "Right" msgstr "" #: ../properties.c:2969 msgid "Specifies how tasks should be positioned on the taskbar." msgstr "" #: ../properties.c:2997 msgid "" "Specifies the horizontal padding of the taskbar. This is the space between " "the border and the elements inside." msgstr "" #: ../properties.c:3012 msgid "" "Specifies the vertical padding of the taskbar. This is the space between the " "border and the elements inside." msgstr "" #: ../properties.c:3027 msgid "Specifies the spacing between the elements inside the taskbar." msgstr "" #: ../properties.c:3031 ../properties.c:3176 msgid "Active background" msgstr "" #: ../properties.c:3037 msgid "Active taskbar" msgstr "" #: ../properties.c:3041 msgid "" "Selects the background used to display the taskbar of the current desktop. " "Backgrounds can be edited in the Backgrounds tab." msgstr "" #: ../properties.c:3045 ../properties.c:3191 msgid "Inactive background" msgstr "" #: ../properties.c:3051 msgid "Inactive taskbar" msgstr "" #: ../properties.c:3055 msgid "" "Selects the background used to display taskbars of inactive desktops. " "Backgrounds can be edited in the Backgrounds tab." msgstr "" #: ../properties.c:3060 msgid "Desktop name" msgstr "" #: ../properties.c:3075 msgid "Show desktop name" msgstr "" #: ../properties.c:3085 msgid "" "If enabled, displays the name of the desktop at the top/left of the taskbar. " "The name is set by your window manager; you might be able to configure it " "there." msgstr "" #: ../properties.c:3100 msgid "" "Specifies the horizontal padding of the desktop name. This is the space " "between the border and the text inside." msgstr "" #: ../properties.c:3115 msgid "" "Specifies the vertical padding of the desktop name. This is the space " "between the border and the text inside." msgstr "" #: ../properties.c:3120 msgid "Active font color" msgstr "" #: ../properties.c:3131 msgid "" "Specifies the font color used to display the name of the current desktop." msgstr "" #: ../properties.c:3135 msgid "Inactive font color" msgstr "" #: ../properties.c:3146 msgid "Specifies the font color used to display the name of inactive desktops." msgstr "" #: ../properties.c:3153 ../properties.c:3542 ../properties.c:4041 #: ../properties.c:4067 ../properties.c:4426 ../properties.c:5070 #: ../properties.c:5095 ../properties.c:5250 msgid "" "If not checked, the desktop theme font is used. If checked, the custom font " "specified here is used." msgstr "" #: ../properties.c:3156 ../properties.c:3545 ../properties.c:4429 #: ../properties.c:5253 msgid "Font" msgstr "" #: ../properties.c:3170 msgid "Specifies the font used to display the desktop name." msgstr "" #: ../properties.c:3182 msgid "Active desktop name" msgstr "" #: ../properties.c:3186 msgid "" "Selects the background used to display the name of the current desktop. " "Backgrounds can be edited in the Backgrounds tab." msgstr "" #: ../properties.c:3197 msgid "Inactive desktop name" msgstr "" #: ../properties.c:3201 msgid "" "Selects the background used to display the name of inactive desktops. " "Backgrounds can be edited in the Backgrounds tab." msgstr "" #: ../properties.c:3213 ../properties.c:3894 ../properties.c:4279 #: ../properties.c:4909 msgid "Mouse events" msgstr "" #: ../properties.c:3226 msgid "Left click" msgstr "" #: ../properties.c:3237 ../properties.c:3273 ../properties.c:3309 #: ../properties.c:3345 ../properties.c:3381 msgid "Close" msgstr "" #: ../properties.c:3238 ../properties.c:3274 ../properties.c:3310 #: ../properties.c:3346 ../properties.c:3382 msgid "Toggle" msgstr "" #: ../properties.c:3239 ../properties.c:3275 ../properties.c:3311 #: ../properties.c:3347 ../properties.c:3383 msgid "Iconify" msgstr "" #: ../properties.c:3240 ../properties.c:3276 ../properties.c:3348 #: ../properties.c:3384 msgid "Shade" msgstr "" #: ../properties.c:3241 ../properties.c:3277 ../properties.c:3313 #: ../properties.c:3349 ../properties.c:3385 msgid "Toggle or iconify" msgstr "" #: ../properties.c:3242 ../properties.c:3278 ../properties.c:3314 #: ../properties.c:3350 ../properties.c:3386 msgid "Maximize or restore" msgstr "" #: ../properties.c:3243 ../properties.c:3279 ../properties.c:3315 #: ../properties.c:3351 ../properties.c:3387 msgid "Desktop left" msgstr "" #: ../properties.c:3244 ../properties.c:3280 ../properties.c:3316 #: ../properties.c:3352 ../properties.c:3388 msgid "Desktop right" msgstr "" #: ../properties.c:3245 ../properties.c:3281 ../properties.c:3317 #: ../properties.c:3353 ../properties.c:3389 msgid "Next task" msgstr "" #: ../properties.c:3246 ../properties.c:3282 ../properties.c:3318 #: ../properties.c:3354 ../properties.c:3390 msgid "Previous task" msgstr "" #: ../properties.c:3248 msgid "" "Specifies the action performed when task buttons receive a left click " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "" #: ../properties.c:3262 msgid "Wheel scroll up" msgstr "" #: ../properties.c:3284 msgid "" "Specifies the action performed when task buttons receive a scroll up " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "" #: ../properties.c:3298 msgid "Middle click" msgstr "" #: ../properties.c:3312 msgid "sShade" msgstr "" #: ../properties.c:3320 msgid "" "Specifies the action performed when task buttons receive a middle click " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "" #: ../properties.c:3334 msgid "Wheel scroll down" msgstr "" #: ../properties.c:3356 msgid "" "Specifies the action performed when task buttons receive a scroll down " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "" #: ../properties.c:3370 msgid "Right click" msgstr "" #: ../properties.c:3392 msgid "" "Specifies the action performed when task buttons receive a right click " "event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task." msgstr "" #: ../properties.c:3420 ../properties.c:4218 msgid "Show icon" msgstr "" #: ../properties.c:3430 msgid "If enabled, the window icon is shown on task buttons." msgstr "" #: ../properties.c:3433 msgid "Show text" msgstr "" #: ../properties.c:3443 msgid "If enabled, the window title is shown on task buttons." msgstr "" #: ../properties.c:3446 msgid "Center text" msgstr "" #: ../properties.c:3456 msgid "" "If enabled, the text is centered on task buttons. Otherwise, it is left-" "aligned." msgstr "" #: ../properties.c:3459 msgid "Show tooltips" msgstr "" #: ../properties.c:3469 msgid "" "If enabled, a tooltip showing the window title is displayed when the mouse " "cursor moves over task buttons." msgstr "" #: ../properties.c:3472 msgid "Maximum width" msgstr "" #: ../properties.c:3482 msgid "Specifies the maximum width of the task buttons." msgstr "" #: ../properties.c:3485 msgid "Maximum height" msgstr "" #: ../properties.c:3495 msgid "Specifies the maximum height of the task buttons." msgstr "" #: ../properties.c:3508 msgid "" "Specifies the horizontal padding of the task buttons. This is the space " "between the border and the content inside." msgstr "" #: ../properties.c:3522 msgid "" "Specifies the vertical padding of the task buttons. This is the space " "between the border and the content inside." msgstr "" #: ../properties.c:3536 msgid "Specifies the spacing between the icon and the text." msgstr "" #: ../properties.c:3556 msgid "Specifies the font used to display the task button text." msgstr "" #: ../properties.c:3568 msgid "Default style" msgstr "" #: ../properties.c:3569 msgid "Default task" msgstr "" #: ../properties.c:3579 ../properties.c:3580 msgid "Normal task" msgstr "" #: ../properties.c:3590 ../properties.c:3591 msgid "Active task" msgstr "" #: ../properties.c:3601 ../properties.c:3602 msgid "Urgent task" msgstr "" #: ../properties.c:3612 ../properties.c:3613 msgid "Iconified task" msgstr "" #: ../properties.c:3717 msgid "If enabled, a custom font color is used to display the task text." msgstr "" #: ../properties.c:3719 ../properties.c:4089 ../properties.c:4444 #: ../properties.c:5117 ../properties.c:5269 msgid "Font color" msgstr "" #: ../properties.c:3728 msgid "Specifies the font color used to display the task text." msgstr "" #: ../properties.c:3734 msgid "" "If enabled, a custom opacity/saturation/brightness is used to display the " "task icon." msgstr "" #: ../properties.c:3745 msgid "Specifies the opacity (in %) used to display the task icon." msgstr "" #: ../properties.c:3756 msgid "" "Specifies the saturation adjustment (in %) used to display the task icon." msgstr "" #: ../properties.c:3767 msgid "" "Specifies the brightness adjustment (in %) used to display the task icon." msgstr "" #: ../properties.c:3773 msgid "If enabled, a custom background is used to display the task." msgstr "" #: ../properties.c:3783 msgid "" "Selects the background used to display the task. Backgrounds can be edited " "in the Backgrounds tab." msgstr "" #: ../properties.c:3787 msgid "Blinks" msgstr "" #: ../properties.c:3795 msgid "Specifies how many times urgent tasks blink." msgstr "" #: ../properties.c:3817 ../properties.c:4177 msgid "Format" msgstr "" #: ../properties.c:3829 msgid "First line format" msgstr "" #: ../properties.c:3841 msgid "" "Specifies the format used to display the first line of the clock text. See " "'man strftime' for all the available options." msgstr "" #: ../properties.c:3845 msgid "Second line format" msgstr "" #: ../properties.c:3857 msgid "" "Specifies the format used to display the second line of the clock text. See " "'man strftime' for all the available options." msgstr "" #: ../properties.c:3861 msgid "First line timezone" msgstr "" #: ../properties.c:3873 msgid "" "Specifies the timezone used to display the first line of the clock text. If " "empty, the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "" #: ../properties.c:3877 msgid "Second line timezone" msgstr "" #: ../properties.c:3889 msgid "" "Specifies the timezone used to display the second line of the clock text. If " "empty, the current timezone is used. Otherwise, it must be set to a valid " "value of the TZ environment variable." msgstr "" #: ../properties.c:3907 ../properties.c:4292 ../properties.c:4936 msgid "Left click command" msgstr "" #: ../properties.c:3919 msgid "" "Specifies a command that will be executed when the clock receives a left " "click." msgstr "" #: ../properties.c:3922 ../properties.c:4307 ../properties.c:4951 msgid "Right click command" msgstr "" #: ../properties.c:3934 msgid "" "Specifies a command that will be executed when the clock receives a right " "click." msgstr "" #: ../properties.c:3937 ../properties.c:4322 ../properties.c:4966 msgid "Middle click command" msgstr "" #: ../properties.c:3949 msgid "" "Specifies a command that will be executed when the clock receives a middle " "click." msgstr "" #: ../properties.c:3952 ../properties.c:4337 ../properties.c:4981 msgid "Wheel scroll up command" msgstr "" #: ../properties.c:3964 msgid "" "Specifies a command that will be executed when the clock receives a mouse " "scroll up." msgstr "" #: ../properties.c:3967 ../properties.c:4352 ../properties.c:4996 msgid "Wheel scroll down command" msgstr "" #: ../properties.c:3979 msgid "" "Specifies a command that will be executed when the clock receives a mouse " "scroll down." msgstr "" #: ../properties.c:4006 msgid "" "Selects the background used to display the clock. Backgrounds can be edited " "in the Backgrounds tab." msgstr "" #: ../properties.c:4020 msgid "" "Specifies the horizontal padding of the clock. This is the space between the " "border and the content inside." msgstr "" #: ../properties.c:4034 msgid "" "Specifies the vertical padding of the clock. This is the space between the " "border and the content inside." msgstr "" #: ../properties.c:4044 ../properties.c:5073 msgid "Font first line" msgstr "" #: ../properties.c:4059 msgid "Specifies the font used to display the first line of the clock." msgstr "" #: ../properties.c:4070 ../properties.c:5098 msgid "Font second line" msgstr "" #: ../properties.c:4084 msgid "Specifies the font used to display the second line of the clock." msgstr "" #: ../properties.c:4100 msgid "Specifies the font color used to display the clock." msgstr "" #: ../properties.c:4104 msgid "Tooltip" msgstr "" #: ../properties.c:4117 msgid "Format" msgstr "" #: ../properties.c:4128 msgid "" "Specifies the format used to display the clock tooltip. See 'man strftime' " "for the available options." msgstr "" #: ../properties.c:4132 msgid "Timezone" msgstr "" #: ../properties.c:4143 msgid "" "Specifies the timezone used to display the clock tooltip. If empty, the " "current timezone is used. Otherwise, it must be set to a valid value of the " "TZ environment variable." msgstr "" #: ../properties.c:4189 msgid "Command" msgstr "" #: ../properties.c:4201 msgid "Specifies the command to execute." msgstr "" #: ../properties.c:4204 msgid "Interval" msgstr "" #: ../properties.c:4214 msgid "" "Specifies the interval at which the command is executed, in seconds. If " "zero, the command is executed only once." msgstr "" #: ../properties.c:4228 msgid "" "If enabled, the first line printed by the command is interpreted as a path " "to an image file." msgstr "" #: ../properties.c:4232 msgid "Cache icon" msgstr "" #: ../properties.c:4243 msgid "" "If enabled, the image is not reloaded from disk every time the command is " "executed if the path remains unchanged. Enabling this is recommended." msgstr "" #: ../properties.c:4246 msgid "Continuous output" msgstr "" #: ../properties.c:4256 msgid "" "If non-zero, the last execp_continuous lines from the output of the command " "are displayed, every execp_continuous lines; this is useful for showing the " "output of commands that run indefinitely, such as 'ping 127.0.0.1'. If zero, " "the output of the command is displayed after it finishes executing." msgstr "" #: ../properties.c:4262 msgid "Display markup" msgstr "" #: ../properties.c:4273 msgid "" "If enabled, the output of the command is treated as Pango markup, which " "allows rich text formatting. Note that using this with commands that print " "data downloaded from the Internet is a potential security risk." msgstr "" #: ../properties.c:4304 msgid "" "Specifies a command that will be executed when the executor receives a left " "click." msgstr "" #: ../properties.c:4319 msgid "" "Specifies a command that will be executed when the executor receives a right " "click." msgstr "" #: ../properties.c:4334 msgid "" "Specifies a command that will be executed when the executor receives a " "middle click." msgstr "" #: ../properties.c:4349 msgid "" "Specifies a command that will be executed when the executor receives a mouse " "scroll up." msgstr "" #: ../properties.c:4364 msgid "" "Specifies a command that will be executed when the executor receives a mouse " "scroll down." msgstr "" #: ../properties.c:4391 msgid "" "Selects the background used to display the executor. Backgrounds can be " "edited in the Backgrounds tab." msgstr "" #: ../properties.c:4405 msgid "" "Specifies the horizontal padding of the executor. This is the space between " "the border and the content inside." msgstr "" #: ../properties.c:4419 msgid "" "Specifies the vertical padding of the executor. This is the space between " "the border and the content inside." msgstr "" #: ../properties.c:4457 msgid "Centered" msgstr "" #: ../properties.c:4469 msgid "Icon width" msgstr "" #: ../properties.c:4479 msgid "If non-zero, the image is resized to this width." msgstr "" #: ../properties.c:4482 msgid "Icon height" msgstr "" #: ../properties.c:4492 msgid "If non-zero, the image is resized to this height." msgstr "" #: ../properties.c:4508 msgid "Tooltip text" msgstr "" #: ../properties.c:4520 msgid "" "The tooltip text to display. Leave this empty to display an automatically " "generated tooltip with information about when the command was last executed." msgstr "" #: ../properties.c:4611 msgid "Icon ordering" msgstr "" #: ../properties.c:4621 msgid "Ascending" msgstr "" #: ../properties.c:4622 msgid "Descending" msgstr "" #: ../properties.c:4623 msgid "Left to right" msgstr "" #: ../properties.c:4624 msgid "Right to left" msgstr "" #: ../properties.c:4626 msgid "" "Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their window " "names. \n" "'Descending' means that icons are sorted in descending order of their window " "names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right." msgstr "" #: ../properties.c:4651 msgid "" "Specifies the monitor on which to place the system tray. Due to technical " "limitations, the system tray cannot be displayed on multiple monitors." msgstr "" #: ../properties.c:4675 msgid "Systray" msgstr "" #: ../properties.c:4679 msgid "" "Selects the background used to display the system tray. Backgrounds can be " "edited in the Backgrounds tab." msgstr "" #: ../properties.c:4694 msgid "" "Specifies the horizontal padding of the system tray. This is the space " "between the border and the content inside." msgstr "" #: ../properties.c:4709 msgid "" "Specifies the vertical padding of the system tray. This is the space between " "the border and the content inside." msgstr "" #: ../properties.c:4724 msgid "Specifies the spacing between system tray icons." msgstr "" #: ../properties.c:4738 msgid "Specifies the size of the system tray icons, in pixels." msgstr "" #: ../properties.c:4753 msgid "Specifies the opacity of the system tray icons, in percent." msgstr "" #: ../properties.c:4768 msgid "" "Specifies the saturation adjustment of the system tray icons, in percent." msgstr "" #: ../properties.c:4783 msgid "" "Specifies the brightness adjustment of the system tray icons, in percent." msgstr "" #: ../properties.c:4799 msgid "Thresholds" msgstr "" #: ../properties.c:4812 msgid "Hide if charge higher than" msgstr "" #: ../properties.c:4822 msgid "" "Minimum battery level for which to hide the batter applet. Use 101 to always " "show the batter applet." msgstr "" #: ../properties.c:4824 ../properties.c:4843 msgid "%" msgstr "" #: ../properties.c:4831 msgid "Alert if charge lower than" msgstr "" #: ../properties.c:4841 msgid "Battery level for which to display an alert." msgstr "" #: ../properties.c:4850 msgid "Alert command" msgstr "" #: ../properties.c:4861 msgid "Command to be executed when the alert threshold is reached." msgstr "" #: ../properties.c:4865 msgid "AC connection events" msgstr "" #: ../properties.c:4878 msgid "AC connected command" msgstr "" #: ../properties.c:4890 msgid "" "Specifies a command that will be executed when AC is connected to the system." msgstr "" #: ../properties.c:4893 msgid "AC disconnected command" msgstr "" #: ../properties.c:4905 msgid "" "Specifies a command that will be executed when AC is disconnected to the " "system." msgstr "" #: ../properties.c:4933 msgid "" "If enabled, shows a tooltip with detailed battery information when the mouse " "is moved over the battery widget." msgstr "" #: ../properties.c:4948 msgid "" "Specifies a command that will be executed when the battery receives a left " "click." msgstr "" #: ../properties.c:4963 msgid "" "Specifies a command that will be executed when the battery receives a right " "click." msgstr "" #: ../properties.c:4978 msgid "" "Specifies a command that will be executed when the battery receives a middle " "click." msgstr "" #: ../properties.c:4993 msgid "" "Specifies a command that will be executed when the battery receives a mouse " "scroll up." msgstr "" #: ../properties.c:5008 msgid "" "Specifies a command that will be executed when the battery receives a mouse " "scroll down." msgstr "" #: ../properties.c:5035 msgid "" "Selects the background used to display the battery. Backgrounds can be " "edited in the Backgrounds tab." msgstr "" #: ../properties.c:5049 msgid "" "Specifies the horizontal padding of the battery. This is the space between " "the border and the content inside." msgstr "" #: ../properties.c:5063 msgid "" "Specifies the vertical padding of the battery. This is the space between the " "border and the content inside." msgstr "" #: ../properties.c:5087 msgid "Specifies the font used to display the first line of the battery text." msgstr "" #: ../properties.c:5112 msgid "Specifies the font used to display the second line of the battery text." msgstr "" #: ../properties.c:5128 msgid "Specifies the font clor used to display the battery text." msgstr "" #: ../properties.c:5140 msgid "Timing" msgstr "" #: ../properties.c:5153 msgid "Show delay" msgstr "" #: ../properties.c:5163 msgid "" "Specifies a delay after which to show the tooltip when moving the mouse over " "an element." msgstr "" #: ../properties.c:5172 msgid "Hide delay" msgstr "" #: ../properties.c:5181 msgid "" "Specifies a delay after which to hide the tooltip when moving the mouse " "outside an element." msgstr "" #: ../properties.c:5215 msgid "" "Selects the background used to display the tooltip. Backgrounds can be " "edited in the Backgrounds tab." msgstr "" #: ../properties.c:5229 msgid "" "Specifies the horizontal padding of the tooltip. This is the space between " "the border and the content inside." msgstr "" #: ../properties.c:5243 msgid "" "Specifies the vertical padding of the tooltip. This is the space between the " "border and the content inside." msgstr "" #: ../properties.c:5264 msgid "Specifies the font used to display the text of the tooltip." msgstr "" #: ../properties.c:5280 msgid "Specifies the font color used to display the text of the tooltip." msgstr "" #: ../main.c:148 msgid "tint2conf" msgstr "" #: ../main.c:156 msgid "Panel theming" msgstr "" #: ../main.c:166 msgid "Theme" msgstr "" #: ../main.c:167 msgid "_Import theme..." msgstr "" #: ../main.c:167 msgid "Import theme" msgstr "" #: ../main.c:168 msgid "_Import default theme..." msgstr "" #: ../main.c:168 msgid "Import default theme" msgstr "" #: ../main.c:169 msgid "_Save as..." msgstr "" #: ../main.c:169 ../main.c:335 msgid "Save theme as" msgstr "" #: ../main.c:170 msgid "_Delete" msgstr "" #: ../main.c:170 msgid "Delete theme" msgstr "" #: ../main.c:171 msgid "_Edit theme..." msgstr "" #: ../main.c:171 msgid "Edit selected theme" msgstr "" #: ../main.c:172 msgid "_Make default" msgstr "" #: ../main.c:172 msgid "Replace the default theme with the selected one" msgstr "" #: ../main.c:173 msgid "_Quit" msgstr "" #: ../main.c:173 msgid "Quit" msgstr "" #: ../main.c:174 msgid "Edit" msgstr "" #: ../main.c:175 msgid "Refresh" msgstr "" #: ../main.c:176 msgid "Refresh all" msgstr "" #: ../main.c:177 msgid "Help" msgstr "" #: ../main.c:178 msgid "_About" msgstr "" #: ../main.c:178 msgid "About" msgstr "" #: ../main.c:198 msgid "Command to run tint2: " msgstr "" #: ../main.c:242 msgid "Theming tool for tint2 panel" msgstr "" #: ../main.c:244 msgid "" "Copyright 2009-2015 tint2 team\n" "Tint2 License GNU GPL version 2\n" "Tintwizard License GNU GPL version 3" msgstr "" #: ../main.c:249 msgid "translator-credits" msgstr "" #: ../main.c:258 msgid "Import theme(s)" msgstr "" #: ../main.c:293 msgid "Save default theme as" msgstr "" #: ../main.c:325 msgid "Select the theme to be saved." msgstr "" tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/properties.c000066400000000000000000006450421265276141000255220ustar00rootroot00000000000000/************************************************************************** * * Tint2conf * * Copyright (C) 2009 Thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 "main.h" #include "properties.h" #include "properties_rw.h" #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 #define DEFAULT_HOR_SPACING 5 GtkWidget *panel_width, *panel_height, *panel_margin_x, *panel_margin_y, *panel_padding_x, *panel_padding_y, *panel_spacing; GtkWidget *panel_wm_menu, *panel_dock, *panel_autohide, *panel_autohide_show_time, *panel_autohide_hide_time, *panel_autohide_size; GtkWidget *panel_combo_strut_policy, *panel_combo_layer, *panel_combo_width_type, *panel_combo_height_type, *panel_combo_monitor; GtkWidget *panel_window_name, *disable_transparency; GtkWidget *panel_mouse_effects; GtkWidget *mouse_hover_icon_opacity, *mouse_hover_icon_saturation, *mouse_hover_icon_brightness; GtkWidget *mouse_pressed_icon_opacity, *mouse_pressed_icon_saturation, *mouse_pressed_icon_brightness; GtkWidget *panel_primary_monitor_first; GtkListStore *panel_items, *all_items; GtkWidget *panel_items_view, *all_items_view; GtkWidget *screen_position[12]; GSList *screen_position_group; GtkWidget *panel_background; GtkWidget *notebook; // taskbar GtkWidget *taskbar_show_desktop, *taskbar_show_name, *taskbar_padding_x, *taskbar_padding_y, *taskbar_spacing; 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; GtkWidget *taskbar_name_font, *taskbar_name_font_set; GtkWidget *taskbar_active_background, *taskbar_inactive_background; GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks; // task GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down; GtkWidget *task_show_icon, *task_show_text, *task_align_center, *font_shadow; GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_spacing; GtkWidget *task_font, *task_font_set; GtkWidget *task_default_color, *task_default_color_set, *task_default_icon_opacity, *task_default_icon_osb_set, *task_default_icon_saturation, *task_default_icon_brightness, *task_default_background, *task_default_background_set; GtkWidget *task_normal_color, *task_normal_color_set, *task_normal_icon_opacity, *task_normal_icon_osb_set, *task_normal_icon_saturation, *task_normal_icon_brightness, *task_normal_background, *task_normal_background_set; GtkWidget *task_active_color, *task_active_color_set, *task_active_icon_opacity, *task_active_icon_osb_set, *task_active_icon_saturation, *task_active_icon_brightness, *task_active_background, *task_active_background_set; GtkWidget *task_urgent_color, *task_urgent_color_set, *task_urgent_icon_opacity, *task_urgent_icon_osb_set, *task_urgent_icon_saturation, *task_urgent_icon_brightness, *task_urgent_background, *task_urgent_background_set; GtkWidget *task_urgent_blinks; GtkWidget *task_iconified_color, *task_iconified_color_set, *task_iconified_icon_opacity, *task_iconified_icon_osb_set, *task_iconified_icon_saturation, *task_iconified_icon_brightness, *task_iconified_background, *task_iconified_background_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; GtkWidget *clock_font_line1, *clock_font_line1_set, *clock_font_line2, *clock_font_line2_set, *clock_font_color; GtkWidget *clock_background; // battery GtkWidget *battery_hide_if_higher, *battery_alert_if_lower, *battery_alert_cmd; GtkWidget *battery_padding_x, *battery_padding_y; GtkWidget *battery_font_line1, *battery_font_line1_set, *battery_font_line2, *battery_font_line2_set, *battery_font_color; GtkWidget *battery_background; GtkWidget *battery_tooltip; GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command; GtkWidget *ac_connected_cmd, *ac_disconnected_cmd; // systray GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing; GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_saturation, *systray_icon_brightness; GtkWidget *systray_background, *systray_monitor; // tooltip GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_set, *tooltip_font_color; GtkWidget *tooltip_task_show, *tooltip_show_after, *tooltip_hide_after; GtkWidget *clock_format_tooltip, *clock_tmz_tooltip; GtkWidget *tooltip_background; // Executors GArray *executors; // launcher GtkListStore *launcher_apps, *all_apps; GtkWidget *launcher_apps_view, *all_apps_view; GtkWidget *launcher_apps_dirs; GtkWidget *launcher_icon_size, *launcher_icon_theme, *launcher_padding_x, *launcher_padding_y, *launcher_spacing; GtkWidget *launcher_icon_opacity, *launcher_icon_saturation, *launcher_icon_brightness; GtkWidget *margin_x, *margin_y; GtkWidget *launcher_background, *launcher_icon_background; GtkWidget *startup_notifications; IconThemeWrapper *icon_theme; GtkWidget *launcher_tooltip; GtkWidget *launcher_icon_theme_override; GtkListStore *backgrounds; GtkWidget *current_background, *background_fill_color, *background_border_color, *background_fill_color_over, *background_border_color_over, *background_fill_color_press, *background_border_color_press, *background_border_width, *background_corner_radius; GtkWidget *addScrollBarToWidget(GtkWidget *widget); gboolean gtk_tree_model_iter_prev_tint2(GtkTreeModel *model, GtkTreeIter *iter); void change_paragraph(GtkWidget *widget); void create_general(GtkWidget *parent); void create_background(GtkWidget *parent); void background_duplicate(GtkWidget *widget, gpointer data); void background_delete(GtkWidget *widget, gpointer data); void background_update_image(int index); void background_update(GtkWidget *widget, gpointer data); void current_background_changed(GtkWidget *widget, gpointer data); void background_combo_changed(GtkWidget *widget, gpointer data); void create_panel(GtkWidget *parent); void create_panel_items(GtkWidget *parent); void create_launcher(GtkWidget *parent); gchar *get_default_theme_name(); void icon_theme_changed(); void load_icons(GtkListStore *apps); void create_taskbar(GtkWidget *parent); void create_task(GtkWidget *parent); void create_task_status(GtkWidget *notebook, char *name, char *text, GtkWidget **task_status_color, GtkWidget **task_status_color_set, GtkWidget **task_status_icon_opacity, GtkWidget **task_status_icon_osb_set, GtkWidget **task_status_icon_saturation, GtkWidget **task_status_icon_brightness, GtkWidget **task_status_background, GtkWidget **task_status_background_set); void create_execp(GtkWidget *parent, int i); void create_clock(GtkWidget *parent); void create_systemtray(GtkWidget *parent); void create_battery(GtkWidget *parent); void create_tooltip(GtkWidget *parent); void panel_add_item(GtkWidget *widget, gpointer data); void panel_remove_item(GtkWidget *widget, gpointer data); void panel_move_item_down(GtkWidget *widget, gpointer data); void panel_move_item_up(GtkWidget *widget, gpointer data); static gint compare_strings(gconstpointer a, gconstpointer b) { return strnatcasecmp((const char*)a, (const char*)b); } const gchar *get_default_font() { GtkSettings *settings = gtk_settings_get_default(); gchar *default_font; g_object_get(settings, "gtk-font-name", &default_font, NULL); if (default_font) return default_font; return "sans 10"; } void applyClicked(GtkWidget *widget, gpointer data) { gchar *file = get_current_theme_file_name(); if (file) { if (config_is_manual(file)) { gchar *backup_path = g_strdup_printf("%s.backup.%ld", file, time(NULL)); copy_file(file, backup_path); g_free(backup_path); } config_save_file(file); } int unused = system("killall -SIGUSR1 tint2 || pkill -SIGUSR1 -x tint2"); (void)unused; g_free(file); g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL); } void cancelClicked(GtkWidget *widget, gpointer data) { GtkWidget *view = (GtkWidget *)data; gtk_widget_destroy(view); } void okClicked(GtkWidget *widget, gpointer data) { applyClicked(widget, data); cancelClicked(widget, data); } void font_set_callback(GtkWidget *widget, gpointer data) { gtk_widget_set_sensitive(data, GTK_TOGGLE_BUTTON(widget)->active); } GtkWidget *create_properties() { GtkWidget *view, *dialog_vbox3, *button; GtkTooltips *tooltips; GtkWidget *page_panel, *page_panel_items, *page_launcher, *page_taskbar, *page_battery, *page_clock, *page_tooltip, *page_systemtray, *page_task, *page_background; GtkWidget *label; tooltips = gtk_tooltips_new(); (void) tooltips; executors = g_array_new(FALSE, TRUE, sizeof(Executor)); // global layer view = gtk_dialog_new(); gtk_window_set_title(GTK_WINDOW(view), _("Properties")); gtk_window_set_modal(GTK_WINDOW(view), TRUE); gtk_window_set_default_size(GTK_WINDOW(view), 920, 600); gtk_window_set_skip_pager_hint(GTK_WINDOW(view), TRUE); gtk_window_set_type_hint(GTK_WINDOW(view), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox3 = GTK_DIALOG(view)->vbox; gtk_widget_show(dialog_vbox3); notebook = gtk_notebook_new(); gtk_widget_show(notebook); gtk_container_set_border_width(GTK_CONTAINER(notebook), 5); gtk_box_pack_start(GTK_BOX(dialog_vbox3), notebook, TRUE, TRUE, 6); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT); button = gtk_button_new_from_stock("gtk-apply"); gtk_widget_show(button); gtk_dialog_add_action_widget(GTK_DIALOG(view), button, GTK_RESPONSE_APPLY); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(applyClicked), NULL); GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); button = gtk_button_new_from_stock("gtk-cancel"); gtk_widget_show(button); gtk_dialog_add_action_widget(GTK_DIALOG(view), button, GTK_RESPONSE_CANCEL); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancelClicked), view); GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); button = gtk_button_new_from_stock("gtk-ok"); gtk_widget_show(button); gtk_dialog_add_action_widget(GTK_DIALOG(view), button, GTK_RESPONSE_OK); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(okClicked), view); GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); // notebook label = gtk_label_new(_("Backgrounds")); gtk_widget_show(label); page_background = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_background), 10); gtk_widget_show(page_background); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_background), label); create_background(page_background); label = gtk_label_new(_("Panel")); gtk_widget_show(label); page_panel = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_panel), 10); gtk_widget_show(page_panel); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_panel), label); create_panel(page_panel); label = gtk_label_new(_("Panel items")); gtk_widget_show(label); page_panel_items = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_panel_items), 10); gtk_widget_show(page_panel_items); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_panel_items), label); create_panel_items(page_panel_items); label = gtk_label_new(_("Taskbar")); gtk_widget_show(label); page_taskbar = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_taskbar), 10); gtk_widget_show(page_taskbar); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_taskbar), label); create_taskbar(page_taskbar); label = gtk_label_new(_("Task buttons")); gtk_widget_show(label); page_task = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_task), 10); gtk_widget_show(page_task); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_task), label); create_task(page_task); label = gtk_label_new(_("Launcher")); gtk_widget_show(label); page_launcher = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_launcher), 10); gtk_widget_show(page_launcher); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_launcher), label); create_launcher(page_launcher); label = gtk_label_new(_("Clock")); gtk_widget_show(label); page_clock = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_clock), 10); gtk_widget_show(page_clock); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_clock), label); create_clock(page_clock); label = gtk_label_new(_("System tray")); gtk_widget_show(label); page_systemtray = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_systemtray), 10); gtk_widget_show(page_systemtray); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_systemtray), label); create_systemtray(page_systemtray); label = gtk_label_new(_("Battery")); gtk_widget_show(label); page_battery = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_battery), 10); gtk_widget_show(page_battery); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_battery), label); create_battery(page_battery); label = gtk_label_new(_("Tooltip")); gtk_widget_show(label); page_tooltip = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_tooltip), 10); gtk_widget_show(page_tooltip); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_tooltip), label); create_tooltip(page_tooltip); return view; } void change_paragraph(GtkWidget *widget) { GtkWidget *hbox; hbox = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(widget), hbox, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox), 6); } GtkWidget *create_background_combo(const char *label) { GtkWidget *combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(backgrounds)); GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "pixbuf", bgColPixbuf, NULL); renderer = gtk_cell_renderer_text_new(); g_object_set(renderer, "wrap-mode", PANGO_WRAP_WORD, NULL); g_object_set(renderer, "wrap-width", 300, NULL); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "text", bgColText, NULL); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(background_combo_changed), (void*)label); return combo; } void background_combo_changed(GtkWidget *widget, gpointer data) { gchar *combo_text = (gchar*)data; if (!combo_text || g_str_equal(combo_text, "")) return; int selected_index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); int index; for (index = 0; ; index++) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gboolean found = gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); if (!found) { break; } gchar *text; gtk_tree_model_get(GTK_TREE_MODEL(backgrounds), &iter, bgColText, &text, -1); gchar **parts = g_strsplit(text, ", ", -1); int ifound; for (ifound = 0; parts[ifound]; ifound++) { if (g_str_equal(parts[ifound], combo_text)) break; } if (parts[ifound] && index != selected_index) { for (; parts[ifound+1]; ifound++) { gchar *tmp = parts[ifound]; parts[ifound] = parts[ifound+1]; parts[ifound+1] = tmp; } g_free(parts[ifound]); parts[ifound] = NULL; text = g_strjoinv(", ", parts); g_strfreev(parts); gtk_list_store_set(backgrounds, &iter, bgColText, text, -1); g_free(text); } else if (!parts[ifound] && index == selected_index) { if (!ifound) { text = g_strdup(combo_text); } else { for (ifound = 0; parts[ifound]; ifound++) { if (compare_strings(combo_text, parts[ifound]) < 0) break; } if (parts[ifound]) { gchar *tmp = parts[ifound]; parts[ifound] = g_strconcat(combo_text, ", ", tmp, NULL); g_free(tmp); } else { ifound--; gchar *tmp = parts[ifound]; parts[ifound] = g_strconcat(tmp, ", ", combo_text, NULL); g_free(tmp); } text = g_strjoinv(", ", parts); g_strfreev(parts); } gtk_list_store_set(backgrounds, &iter, bgColText, text, -1); g_free(text); } } } void gdkColor2CairoColor(GdkColor color, double *red, double *green, double *blue) { *red = color.red / (double)0xffff; *green = color.green / (double)0xffff; *blue = color.blue / (double)0xffff; } void cairoColor2GdkColor(double red, double green, double blue, GdkColor *color) { color->pixel = 0; color->red = red * 0xffff; color->green = green * 0xffff; color->blue = blue * 0xffff; } void create_background(GtkWidget *parent) { backgrounds = gtk_list_store_new(bgNumCols, GDK_TYPE_PIXBUF, GDK_TYPE_COLOR, GTK_TYPE_INT, GDK_TYPE_COLOR, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_STRING, GDK_TYPE_COLOR, GTK_TYPE_INT, GDK_TYPE_COLOR, GTK_TYPE_INT, GDK_TYPE_COLOR, GTK_TYPE_INT, GDK_TYPE_COLOR, GTK_TYPE_INT); GtkWidget *table, *label, *button; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); table = gtk_table_new(1, 4, 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 = 0; label = gtk_label_new(_("Background")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; current_background = create_background_combo(NULL); gtk_widget_show(current_background); gtk_table_attach(GTK_TABLE(table), current_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, current_background, _("Selects the background you would like to modify"), NULL); button = gtk_button_new_from_stock("gtk-add"); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(background_duplicate), NULL); gtk_widget_show(button); gtk_table_attach(GTK_TABLE(table), button, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, button, _("Creates a copy of the current background"), NULL); button = gtk_button_new_from_stock("gtk-remove"); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(background_delete), NULL); gtk_widget_show(button); gtk_table_attach(GTK_TABLE(table), button, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, button, _("Deletes the current background"), NULL); table = gtk_table_new(4, 4, 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++, col = 2; label = gtk_label_new(_("Fill color")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_fill_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(background_fill_color), TRUE); gtk_widget_show(background_fill_color); gtk_table_attach(GTK_TABLE(table), background_fill_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_fill_color, _("The fill color of the current background"), NULL); row++, col = 2; label = gtk_label_new(_("Border color")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_border_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(background_border_color), TRUE); gtk_widget_show(background_border_color); gtk_table_attach(GTK_TABLE(table), background_border_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_border_color, _("The border color of the current background"), NULL); row++, col = 2; label = gtk_label_new(_("Fill color (mouse over)")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_fill_color_over = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(background_fill_color_over), TRUE); gtk_widget_show(background_fill_color_over); gtk_table_attach(GTK_TABLE(table), background_fill_color_over, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_fill_color_over, _("The fill color of the current background on mouse over"), NULL); row++, col = 2; label = gtk_label_new(_("Border color (mouse over)")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_border_color_over = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(background_border_color_over), TRUE); gtk_widget_show(background_border_color_over); gtk_table_attach(GTK_TABLE(table), background_border_color_over, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_border_color_over, _("The border color of the current background on mouse over"), NULL); row++, col = 2; label = gtk_label_new(_("Fill color (pressed)")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_fill_color_press = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(background_fill_color_press), TRUE); gtk_widget_show(background_fill_color_press); gtk_table_attach(GTK_TABLE(table), background_fill_color_press, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_fill_color_press, _("The fill color of the current background on mouse button press"), NULL); row++, col = 2; label = gtk_label_new(_("Border color (pressed)")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_border_color_press = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(background_border_color_press), TRUE); gtk_widget_show(background_border_color_press); gtk_table_attach(GTK_TABLE(table), background_border_color_press, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_border_color_press, _("The border color of the current background on mouse button press"), NULL); row++, col = 2; label = gtk_label_new(_("Border width")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_border_width = gtk_spin_button_new_with_range(0, 100, 1); gtk_widget_show(background_border_width); gtk_table_attach(GTK_TABLE(table), background_border_width, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_border_width, _("The width of the border of the current background, in pixels"), NULL); row++, col = 2; label = gtk_label_new(_("Corner radius")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; background_corner_radius = gtk_spin_button_new_with_range(0, 100, 1); gtk_widget_show(background_corner_radius); gtk_table_attach(GTK_TABLE(table), background_corner_radius, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, background_corner_radius, _("The corner radius of the current background"), NULL); g_signal_connect(G_OBJECT(current_background), "changed", G_CALLBACK(current_background_changed), NULL); g_signal_connect(G_OBJECT(background_fill_color), "color-set", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_border_color), "color-set", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_fill_color_over), "color-set", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_border_color_over), "color-set", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_fill_color_press), "color-set", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_border_color_press), "color-set", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_border_width), "value-changed", G_CALLBACK(background_update), NULL); g_signal_connect(G_OBJECT(background_corner_radius), "value-changed", G_CALLBACK(background_update), NULL); change_paragraph(parent); } int get_model_length(GtkTreeModel *model) { int i; for (i = 0; ; i++) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(i, -1); gboolean end = gtk_tree_model_get_iter(model, &iter, path); gtk_tree_path_free(path); if (!end) { return i; } } } int background_index_safe(int index) { if (index <= 0) index = 0; if (index >= get_model_length(GTK_TREE_MODEL(backgrounds))) index = 0; return index; } void background_create_new() { int r = 0; int b = 0; GdkColor fillColor; cairoColor2GdkColor(0, 0, 0, &fillColor); int fillOpacity = 0; GdkColor borderColor; cairoColor2GdkColor(0, 0, 0, &borderColor); int borderOpacity = 0; GdkColor fillColorOver; cairoColor2GdkColor(0, 0, 0, &fillColorOver); int fillOpacityOver = 0; GdkColor borderColorOver; cairoColor2GdkColor(0, 0, 0, &borderColorOver); int borderOpacityOver = 0; GdkColor fillColorPress; cairoColor2GdkColor(0, 0, 0, &fillColorPress); int fillOpacityPress = 0; GdkColor borderColorPress; cairoColor2GdkColor(0, 0, 0, &borderColorPress); int borderOpacityPress = 0; int index = 0; GtkTreeIter iter; gtk_list_store_append(backgrounds, &iter); gtk_list_store_set(backgrounds, &iter, bgColPixbuf, NULL, bgColFillColor, &fillColor, bgColFillOpacity, fillOpacity, bgColBorderColor, &borderColor, bgColBorderOpacity, borderOpacity, bgColBorderWidth, b, bgColCornerRadius, r, bgColFillColorOver, &fillColorOver, bgColFillOpacityOver, fillOpacityOver, bgColBorderColorOver, &borderColorOver, bgColBorderOpacityOver, borderOpacityOver, bgColFillColorPress, &fillColorPress, bgColFillOpacityPress, fillOpacityPress, bgColBorderColorPress, &borderColorPress, bgColBorderOpacityPress, borderOpacityPress, bgColText, "", -1); background_update_image(index); gtk_combo_box_set_active(GTK_COMBO_BOX(current_background), get_model_length(GTK_TREE_MODEL(backgrounds)) - 1); current_background_changed(0, 0); } void background_duplicate(GtkWidget *widget, gpointer data) { int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_background)); if (index < 0) { background_create_new(); return; } GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); int r; int b; GdkColor *fillColor; int fillOpacity; GdkColor *borderColor; int borderOpacity; GdkColor *fillColorOver; int fillOpacityOver; GdkColor *borderColorOver; int borderOpacityOver; GdkColor *fillColorPress; int fillOpacityPress; GdkColor *borderColorPress; int borderOpacityPress; gtk_tree_model_get(GTK_TREE_MODEL(backgrounds), &iter, bgColFillColor, &fillColor, bgColFillOpacity, &fillOpacity, bgColBorderColor, &borderColor, bgColBorderOpacity, &borderOpacity, bgColFillColorOver, &fillColorOver, bgColFillOpacityOver, &fillOpacityOver, bgColBorderColorOver, &borderColorOver, bgColBorderOpacityOver, &borderOpacityOver, bgColFillColorPress, &fillColorPress, bgColFillOpacityPress, &fillOpacityPress, bgColBorderColorPress, &borderColorPress, bgColBorderOpacityPress, &borderOpacityPress, bgColBorderWidth, &b, bgColCornerRadius, &r, -1); gtk_list_store_append(backgrounds, &iter); gtk_list_store_set(backgrounds, &iter, bgColPixbuf, NULL, bgColFillColor, fillColor, bgColFillOpacity, fillOpacity, bgColBorderColor, borderColor, bgColBorderOpacity, borderOpacity, bgColFillColorOver, fillColorOver, bgColFillOpacityOver, fillOpacityOver, bgColBorderColorOver, borderColorOver, bgColBorderOpacityOver, borderOpacityOver, bgColFillColorPress, fillColorPress, bgColFillOpacityPress, fillOpacityPress, bgColBorderColorPress, borderColorPress, bgColBorderOpacityPress, borderOpacityPress, bgColBorderWidth, b, bgColCornerRadius, r, bgColText, "" -1); g_boxed_free(GDK_TYPE_COLOR, fillColor); g_boxed_free(GDK_TYPE_COLOR, borderColor); g_boxed_free(GDK_TYPE_COLOR, fillColorOver); g_boxed_free(GDK_TYPE_COLOR, borderColorOver); g_boxed_free(GDK_TYPE_COLOR, fillColorPress); g_boxed_free(GDK_TYPE_COLOR, borderColorPress); background_update_image(get_model_length(GTK_TREE_MODEL(backgrounds)) - 1); gtk_combo_box_set_active(GTK_COMBO_BOX(current_background), get_model_length(GTK_TREE_MODEL(backgrounds)) - 1); } void background_delete(GtkWidget *widget, gpointer data) { int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_background)); if (index < 0) return; if (get_model_length(GTK_TREE_MODEL(backgrounds)) <= 1) return; GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); gtk_list_store_remove(backgrounds, &iter); if (index == get_model_length(GTK_TREE_MODEL(backgrounds))) index--; gtk_combo_box_set_active(GTK_COMBO_BOX(current_background), index); } void background_update_image(int index) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); int w = 70; int h = 30; int r; int b; GdkPixbuf *pixbuf; GdkColor *fillColor; int fillOpacity = 50; GdkColor *borderColor; int borderOpacity = 100; gtk_tree_model_get(GTK_TREE_MODEL(backgrounds), &iter, bgColFillColor, &fillColor, bgColFillOpacity, &fillOpacity, bgColBorderColor, &borderColor, bgColBorderOpacity, &borderOpacity, bgColBorderWidth, &b, bgColCornerRadius, &r, -1); double bg_r, bg_g, bg_b, bg_a; gdkColor2CairoColor(*fillColor, &bg_r, &bg_g, &bg_b); bg_a = fillOpacity / 100.0; double b_r, b_g, b_b, b_a; gdkColor2CairoColor(*borderColor, &b_r, &b_g, &b_b); b_a = borderOpacity / 100.0; g_boxed_free(GDK_TYPE_COLOR, fillColor); g_boxed_free(GDK_TYPE_COLOR, borderColor); GdkPixmap *pixmap = gdk_pixmap_new(NULL, w, h, 24); cairo_t *cr = gdk_cairo_create(pixmap); cairo_set_line_width(cr, b); cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); cairo_rectangle(cr, 0, 0, w, h); cairo_fill(cr); double degrees = 3.1415926 / 180.0; cairo_new_sub_path(cr); cairo_arc(cr, w - r - b, r + b, r, -90 * degrees, 0 * degrees); cairo_arc(cr, w - r - b, h - r - b, r, 0 * degrees, 90 * degrees); cairo_arc(cr, r + b, h - r - b, r, 90 * degrees, 180 * degrees); cairo_arc(cr, r + b, r + b, r, 180 * degrees, 270 * degrees); cairo_close_path(cr); cairo_set_source_rgba(cr, bg_r, bg_g, bg_b, bg_a); cairo_fill_preserve(cr); cairo_set_source_rgba(cr, b_r, b_g, b_b, b_a); cairo_set_line_width(cr, b); cairo_stroke(cr); cairo_destroy(cr); cr = NULL; pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, gdk_colormap_get_system(), 0, 0, 0, 0, w, h); if (pixmap) g_object_unref(pixmap); gtk_list_store_set(backgrounds, &iter, bgColPixbuf, pixbuf, -1); if (pixbuf) g_object_unref(pixbuf); } void background_force_update() { background_update(NULL, NULL); } void background_update(GtkWidget *widget, gpointer data) { int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_background)); if (index < 0) return; GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); int r; int b; r = gtk_spin_button_get_value(GTK_SPIN_BUTTON(background_corner_radius)); b = gtk_spin_button_get_value(GTK_SPIN_BUTTON(background_border_width)); GdkColor fillColor; int fillOpacity; GdkColor borderColor; int borderOpacity; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_fill_color), &fillColor); fillOpacity = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_fill_color)) * 100.0 / 0xffff); gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color), &borderColor); borderOpacity = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color)) * 100.0 / 0xffff); GdkColor fillColorOver; int fillOpacityOver; GdkColor borderColorOver; int borderOpacityOver; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_fill_color_over), &fillColorOver); fillOpacityOver = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_fill_color_over)) * 100.0 / 0xffff); gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color_over), &borderColorOver); borderOpacityOver = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color_over)) * 100.0 / 0xffff); GdkColor fillColorPress; int fillOpacityPress; GdkColor borderColorPress; int borderOpacityPress; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_fill_color_press), &fillColorPress); fillOpacityPress = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_fill_color_press)) * 100.0 / 0xffff); gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color_press), &borderColorPress); borderOpacityPress = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color_press)) * 100.0 / 0xffff); gtk_list_store_set(backgrounds, &iter, bgColPixbuf, NULL, bgColFillColor, &fillColor, bgColFillOpacity, fillOpacity, bgColBorderColor, &borderColor, bgColBorderOpacity, borderOpacity, bgColFillColorOver, &fillColorOver, bgColFillOpacityOver, fillOpacityOver, bgColBorderColorOver, &borderColorOver, bgColBorderOpacityOver, borderOpacityOver, bgColFillColorPress, &fillColorPress, bgColFillOpacityPress, fillOpacityPress, bgColBorderColorPress, &borderColorPress, bgColBorderOpacityPress, borderOpacityPress, bgColBorderWidth, b, bgColCornerRadius, r, -1); background_update_image(index); } void current_background_changed(GtkWidget *widget, gpointer data) { int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_background)); if (index < 0) return; GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); int r; int b; GdkColor *fillColor; int fillOpacity; GdkColor *borderColor; int borderOpacity; GdkColor *fillColorOver; int fillOpacityOver; GdkColor *borderColorOver; int borderOpacityOver; GdkColor *fillColorPress; int fillOpacityPress; GdkColor *borderColorPress; int borderOpacityPress; gtk_tree_model_get(GTK_TREE_MODEL(backgrounds), &iter, bgColFillColor, &fillColor, bgColFillOpacity, &fillOpacity, bgColBorderColor, &borderColor, bgColBorderOpacity, &borderOpacity, bgColFillColorOver, &fillColorOver, bgColFillOpacityOver, &fillOpacityOver, bgColBorderColorOver, &borderColorOver, bgColBorderOpacityOver, &borderOpacityOver, bgColFillColorPress, &fillColorPress, bgColFillOpacityPress, &fillOpacityPress, bgColBorderColorPress, &borderColorPress, bgColBorderOpacityPress, &borderOpacityPress, bgColBorderWidth, &b, bgColCornerRadius, &r, -1); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color), fillColor); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color), (fillOpacity*0xffff)/100); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color), borderColor); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color), (borderOpacity*0xffff)/100); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color_over), fillColorOver); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color_over), (fillOpacityOver*0xffff)/100); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_over), borderColorOver); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_over), (borderOpacityOver*0xffff)/100); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color_press), fillColorPress); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color_press), (fillOpacityPress*0xffff)/100); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_press), borderColorPress); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_press), (borderOpacityPress*0xffff)/100); gtk_spin_button_set_value(GTK_SPIN_BUTTON(background_border_width), b); gtk_spin_button_set_value(GTK_SPIN_BUTTON(background_corner_radius), r); g_boxed_free(GDK_TYPE_COLOR, fillColor); g_boxed_free(GDK_TYPE_COLOR, borderColor); g_boxed_free(GDK_TYPE_COLOR, fillColorOver); g_boxed_free(GDK_TYPE_COLOR, borderColorOver); g_boxed_free(GDK_TYPE_COLOR, fillColorPress); g_boxed_free(GDK_TYPE_COLOR, borderColorPress); } void create_panel(GtkWidget *parent) { int i; GtkWidget *table, *hbox, *position; GtkWidget *label; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); label = gtk_label_new(_("Geometry")); 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); hbox = gtk_hbox_new(FALSE, 20); gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0); table = gtk_table_new(2, 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(_("Position")); 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++; position = gtk_table_new(5, 5, FALSE); gtk_widget_show(position); for (i = 0; i < 12; ++i) { GSList *group = i == 0 ? NULL : gtk_radio_button_get_group(GTK_RADIO_BUTTON(screen_position[0])); screen_position[i] = gtk_radio_button_new(group); g_object_set(screen_position[i], "draw-indicator", FALSE, NULL); gtk_widget_show(screen_position[i]); if (i <= 2 || i >= 9) { gtk_widget_set_size_request(screen_position[i], 30, 15); } else { gtk_widget_set_size_request(screen_position[i], 15, 25); } } gtk_table_attach_defaults(GTK_TABLE(position), screen_position[0], 1, 2, 0, 1); gtk_tooltips_set_tip(tooltips, screen_position[0], _("Position on screen: top-left, horizontal panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[1], 2, 3, 0, 1); gtk_tooltips_set_tip(tooltips, screen_position[1], _("Position on screen: top-center, horizontal panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[2], 3, 4, 0, 1); gtk_tooltips_set_tip(tooltips, screen_position[2], _("Position on screen: top-right, horizontal panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[3], 0, 1, 1, 2); gtk_tooltips_set_tip(tooltips, screen_position[3], _("Position on screen: top-left, vertical panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[4], 0, 1, 2, 3); gtk_tooltips_set_tip(tooltips, screen_position[4], _("Position on screen: center-left, vertical panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[5], 0, 1, 3, 4); gtk_tooltips_set_tip(tooltips, screen_position[5], _("Position on screen: bottom-left, vertical panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[6], 4, 5, 1, 2); gtk_tooltips_set_tip(tooltips, screen_position[6], _("Position on screen: top-right, vertical panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[7], 4, 5, 2, 3); gtk_tooltips_set_tip(tooltips, screen_position[7], _("Position on screen: center-right, vertical panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[8], 4, 5, 3, 4); gtk_tooltips_set_tip(tooltips, screen_position[8], _("Position on screen: bottom-right, vertical panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[9], 1, 2, 4, 5); gtk_tooltips_set_tip(tooltips, screen_position[9], _("Position on screen: bottom-left, horizontal panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[10], 2, 3, 4, 5); gtk_tooltips_set_tip(tooltips, screen_position[10], _("Position on screen: bottom-center, horizontal panel"), NULL); gtk_table_attach_defaults(GTK_TABLE(position), screen_position[11], 3, 4, 4, 5); gtk_tooltips_set_tip(tooltips, screen_position[11], _("Position on screen: bottom-right, horizontal panel"), NULL); gtk_table_attach(GTK_TABLE(table), position, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); row++; col = 2; label = gtk_label_new(_("Monitor")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_combo_monitor = gtk_combo_box_new_text(); gtk_widget_show(panel_combo_monitor); gtk_table_attach(GTK_TABLE(table), panel_combo_monitor, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("All")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("1")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("2")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("3")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("4")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("5")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_monitor), _("6")); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_monitor), 0); gtk_tooltips_set_tip(tooltips, panel_combo_monitor, _("The monitor on which the panel is placed"), NULL); row++; col = 2; label = gtk_label_new(_("Primary monitor first")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_primary_monitor_first = gtk_check_button_new(); gtk_widget_show(panel_primary_monitor_first); gtk_table_attach(GTK_TABLE(table), panel_primary_monitor_first, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_primary_monitor_first, _("If enabled, the primary monitor will have index 1 in the monitor list even if it is not top-left."), NULL); row++; col = 2; label = gtk_label_new(_("Length")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_width = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(panel_width); gtk_table_attach(GTK_TABLE(table), panel_width, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_width, _("The length of the panel (width for horizontal panels, height for vertical panels)"), NULL); panel_combo_width_type = gtk_combo_box_new_text(); gtk_widget_show(panel_combo_width_type); gtk_table_attach(GTK_TABLE(table), panel_combo_width_type, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_width_type), _("Percent")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_width_type), _("Pixels")); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 0); gtk_tooltips_set_tip(tooltips, panel_combo_width_type, _("The units used to specify the length of the panel: pixels or percentage of the monitor size"), NULL); row++; col = 2; label = gtk_label_new(_("Size")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_height = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(panel_height); gtk_table_attach(GTK_TABLE(table), panel_height, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_height, _("The size of the panel (height for horizontal panels, width for vertical panels)"), NULL); panel_combo_height_type = gtk_combo_box_new_text(); gtk_widget_show(panel_combo_height_type); gtk_table_attach(GTK_TABLE(table), panel_combo_height_type, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_height_type), _("Percent")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_height_type), _("Pixels")); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_height_type), 0); gtk_tooltips_set_tip(tooltips, panel_combo_height_type, _("The units used to specify the size of the panel: pixels or percentage of the monitor size"), NULL); row++; col = 2; label = gtk_label_new(_("Horizontal margin")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_margin_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(panel_margin_x); gtk_table_attach(GTK_TABLE(table), panel_margin_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_margin_x, _("Creates a space between the panel and the edge of the monitor. " "For left-aligned panels, the space is created on the right of the panel; " "for right-aligned panels, it is created on the left; " "for centered panels, it is evenly distributed on both sides of the panel."), NULL); row++; col = 2; label = gtk_label_new(_("Vertical margin")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_margin_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(panel_margin_y); gtk_table_attach(GTK_TABLE(table), panel_margin_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_margin_y, _("Creates a space between the panel and the edge of the monitor. " "For top-aligned panels, the space is created on the bottom of the panel; " "for bottom-aligned panels, it is created on the top; " "for centered panels, it is evenly distributed on both sides of the panel."), NULL); change_paragraph(parent); label = gtk_label_new(_("Appearance")); 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(2, 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(_("Background")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_background = create_background_combo(_("Panel")); gtk_widget_show(panel_background); gtk_table_attach(GTK_TABLE(table), panel_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_background, _("Selects the background used to display the panel. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++; col = 2; label = gtk_label_new(_("Horizontal padding")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(panel_padding_x); gtk_table_attach(GTK_TABLE(table), panel_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_padding_x, _("Specifies the horizontal padding of the panel. " "This is the space between the border of the panel and the elements inside."), NULL); row++; col = 2; label = gtk_label_new(_("Vertical padding")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(panel_padding_y); gtk_table_attach(GTK_TABLE(table), panel_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_padding_y, _("Specifies the vertical padding of the panel. " "This is the space between the border of the panel and the elements inside."), NULL); row++; col = 2; label = gtk_label_new(_("Spacing")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_spacing = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(panel_spacing); gtk_table_attach(GTK_TABLE(table), panel_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_spacing, _("Specifies the spacing between elements inside the panel."), NULL); row++; col = 2; label = gtk_label_new(_("Ignore compositor")); 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++; disable_transparency = gtk_check_button_new(); gtk_widget_show(disable_transparency); gtk_table_attach(GTK_TABLE(table), disable_transparency, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, disable_transparency, _("If enabled, the compositor will not be used to draw a transparent panel. " "May fix display corruption problems on broken graphics stacks."), NULL); row++, col = 2; label = gtk_label_new(_("Font shadows")); 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++; font_shadow = gtk_check_button_new(); gtk_widget_show(font_shadow); gtk_table_attach(GTK_TABLE(table), font_shadow, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, font_shadow, _("If enabled, a shadow will be drawn behind text. " "This may improve legibility on transparent panels."), NULL); row++; col = 2; label = gtk_label_new(_("Mouse effects")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_mouse_effects = gtk_check_button_new(); gtk_widget_show(panel_mouse_effects); gtk_table_attach(GTK_TABLE(table), panel_mouse_effects, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_mouse_effects, _("Clickable interface items change appearance when the mouse is moved over them."), NULL); row++; col = 2; label = gtk_label_new(_("Icon opacity (hovered)")); 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++; mouse_hover_icon_opacity = gtk_spin_button_new_with_range(0, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_hover_icon_opacity), 100); gtk_widget_show(mouse_hover_icon_opacity); gtk_table_attach(GTK_TABLE(table), mouse_hover_icon_opacity, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, mouse_hover_icon_opacity, _("Specifies the opacity adjustment of the icons under the mouse, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon saturation (hovered)")); 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++; mouse_hover_icon_saturation = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_hover_icon_saturation), 0); gtk_widget_show(mouse_hover_icon_saturation); gtk_table_attach(GTK_TABLE(table), mouse_hover_icon_saturation, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, mouse_hover_icon_saturation, _("Specifies the saturation adjustment of the icons under the mouse, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon brightness (hovered)")); 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++; mouse_hover_icon_brightness = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_hover_icon_brightness), 10); gtk_widget_show(mouse_hover_icon_brightness); gtk_table_attach(GTK_TABLE(table), mouse_hover_icon_brightness, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, mouse_hover_icon_brightness, _("Specifies the brightness adjustment of the icons under the mouse, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon opacity (pressed)")); 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++; mouse_pressed_icon_opacity = gtk_spin_button_new_with_range(0, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_pressed_icon_opacity), 100); gtk_widget_show(mouse_pressed_icon_opacity); gtk_table_attach(GTK_TABLE(table), mouse_pressed_icon_opacity, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, mouse_pressed_icon_opacity, _("Specifies the opacity adjustment of the icons on mouse button press, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon saturation (pressed)")); 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++; mouse_pressed_icon_saturation = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_pressed_icon_saturation), 0); gtk_widget_show(mouse_pressed_icon_saturation); gtk_table_attach(GTK_TABLE(table), mouse_pressed_icon_saturation, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, mouse_pressed_icon_saturation, _("Specifies the saturation adjustment of the icons on mouse button press, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon brightness (pressed)")); 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++; mouse_pressed_icon_brightness = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_pressed_icon_brightness), 0); gtk_widget_show(mouse_pressed_icon_brightness); gtk_table_attach(GTK_TABLE(table), mouse_pressed_icon_brightness, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, mouse_pressed_icon_brightness, _("Specifies the brightness adjustment of the icons on mouse button press, in percent."), NULL); change_paragraph(parent); label = gtk_label_new(_("Autohide")); 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(2, 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(_("Autohide")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_autohide = gtk_check_button_new(); gtk_widget_show(panel_autohide); gtk_table_attach(GTK_TABLE(table), panel_autohide, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_autohide, _("If enabled, the panel is hidden when the mouse cursor leaves the panel."), NULL); row++; col = 2; label = gtk_label_new(_("Show panel after")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_autohide_show_time = gtk_spin_button_new_with_range(0, 10000, 0.1); gtk_widget_show(panel_autohide_show_time); gtk_table_attach(GTK_TABLE(table), panel_autohide_show_time, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_autohide_show_time, _("Specifies a delay after which the panel is shown when the mouse cursor enters the panel."), NULL); label = gtk_label_new(_("seconds")); 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++; row++; col = 2; label = gtk_label_new(_("Hidden size")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_autohide_size = gtk_spin_button_new_with_range(1, 500, 1); gtk_widget_show(panel_autohide_size); gtk_table_attach(GTK_TABLE(table), panel_autohide_size, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_autohide_size, _("Specifies the size of the panel when hidden, in pixels."), NULL); row++; col = 2; label = gtk_label_new(_("Hide panel after")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_autohide_hide_time = gtk_spin_button_new_with_range(0, 10000, 0.1); gtk_widget_show(panel_autohide_hide_time); gtk_table_attach(GTK_TABLE(table), panel_autohide_hide_time, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_autohide_hide_time, _("Specifies a delay after which the panel is hidden when the mouse cursor leaves the panel."), NULL); label = gtk_label_new(_("seconds")); 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++; change_paragraph(parent); label = gtk_label_new(_("Window manager interaction")); 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(2, 12, 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(_("Forward mouse events")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_wm_menu = gtk_check_button_new(); gtk_widget_show(panel_wm_menu); gtk_table_attach(GTK_TABLE(table), panel_wm_menu, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_wm_menu, _("If enabled, mouse events not handled by panel elements are forwarded to the desktop. " "Useful on desktop environments that show a start menu when right clicking the desktop, " "or switch the desktop when rotating the mouse wheel over the desktop."), NULL); row++; col = 2; label = gtk_label_new(_("Place panel in dock")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_dock = gtk_check_button_new(); gtk_widget_show(panel_dock); gtk_table_attach(GTK_TABLE(table), panel_dock, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_dock, _("If enabled, places the panel in the dock area of the window manager. " "Windows placed in the dock are usually treated differently than normal windows. " "The exact behavior depends on the window manager and its configuration."), NULL); row++; col = 2; label = gtk_label_new(_("Panel layer")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_combo_layer = gtk_combo_box_new_text(); gtk_widget_show(panel_combo_layer); gtk_table_attach(GTK_TABLE(table), panel_combo_layer, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_layer), _("Top")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_layer), _("Normal")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_layer), _("Bottom")); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 1); gtk_tooltips_set_tip(tooltips, panel_combo_layer, _("Specifies the layer on which the panel window should be placed. \n" "Top means the panel should always cover other windows. \n" "Bottom means other windows should always cover the panel. \n" "Normal means that other windows may or may not cover the panel, depending on which has focus. \n" "Note that some window managers prevent this option from working correctly if the panel is placed in the dock."), NULL); row++; col = 2; label = gtk_label_new(_("Maximized windows")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_combo_strut_policy = gtk_combo_box_new_text(); gtk_widget_show(panel_combo_strut_policy); gtk_table_attach(GTK_TABLE(table), panel_combo_strut_policy, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_strut_policy), _("Match the panel size")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_strut_policy), _("Match the hidden panel size")); gtk_combo_box_append_text(GTK_COMBO_BOX(panel_combo_strut_policy), _("Fill the screen")); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 0); gtk_tooltips_set_tip(tooltips, panel_combo_strut_policy, _("Specifies the size of maximized windows. \n" "Match the panel size means that maximized windows should extend to the edge of the panel. \n" "Match the hidden panel size means that maximized windows should extend to the edge of the panel when hidden; " "when visible, the panel and the windows will overlap. \n" "Fill the screen means that maximized windows will always have the same size as the screen. \n" "\n" "Note: on multi-monitor (Xinerama) setups, the panel must be placed at the edge (not in the middle) " "of the virtual screen for this to work correctly."), NULL); row++; col = 2; label = gtk_label_new(_("Window name")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; panel_window_name = gtk_entry_new(); gtk_widget_show(panel_window_name); gtk_entry_set_width_chars(GTK_ENTRY(panel_window_name), 28); gtk_entry_set_text(GTK_ENTRY(panel_window_name), "tint2"); gtk_table_attach(GTK_TABLE(table), panel_window_name, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, panel_window_name, _("Specifies the name of the panel window. " "This is useful if you want to configure special treatment of tint2 windows in your " "window manager or compositor."), NULL); change_paragraph(parent); } void create_panel_items(GtkWidget *parent) { GtkWidget *table, *label, *button, *image; GtkTooltips *tooltips = gtk_tooltips_new(); panel_items = gtk_list_store_new(itemsNumCols, G_TYPE_STRING, G_TYPE_STRING); all_items = gtk_list_store_new(itemsNumCols, G_TYPE_STRING, G_TYPE_STRING); GtkTreeIter iter; gtk_list_store_append(all_items, &iter); gtk_list_store_set(all_items, &iter, itemsColName, _("Battery"), itemsColValue, "B", -1); gtk_list_store_append(all_items, &iter); gtk_list_store_set(all_items, &iter, itemsColName, _("Clock"), itemsColValue, "C", -1); gtk_list_store_append(all_items, &iter); gtk_list_store_set(all_items, &iter, itemsColName, _("System tray"), itemsColValue, "S", -1); gtk_list_store_append(all_items, &iter); gtk_list_store_set(all_items, &iter, itemsColName, _("Taskbar"), itemsColValue, "T", -1); gtk_list_store_append(all_items, &iter); gtk_list_store_set(all_items, &iter, 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); gtk_list_store_append(all_items, &iter); gtk_list_store_set(all_items, &iter, itemsColName, _("Executor"), itemsColValue, "E", -1); panel_items_view = gtk_tree_view_new(); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(panel_items_view), -1, "", gtk_cell_renderer_text_new(), "text", itemsColName, NULL); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(panel_items_view), FALSE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(panel_items_view)), GTK_SELECTION_SINGLE); gtk_tree_view_set_model(GTK_TREE_VIEW(panel_items_view), GTK_TREE_MODEL(panel_items)); g_object_unref(panel_items); gtk_tooltips_set_tip(tooltips, panel_items_view, _("Specifies the elements that will appear in the panel and their order. " "Elements can be added by selecting them in the list of available elements, then clicking on " "the add left button."), NULL); all_items_view = gtk_tree_view_new(); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(all_items_view), -1, "", gtk_cell_renderer_text_new(), "text", itemsColName, NULL); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(all_items_view), FALSE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(all_items_view)), GTK_SELECTION_SINGLE); gtk_tree_view_set_model(GTK_TREE_VIEW(all_items_view), GTK_TREE_MODEL(all_items)); g_object_unref(all_items); gtk_tooltips_set_tip(tooltips, all_items_view, _("Lists all the possible elements that can appear in the panel. " "Elements can be added to the panel by selecting them, then clicking on " "the add left button."), NULL); table = gtk_table_new(2, 3, 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); label = gtk_label_new(_("Elements selected")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); label = gtk_label_new(_("Elements available")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); GtkWidget *vbox; vbox = gtk_vbox_new(FALSE, 0); gtk_widget_show(vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(panel_move_item_up), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Moves up the current element in the list of selected elements."), NULL); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(panel_move_item_down), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Moves down the current element in the list of selected elements."), NULL); label = gtk_label_new(_(" ")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_BACK, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(panel_add_item), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Copies the current element in the list of available elements to the list of selected elements."), NULL); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(panel_remove_item), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Removes the current element from the list of selected elements."), NULL); gtk_table_attach(GTK_TABLE(table), vbox, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show(panel_items_view); gtk_table_attach(GTK_TABLE(table), addScrollBarToWidget(panel_items_view), 0, 1, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); gtk_widget_show(all_items_view); gtk_table_attach(GTK_TABLE(table), addScrollBarToWidget(all_items_view), 2, 3, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); change_paragraph(parent); } gboolean panel_contains(const char *value) { GtkTreeModel *model = GTK_TREE_MODEL(panel_items); GtkTreeIter i; if (!gtk_tree_model_get_iter_first(model, &i)) { return FALSE; } while (1) { gchar *v; gtk_tree_model_get(model, &i, itemsColValue, &v, -1); if (g_str_equal(value, v)) { return TRUE; } if (!gtk_tree_model_iter_next(model, &i)) { break; } } return FALSE; } char *get_panel_items() { char *result = calloc(1, 256 * sizeof(char)); GtkTreeModel *model = GTK_TREE_MODEL(panel_items); GtkTreeIter i; if (!gtk_tree_model_get_iter_first(model, &i)) { return FALSE; } while (1) { gchar *v; gtk_tree_model_get(model, &i, itemsColValue, &v, -1); strcat(result, v); if (!gtk_tree_model_iter_next(model, &i)) { break; } } return result; } void set_panel_items(const char *items) { gtk_list_store_clear(panel_items); int execp_index = -1; for (; items && *items; items++) { const char *value = NULL; const char *name = NULL; char buffer[256]; char v = *items; if (v == 'B') { value = "B"; name = _("Battery"); } else if (v == 'C') { value = "C"; name = _("Clock"); } else if (v == 'S') { value = "S"; name = _("System tray"); } else if (v == 'T') { value = "T"; name = _("Taskbar"); } else if (v == 'L') { value = "L"; name = _("Launcher"); } else if (v == 'F') { value = "F"; name = _("Free space"); } else if (v == 'E') { execp_index++; buffer[0] = 0; sprintf(buffer, "%s %d", _("Executor"), execp_index + 1); name = buffer; value = "E"; } else { continue; } GtkTreeIter iter; gtk_list_store_append(panel_items, &iter); gtk_list_store_set(panel_items, &iter, itemsColName, name, itemsColValue, value, -1); } } void panel_add_item(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(all_items_view)), &model, &iter)) { gchar *name; gchar *value; gtk_tree_model_get(model, &iter, itemsColName, &name, itemsColValue, &value, -1); if (!panel_contains(value) || g_str_equal(value, "E")) { GtkTreeIter iter; gtk_list_store_append(panel_items, &iter); gtk_list_store_set(panel_items, &iter, itemsColName, g_strdup(name), itemsColValue, g_strdup(value), -1); if (g_str_equal(value, "E")) { execp_create_new(); } } } execp_update_indices(); } void panel_remove_item(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(panel_items_view)), &model, &iter)) { gchar *name; gchar *value; gtk_tree_model_get(model, &iter, itemsColName, &name, itemsColValue, &value, -1); if (g_str_equal(value, "E")) { for (int i = 0; i < executors->len; i++) { Executor *executor = &g_array_index(executors, Executor, i); if (g_str_equal(name, executor->name)) { execp_remove(i); break; } } } gtk_list_store_remove(panel_items, &iter); } execp_update_indices(); } void panel_move_item_down(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(panel_items_view)), &model, &iter)) { GtkTreeIter next = iter; if (gtk_tree_model_iter_next(model, &next)) { gchar *name1; gchar *value1; gtk_tree_model_get(model, &iter, itemsColName, &name1, itemsColValue, &value1, -1); gchar *name2; gchar *value2; gtk_tree_model_get(model, &next, itemsColName, &name2, itemsColValue, &value2, -1); if (g_str_equal(value1, "E") && g_str_equal(value2, "E")) { Executor *executor1 = NULL; Executor *executor2 = NULL; for (int i = 0; i < executors->len; i++) { Executor *executor = &g_array_index(executors, Executor, i); if (g_str_equal(name1, executor->name)) { executor1 = executor; } if (g_str_equal(name2, executor->name)) { executor2 = executor; } } Executor tmp = *executor1; *executor1 = *executor2; *executor2 = tmp; } gtk_list_store_swap(panel_items, &iter, &next); } } execp_update_indices(); } void panel_move_item_up(GtkWidget *widget, gpointer data) { { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(panel_items_view)), &model, &iter)) { GtkTreeIter prev = iter; if (gtk_tree_model_iter_prev_tint2(model, &prev)) { gchar *name1; gchar *value1; gtk_tree_model_get(model, &iter, itemsColName, &name1, itemsColValue, &value1, -1); gchar *name2; gchar *value2; gtk_tree_model_get(model, &prev, itemsColName, &name2, itemsColValue, &value2, -1); if (g_str_equal(value1, "E") && g_str_equal(value2, "E")) { Executor *executor1 = NULL; Executor *executor2 = NULL; for (int i = 0; i < executors->len; i++) { Executor *executor = &g_array_index(executors, Executor, i); if (g_str_equal(name1, executor->name)) { executor1 = executor; } if (g_str_equal(name2, executor->name)) { executor2 = executor; } } Executor tmp = *executor1; *executor1 = *executor2; *executor2 = tmp; } gtk_list_store_swap(panel_items, &iter, &prev); } } } execp_update_indices(); } enum { iconsColName = 0, iconsColDescr, iconsNumCols }; GtkListStore *icon_themes; void launcher_add_app(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(all_apps_view)), &model, &iter)) { GdkPixbuf *pixbuf; gchar *name; gchar *path; gchar *iconName; gtk_tree_model_get(model, &iter, appsColIcon, &pixbuf, appsColText, &name, appsColPath, &path, appsColIconName, &iconName, -1); GtkTreeIter iter; gtk_list_store_append(launcher_apps, &iter); gtk_list_store_set(launcher_apps, &iter, appsColIcon, pixbuf, appsColText, g_strdup(name), appsColPath, g_strdup(path), appsColIconName, g_strdup(iconName), -1); if (pixbuf) g_object_unref(pixbuf); } } void launcher_remove_app(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(launcher_apps_view)), &model, &iter)) { gtk_list_store_remove(launcher_apps, &iter); } } void launcher_move_app_down(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(launcher_apps_view)), &model, &iter)) { GtkTreeIter next = iter; if (gtk_tree_model_iter_next(model, &next)) { gtk_list_store_swap(launcher_apps, &iter, &next); } } } void launcher_move_app_up(GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(launcher_apps_view)), &model, &iter)) { GtkTreeIter prev = iter; if (gtk_tree_model_iter_prev_tint2(model, &prev)) { gtk_list_store_swap(launcher_apps, &iter, &prev); } } } gboolean gtk_tree_model_iter_prev_tint2(GtkTreeModel *model, GtkTreeIter *iter) { GtkTreeIter i; if (!gtk_tree_model_get_iter_first(model, &i)) { return FALSE; } GtkTreePath *piter = gtk_tree_model_get_path(model, iter); if (!piter) return FALSE; while (1) { GtkTreeIter next = i; if (gtk_tree_model_iter_next(model, &next)) { GtkTreePath *pn = gtk_tree_model_get_path(model, &next); if (!pn) continue; if (gtk_tree_path_compare(piter, pn) == 0) { gtk_tree_path_free(piter); gtk_tree_path_free(pn); *iter = i; return TRUE; } gtk_tree_path_free(pn); i = next; } else { break; } } gtk_tree_path_free(piter); return FALSE; } // Note: the returned pointer must be released with g_free! gchar *get_current_icon_theme() { int index = gtk_combo_box_get_active(GTK_COMBO_BOX(launcher_icon_theme)); if (index <= 0) { return NULL; } GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gtk_tree_model_get_iter(GTK_TREE_MODEL(icon_themes), &iter, path); gtk_tree_path_free(path); gchar *name; gtk_tree_model_get(GTK_TREE_MODEL(icon_themes), &iter, iconsColName, &name, -1); return name; } void set_current_icon_theme(const char *theme) { int i; for (i = 0; ; i++) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(i, -1); gboolean end = gtk_tree_model_get_iter(GTK_TREE_MODEL(icon_themes), &iter, path); gtk_tree_path_free(path); if (!end) { break; } gchar *name; gtk_tree_model_get(GTK_TREE_MODEL(icon_themes), &iter, iconsColName, &name, -1); if (g_str_equal(name, theme)) { gtk_combo_box_set_active(GTK_COMBO_BOX(launcher_icon_theme), i); g_free(name); break; } g_free(name); } } void icon_theme_changed() { if (icon_theme) free_themes(icon_theme); gchar *icon_theme_name = get_current_icon_theme(); if (!icon_theme_name || g_str_equal(icon_theme_name, "")) { g_free(icon_theme_name); icon_theme_name = get_default_theme_name(); } icon_theme = load_themes(icon_theme_name); g_free(icon_theme_name); load_icons(launcher_apps); load_icons(all_apps); } void launcher_icon_theme_changed(GtkWidget *widget, gpointer data) { icon_theme_changed(); } GdkPixbuf *load_icon(const gchar *name) { int size = 22; char *path = get_icon_path(icon_theme, name, size); GdkPixbuf *pixbuf = path ? gdk_pixbuf_new_from_file_at_size(path, size, size, NULL) : NULL; free(path); return pixbuf; } void load_icons(GtkListStore *apps) { int i; for (i = 0; ; i++) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(i, -1); gboolean found = gtk_tree_model_get_iter(GTK_TREE_MODEL(apps), &iter, path); gtk_tree_path_free(path); if (!found) break; gchar *iconName; gtk_tree_model_get(GTK_TREE_MODEL(apps), &iter, appsColIconName, &iconName, -1); GdkPixbuf *pixbuf = load_icon(iconName); gtk_list_store_set(apps, &iter, appsColIcon, pixbuf, -1); if (pixbuf) g_object_unref(pixbuf); g_free(iconName); } } void load_desktop_file(const char *file, gboolean selected) { DesktopEntry entry; if (read_desktop_file(file, &entry)) { 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(file), appsColIconName, g_strdup(entry.icon), -1); if (pixbuf) g_object_unref(pixbuf); } else { printf("Could not load %s\n", file); GtkTreeIter iter; gtk_list_store_append(selected ? launcher_apps : all_apps, &iter); gtk_list_store_set(selected ? launcher_apps :all_apps, &iter, appsColIcon, NULL, appsColText, g_strdup(file), appsColPath, g_strdup(file), appsColIconName, g_strdup(""), -1); } free_desktop_entry(&entry); } 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); } 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) { 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_list_free(files); } void load_theme_file(const char *file_name, const char *theme) { if (!file_name || !theme) { return; } FILE *f; if ((f = fopen(file_name, "rt")) == NULL) { return; } char *line = NULL; size_t line_size; while (getline(&line, &line_size, f) >= 0) { char *key, *value; int line_len = strlen(line); if (line_len >= 1) { if (line[line_len - 1] == '\n') { line[line_len - 1] = '\0'; line_len--; } } if (line_len == 0) continue; if (parse_theme_line(line, &key, &value)) { if (strcmp(key, "Name") == 0) { // value is like Tango GtkTreeIter iter; gtk_list_store_append(icon_themes, &iter); gtk_list_store_set(icon_themes, &iter, iconsColName, g_strdup(theme), iconsColDescr, g_strdup(value), -1); } } if (line[0] == '[' && line[line_len - 1] == ']' && strcmp(line, "[Icon Theme]") != 0) { break; } } fclose(f); free(line); } void load_icon_themes(const gchar *path, const gchar *parent) { 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 (parent && g_file_test(file, G_FILE_TEST_IS_REGULAR) && g_str_equal(name, "index.theme")) { load_theme_file(file, parent); } else if (g_file_test(file, G_FILE_TEST_IS_DIR)) { load_icon_themes(file, name); } g_free(file); } g_dir_close(d); } gchar *get_default_theme_name() { gchar *name = NULL; g_object_get(gtk_settings_get_default(), "gtk-icon-theme-name", &name, NULL); if (!name) { name = g_strdup("hicolor"); } return name; } GtkWidget *addScrollBarToWidget(GtkWidget *widget) { GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), widget); gtk_widget_set_size_request(scrolled_window, 100, 300); gtk_widget_show(widget); gtk_widget_show(scrolled_window); return scrolled_window; } void create_launcher(GtkWidget *parent) { GtkWidget *image; GtkTooltips *tooltips = gtk_tooltips_new(); icon_theme = NULL; launcher_apps = gtk_list_store_new(appsNumCols, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); all_apps = gtk_list_store_new(appsNumCols, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); icon_themes = gtk_list_store_new(iconsNumCols, G_TYPE_STRING, G_TYPE_STRING); launcher_apps_view = gtk_tree_view_new(); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(launcher_apps_view), -1, "", gtk_cell_renderer_pixbuf_new(), "pixbuf", appsColIcon, NULL); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(launcher_apps_view), -1, "", gtk_cell_renderer_text_new(), "text", appsColText, NULL); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(launcher_apps_view), FALSE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(launcher_apps_view)), GTK_SELECTION_SINGLE); gtk_tree_view_set_model(GTK_TREE_VIEW(launcher_apps_view), GTK_TREE_MODEL(launcher_apps)); g_object_unref(launcher_apps); gtk_tooltips_set_tip(tooltips, launcher_apps_view, _("Specifies the application launchers that will appear in the launcher and their order. " "Launchers can be added by selecting an item in the list of available applications, then clicking on " "the add left button."), NULL); all_apps_view = gtk_tree_view_new(); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(all_apps_view), -1, "", gtk_cell_renderer_pixbuf_new(), "pixbuf", appsColIcon, NULL); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(all_apps_view), -1, "", gtk_cell_renderer_text_new(), "text", appsColText, NULL); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(all_apps_view), FALSE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(all_apps_view)), GTK_SELECTION_SINGLE); gtk_tree_view_set_model(GTK_TREE_VIEW(all_apps_view), GTK_TREE_MODEL(all_apps)); g_object_unref(all_apps); gtk_tooltips_set_tip(tooltips, all_apps_view, _("Lists all the applications detected on the system. " "Launchers can be added to the launcher by selecting an application, then clicking on " "the add left button."), NULL); GtkWidget *table, *label, *button; int row, col; table = gtk_table_new(2, 3, 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); label = gtk_label_new(_("Applications selected")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); label = gtk_label_new(_("Applications available")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); GtkWidget *vbox; vbox = gtk_vbox_new(FALSE, 0); gtk_widget_show(vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(launcher_move_app_up), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Moves up the current launcher in the list of selected applications."), NULL); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(launcher_move_app_down), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Moves down the current launcher in the list of selected applications."), NULL); label = gtk_label_new(_(" ")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_BACK, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(launcher_add_app), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Copies the current application in the list of available applications to the list of selected applications."), NULL); button = gtk_button_new(); image = gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), image); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(launcher_remove_app), NULL); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, button, _("Removes the current application from the list of selected application."), NULL); gtk_table_attach(GTK_TABLE(table), vbox, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show(launcher_apps_view); gtk_table_attach(GTK_TABLE(table), addScrollBarToWidget(launcher_apps_view), 0, 1, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); gtk_widget_show(all_apps_view); gtk_table_attach(GTK_TABLE(table), addScrollBarToWidget(all_apps_view), 2, 3, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0); change_paragraph(parent); label = gtk_label_new(_("Additional application directories")); 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); launcher_apps_dirs = gtk_entry_new(); gtk_widget_show(launcher_apps_dirs); gtk_box_pack_start(GTK_BOX(parent), launcher_apps_dirs, FALSE, FALSE, 0); gtk_tooltips_set_tip(tooltips, launcher_apps_dirs, _("Specifies a path to a directory from which the launcher is loading all .desktop files (all subdirectories are explored recursively). " "Can be used multiple times, in which case the paths must be separated by commas. Leading ~ is expaned to the path of the user's home directory."), NULL); label = gtk_label_new(_("Appearance")); 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(7, 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(_("Background")); 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++; launcher_background = create_background_combo(_("Launcher")); gtk_widget_show(launcher_background); gtk_table_attach(GTK_TABLE(table), launcher_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_background, _("Selects the background used to display the launcher. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++, col = 2; label = gtk_label_new(_("Icon background")); 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++; launcher_icon_background = create_background_combo(_("Launcher icon")); gtk_widget_show(launcher_icon_background); gtk_table_attach(GTK_TABLE(table), launcher_icon_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_background, _("Selects the background used to display the launcher icon. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++, col = 2; label = gtk_label_new(_("Horizontal padding")); 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++; launcher_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(launcher_padding_x); gtk_table_attach(GTK_TABLE(table), launcher_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_padding_x, _("Specifies the horizontal padding of the launcher. " "This is the space between the border and the elements inside."), NULL); row++, col = 2; label = gtk_label_new(_("Vertical padding")); 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++; launcher_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(launcher_padding_y); gtk_table_attach(GTK_TABLE(table), launcher_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_padding_y, _("Specifies the vertical padding of the launcher. " "This is the space between the border and the elements inside."), NULL); row++, col = 2; label = gtk_label_new(_("Spacing")); 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++; launcher_spacing = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(launcher_spacing); gtk_table_attach(GTK_TABLE(table), launcher_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_spacing, _("Specifies the spacing between the elements inside the launcher."), NULL); row++, col = 2; label = gtk_label_new(_("Icon size")); 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++; launcher_icon_size = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(launcher_icon_size); gtk_table_attach(GTK_TABLE(table), launcher_icon_size, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_size, _("Specifies the size of the launcher icons, in pixels."), NULL); row++; col = 2; label = gtk_label_new(_("Icon opacity")); 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++; launcher_icon_opacity = gtk_spin_button_new_with_range(0, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_opacity), 100); gtk_widget_show(launcher_icon_opacity); gtk_table_attach(GTK_TABLE(table), launcher_icon_opacity, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_opacity, _("Specifies the opacity of the launcher icons, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon saturation")); 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++; launcher_icon_saturation = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_saturation), 0); gtk_widget_show(launcher_icon_saturation); gtk_table_attach(GTK_TABLE(table), launcher_icon_saturation, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_saturation, _("Specifies the saturation adjustment of the launcher icons, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon brightness")); 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++; launcher_icon_brightness = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_brightness), 0); gtk_widget_show(launcher_icon_brightness); gtk_table_attach(GTK_TABLE(table), launcher_icon_brightness, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_brightness, _("Specifies the brightness adjustment of the launcher icons, in percent."), NULL); row++, col = 2; label = gtk_label_new(_("Icon theme")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; launcher_icon_theme = gtk_combo_box_new_with_model(GTK_TREE_MODEL(icon_themes)); GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(launcher_icon_theme), renderer, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(launcher_icon_theme), renderer, "text", iconsColDescr, NULL); g_signal_connect(G_OBJECT(launcher_icon_theme), "changed", G_CALLBACK(launcher_icon_theme_changed), NULL); gtk_widget_show(launcher_icon_theme); gtk_table_attach(GTK_TABLE(table), launcher_icon_theme, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_theme, _("The icon theme used to display launcher icons. If left blank, " "tint2 will detect and use the icon theme of your desktop as long as you have " "an XSETTINGS manager running (most desktop environments do)."), NULL); launcher_icon_theme_override = gtk_check_button_new_with_label(_("Overrides XSETTINGS")); gtk_widget_show(launcher_icon_theme_override); gtk_table_attach(GTK_TABLE(table), launcher_icon_theme_override, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_icon_theme_override, _("If enabled, the icon theme selected here will override the one provided by XSETTINGS."), NULL); row++, col = 2; label = gtk_label_new(_("Startup notifications")); 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++; startup_notifications = gtk_check_button_new(); gtk_widget_show(startup_notifications); gtk_table_attach(GTK_TABLE(table), startup_notifications, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, startup_notifications, _("If enabled, startup notifications are shown when starting applications from the launcher. " "The appearance may vary depending on your desktop environment configuration; normally, a busy mouse cursor is displayed until the application starts."), NULL); row++, col = 2; label = gtk_label_new(_("Tooltips")); 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++; launcher_tooltip = gtk_check_button_new(); gtk_widget_show(launcher_tooltip); gtk_table_attach(GTK_TABLE(table), launcher_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, launcher_tooltip, _("If enabled, shows a tooltip with the application name when the mouse is moved over an application launcher."), NULL); change_paragraph(parent); GtkTreeIter iter; gtk_list_store_append(icon_themes, &iter); gtk_list_store_set(icon_themes, &iter, 0, "", -1); fprintf(stderr, "Loading icon themes\n"); const GSList *location; for (location = get_icon_locations(); location; location = g_slist_next(location)) { const gchar *path = (gchar*) location->data; load_icon_themes(path, NULL); } fprintf(stderr, "Icon themes loaded\n"); fprintf(stderr, "Loading .desktop files\n"); GList *entries = NULL; load_desktop_entries("/usr/share/applications", &entries); load_desktop_entries("/usr/local/share/applications", &entries); gchar *path = g_build_filename(g_get_home_dir(), ".local/share/applications", NULL); load_desktop_entries(path, &entries); 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(); load_icons(launcher_apps); load_icons(all_apps); fprintf(stderr, "Desktop files loaded\n"); } void create_taskbar(GtkWidget *parent) { GtkWidget *table, *label; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); label = gtk_label_new(_("Options")); 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(4, 2, 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 = col = 0; col = 2; row++; label = gtk_label_new(_("Show a taskbar for each desktop")); 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_show_desktop = gtk_check_button_new(); gtk_widget_show(taskbar_show_desktop); gtk_table_attach(GTK_TABLE(table), taskbar_show_desktop, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_show_desktop, _("If enabled, the taskbar is split into multiple smaller taskbars, one for each virtual desktop."), NULL); col = 2; row++; label = gtk_label_new(_("Distribute size between taskbars")); 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_distribute_size = gtk_check_button_new(); gtk_widget_show(taskbar_distribute_size); gtk_table_attach(GTK_TABLE(table), taskbar_distribute_size, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_distribute_size, _("If enabled and 'Show a taskbar for each desktop' is also enabled, " "the available size is distributed between taskbars proportionally to the number of tasks."), NULL); col = 2; row++; label = gtk_label_new(_("Hide inactive tasks")); 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_hide_inactive_tasks = gtk_check_button_new(); gtk_widget_show(taskbar_hide_inactive_tasks); gtk_table_attach(GTK_TABLE(table), taskbar_hide_inactive_tasks, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_hide_inactive_tasks, _("If enabled, only the active task will be shown in the taskbar."), NULL); col = 2; row++; label = gtk_label_new(_("Hide tasks from different monitors")); 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_hide_diff_monitor = gtk_check_button_new(); gtk_widget_show(taskbar_hide_diff_monitor); gtk_table_attach(GTK_TABLE(table), taskbar_hide_diff_monitor, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_hide_diff_monitor, _("If enabled, tasks that are not on the same monitor as the panel will not be displayed. " "This behavior is enabled automatically if the panel monitor is set to 'All'."), NULL); col = 2; row++; label = gtk_label_new(_("Always show all desktop tasks")); 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_always_show_all_desktop_tasks = gtk_check_button_new(); gtk_widget_show(taskbar_always_show_all_desktop_tasks); gtk_table_attach(GTK_TABLE(table), taskbar_always_show_all_desktop_tasks, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_always_show_all_desktop_tasks, _("Has effect only if 'Show a taskbar for each desktop' is enabled. " "If enabled, tasks that appear on all desktops are shown on all taskbars. " "Otherwise, they are shown only on the taskbar of the current desktop."), NULL); row++; col = 2; label = gtk_label_new(_("Task sorting")); 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_sort_order = gtk_combo_box_new_text(); gtk_widget_show(taskbar_sort_order); gtk_table_attach(GTK_TABLE(table), taskbar_sort_order, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_sort_order), _("None")); gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_sort_order), _("By title")); gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_sort_order), _("By center")); gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_sort_order), _("Most recently used first")); gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_sort_order), _("Most recently used last")); gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0); gtk_tooltips_set_tip(tooltips, taskbar_sort_order, _("Specifies how tasks should be sorted on the taskbar. \n" "'None' means that new tasks are added to the end, and the user can also reorder task buttons by mouse dragging. \n" "'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(_("Appearance")); 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(3, 12, 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 = col = 0; col = 2; label = gtk_label_new(_("Horizontal padding")); 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_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(taskbar_padding_x); gtk_table_attach(GTK_TABLE(table), taskbar_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_padding_x, _("Specifies the horizontal padding of the taskbar. " "This is the space between the border and the elements inside."), NULL); col = 2; row++; label = gtk_label_new(_("Vertical padding")); 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_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(taskbar_padding_y); gtk_table_attach(GTK_TABLE(table), taskbar_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_padding_y, _("Specifies the vertical padding of the taskbar. " "This is the space between the border and the elements inside."), NULL); col = 2; row++; label = gtk_label_new(_("Spacing")); 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_spacing = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(taskbar_spacing); gtk_table_attach(GTK_TABLE(table), taskbar_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_spacing, _("Specifies the spacing between the elements inside the taskbar."), NULL); col = 2; row++; label = gtk_label_new(_("Active background")); 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_active_background = create_background_combo(_("Active taskbar")); gtk_widget_show(taskbar_active_background); gtk_table_attach(GTK_TABLE(table), taskbar_active_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_active_background, _("Selects the background used to display the taskbar of the current desktop. " "Backgrounds can be edited in the Backgrounds tab."), NULL); col = 2; row++; label = gtk_label_new(_("Inactive background")); 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_inactive_background = create_background_combo(_("Inactive taskbar")); gtk_widget_show(taskbar_inactive_background); gtk_table_attach(GTK_TABLE(table), taskbar_inactive_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_inactive_background, _("Selects the background used to display taskbars of inactive desktops. " "Backgrounds can be edited in the Backgrounds tab."), NULL); change_paragraph(parent); label = gtk_label_new(_("Desktop name")); 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(6, 22, 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 = col = 0; col = 2; row++; label = gtk_label_new(_("Show desktop name")); 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_show_name = gtk_check_button_new(); gtk_widget_show(taskbar_show_name); gtk_table_attach(GTK_TABLE(table), taskbar_show_name, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_show_name, _("If enabled, displays the name of the desktop at the top/left of the taskbar. " "The name is set by your window manager; you might be able to configure it there."), NULL); col = 2; row++; label = gtk_label_new(_("Horizontal padding")); 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_name_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(taskbar_name_padding_x); gtk_table_attach(GTK_TABLE(table), taskbar_name_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_name_padding_x, _("Specifies the horizontal padding of the desktop name. " "This is the space between the border and the text inside."), NULL); col = 2; row++; label = gtk_label_new(_("Vertical padding")); 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_name_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(taskbar_name_padding_y); gtk_table_attach(GTK_TABLE(table), taskbar_name_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_name_padding_y, _("Specifies the vertical padding of the desktop name. " "This is the space between the border and the text inside."), NULL); col = 2; row++; label = gtk_label_new(_("Active font color")); 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_name_active_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(taskbar_name_active_color), TRUE); gtk_widget_show(taskbar_name_active_color); gtk_table_attach(GTK_TABLE(table), taskbar_name_active_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_name_active_color, _("Specifies the font color used to display the name of the current desktop."), NULL); col = 2; row++; label = gtk_label_new(_("Inactive font color")); 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_name_inactive_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(taskbar_name_inactive_color), TRUE); gtk_widget_show(taskbar_name_inactive_color); gtk_table_attach(GTK_TABLE(table), taskbar_name_inactive_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_name_inactive_color, _("Specifies the font color used to display the name of inactive desktops."), NULL); col = 1; row++; taskbar_name_font_set = gtk_check_button_new(); gtk_widget_show(taskbar_name_font_set); gtk_table_attach(GTK_TABLE(table), taskbar_name_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, taskbar_name_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font")); 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++; PangoFontDescription *taskbar_name_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_weight(taskbar_name_font_desc, PANGO_WEIGHT_BOLD); taskbar_name_font = gtk_font_button_new_with_font(pango_font_description_to_string(taskbar_name_font_desc)); pango_font_description_free(taskbar_name_font_desc); gtk_widget_show(taskbar_name_font); gtk_table_attach(GTK_TABLE(table), taskbar_name_font, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(taskbar_name_font), TRUE); gtk_tooltips_set_tip(tooltips, taskbar_name_font, _("Specifies the font used to display the desktop name."), NULL); gtk_signal_connect(GTK_OBJECT(taskbar_name_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), taskbar_name_font); font_set_callback(taskbar_name_font_set, taskbar_name_font); col = 2; row++; label = gtk_label_new(_("Active background")); 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_name_active_background = create_background_combo(_("Active desktop name")); gtk_widget_show(taskbar_name_active_background); gtk_table_attach(GTK_TABLE(table), taskbar_name_active_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_name_active_background, _("Selects the background used to display the name of the current desktop. " "Backgrounds can be edited in the Backgrounds tab."), NULL); col = 2; row++; label = gtk_label_new(_("Inactive background")); 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_name_inactive_background = create_background_combo(_("Inactive desktop name")); gtk_widget_show(taskbar_name_inactive_background); gtk_table_attach(GTK_TABLE(table), taskbar_name_inactive_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_name_inactive_background, _("Selects the background used to display the name of inactive desktops. " "Backgrounds can be edited in the Backgrounds tab."), NULL); change_paragraph(parent); } void create_task(GtkWidget *parent) { GtkWidget *table, *label, *notebook; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); label = gtk_label_new(_("Mouse events")); 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(3, 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")); 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++; task_mouse_left = gtk_combo_box_new_text(); gtk_widget_show(task_mouse_left); gtk_table_attach(GTK_TABLE(table), task_mouse_left, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("None")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Close")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Toggle")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Shade")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Toggle or iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Maximize or restore")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Desktop left")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Desktop right")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Next task")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_left), _("Previous task")); gtk_combo_box_set_active(GTK_COMBO_BOX(task_mouse_left), 5); gtk_tooltips_set_tip(tooltips, task_mouse_left, _("Specifies the action performed when task buttons receive a left click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task."), NULL); row++, col = 2; label = gtk_label_new(_("Wheel scroll up")); 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++; task_mouse_scroll_up = gtk_combo_box_new_text(); gtk_widget_show(task_mouse_scroll_up); gtk_table_attach(GTK_TABLE(table), task_mouse_scroll_up, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("None")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Close")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Toggle")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Shade")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Toggle or iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Maximize or restore")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Desktop left")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Desktop right")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Next task")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_up), _("Previous task")); gtk_combo_box_set_active(GTK_COMBO_BOX(task_mouse_scroll_up), 0); gtk_tooltips_set_tip(tooltips, task_mouse_scroll_up, _("Specifies the action performed when task buttons receive a scroll up event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task."), NULL); row++, col = 2; label = gtk_label_new(_("Middle click")); 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++; task_mouse_middle = gtk_combo_box_new_text(); gtk_widget_show(task_mouse_middle); gtk_table_attach(GTK_TABLE(table), task_mouse_middle, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("None")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Close")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Toggle")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("sShade")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Toggle or iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Maximize or restore")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Desktop left")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Desktop right")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Next task")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_middle), _("Previous task")); gtk_combo_box_set_active(GTK_COMBO_BOX(task_mouse_middle), 0); gtk_tooltips_set_tip(tooltips, task_mouse_middle, _("Specifies the action performed when task buttons receive a middle click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task."), NULL); row++, col = 2; label = gtk_label_new(_("Wheel scroll down")); 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++; task_mouse_scroll_down = gtk_combo_box_new_text(); gtk_widget_show(task_mouse_scroll_down); gtk_table_attach(GTK_TABLE(table), task_mouse_scroll_down, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("None")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Close")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Toggle")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Shade")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Toggle or iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Maximize or restore")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Desktop left")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Desktop right")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Next task")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_scroll_down), _("Previous task")); gtk_combo_box_set_active(GTK_COMBO_BOX(task_mouse_scroll_down), 0); gtk_tooltips_set_tip(tooltips, task_mouse_scroll_down, _("Specifies the action performed when task buttons receive a scroll down event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task."), NULL); row++, col = 2; label = gtk_label_new(_("Right click")); 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++; task_mouse_right = gtk_combo_box_new_text(); gtk_widget_show(task_mouse_right); gtk_table_attach(GTK_TABLE(table), task_mouse_right, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("None")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Close")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Toggle")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Shade")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Toggle or iconify")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Maximize or restore")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Desktop left")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Desktop right")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Next task")); gtk_combo_box_append_text(GTK_COMBO_BOX(task_mouse_right), _("Previous task")); gtk_combo_box_set_active(GTK_COMBO_BOX(task_mouse_right), 1); gtk_tooltips_set_tip(tooltips, task_mouse_right, _("Specifies the action performed when task buttons receive a right click event: \n" "'None' means that no action is taken. \n" "'Close' closes the task. \n" "'Toggle' toggles the task. \n" "'Iconify' iconifies (minimizes) the task. \n" "'Shade' shades (collapses) the task. \n" "'Toggle or iconify' toggles or iconifies the task. \n" "'Maximize or restore' maximizes or minimizes the task. \n" "'Desktop left' sends the task to the previous desktop. \n" "'Desktop right' sends the task to the next desktop. \n" "'Next task' sends the focus to the next task. \n" "'Previous task' sends the focus to the previous task."), NULL); change_paragraph(parent); label = gtk_label_new(_("Appearance")); 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(4, 13, 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(_("Show icon")); 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++; task_show_icon = gtk_check_button_new(); gtk_widget_show(task_show_icon); gtk_table_attach(GTK_TABLE(table), task_show_icon, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_show_icon, _("If enabled, the window icon is shown on task buttons."), NULL); row++, col = 2; label = gtk_label_new(_("Show text")); 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++; task_show_text = gtk_check_button_new(); gtk_widget_show(task_show_text); gtk_table_attach(GTK_TABLE(table), task_show_text, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_show_text, _("If enabled, the window title is shown on task buttons."), NULL); row++, col = 2; label = gtk_label_new(_("Center text")); 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++; task_align_center = gtk_check_button_new(); gtk_widget_show(task_align_center); gtk_table_attach(GTK_TABLE(table), task_align_center, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_align_center, _("If enabled, the text is centered on task buttons. Otherwise, it is left-aligned."), NULL); row++, col = 2; label = gtk_label_new(_("Show tooltips")); 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++; tooltip_task_show = gtk_check_button_new(); gtk_widget_show(tooltip_task_show); gtk_table_attach(GTK_TABLE(table), tooltip_task_show, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, tooltip_task_show, _("If enabled, a tooltip showing the window title is displayed when the mouse cursor moves over task buttons."), NULL); row++, col = 2; label = gtk_label_new(_("Maximum width")); 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++; task_maximum_width = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(task_maximum_width); gtk_table_attach(GTK_TABLE(table), task_maximum_width, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_maximum_width, _("Specifies the maximum width of the task buttons."), NULL); row++, col = 2; label = gtk_label_new(_("Maximum height")); 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++; task_maximum_height = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(task_maximum_height); gtk_table_attach(GTK_TABLE(table), task_maximum_height, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_maximum_height, _("Specifies the maximum height of the task buttons."), NULL); row++, col = 2; label = gtk_label_new(_("Horizontal padding")); 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++; task_padding_x = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(task_padding_x); gtk_table_attach(GTK_TABLE(table), task_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_padding_x, _("Specifies the horizontal padding of the task buttons. " "This is the space between the border and the content inside."), NULL); row++, col = 2; label = gtk_label_new(_("Vertical padding")); 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++; task_padding_y = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(task_padding_y); gtk_table_attach(GTK_TABLE(table), task_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_padding_y, _("Specifies the vertical padding of the task buttons. " "This is the space between the border and the content inside."), NULL); row++, col = 2; label = gtk_label_new(_("Spacing")); 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++; task_spacing = gtk_spin_button_new_with_range(0, 9000, 1); gtk_widget_show(task_spacing); gtk_table_attach(GTK_TABLE(table), task_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, task_spacing, _("Specifies the spacing between the icon and the text."), NULL); row++, col = 1; task_font_set = gtk_check_button_new(); gtk_widget_show(task_font_set); gtk_table_attach(GTK_TABLE(table), task_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, task_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font")); 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++; task_font = gtk_font_button_new_with_font(get_default_font()); gtk_widget_show(task_font); gtk_table_attach(GTK_TABLE(table), task_font, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(task_font), TRUE); gtk_tooltips_set_tip(tooltips, task_font, _("Specifies the font used to display the task button text."), NULL); gtk_signal_connect(GTK_OBJECT(task_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), task_font); font_set_callback(task_font_set, task_font); change_paragraph(parent); notebook = gtk_notebook_new(); gtk_widget_show(notebook); gtk_container_set_border_width(GTK_CONTAINER(notebook), 0); gtk_box_pack_start(GTK_BOX(parent), notebook, TRUE, TRUE, 0); create_task_status(notebook, _("Default style"), _("Default task"), &task_default_color, &task_default_color_set, &task_default_icon_opacity, &task_default_icon_osb_set, &task_default_icon_saturation, &task_default_icon_brightness, &task_default_background, &task_default_background_set); create_task_status(notebook, _("Normal task"), _("Normal task"), &task_normal_color, &task_normal_color_set, &task_normal_icon_opacity, &task_normal_icon_osb_set, &task_normal_icon_saturation, &task_normal_icon_brightness, &task_normal_background, &task_normal_background_set); create_task_status(notebook, _("Active task"), _("Active task"), &task_active_color, &task_active_color_set, &task_active_icon_opacity, &task_active_icon_osb_set, &task_active_icon_saturation, &task_active_icon_brightness, &task_active_background, &task_active_background_set); create_task_status(notebook, _("Urgent task"), _("Urgent task"), &task_urgent_color, &task_urgent_color_set, &task_urgent_icon_opacity, &task_urgent_icon_osb_set, &task_urgent_icon_saturation, &task_urgent_icon_brightness, &task_urgent_background, &task_urgent_background_set); create_task_status(notebook, _("Iconified task"), _("Iconified task"), &task_iconified_color, &task_iconified_color_set, &task_iconified_icon_opacity, &task_iconified_icon_osb_set, &task_iconified_icon_saturation, &task_iconified_icon_brightness, &task_iconified_background, &task_iconified_background_set); } void task_status_toggle_button_callback(GtkWidget *widget, gpointer data) { GtkWidget *child1, *child2, *child3; child1 = child2 = child3 = NULL; if (widget == task_default_color_set) { child1 = task_default_color; } else if (widget == task_default_icon_osb_set) { child1 = task_default_icon_opacity; child2 = task_default_icon_saturation; child3 = task_default_icon_brightness; } else if (widget == task_default_background_set) { child1 = task_default_background; } else if (widget == task_normal_color_set) { child1 = task_normal_color; } else if (widget == task_normal_icon_osb_set) { child1 = task_normal_icon_opacity; child2 = task_normal_icon_saturation; child3 = task_normal_icon_brightness; } else if (widget == task_normal_background_set) { child1 = task_normal_background; } else if (widget == task_active_color_set) { child1 = task_active_color; } else if (widget == task_active_icon_osb_set) { child1 = task_active_icon_opacity; child2 = task_active_icon_saturation; child3 = task_active_icon_brightness; } else if (widget == task_active_background_set) { child1 = task_active_background; } else if (widget == task_urgent_color_set) { child1 = task_urgent_color; } else if (widget == task_urgent_icon_osb_set) { child1 = task_urgent_icon_opacity; child2 = task_urgent_icon_saturation; child3 = task_urgent_icon_brightness; } else if (widget == task_urgent_background_set) { child1 = task_urgent_background; } else if (widget == task_iconified_color_set) { child1 = task_iconified_color; } else if (widget == task_iconified_icon_osb_set) { child1 = task_iconified_icon_opacity; child2 = task_iconified_icon_saturation; child3 = task_iconified_icon_brightness; } else if (widget == task_iconified_background_set) { child1 = task_iconified_background; } if (child1) gtk_widget_set_sensitive(child1, GTK_TOGGLE_BUTTON(widget)->active); if (child2) gtk_widget_set_sensitive(child2, GTK_TOGGLE_BUTTON(widget)->active); if (child3) gtk_widget_set_sensitive(child3, GTK_TOGGLE_BUTTON(widget)->active); } void create_task_status(GtkWidget *notebook, char *name, char *text, GtkWidget **task_status_color, GtkWidget **task_status_color_set, GtkWidget **task_status_icon_opacity, GtkWidget **task_status_icon_osb_set, GtkWidget **task_status_icon_saturation, GtkWidget **task_status_icon_brightness, GtkWidget **task_status_background, GtkWidget **task_status_background_set) { GtkTooltips *tooltips = gtk_tooltips_new(); GtkWidget *label = gtk_label_new(_(name)); gtk_widget_show(label); GtkWidget *page_task = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); gtk_container_set_border_width(GTK_CONTAINER(page_task), 10); gtk_widget_show(page_task); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page_task, label); GtkWidget *table = gtk_table_new(6, 3, FALSE); gtk_widget_show(table); gtk_box_pack_start(GTK_BOX(page_task), table, FALSE, FALSE, 0); gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING); gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING); *task_status_color_set = gtk_check_button_new(); gtk_widget_show(*task_status_color_set); gtk_table_attach(GTK_TABLE(table), *task_status_color_set, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); gtk_signal_connect(GTK_OBJECT(*task_status_color_set), "toggled", GTK_SIGNAL_FUNC(task_status_toggle_button_callback), NULL); gtk_tooltips_set_tip(tooltips, *task_status_color_set, _("If enabled, a custom font color is used to display the task text."), NULL); label = gtk_label_new(_("Font color")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); *task_status_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(*task_status_color), TRUE); gtk_widget_show(*task_status_color); gtk_table_attach(GTK_TABLE(table), *task_status_color, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, *task_status_color, _("Specifies the font color used to display the task text."), NULL); *task_status_icon_osb_set = gtk_check_button_new(); gtk_widget_show(*task_status_icon_osb_set); gtk_table_attach(GTK_TABLE(table), *task_status_icon_osb_set, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); gtk_signal_connect(GTK_OBJECT(*task_status_icon_osb_set), "toggled", GTK_SIGNAL_FUNC(task_status_toggle_button_callback), NULL); gtk_tooltips_set_tip(tooltips, *task_status_icon_osb_set, _("If enabled, a custom opacity/saturation/brightness is used to display the task icon."), NULL); label = gtk_label_new(_("Icon opacity")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); *task_status_icon_opacity = gtk_spin_button_new_with_range(0, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(*task_status_icon_opacity), 100); gtk_widget_show(*task_status_icon_opacity); gtk_table_attach(GTK_TABLE(table), *task_status_icon_opacity, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, *task_status_icon_opacity, _("Specifies the opacity (in %) used to display the task icon."), NULL); label = gtk_label_new(_("Icon saturation")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); *task_status_icon_saturation = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(*task_status_icon_saturation), 0); gtk_widget_show(*task_status_icon_saturation); gtk_table_attach(GTK_TABLE(table), *task_status_icon_saturation, 2, 3, 2, 3, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, *task_status_icon_saturation, _("Specifies the saturation adjustment (in %) used to display the task icon."), NULL); label = gtk_label_new(_("Icon brightness")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 3, 4, GTK_FILL, 0, 0, 0); *task_status_icon_brightness = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(*task_status_icon_brightness), 0); gtk_widget_show(*task_status_icon_brightness); gtk_table_attach(GTK_TABLE(table), *task_status_icon_brightness, 2, 3, 3, 4, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, *task_status_icon_brightness, _("Specifies the brightness adjustment (in %) used to display the task icon."), NULL); *task_status_background_set = gtk_check_button_new(); gtk_widget_show(*task_status_background_set); gtk_table_attach(GTK_TABLE(table), *task_status_background_set, 0, 1, 4, 5, GTK_FILL, 0, 0, 0); gtk_signal_connect(GTK_OBJECT(*task_status_background_set), "toggled", GTK_SIGNAL_FUNC(task_status_toggle_button_callback), NULL); gtk_tooltips_set_tip(tooltips, *task_status_background_set, _("If enabled, a custom background is used to display the task."), NULL); label = gtk_label_new(_("Background")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 4, 5, GTK_FILL, 0, 0, 0); *task_status_background = create_background_combo(text); gtk_widget_show(*task_status_background); gtk_table_attach(GTK_TABLE(table), *task_status_background, 2, 3, 4, 5, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, *task_status_background, _("Selects the background used to display the task. " "Backgrounds can be edited in the Backgrounds tab."), NULL); if (*task_status_color == task_urgent_color) { label = gtk_label_new(_("Blinks")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 5, 6, GTK_FILL, 0, 0, 0); task_urgent_blinks = gtk_spin_button_new_with_range(0, 1000000, 1); gtk_widget_show(task_urgent_blinks); gtk_table_attach(GTK_TABLE(table), task_urgent_blinks, 2, 3, 5, 6, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, task_urgent_blinks, _("Specifies how many times urgent tasks blink."), NULL); } task_status_toggle_button_callback(*task_status_color_set, NULL); task_status_toggle_button_callback(*task_status_icon_osb_set, NULL); task_status_toggle_button_callback(*task_status_background_set, NULL); } void create_clock(GtkWidget *parent) { GtkWidget *table; GtkWidget *label; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); table = gtk_table_new(1, 2, 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(_("Format")); 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(3, 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(_("First line format")); 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_format_line1 = gtk_entry_new(); gtk_widget_show(clock_format_line1); gtk_entry_set_width_chars(GTK_ENTRY(clock_format_line1), 16); gtk_table_attach(GTK_TABLE(table), clock_format_line1, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_format_line1, _("Specifies the format used to display the first line of the clock text. " "See 'man strftime' for all the available options."), NULL); row++, col = 2; label = gtk_label_new(_("Second line format")); 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_format_line2 = gtk_entry_new(); gtk_widget_show(clock_format_line2); gtk_entry_set_width_chars(GTK_ENTRY(clock_format_line2), 16); gtk_table_attach(GTK_TABLE(table), clock_format_line2, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_format_line2, _("Specifies the format used to display the second line of the clock text. " "See 'man strftime' for all the available options."), NULL); row++, col = 2; label = gtk_label_new(_("First line timezone")); 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_tmz_line1 = gtk_entry_new(); gtk_widget_show(clock_tmz_line1); gtk_entry_set_width_chars(GTK_ENTRY(clock_tmz_line1), 16); gtk_table_attach(GTK_TABLE(table), clock_tmz_line1, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_tmz_line1, _("Specifies the timezone used to display the first line of the clock text. If empty, the current timezone is used. " "Otherwise, it must be set to a valid value of the TZ environment variable."), NULL); row++, col = 2; label = gtk_label_new(_("Second line timezone")); 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_tmz_line2 = gtk_entry_new(); gtk_widget_show(clock_tmz_line2); gtk_entry_set_width_chars(GTK_ENTRY(clock_tmz_line2), 16); gtk_table_attach(GTK_TABLE(table), clock_tmz_line2, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_tmz_line2, _("Specifies the timezone used to display the second line of the clock text. If empty, the current timezone is used. " "Otherwise, it must be set to a valid value of the TZ environment variable."), NULL); change_paragraph(parent); label = gtk_label_new(_("Mouse events")); 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++; clock_left_command = gtk_entry_new(); gtk_widget_show(clock_left_command); gtk_entry_set_width_chars(GTK_ENTRY(clock_left_command), 50); gtk_table_attach(GTK_TABLE(table), clock_left_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_left_command, _("Specifies a command that will be executed when the clock 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++; clock_right_command = gtk_entry_new(); gtk_widget_show(clock_right_command); gtk_entry_set_width_chars(GTK_ENTRY(clock_right_command), 50); gtk_table_attach(GTK_TABLE(table), clock_right_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; 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(_("Appearance")); 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(3, 22, 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(_("Background")); 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_background = create_background_combo(_("Clock")); gtk_widget_show(clock_background); gtk_table_attach(GTK_TABLE(table), clock_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_background, _("Selects the background used to display the clock. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++, col = 2; label = gtk_label_new(_("Horizontal padding")); 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_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(clock_padding_x); gtk_table_attach(GTK_TABLE(table), clock_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_padding_x, _("Specifies the horizontal padding of the clock. " "This is the space between the border and the content inside."), NULL); row++, col = 2; label = gtk_label_new(_("Vertical padding")); 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_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(clock_padding_y); gtk_table_attach(GTK_TABLE(table), clock_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_padding_y, _("Specifies the vertical padding of the clock. " "This is the space between the border and the content inside."), NULL); row++, col = 1; clock_font_line1_set = gtk_check_button_new(); gtk_widget_show(clock_font_line1_set); gtk_table_attach(GTK_TABLE(table), clock_font_line1_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, clock_font_line1_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font first line")); 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++; PangoFontDescription *time1_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_weight(time1_font_desc, PANGO_WEIGHT_BOLD); pango_font_description_set_size(time1_font_desc, pango_font_description_get_size(time1_font_desc)); clock_font_line1 = gtk_font_button_new_with_font(pango_font_description_to_string(time1_font_desc)); pango_font_description_free(time1_font_desc); gtk_widget_show(clock_font_line1); gtk_table_attach(GTK_TABLE(table), clock_font_line1, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(clock_font_line1), TRUE); gtk_tooltips_set_tip(tooltips, clock_font_line1, _("Specifies the font used to display the first line of the clock."), NULL); gtk_signal_connect(GTK_OBJECT(clock_font_line1_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), clock_font_line1); font_set_callback(clock_font_line1_set, clock_font_line1); row++, col = 1; clock_font_line2_set = gtk_check_button_new(); gtk_widget_show(clock_font_line2_set); gtk_table_attach(GTK_TABLE(table), clock_font_line2_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, clock_font_line2_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font second line")); 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++; PangoFontDescription *time2_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(time2_font_desc, pango_font_description_get_size(time2_font_desc) - PANGO_SCALE); clock_font_line2 = gtk_font_button_new_with_font(pango_font_description_to_string(time2_font_desc));; pango_font_description_free(time2_font_desc); gtk_widget_show(clock_font_line2); gtk_table_attach(GTK_TABLE(table), clock_font_line2, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(clock_font_line2), TRUE); gtk_tooltips_set_tip(tooltips, clock_font_line2, _("Specifies the font used to display the second line of the clock."), NULL); gtk_signal_connect(GTK_OBJECT(clock_font_line2_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), clock_font_line2); font_set_callback(clock_font_line2_set, clock_font_line2); row++, col = 2; label = gtk_label_new(_("Font color")); 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_font_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(clock_font_color), TRUE); gtk_widget_show(clock_font_color); gtk_table_attach(GTK_TABLE(table), clock_font_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_font_color, _("Specifies the font color used to display the clock."), NULL); change_paragraph(parent); label = gtk_label_new(_("Tooltip")); 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(3, 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(_("Format")); 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_format_tooltip = gtk_entry_new(); gtk_widget_show(clock_format_tooltip); gtk_entry_set_width_chars(GTK_ENTRY(clock_format_tooltip), 30); gtk_table_attach(GTK_TABLE(table), clock_format_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_format_tooltip, _("Specifies the format used to display the clock tooltip. " "See 'man strftime' for the available options."), NULL); row++, col = 2; label = gtk_label_new(_("Timezone")); 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_tmz_tooltip = gtk_entry_new(); gtk_widget_show(clock_tmz_tooltip); gtk_entry_set_width_chars(GTK_ENTRY(clock_tmz_tooltip), 16); gtk_table_attach(GTK_TABLE(table), clock_tmz_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, clock_tmz_tooltip, _("Specifies the timezone used to display the clock tooltip. If empty, the current timezone is used. " "Otherwise, it must be set to a valid value of the TZ environment variable."), NULL); change_paragraph(parent); } void create_execp(GtkWidget *notebook, int i) { GtkWidget *label; GtkWidget *table; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); Executor *executor = &g_array_index(executors, Executor, i); executor->name[0] = 0; sprintf(executor->name, "%s %d", _("Executor"), i + 1); executor->page_label = gtk_label_new(executor->name); gtk_widget_show(executor->page_label); executor->page_execp = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING); executor->container = addScrollBarToWidget(executor->page_execp); gtk_container_set_border_width(GTK_CONTAINER(executor->page_execp), 10); gtk_widget_show(executor->page_execp); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), executor->container, executor->page_label); GtkWidget *parent = executor->page_execp; table = gtk_table_new(1, 2, 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(_("Format")); 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(3, 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(_("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++; executor->execp_command = gtk_entry_new(); gtk_widget_show(executor->execp_command); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_command), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_command, _("Specifies the command to execute."), NULL); row++, col = 2; label = gtk_label_new(_("Interval")); 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++; executor->execp_interval = gtk_spin_button_new_with_range(0, 1000000, 1); gtk_widget_show(executor->execp_interval); gtk_table_attach(GTK_TABLE(table), executor->execp_interval, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_interval, _("Specifies the interval at which the command is executed, in seconds. " "If zero, the command is executed only once."), NULL); row++, col = 2; label = gtk_label_new(_("Show icon")); 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++; executor->execp_has_icon = gtk_check_button_new(); gtk_widget_show(executor->execp_has_icon); gtk_table_attach(GTK_TABLE(table), executor->execp_has_icon, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_has_icon, _("If enabled, the first line printed by the command is interpreted " "as a path to an image file."), NULL); row++, col = 2; label = gtk_label_new(_("Cache icon")); 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++; executor->execp_cache_icon = gtk_check_button_new(); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(executor->execp_cache_icon), 1); gtk_widget_show(executor->execp_cache_icon); gtk_table_attach(GTK_TABLE(table), executor->execp_cache_icon, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_cache_icon, _("If enabled, the image is not reloaded from disk every time the command is executed if the path remains unchanged. Enabling this is recommended."), NULL); row++, col = 2; label = gtk_label_new(_("Continuous output")); 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++; executor->execp_continuous = gtk_spin_button_new_with_range(0, 1000000, 1); gtk_widget_show(executor->execp_continuous); gtk_table_attach(GTK_TABLE(table), executor->execp_continuous, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_continuous, _("If non-zero, the last execp_continuous lines from the output of " "the command are displayed, every execp_continuous lines; this is " "useful for showing the output of commands that run indefinitely, " "such as 'ping 127.0.0.1'. If zero, the output of the command is " "displayed after it finishes executing."), NULL); row++, col = 2; label = gtk_label_new(_("Display markup")); 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++; executor->execp_markup = gtk_check_button_new(); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(executor->execp_markup), 1); gtk_widget_show(executor->execp_markup); gtk_table_attach(GTK_TABLE(table), executor->execp_markup, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_markup, _("If enabled, the output of the command is treated as Pango markup, " "which allows rich text formatting. Note that using this with commands " "that print data downloaded from the Internet is a potential security risk."), NULL); change_paragraph(parent); label = gtk_label_new(_("Mouse events")); 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++; executor->execp_left_command = gtk_entry_new(); gtk_widget_show(executor->execp_left_command); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_left_command), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_left_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_left_command, _("Specifies a command that will be executed when the executor 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++; executor->execp_right_command = gtk_entry_new(); gtk_widget_show(executor->execp_right_command); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_right_command), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_right_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_right_command, _("Specifies a command that will be executed when the executor 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++; executor->execp_mclick_command = gtk_entry_new(); gtk_widget_show(executor->execp_mclick_command); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_mclick_command), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_mclick_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_mclick_command, _("Specifies a command that will be executed when the executor 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++; executor->execp_uwheel_command = gtk_entry_new(); gtk_widget_show(executor->execp_uwheel_command); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_uwheel_command), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_uwheel_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_uwheel_command, _("Specifies a command that will be executed when the executor 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++; executor->execp_dwheel_command = gtk_entry_new(); gtk_widget_show(executor->execp_dwheel_command); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_dwheel_command), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_dwheel_command, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_dwheel_command, _("Specifies a command that will be executed when the executor receives a mouse scroll down."), NULL); change_paragraph(parent); label = gtk_label_new(_("Appearance")); 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(3, 22, 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(_("Background")); 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++; executor->execp_background = create_background_combo(_("Executor")); gtk_widget_show(executor->execp_background); gtk_table_attach(GTK_TABLE(table), executor->execp_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_background, _("Selects the background used to display the executor. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++, col = 2; label = gtk_label_new(_("Horizontal padding")); 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++; executor->execp_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(executor->execp_padding_x); gtk_table_attach(GTK_TABLE(table), executor->execp_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_padding_x, _("Specifies the horizontal padding of the executor. " "This is the space between the border and the content inside."), NULL); row++, col = 2; label = gtk_label_new(_("Vertical padding")); 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++; executor->execp_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(executor->execp_padding_y); gtk_table_attach(GTK_TABLE(table), executor->execp_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_padding_y, _("Specifies the vertical padding of the executor. " "This is the space between the border and the content inside."), NULL); row++, col = 1; executor->execp_font_set = gtk_check_button_new(); gtk_widget_show(executor->execp_font_set); gtk_table_attach(GTK_TABLE(table), executor->execp_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, executor->execp_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font")); 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++; executor->execp_font = gtk_font_button_new_with_font(get_default_font()); gtk_widget_show(executor->execp_font); gtk_table_attach(GTK_TABLE(table), executor->execp_font, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(executor->execp_font), TRUE); gtk_signal_connect(GTK_OBJECT(executor->execp_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), executor->execp_font); font_set_callback(executor->execp_font_set, executor->execp_font); row++, col = 2; label = gtk_label_new(_("Font color")); 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++; executor->execp_font_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(executor->execp_font_color), TRUE); gtk_widget_show(executor->execp_font_color); gtk_table_attach(GTK_TABLE(table), executor->execp_font_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; row++, col = 2; label = gtk_label_new(_("Centered")); 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++; executor->execp_centered = gtk_check_button_new(); gtk_widget_show(executor->execp_centered); gtk_table_attach(GTK_TABLE(table), executor->execp_centered, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; row++, col = 2; label = gtk_label_new(_("Icon width")); 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++; executor->execp_icon_w = gtk_spin_button_new_with_range(0, 1000000, 1); gtk_widget_show(executor->execp_icon_w); gtk_table_attach(GTK_TABLE(table), executor->execp_icon_w, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_icon_w, _("If non-zero, the image is resized to this width."), NULL); row++, col = 2; label = gtk_label_new(_("Icon height")); 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++; executor->execp_icon_h = gtk_spin_button_new_with_range(0, 1000000, 1); gtk_widget_show(executor->execp_icon_h); gtk_table_attach(GTK_TABLE(table), executor->execp_icon_h, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_icon_h, _("If non-zero, the image is resized to this height."), NULL); row++, col = 2; label = gtk_label_new(_("Tooltip")); 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++; executor->execp_show_tooltip = gtk_check_button_new(); gtk_widget_show(executor->execp_show_tooltip); gtk_table_attach(GTK_TABLE(table), executor->execp_show_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(executor->execp_show_tooltip), 1); col++; row++, col = 2; label = gtk_label_new(_("Tooltip text")); 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++; executor->execp_tooltip = gtk_entry_new(); gtk_widget_show(executor->execp_tooltip); gtk_entry_set_width_chars(GTK_ENTRY(executor->execp_tooltip), 50); gtk_table_attach(GTK_TABLE(table), executor->execp_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, executor->execp_tooltip, _("The tooltip text to display. Leave this empty to display an automatically generated tooltip with information about when the command was last executed."), NULL); change_paragraph(parent); } void execp_create_new() { g_array_set_size(executors, executors->len + 1); create_execp(notebook, executors->len - 1); } Executor *execp_get_last() { if (executors->len <= 0) execp_create_new(); return &g_array_index(executors, Executor, executors->len - 1); } void execp_remove(int i) { Executor *executor = &g_array_index(executors, Executor, i); for (int i_page = 0; i_page < gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)); i_page++) { GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i_page); if (page == executor->container) { gtk_widget_hide(page); gtk_notebook_remove_page(GTK_NOTEBOOK(notebook), i_page); } } executors = g_array_remove_index(executors, i); } void execp_update_indices() { for (int i = 0; i < executors->len; i++) { Executor *executor = &g_array_index(executors, Executor, i); sprintf(executor->name, "%s %d", _("Executor"), i + 1); gtk_label_set_text(GTK_LABEL(executor->page_label), executor->name); } GtkTreeModel *model = GTK_TREE_MODEL(panel_items); GtkTreeIter iter; if (!gtk_tree_model_get_iter_first(model, &iter)) return; int execp_index = -1; while (1) { gchar *name; gchar *value; gtk_tree_model_get(model, &iter, itemsColName, &name, itemsColValue, &value, -1); if (g_str_equal(value, "E")) { execp_index++; char buffer[256]; buffer[0] = 0; sprintf(buffer, "%s %d", _("Executor"), execp_index + 1); gtk_list_store_set(panel_items, &iter, itemsColName, buffer, -1); } if (!gtk_tree_model_iter_next(model, &iter)) break; } } void create_systemtray(GtkWidget *parent) { GtkWidget *table; GtkWidget *label; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); label = gtk_label_new(_("Options")); 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(2, 2, 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(_("Icon ordering")); 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++; systray_icon_order = gtk_combo_box_new_text(); gtk_widget_show(systray_icon_order); gtk_table_attach(GTK_TABLE(table), systray_icon_order, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(systray_icon_order), _("Ascending")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_icon_order), _("Descending")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_icon_order), _("Left to right")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_icon_order), _("Right to left")); gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 0); gtk_tooltips_set_tip(tooltips, systray_icon_order, _("Specifies the order used to arrange the system tray icons. \n" "'Ascending' means that icons are sorted in ascending order of their window names. \n" "'Descending' means that icons are sorted in descending order of their window names. \n" "'Left to right' means that icons are always added to the left. \n" "'Right to left' means that icons are always added to the right."), NULL); row++; col = 2; label = gtk_label_new(_("Monitor")); 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++; systray_monitor = gtk_combo_box_new_text(); gtk_widget_show(systray_monitor); gtk_table_attach(GTK_TABLE(table), systray_monitor, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("1")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("2")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("3")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("4")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("5")); gtk_combo_box_append_text(GTK_COMBO_BOX(systray_monitor), _("6")); gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 0); gtk_tooltips_set_tip(tooltips, systray_monitor, _("Specifies the monitor on which to place the system tray. " "Due to technical limitations, the system tray cannot be displayed on multiple monitors."), NULL); change_paragraph(parent); label = gtk_label_new(_("Appearance")); 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(6, 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(_("Background")); 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++; systray_background = create_background_combo(_("Systray")); gtk_widget_show(systray_background); gtk_table_attach(GTK_TABLE(table), systray_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_background, _("Selects the background used to display the system tray. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++; col = 2; label = gtk_label_new(_("Horizontal padding")); 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++; systray_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(systray_padding_x); gtk_table_attach(GTK_TABLE(table), systray_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_padding_x, _("Specifies the horizontal padding of the system tray. " "This is the space between the border and the content inside."), NULL); row++; col = 2; label = gtk_label_new(_("Vertical padding")); 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++; systray_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(systray_padding_y); gtk_table_attach(GTK_TABLE(table), systray_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_padding_y, _("Specifies the vertical padding of the system tray. " "This is the space between the border and the content inside."), NULL); row++; col = 2; label = gtk_label_new(_("Spacing")); 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++; systray_spacing = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(systray_spacing); gtk_table_attach(GTK_TABLE(table), systray_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_spacing, _("Specifies the spacing between system tray icons."), NULL); row++; col = 2; label = gtk_label_new(_("Icon size")); 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++; systray_icon_size = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(systray_icon_size); gtk_table_attach(GTK_TABLE(table), systray_icon_size, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_icon_size, _("Specifies the size of the system tray icons, in pixels."), NULL); row++; col = 2; label = gtk_label_new(_("Icon opacity")); 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++; systray_icon_opacity = gtk_spin_button_new_with_range(0, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_opacity), 100); gtk_widget_show(systray_icon_opacity); gtk_table_attach(GTK_TABLE(table), systray_icon_opacity, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_icon_opacity, _("Specifies the opacity of the system tray icons, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon saturation")); 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++; systray_icon_saturation = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_saturation), 0); gtk_widget_show(systray_icon_saturation); gtk_table_attach(GTK_TABLE(table), systray_icon_saturation, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_icon_saturation, _("Specifies the saturation adjustment of the system tray icons, in percent."), NULL); row++; col = 2; label = gtk_label_new(_("Icon brightness")); 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++; systray_icon_brightness = gtk_spin_button_new_with_range(-100, 100, 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_brightness), 0); gtk_widget_show(systray_icon_brightness); gtk_table_attach(GTK_TABLE(table), systray_icon_brightness, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, systray_icon_brightness, _("Specifies the brightness adjustment of the system tray icons, in percent."), NULL); } void create_battery(GtkWidget *parent) { GtkWidget *table, *label; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); table = gtk_table_new(1, 2, 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(_("Thresholds")); 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(2, 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(_("Hide if charge higher than")); 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_hide_if_higher = gtk_spin_button_new_with_range(0, 101, 1); gtk_widget_show(battery_hide_if_higher); gtk_table_attach(GTK_TABLE(table), battery_hide_if_higher, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_hide_if_higher, _("Minimum battery level for which to hide the batter applet. Use 101 to always show the batter applet."), NULL); label = gtk_label_new(_("%")); 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++; row++, col = 2; label = gtk_label_new(_("Alert if charge lower than")); 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_alert_if_lower = gtk_spin_button_new_with_range(0, 100, 1); gtk_widget_show(battery_alert_if_lower); gtk_table_attach(GTK_TABLE(table), battery_alert_if_lower, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_alert_if_lower, _("Battery level for which to display an alert."), NULL); label = gtk_label_new(_("%")); 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++; row++, col = 2; label = gtk_label_new(_("Alert 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_alert_cmd = gtk_entry_new(); gtk_widget_show(battery_alert_cmd); gtk_entry_set_width_chars(GTK_ENTRY(battery_alert_cmd), 50); gtk_table_attach(GTK_TABLE(table), battery_alert_cmd, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_alert_cmd, _("Command to be executed when the alert threshold is reached."), NULL); change_paragraph(parent); label = gtk_label_new(_("AC connection events")); 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(2, 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(_("AC connected 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++; ac_connected_cmd = gtk_entry_new(); gtk_widget_show(ac_connected_cmd); gtk_entry_set_width_chars(GTK_ENTRY(ac_connected_cmd), 50); gtk_table_attach(GTK_TABLE(table), ac_connected_cmd, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, ac_connected_cmd, _("Specifies a command that will be executed when AC is connected to the system."), NULL); row++, col = 2; label = gtk_label_new(_("AC disconnected 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++; ac_disconnected_cmd = gtk_entry_new(); gtk_widget_show(ac_disconnected_cmd); gtk_entry_set_width_chars(GTK_ENTRY(ac_disconnected_cmd), 50); gtk_table_attach(GTK_TABLE(table), ac_disconnected_cmd, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, ac_disconnected_cmd, _("Specifies a command that will be executed when AC is disconnected to the system."), NULL); change_paragraph(parent); label = gtk_label_new(_("Mouse events")); 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(_("Tooltips")); 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_tooltip = gtk_check_button_new(); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_tooltip), 1); gtk_widget_show(battery_tooltip); gtk_table_attach(GTK_TABLE(table), battery_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_tooltip, _("If enabled, shows a tooltip with detailed battery information when the mouse is moved over the battery widget."), NULL); row++, 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(_("Appearance")); 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(4, 22, 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(_("Background")); 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_background = create_background_combo(_("Battery")); gtk_widget_show(battery_background); gtk_table_attach(GTK_TABLE(table), battery_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_background, _("Selects the background used to display the battery. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++, col = 2; label = gtk_label_new(_("Horizontal padding")); 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_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(battery_padding_x); gtk_table_attach(GTK_TABLE(table), battery_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_padding_x, _("Specifies the horizontal padding of the battery. " "This is the space between the border and the content inside."), NULL); row++, col = 2; label = gtk_label_new(_("Vertical padding")); 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_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(battery_padding_y); gtk_table_attach(GTK_TABLE(table), battery_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_padding_y, _("Specifies the vertical padding of the battery. " "This is the space between the border and the content inside."), NULL); row++, col = 1; battery_font_line1_set = gtk_check_button_new(); gtk_widget_show(battery_font_line1_set); gtk_table_attach(GTK_TABLE(table), battery_font_line1_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, battery_font_line1_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font first line")); 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++; PangoFontDescription *bat1_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(bat1_font_desc, pango_font_description_get_size(bat1_font_desc) - PANGO_SCALE); battery_font_line1 = gtk_font_button_new_with_font(pango_font_description_to_string(bat1_font_desc)); gtk_widget_show(battery_font_line1); pango_font_description_free(bat1_font_desc); gtk_table_attach(GTK_TABLE(table), battery_font_line1, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(battery_font_line1), TRUE); gtk_tooltips_set_tip(tooltips, battery_font_line1, _("Specifies the font used to display the first line of the battery text."), NULL); gtk_signal_connect(GTK_OBJECT(battery_font_line1_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), battery_font_line1); font_set_callback(battery_font_line1_set, battery_font_line1); row++, col = 1; battery_font_line2_set = gtk_check_button_new(); gtk_widget_show(battery_font_line2_set); gtk_table_attach(GTK_TABLE(table), battery_font_line2_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, battery_font_line2_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font second line")); 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++; PangoFontDescription *bat2_font_desc = pango_font_description_from_string(get_default_font()); pango_font_description_set_size(bat2_font_desc, pango_font_description_get_size(bat2_font_desc) - PANGO_SCALE); battery_font_line2 = gtk_font_button_new_with_font(pango_font_description_to_string(bat2_font_desc)); pango_font_description_free(bat2_font_desc); gtk_widget_show(battery_font_line2); gtk_table_attach(GTK_TABLE(table), battery_font_line2, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(battery_font_line2), TRUE); gtk_tooltips_set_tip(tooltips, battery_font_line2, _("Specifies the font used to display the second line of the battery text."), NULL); gtk_signal_connect(GTK_OBJECT(battery_font_line2_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), battery_font_line2); font_set_callback(battery_font_line2_set, battery_font_line2); row++, col = 2; label = gtk_label_new(_("Font color")); 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_font_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(battery_font_color), TRUE); gtk_widget_show(battery_font_color); gtk_table_attach(GTK_TABLE(table), battery_font_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, battery_font_color, _("Specifies the font clor used to display the battery text."), NULL); change_paragraph(parent); } void create_tooltip(GtkWidget *parent) { GtkWidget *table; GtkWidget *label; int row, col; GtkTooltips *tooltips = gtk_tooltips_new(); label = gtk_label_new(_("Timing")); 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(2, 22, 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(_("Show delay")); 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++; tooltip_show_after = gtk_spin_button_new_with_range(0, 10000, 0.1); gtk_widget_show(tooltip_show_after); gtk_table_attach(GTK_TABLE(table), tooltip_show_after, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, tooltip_show_after, _("Specifies a delay after which to show the tooltip when moving the mouse over an element."), NULL); label = gtk_label_new(_("seconds")); 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++; row++, col = 2; label = gtk_label_new(_("Hide delay")); 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++; tooltip_hide_after = gtk_spin_button_new_with_range(0, 10000, 0.1); gtk_widget_show(tooltip_hide_after); gtk_table_attach(GTK_TABLE(table), tooltip_hide_after, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, tooltip_hide_after, _("Specifies a delay after which to hide the tooltip when moving the mouse outside an element."), NULL); col++; label = gtk_label_new(_("seconds")); 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++; change_paragraph(parent); label = gtk_label_new(_("Appearance")); 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(3, 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(_("Background")); 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++; tooltip_background = create_background_combo(_("Tooltip")); gtk_widget_show(tooltip_background); gtk_table_attach(GTK_TABLE(table), tooltip_background, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, tooltip_background, _("Selects the background used to display the tooltip. " "Backgrounds can be edited in the Backgrounds tab."), NULL); row++, col = 2; label = gtk_label_new(_("Horizontal padding")); 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++; tooltip_padding_x = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(tooltip_padding_x); gtk_table_attach(GTK_TABLE(table), tooltip_padding_x, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, tooltip_padding_x, _("Specifies the horizontal padding of the tooltip. " "This is the space between the border and the content inside."), NULL); row++, col = 2; label = gtk_label_new(_("Vertical padding")); 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++; tooltip_padding_y = gtk_spin_button_new_with_range(0, 500, 1); gtk_widget_show(tooltip_padding_y); gtk_table_attach(GTK_TABLE(table), tooltip_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, tooltip_padding_y, _("Specifies the vertical padding of the tooltip. " "This is the space between the border and the content inside."), NULL); row++, col = 1; tooltip_font_set = gtk_check_button_new(); gtk_widget_show(tooltip_font_set); gtk_table_attach(GTK_TABLE(table), tooltip_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); gtk_tooltips_set_tip(tooltips, tooltip_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL); col++; label = gtk_label_new(_("Font")); 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++; tooltip_font = gtk_font_button_new_with_font(get_default_font()); gtk_widget_show(tooltip_font); gtk_table_attach(GTK_TABLE(table), tooltip_font, col, col+3, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_font_button_set_show_style(GTK_FONT_BUTTON(tooltip_font), TRUE); gtk_tooltips_set_tip(tooltips, tooltip_font, _("Specifies the font used to display the text of the tooltip."), NULL); gtk_signal_connect(GTK_OBJECT(tooltip_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), tooltip_font); font_set_callback(tooltip_font_set, tooltip_font); row++, col = 2; label = gtk_label_new(_("Font color")); 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++; tooltip_font_color = gtk_color_button_new(); gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(tooltip_font_color), TRUE); gtk_widget_show(tooltip_font_color); gtk_table_attach(GTK_TABLE(table), tooltip_font_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, tooltip_font_color, _("Specifies the font color used to display the text of the tooltip."), NULL); change_paragraph(parent); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/properties.h000066400000000000000000000173751265276141000255310ustar00rootroot00000000000000 #ifndef PROPERTIES #define PROPERTIES #include #include #include #include "../launcher/icon-theme-common.h" // panel extern GtkWidget *panel_width, *panel_height, *panel_margin_x, *panel_margin_y, *panel_padding_x, *panel_padding_y, *panel_spacing; extern GtkWidget *panel_wm_menu, *panel_dock, *panel_autohide, *panel_autohide_show_time, *panel_autohide_hide_time, *panel_autohide_size; extern GtkWidget *panel_combo_strut_policy, *panel_combo_layer, *panel_combo_width_type, *panel_combo_height_type, *panel_combo_monitor; extern GtkWidget *panel_window_name, *disable_transparency; extern GtkWidget *panel_mouse_effects; extern GtkWidget *mouse_hover_icon_opacity, *mouse_hover_icon_saturation, *mouse_hover_icon_brightness; extern GtkWidget *mouse_pressed_icon_opacity, *mouse_pressed_icon_saturation, *mouse_pressed_icon_brightness; extern GtkWidget *panel_primary_monitor_first; enum { itemsColName = 0, itemsColValue, itemsNumCols }; extern GtkListStore *panel_items, *all_items; extern GtkWidget *panel_items_view, *all_items_view; char *get_panel_items(); void set_panel_items(const char *items); extern GtkWidget *screen_position[12]; extern GSList *screen_position_group; extern GtkWidget *panel_background; #define POS_TLH 0 #define POS_TCH 1 #define POS_TRH 2 #define POS_TLV 3 #define POS_CLV 4 #define POS_BLV 5 #define POS_TRV 6 #define POS_CRV 7 #define POS_BRV 8 #define POS_BLH 9 #define POS_BCH 10 #define POS_BRH 11 // taskbar extern GtkWidget *taskbar_show_desktop, *taskbar_show_name, *taskbar_padding_x, *taskbar_padding_y, *taskbar_spacing; 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; extern GtkWidget *taskbar_name_font, *taskbar_name_font_set; 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, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks; // task extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down; extern GtkWidget *task_show_icon, *task_show_text, *task_align_center, *font_shadow; extern GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_spacing; extern GtkWidget *task_font, *task_font_set; extern GtkWidget *task_default_color, *task_default_color_set, *task_default_icon_opacity, *task_default_icon_osb_set, *task_default_icon_saturation, *task_default_icon_brightness, *task_default_background, *task_default_background_set; extern GtkWidget *task_normal_color, *task_normal_color_set, *task_normal_icon_opacity, *task_normal_icon_osb_set, *task_normal_icon_saturation, *task_normal_icon_brightness, *task_normal_background, *task_normal_background_set; extern GtkWidget *task_active_color, *task_active_color_set, *task_active_icon_opacity, *task_active_icon_osb_set, *task_active_icon_saturation, *task_active_icon_brightness, *task_active_background, *task_active_background_set; extern GtkWidget *task_urgent_color, *task_urgent_color_set, *task_urgent_icon_opacity, *task_urgent_icon_osb_set, *task_urgent_icon_saturation, *task_urgent_icon_brightness, *task_urgent_background, *task_urgent_background_set; extern GtkWidget *task_urgent_blinks; extern GtkWidget *task_iconified_color, *task_iconified_color_set, *task_iconified_icon_opacity, *task_iconified_icon_osb_set, *task_iconified_icon_saturation, *task_iconified_icon_brightness, *task_iconified_background, *task_iconified_background_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; extern GtkWidget *clock_font_line1, *clock_font_line1_set, *clock_font_line2, *clock_font_line2_set, *clock_font_color; extern GtkWidget *clock_background; // battery extern GtkWidget *battery_hide_if_higher, *battery_alert_if_lower, *battery_alert_cmd; extern GtkWidget *battery_padding_x, *battery_padding_y; extern GtkWidget *battery_font_line1, *battery_font_line1_set, *battery_font_line2, *battery_font_line2_set, *battery_font_color; extern GtkWidget *battery_background; extern GtkWidget *battery_tooltip; extern GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command; extern GtkWidget *ac_connected_cmd, *ac_disconnected_cmd; // systray extern GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing; extern GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_saturation, *systray_icon_brightness; extern GtkWidget *systray_background, *systray_monitor; // tooltip extern GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_set, *tooltip_font_color; extern GtkWidget *tooltip_task_show, *tooltip_show_after, *tooltip_hide_after; extern GtkWidget *clock_format_tooltip, *clock_tmz_tooltip; extern GtkWidget *tooltip_background; // Executor typedef struct Executor { char name[256]; GtkWidget *container; GtkWidget *page_execp; GtkWidget *page_label; GtkWidget *execp_command, *execp_interval, *execp_has_icon, *execp_cache_icon, *execp_show_tooltip; GtkWidget *execp_continuous, *execp_markup, *execp_tooltip; GtkWidget *execp_left_command, *execp_right_command; GtkWidget *execp_mclick_command, *execp_rclick_command, *execp_uwheel_command, *execp_dwheel_command; GtkWidget *execp_font, *execp_font_set, *execp_font_color, *execp_padding_x, *execp_padding_y, *execp_centered; GtkWidget *execp_background, *execp_icon_w, *execp_icon_h; } Executor; extern GArray *executors; // launcher enum { appsColIcon = 0, appsColIconName, appsColText, appsColPath, appsNumCols }; extern GtkListStore *launcher_apps, *all_apps; extern GtkWidget *launcher_apps_view, *all_apps_view; extern GtkWidget *launcher_apps_dirs; extern GtkWidget *launcher_icon_size, *launcher_icon_theme, *launcher_padding_x, *launcher_padding_y, *launcher_spacing; extern GtkWidget *launcher_icon_opacity, *launcher_icon_saturation, *launcher_icon_brightness; extern GtkWidget *margin_x, *margin_y; extern GtkWidget *launcher_background, *launcher_icon_background; extern GtkWidget *startup_notifications; extern IconThemeWrapper *icon_theme; extern GtkWidget *launcher_tooltip; extern GtkWidget *launcher_icon_theme_override; void load_desktop_file(const char *file, gboolean selected); void set_current_icon_theme(const char *theme); gchar *get_current_icon_theme(); // background enum { bgColPixbuf = 0, bgColFillColor, bgColFillOpacity, bgColBorderColor, bgColBorderOpacity, bgColBorderWidth, bgColCornerRadius, bgColText, bgColFillColorOver, bgColFillOpacityOver, bgColBorderColorOver, bgColBorderOpacityOver, bgColFillColorPress, bgColFillOpacityPress, bgColBorderColorPress, bgColBorderOpacityPress, bgNumCols }; extern GtkListStore *backgrounds; extern GtkWidget *current_background, *background_fill_color, *background_border_color, *background_fill_color_over, *background_border_color_over, *background_fill_color_press, *background_border_color_press, *background_border_width, *background_corner_radius; void background_create_new(); void background_force_update(); int background_index_safe(int index); GtkWidget *create_properties(); void execp_create_new(); Executor *execp_get_last(); void execp_remove(int i); void execp_update_indices(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/properties_rw.c000066400000000000000000002230461265276141000262260ustar00rootroot00000000000000#include #include #include #include #include "common.h" #include "properties.h" #include "properties_rw.h" void finalize_bg(); void add_entry(char *key, char *value); void hex2gdk(char *hex, GdkColor *color); void set_action(char *event, GtkWidget *combo); char *get_action(GtkWidget *combo); int config_has_panel_items; int config_has_battery; int config_has_systray; int config_battery_enabled; int config_systray_enabled; int no_items_clock_enabled; int no_items_systray_enabled; int no_items_battery_enabled; static int num_bg; static int read_bg_color_hover; static int read_border_color_hover; static int read_bg_color_press; static int read_border_color_press; void config_read_file(const char *path) { num_bg = 0; background_create_new(); FILE *fp; char line[512]; char *key, *value; if ((fp = fopen(path, "r")) == NULL) return; config_has_panel_items = 0; config_has_battery = 0; config_battery_enabled = 0; config_has_systray = 0; config_systray_enabled = 0; no_items_clock_enabled = 0; no_items_systray_enabled = 0; no_items_battery_enabled = 0; while (fgets(line, sizeof(line), fp) != NULL) { if (parse_line(line, &key, &value)) { add_entry(key, value); free(key); free(value); } } fclose(fp); finalize_bg(); if (!config_has_panel_items) { char panel_items[256]; panel_items[0] = 0; strcat(panel_items, "T"); if (config_has_battery) { if (config_battery_enabled) strcat(panel_items, "B"); } else { if (no_items_battery_enabled) strcat(panel_items, "B"); } if (config_has_systray) { if (config_systray_enabled) strcat(panel_items, "S"); } else { if (no_items_systray_enabled) strcat(panel_items, "S"); } if (no_items_clock_enabled) strcat(panel_items, "C"); set_panel_items(panel_items); } } void config_write_color(FILE *fp, const char *name, GdkColor color, int opacity) { fprintf(fp, "%s = #%02x%02x%02x %d\n", name, color.red >> 8, color.green >> 8, color.blue >> 8, opacity); } void config_write_backgrounds(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Backgrounds\n"); int index; for (index = 1; ; index++) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gboolean found = gtk_tree_model_get_iter(GTK_TREE_MODEL(backgrounds), &iter, path); gtk_tree_path_free(path); if (!found) { break; } int r; int b; GdkColor *fillColor; int fillOpacity; GdkColor *borderColor; int borderOpacity; GdkColor *fillColorOver; int fillOpacityOver; GdkColor *borderColorOver; int borderOpacityOver; GdkColor *fillColorPress; int fillOpacityPress; GdkColor *borderColorPress; int borderOpacityPress; gchar *text; gtk_tree_model_get(GTK_TREE_MODEL(backgrounds), &iter, bgColFillColor, &fillColor, bgColFillOpacity, &fillOpacity, bgColBorderColor, &borderColor, bgColBorderOpacity, &borderOpacity, bgColFillColorOver, &fillColorOver, bgColFillOpacityOver, &fillOpacityOver, bgColBorderColorOver, &borderColorOver, bgColBorderOpacityOver, &borderOpacityOver, bgColFillColorPress, &fillColorPress, bgColFillOpacityPress, &fillOpacityPress, bgColBorderColorPress, &borderColorPress, bgColBorderOpacityPress, &borderOpacityPress, bgColBorderWidth, &b, bgColCornerRadius, &r, bgColText, &text, -1); fprintf(fp, "# Background %d: %s\n", index, text ? text : ""); fprintf(fp, "rounded = %d\n", r); fprintf(fp, "border_width = %d\n", b); config_write_color(fp, "background_color", *fillColor, fillOpacity); config_write_color(fp, "border_color", *borderColor, borderOpacity); config_write_color(fp, "background_color_hover", *fillColorOver, fillOpacityOver); config_write_color(fp, "border_color_hover", *borderColorOver, borderOpacityOver); config_write_color(fp, "background_color_pressed", *fillColorPress, fillOpacityPress); config_write_color(fp, "border_color_pressed", *borderColorPress, borderOpacityPress); fprintf(fp, "\n"); } } void config_write_panel(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Panel\n"); char *items = get_panel_items(); fprintf(fp, "panel_items = %s\n", items); free(items); fprintf(fp, "panel_size = %d%s %d%s\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_width)), gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_width_type)) == 0 ? "%" : "", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_height)), gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_height_type)) == 0 ? "%" : ""); fprintf(fp, "panel_margin = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_margin_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_margin_y))); fprintf(fp, "panel_padding = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_padding_y)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_spacing))); fprintf(fp, "panel_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(panel_background))); fprintf(fp, "wm_menu = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_wm_menu)) ? 1 : 0); fprintf(fp, "panel_dock = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_dock)) ? 1 : 0); fprintf(fp, "panel_position = "); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_BLH]))) { fprintf(fp, "bottom left horizontal"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_BCH]))) { fprintf(fp, "bottom center horizontal"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_BRH]))) { fprintf(fp, "bottom right horizontal"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_TLH]))) { fprintf(fp, "top left horizontal"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_TCH]))) { fprintf(fp, "top center horizontal"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_TRH]))) { fprintf(fp, "top right horizontal"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_TLV]))) { fprintf(fp, "top left vertical"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_CLV]))) { fprintf(fp, "center left vertical"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_BLV]))) { fprintf(fp, "bottom left vertical"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_TRV]))) { fprintf(fp, "top right vertical"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_CRV]))) { fprintf(fp, "center right vertical"); } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(screen_position[POS_BRV]))) { fprintf(fp, "bottom right vertical"); } fprintf(fp, "\n"); fprintf(fp, "panel_layer = "); if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_layer)) == 0) { fprintf(fp, "top"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_layer)) == 1) { fprintf(fp, "normal"); } else { fprintf(fp, "bottom"); } fprintf(fp, "\n"); fprintf(fp, "panel_monitor = "); if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor)) == 0) { fprintf(fp, "all"); } else { fprintf(fp, "%d", gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_monitor))); } fprintf(fp, "\n"); fprintf(fp, "primary_monitor_first = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_primary_monitor_first)) ? 1 : 0); fprintf(fp, "autohide = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_autohide)) ? 1 : 0); fprintf(fp, "autohide_show_timeout = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_autohide_show_time))); fprintf(fp, "autohide_hide_timeout = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_autohide_hide_time))); fprintf(fp, "autohide_height = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(panel_autohide_size))); fprintf(fp, "strut_policy = "); if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_strut_policy)) == 0) { fprintf(fp, "follow_size"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_strut_policy)) == 1) { fprintf(fp, "minimum"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_strut_policy)) == 2) { fprintf(fp, "none"); } fprintf(fp, "\n"); fprintf(fp, "panel_window_name = %s\n", gtk_entry_get_text(GTK_ENTRY(panel_window_name))); fprintf(fp, "disable_transparency = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(disable_transparency)) ? 1 : 0); fprintf(fp, "mouse_effects = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel_mouse_effects)) ? 1 : 0); fprintf(fp, "font_shadow = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(font_shadow)) ? 1 : 0); fprintf(fp, "mouse_hover_icon_asb = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_hover_icon_opacity)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_hover_icon_saturation)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_hover_icon_brightness))); fprintf(fp, "mouse_pressed_icon_asb = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_pressed_icon_opacity)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_pressed_icon_saturation)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_pressed_icon_brightness))); fprintf(fp, "\n"); } void config_write_taskbar(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Taskbar\n"); fprintf(fp, "taskbar_mode = %s\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop)) ? "multi_desktop" : "single_desktop"); fprintf(fp, "taskbar_padding = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_padding_y)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_spacing))); fprintf(fp, "taskbar_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_inactive_background))); fprintf(fp, "taskbar_active_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_active_background))); fprintf(fp, "taskbar_name = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_show_name)) ? 1 : 0); fprintf(fp, "taskbar_hide_inactive_tasks = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_inactive_tasks)) ? 1 : 0); fprintf(fp, "taskbar_hide_different_monitor = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_diff_monitor)) ? 1 : 0); fprintf(fp, "taskbar_always_show_all_desktop_tasks = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_always_show_all_desktop_tasks)) ? 1 : 0); fprintf(fp, "taskbar_name_padding = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_name_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_name_padding_y))); fprintf(fp, "taskbar_name_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_name_inactive_background))); fprintf(fp, "taskbar_name_active_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_name_active_background))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_name_font_set))) fprintf(fp, "taskbar_name_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(taskbar_name_font))); GdkColor color; gtk_color_button_get_color(GTK_COLOR_BUTTON(taskbar_name_inactive_color), &color); config_write_color(fp, "taskbar_name_font_color", color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(taskbar_name_inactive_color)) * 100 / 0xffff); gtk_color_button_get_color(GTK_COLOR_BUTTON(taskbar_name_active_color), &color); config_write_color(fp, "taskbar_name_active_font_color", color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(taskbar_name_active_color)) * 100 / 0xffff); fprintf(fp, "taskbar_distribute_size = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_distribute_size)) ? 1 : 0); fprintf(fp, "taskbar_sort_order = "); if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) <= 0) { fprintf(fp, "none"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 1) { fprintf(fp, "title"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 2) { fprintf(fp, "center"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 3) { fprintf(fp, "mru"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 4) { fprintf(fp, "lru"); } else { fprintf(fp, "none"); } 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"); } void config_write_task_font_color(FILE *fp, char *name, GtkWidget *task_color) { GdkColor color; gtk_color_button_get_color(GTK_COLOR_BUTTON(task_color), &color); char full_name[128]; sprintf(full_name, "task%s_font_color", name); config_write_color(fp, full_name, color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(task_color)) * 100 / 0xffff); } void config_write_task_icon_osb(FILE *fp, char *name, GtkWidget *widget_opacity, GtkWidget *widget_saturation, GtkWidget *widget_brightness) { char full_name[128]; sprintf(full_name, "task%s_icon_asb", name); fprintf(fp, "%s = %d %d %d\n", full_name, (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget_opacity)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget_saturation)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget_brightness))); } void config_write_task_background(FILE *fp, char *name, GtkWidget *task_background) { char full_name[128]; sprintf(full_name, "task%s_background_id", name); fprintf(fp, "%s = %d\n", full_name, gtk_combo_box_get_active(GTK_COMBO_BOX(task_background))); } void config_write_task(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Task\n"); fprintf(fp, "task_text = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_show_text)) ? 1 : 0); fprintf(fp, "task_icon = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_show_icon)) ? 1 : 0); fprintf(fp, "task_centered = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_align_center)) ? 1 : 0); fprintf(fp, "urgent_nb_of_blink = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_urgent_blinks))); fprintf(fp, "task_maximum_size = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_maximum_width)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_maximum_height))); fprintf(fp, "task_padding = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_padding_y)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_spacing))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_font_set))) fprintf(fp, "task_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(task_font))); fprintf(fp, "task_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(tooltip_task_show)) ? 1 : 0); // same for: "" _normal _active _urgent _iconified if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_default_color_set))) { config_write_task_font_color(fp, "", task_default_color); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_normal_color_set))) { config_write_task_font_color(fp, "_normal", task_normal_color); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_active_color_set))) { config_write_task_font_color(fp, "_active", task_active_color); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_urgent_color_set))) { config_write_task_font_color(fp, "_urgent", task_urgent_color); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_iconified_color_set))) { config_write_task_font_color(fp, "_iconified", task_iconified_color); } // same for: "" _normal _active _urgent _iconified if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_default_icon_osb_set))) { config_write_task_icon_osb(fp, "", task_default_icon_opacity, task_default_icon_saturation, task_default_icon_brightness); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_normal_icon_osb_set))) { config_write_task_icon_osb(fp, "_normal", task_normal_icon_opacity, task_normal_icon_saturation, task_normal_icon_brightness); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_active_icon_osb_set))) { config_write_task_icon_osb(fp, "_active", task_active_icon_opacity, task_active_icon_saturation, task_active_icon_brightness); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_urgent_icon_osb_set))) { config_write_task_icon_osb(fp, "_urgent", task_urgent_icon_opacity, task_urgent_icon_saturation, task_urgent_icon_brightness); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_iconified_icon_osb_set))) { config_write_task_icon_osb(fp, "_iconified", task_iconified_icon_opacity, task_iconified_icon_saturation, task_iconified_icon_brightness); } // same for: "" _normal _active _urgent _iconified if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_default_background_set))) { config_write_task_background(fp, "", task_default_background); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_normal_background_set))) { config_write_task_background(fp, "_normal", task_normal_background); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_active_background_set))) { config_write_task_background(fp, "_active", task_active_background); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_urgent_background_set))) { config_write_task_background(fp, "_urgent", task_urgent_background); } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_iconified_background_set))) { config_write_task_background(fp, "_iconified", task_iconified_background); } fprintf(fp, "mouse_left = %s\n", get_action(task_mouse_left)); fprintf(fp, "mouse_middle = %s\n", get_action(task_mouse_middle)); fprintf(fp, "mouse_right = %s\n", get_action(task_mouse_right)); fprintf(fp, "mouse_scroll_up = %s\n", get_action(task_mouse_scroll_up)); fprintf(fp, "mouse_scroll_down = %s\n", get_action(task_mouse_scroll_down)); fprintf(fp, "\n"); } void config_write_systray(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# System tray (notification area)\n"); fprintf(fp, "systray_padding = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_padding_y)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_spacing))); fprintf(fp, "systray_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(systray_background))); fprintf(fp, "systray_sort = "); if (gtk_combo_box_get_active(GTK_COMBO_BOX(systray_icon_order)) == 0) { fprintf(fp, "ascending"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(systray_icon_order)) == 1) { fprintf(fp, "descending"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(systray_icon_order)) == 2) { fprintf(fp, "left2right"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(systray_icon_order)) == 3) { fprintf(fp, "right2left"); } fprintf(fp, "\n"); fprintf(fp, "systray_icon_size = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_size))); fprintf(fp, "systray_icon_asb = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_opacity)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_saturation)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_brightness))); fprintf(fp, "systray_monitor = "); fprintf(fp, "%d", MAX(1, 1 + gtk_combo_box_get_active(GTK_COMBO_BOX(systray_monitor)))); fprintf(fp, "\n"); fprintf(fp, "\n"); } void config_write_launcher(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Launcher\n"); fprintf(fp, "launcher_padding = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_padding_y)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_spacing))); fprintf(fp, "launcher_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(launcher_background))); fprintf(fp, "launcher_icon_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(launcher_icon_background))); fprintf(fp, "launcher_icon_size = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_icon_size))); fprintf(fp, "launcher_icon_asb = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_icon_opacity)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_icon_saturation)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(launcher_icon_brightness))); gchar *icon_theme = get_current_icon_theme(); if (icon_theme && !g_str_equal(icon_theme, "")) { fprintf(fp, "launcher_icon_theme = %s\n", icon_theme); g_free(icon_theme); icon_theme = NULL; } fprintf(fp, "launcher_icon_theme_override = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_icon_theme_override)) ? 1 : 0); fprintf(fp, "startup_notifications = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(startup_notifications)) ? 1 : 0); fprintf(fp, "launcher_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_tooltip)) ? 1 : 0); int index; for (index = 0; ; index++) { GtkTreePath *path; GtkTreeIter iter; path = gtk_tree_path_new_from_indices(index, -1); gboolean found = gtk_tree_model_get_iter(GTK_TREE_MODEL(launcher_apps), &iter, path); gtk_tree_path_free(path); if (!found) { break; } gchar *app_path; gtk_tree_model_get(GTK_TREE_MODEL(launcher_apps), &iter, appsColPath, &app_path, -1); char *contracted = contract_tilde(app_path); fprintf(fp, "launcher_item_app = %s\n", contracted); free(contracted); g_free(app_path); } gchar **app_dirs = g_strsplit(gtk_entry_get_text(GTK_ENTRY(launcher_apps_dirs)), ",", 0); for (index = 0; app_dirs[index]; index++) { gchar *dir = app_dirs[index]; g_strstrip(dir); if (strlen(dir) > 0) { char *contracted = contract_tilde(dir); fprintf(fp, "launcher_apps_dir = %s\n", contracted); free(contracted); } } g_strfreev(app_dirs); fprintf(fp, "\n"); } void config_write_clock(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Clock\n"); fprintf(fp, "time1_format = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_format_line1))); fprintf(fp, "time2_format = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_format_line2))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(clock_font_line1_set))) fprintf(fp, "time1_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_line1))); fprintf(fp, "time1_timezone = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_tmz_line1))); fprintf(fp, "time2_timezone = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_tmz_line2))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(clock_font_line2_set))) fprintf(fp, "time2_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_line2))); GdkColor color; gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_font_color), &color); config_write_color(fp, "clock_font_color", color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(clock_font_color)) * 100 / 0xffff); fprintf(fp, "clock_padding = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(clock_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(clock_padding_y))); fprintf(fp, "clock_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(clock_background))); fprintf(fp, "clock_tooltip = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_format_tooltip))); 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"); } void config_write_battery(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Battery\n"); fprintf(fp, "battery_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(battery_tooltip)) ? 1 : 0); fprintf(fp, "battery_low_status = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(battery_alert_if_lower))); fprintf(fp, "battery_low_cmd = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_alert_cmd))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(battery_font_line1_set))) fprintf(fp, "bat1_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(battery_font_line1))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(battery_font_line2_set))) fprintf(fp, "bat2_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(battery_font_line2))); GdkColor color; gtk_color_button_get_color(GTK_COLOR_BUTTON(battery_font_color), &color); config_write_color(fp, "battery_font_color", color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(battery_font_color)) * 100 / 0xffff); fprintf(fp, "battery_padding = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(battery_padding_x)), (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, "ac_connected_cmd = %s\n", gtk_entry_get_text(GTK_ENTRY(ac_connected_cmd))); fprintf(fp, "ac_disconnected_cmd = %s\n", gtk_entry_get_text(GTK_ENTRY(ac_disconnected_cmd))); fprintf(fp, "\n"); } void config_write_execp(FILE *fp) { for (int i = 0; i < executors->len; i++) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Executor %d\n", i + 1); Executor *executor = &g_array_index(executors, Executor, i); fprintf(fp, "execp = new\n"); fprintf(fp, "execp_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_command))); fprintf(fp, "execp_interval = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(executor->execp_interval))); fprintf(fp, "execp_has_icon = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_has_icon)) ? 1 : 0); fprintf(fp, "execp_cache_icon = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_cache_icon)) ? 1 : 0); fprintf(fp, "execp_continuous = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(executor->execp_continuous))); fprintf(fp, "execp_markup = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_markup)) ? 1 : 0); if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_show_tooltip))) { fprintf(fp, "execp_tooltip = \n"); } else { const gchar *text = gtk_entry_get_text(GTK_ENTRY(executor->execp_tooltip)); if (strlen(text) > 0) fprintf(fp, "execp_tooltip = %s\n", text); } fprintf(fp, "execp_lclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_left_command))); fprintf(fp, "execp_rclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_right_command))); fprintf(fp, "execp_mclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_mclick_command))); fprintf(fp, "execp_uwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_uwheel_command))); fprintf(fp, "execp_dwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_dwheel_command))); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_font_set))) fprintf(fp, "execp_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(executor->execp_font))); GdkColor color; gtk_color_button_get_color(GTK_COLOR_BUTTON(executor->execp_font_color), &color); config_write_color(fp, "execp_font_color", color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(executor->execp_font_color)) * 100 / 0xffff); fprintf(fp, "execp_padding = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(executor->execp_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(executor->execp_padding_y))); fprintf(fp, "execp_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_background))); fprintf(fp, "execp_centered = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_centered)) ? 1 : 0); fprintf(fp, "execp_icon_w = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(executor->execp_icon_w))); fprintf(fp, "execp_icon_h = %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(executor->execp_icon_h))); fprintf(fp, "\n"); } } void config_write_tooltip(FILE *fp) { fprintf(fp, "#-------------------------------------\n"); fprintf(fp, "# Tooltip\n"); fprintf(fp, "tooltip_show_timeout = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(tooltip_show_after))); fprintf(fp, "tooltip_hide_timeout = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(tooltip_hide_after))); fprintf(fp, "tooltip_padding = %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(tooltip_padding_x)), (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(tooltip_padding_y))); fprintf(fp, "tooltip_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(tooltip_background))); GdkColor color; gtk_color_button_get_color(GTK_COLOR_BUTTON(tooltip_font_color), &color); config_write_color(fp, "tooltip_font_color", color, gtk_color_button_get_alpha(GTK_COLOR_BUTTON(tooltip_font_color)) * 100 / 0xffff); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(tooltip_font_set))) fprintf(fp, "tooltip_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(tooltip_font))); fprintf(fp, "\n"); } // Similar to BSD checksum, except we skip the first line (metadata) unsigned short checksum_txt(FILE *f) { unsigned int checksum = 0; fseek(f, 0, SEEK_SET); // Skip the first line int c; do { c = getc(f); } while (c != EOF && c != '\n'); while ((c = getc(f)) != EOF) { // Rotate right checksum = (checksum >> 1) + ((checksum & 1) << 15); // Update checksum checksum += c; // Truncate to 16 bits checksum &= 0xffff; } return checksum; } void config_save_file(const char *path) { printf("config_save_file : %s\n", path); FILE *fp; if ((fp = fopen(path, "w+t")) == NULL) return; unsigned short checksum = 0; fprintf(fp, "#---- Generated by tint2conf %04x ----\n", checksum); fprintf(fp, "# See https://gitlab.com/o9000/tint2/wikis/Configure for \n"); fprintf(fp, "# full documentation of the configuration options.\n"); config_write_backgrounds(fp); config_write_panel(fp); config_write_taskbar(fp); config_write_task(fp); config_write_systray(fp); config_write_launcher(fp); config_write_clock(fp); config_write_battery(fp); config_write_execp(fp); config_write_tooltip(fp); checksum = checksum_txt(fp); fseek(fp, 0, SEEK_SET); fflush(fp); fprintf(fp, "#---- Generated by tint2conf %04x ----\n", checksum); fclose(fp); } gboolean config_is_manual(const char *path) { FILE *fp; char line[512]; gboolean result; if ((fp = fopen(path, "r")) == NULL) return FALSE; result = TRUE; if (fgets(line, sizeof(line), fp) != NULL) { if (!g_regex_match_simple("^#---- Generated by tint2conf [0-9a-f][0-9a-f][0-9a-f][0-9a-f] ----\n$", line, 0, 0)) { result = TRUE; } else { unsigned short checksum1 = checksum_txt(fp); unsigned short checksum2 = 0; if (sscanf(line, "#---- Generated by tint2conf %hxu", &checksum2) == 1) { result = checksum1 != checksum2; } else { result = TRUE; } } } fclose(fp); return result; } void finalize_bg() { if (num_bg > 0) { if (!read_bg_color_hover) { GdkColor fillColor; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_fill_color), &fillColor); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color_over), &fillColor); int fillOpacity = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_fill_color)); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color_over), fillOpacity); background_force_update(); } if (!read_border_color_hover) { GdkColor fillColor; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color), &fillColor); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_over), &fillColor); int fillOpacity = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color)); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_over), fillOpacity); background_force_update(); } if (!read_bg_color_press) { GdkColor fillColor; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_fill_color), &fillColor); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color_press), &fillColor); int fillOpacity = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_fill_color)); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color_press), fillOpacity); background_force_update(); } if (!read_border_color_press) { GdkColor fillColor; gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color_over), &fillColor); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_press), &fillColor); int fillOpacity = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color_over)); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_press), fillOpacity); background_force_update(); } } } void add_entry(char *key, char *value) { char *value1=0, *value2=0, *value3=0; /* Background and border */ if (strcmp(key, "rounded") == 0) { // 'rounded' is the first parameter => alloc a new background finalize_bg(); background_create_new(); num_bg++; read_bg_color_hover = 0; read_border_color_hover = 0; read_bg_color_press = 0; read_border_color_press = 0; gtk_spin_button_set_value(GTK_SPIN_BUTTON(background_corner_radius), atoi(value)); background_force_update(); } else if (strcmp(key, "border_width") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(background_border_width), atoi(value)); background_force_update(); } else if (strcmp(key, "background_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color), &col); int alpha = value2 ? atoi(value2) : 50; gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color), (alpha*65535)/100); background_force_update(); } else if (strcmp(key, "border_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color), &col); int alpha = value2 ? atoi(value2) : 50; gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color), (alpha*65535)/100); background_force_update(); } else if (strcmp(key, "background_color_hover") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color_over), &col); int alpha = value2 ? atoi(value2) : 50; gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color_over), (alpha*65535)/100); background_force_update(); read_bg_color_hover = 1; } else if (strcmp(key, "border_color_hover") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_over), &col); int alpha = value2 ? atoi(value2) : 50; gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_over), (alpha*65535)/100); background_force_update(); read_border_color_hover = 1; } else if (strcmp(key, "background_color_pressed") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_fill_color_press), &col); int alpha = value2 ? atoi(value2) : 50; gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_fill_color_press), (alpha*65535)/100); background_force_update(); read_bg_color_press = 1; } else if (strcmp(key, "border_color_pressed") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_press), &col); int alpha = value2 ? atoi(value2) : 50; gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_press), (alpha*65535)/100); background_force_update(); read_border_color_press = 1; } /* Panel */ else if (strcmp(key, "panel_size") == 0) { extract_values(value, &value1, &value2, &value3); char *b; if ((b = strchr(value1, '%'))) { b[0] = '\0'; gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 0); } else gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_width), atoi(value1)); if (atoi(value1) == 0) { // full width mode gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_width), 100); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 0); } if ((b = strchr(value2, '%'))) { b[0] = '\0'; gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_height_type), 0); } else gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_height_type), 1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_height), atoi(value2)); } else if (strcmp(key, "panel_items") == 0) { config_has_panel_items = 1; set_panel_items(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(value2)); } else if (strcmp(key, "panel_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_padding_x), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_spacing), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_padding_y), atoi(value2)); if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_spacing), atoi(value3)); } else if (strcmp(key, "panel_position") == 0) { extract_values(value, &value1, &value2, &value3); char vpos, hpos, orientation; vpos = 'B'; hpos = 'C'; orientation = 'H'; if (value1) { if (strcmp(value1, "top") == 0) vpos = 'T'; if (strcmp(value1, "bottom") == 0) vpos = 'B'; if (strcmp(value1, "center") == 0) vpos = 'C'; } if (value2) { if (strcmp(value2, "left") == 0) hpos = 'L'; if (strcmp(value2, "right") == 0) hpos = 'R'; if (strcmp(value2, "center") == 0) hpos = 'C'; } if (value3) { if (strcmp(value3, "horizontal") == 0) orientation = 'H'; if (strcmp(value3, "vertical") == 0) orientation = 'V'; } if (vpos == 'T' && hpos == 'L' && orientation == 'H') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_TLH]), 1); if (vpos == 'T' && hpos == 'C' && orientation == 'H') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_TCH]), 1); if (vpos == 'T' && hpos == 'R' && orientation == 'H') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_TRH]), 1); if (vpos == 'B' && hpos == 'L' && orientation == 'H') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_BLH]), 1); if (vpos == 'B' && hpos == 'C' && orientation == 'H') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_BCH]), 1); if (vpos == 'B' && hpos == 'R' && orientation == 'H') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_BRH]), 1); if (vpos == 'T' && hpos == 'L' && orientation == 'V') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_TLV]), 1); if (vpos == 'C' && hpos == 'L' && orientation == 'V') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_CLV]), 1); if (vpos == 'B' && hpos == 'L' && orientation == 'V') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_BLV]), 1); if (vpos == 'T' && hpos == 'R' && orientation == 'V') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_TRV]), 1); if (vpos == 'C' && hpos == 'R' && orientation == 'V') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_CRV]), 1); if (vpos == 'B' && hpos == 'R' && orientation == 'V') gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(screen_position[POS_BRV]), 1); } else if (strcmp(key, "panel_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(panel_background), id); } else if (strcmp(key, "panel_window_name") == 0) { gtk_entry_set_text(GTK_ENTRY(panel_window_name), value); } else if (strcmp(key, "disable_transparency") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(disable_transparency), atoi(value)); } else if (strcmp(key, "mouse_effects") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_mouse_effects), atoi(value)); } else if (strcmp(key, "mouse_hover_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_hover_icon_opacity), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_hover_icon_saturation), atoi(value2)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_hover_icon_brightness), atoi(value3)); } else if (strcmp(key, "mouse_pressed_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_pressed_icon_opacity), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_pressed_icon_saturation), atoi(value2)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(mouse_pressed_icon_brightness), atoi(value3)); } else if (strcmp(key, "font_shadow") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(font_shadow), atoi(value)); } else if (strcmp(key, "wm_menu") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_wm_menu), atoi(value)); } else if (strcmp(key, "panel_dock") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_dock), atoi(value)); } else if (strcmp(key, "panel_layer") == 0) { if (strcmp(value, "bottom") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 2); else if (strcmp(value, "top") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 0); else gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 1); } 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, "1") == 0) 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), 2); else if (strcmp(value, "3") == 0) 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), 4); else if (strcmp(value, "5") == 0) 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), 6); } else if (strcmp(key, "primary_monitor_first") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_primary_monitor_first), atoi(value)); } /* autohide options */ else if (strcmp(key, "autohide") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_autohide), atoi(value)); } else if (strcmp(key, "autohide_show_timeout") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_show_time), atof(value)); } else if (strcmp(key, "autohide_hide_timeout") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_hide_time), atof(value)); } else if (strcmp(key, "strut_policy") == 0) { if (strcmp(value, "follow_size") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 0); else if (strcmp(value, "none") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 2); else gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 1); } else if (strcmp(key, "autohide_height") == 0) { if (atoi(value) <= 0) { // autohide need height > 0 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_size), 1); } else { gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_size), atoi(value)); } } /* Battery */ else if (strcmp(key, "battery") == 0) { // Obsolete option config_has_battery = 1; config_battery_enabled = atoi(value); } else if (strcmp(key, "battery_tooltip") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_tooltip), atoi(value)); } else if (strcmp(key, "battery_low_status") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(battery_alert_if_lower), atof(value)); } else if (strcmp(key, "battery_low_cmd") == 0) { gtk_entry_set_text(GTK_ENTRY(battery_alert_cmd), value); } else if (strcmp(key, "bat1_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(battery_font_line1), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_font_line1_set), TRUE); } else if (strcmp(key, "bat2_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(battery_font_line2), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_font_line2_set), TRUE); } else if (strcmp(key, "battery_font_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(battery_font_color), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(battery_font_color), (alpha*65535)/100); } } else if (strcmp(key, "battery_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(battery_padding_x), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(battery_padding_y), atoi(value2)); } else if (strcmp(key, "battery_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(battery_background), id); } else if (strcmp(key, "battery_hide") == 0) { int percentage_hide = atoi(value); if (percentage_hide == 0) gtk_spin_button_set_value(GTK_SPIN_BUTTON(battery_hide_if_higher), 101.0); 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); } else if (strcmp(key, "ac_connected_cmd") == 0) { gtk_entry_set_text(GTK_ENTRY(ac_connected_cmd), value); } else if (strcmp(key, "ac_disconnected_cmd") == 0) { gtk_entry_set_text(GTK_ENTRY(ac_disconnected_cmd), value); } /* Clock */ else if (strcmp(key, "time1_format") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_format_line1), value); no_items_clock_enabled = strlen(value) > 0; } else if (strcmp(key, "time2_format") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_format_line2), value); } else if (strcmp(key, "time1_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(clock_font_line1), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(clock_font_line1_set), TRUE); } else if (strcmp(key, "time1_timezone") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_tmz_line1), value); } else if (strcmp(key, "time2_timezone") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_tmz_line2), value); } else if (strcmp(key, "time2_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(clock_font_line2), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(clock_font_line2_set), TRUE); } else if (strcmp(key, "clock_font_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(clock_font_color), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(clock_font_color), (alpha*65535)/100); } } else if (strcmp(key, "clock_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(clock_padding_x), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(clock_padding_y), atoi(value2)); } else if (strcmp(key, "clock_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(clock_background), id); } else if (strcmp(key, "clock_tooltip") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_format_tooltip), value); } else if (strcmp(key, "clock_tooltip_timezone") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_tmz_tooltip), value); } else if (strcmp(key, "clock_lclick_command") == 0) { gtk_entry_set_text(GTK_ENTRY(clock_left_command), 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) { if (strcmp(value, "multi_desktop") == 0) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 1); else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 0); } else if (strcmp(key, "taskbar_distribute_size") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_distribute_size), atoi(value)); } else if (strcmp(key, "taskbar_sort_order") == 0) { if (strcmp(value, "none") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0); else if (strcmp(value, "title") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 1); else if (strcmp(value, "center") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 2); else if (strcmp(value, "mru") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 3); else if (strcmp(value, "lru") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 4); 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)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_spacing), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_padding_y), atoi(value2)); if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_spacing), atoi(value3)); } else if (strcmp(key, "taskbar_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_inactive_background), id); if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_active_background)) < 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_active_background), id); } else if (strcmp(key, "taskbar_active_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_active_background), id); } else if (strcmp(key, "taskbar_name") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_name), atoi(value)); } else if (strcmp(key, "taskbar_hide_inactive_tasks") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_hide_inactive_tasks), atoi(value)); } else if (strcmp(key, "taskbar_hide_different_monitor") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_hide_diff_monitor), atoi(value)); } else if (strcmp(key, "taskbar_always_show_all_desktop_tasks") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_always_show_all_desktop_tasks), atoi(value)); } else if (strcmp(key, "taskbar_name_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_name_padding_x), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_name_padding_y), atoi(value2)); } else if (strcmp(key, "taskbar_name_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_name_inactive_background), id); if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_name_active_background)) < 0) gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_name_active_background), id); } else if (strcmp(key, "taskbar_name_active_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_name_active_background), id); } else if (strcmp(key, "taskbar_name_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(taskbar_name_font), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_name_font_set), TRUE); } else if (strcmp(key, "taskbar_name_font_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(taskbar_name_inactive_color), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(taskbar_name_inactive_color), (alpha*65535)/100); } } else if (strcmp(key, "taskbar_name_active_font_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(taskbar_name_active_color), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(taskbar_name_active_color), (alpha*65535)/100); } } /* Task */ else if (strcmp(key, "task_text") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_show_text), atoi(value)); } else if (strcmp(key, "task_icon") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_show_icon), atoi(value)); } else if (strcmp(key, "task_centered") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_align_center), atoi(value)); } else if (strcmp(key, "urgent_nb_of_blink") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_urgent_blinks), atoi(value)); } else if (strcmp(key, "task_width") == 0) { // old parameter : just for backward compatibility gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_width), atoi(value)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_height), 30.0); } else if (strcmp(key, "task_maximum_size") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_width), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_height), 30.0); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_height), atoi(value2)); } else if (strcmp(key, "task_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_padding_x), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_spacing), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_padding_y), atoi(value2)); if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_spacing), atoi(value3)); } else if (strcmp(key, "task_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(task_font), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_font_set), TRUE); } else if (g_regex_match_simple("task.*_font_color", key, 0, 0)) { gchar** split = g_regex_split_simple("_", key, 0, 0); GtkWidget *widget = NULL; if (strcmp(split[1], "normal") == 0) { widget = task_normal_color; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_normal_color_set), 1); } else if (strcmp(split[1], "active") == 0) { widget = task_active_color; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_active_color_set), 1); } else if (strcmp(split[1], "urgent") == 0) { widget = task_urgent_color; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_urgent_color_set), 1); } else if (strcmp(split[1], "iconified") == 0) { widget = task_iconified_color; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_iconified_color_set), 1); } else if (strcmp(split[1], "font") == 0) { widget = task_default_color; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_default_color_set), 1); } g_strfreev(split); if (widget) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(widget), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(widget), (alpha*65535)/100); } } } else if (g_regex_match_simple("task.*_icon_asb", key, 0, 0)) { gchar** split = g_regex_split_simple("_", key, 0, 0); GtkWidget *widget_opacity = NULL; GtkWidget *widget_saturation = NULL; GtkWidget *widget_brightness = NULL; if (strcmp(split[1], "normal") == 0) { widget_opacity = task_normal_icon_opacity; widget_saturation = task_normal_icon_saturation; widget_brightness = task_normal_icon_brightness; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_normal_icon_osb_set), 1); } else if (strcmp(split[1], "active") == 0) { widget_opacity = task_active_icon_opacity; widget_saturation = task_active_icon_saturation; widget_brightness = task_active_icon_brightness; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_active_icon_osb_set), 1); } else if (strcmp(split[1], "urgent") == 0) { widget_opacity = task_urgent_icon_opacity; widget_saturation = task_urgent_icon_saturation; widget_brightness = task_urgent_icon_brightness; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_urgent_icon_osb_set), 1); } else if (strcmp(split[1], "iconified") == 0) { widget_opacity = task_iconified_icon_opacity; widget_saturation = task_iconified_icon_saturation; widget_brightness = task_iconified_icon_brightness; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_iconified_icon_osb_set), 1); } else if (strcmp(split[1], "icon") == 0) { widget_opacity = task_default_icon_opacity; widget_saturation = task_default_icon_saturation; widget_brightness = task_default_icon_brightness; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_default_icon_osb_set), 1); } g_strfreev(split); if (widget_opacity && widget_saturation && widget_brightness) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_opacity), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_saturation), atoi(value2)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_brightness), atoi(value3)); } } else if (g_regex_match_simple("task.*_background_id", key, 0, 0)) { gchar** split = g_regex_split_simple("_", key, 0, 0); GtkWidget *widget = NULL; if (strcmp(split[1], "normal") == 0) { widget = task_normal_background; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_normal_background_set), 1); } else if (strcmp(split[1], "active") == 0) { widget = task_active_background; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_active_background_set), 1); } else if (strcmp(split[1], "urgent") == 0) { widget = task_urgent_background; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_urgent_background_set), 1); } else if (strcmp(split[1], "iconified") == 0) { widget = task_iconified_background; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_iconified_background_set), 1); } else if (strcmp(split[1], "background") == 0) { widget = task_default_background; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_default_background_set), 1); } g_strfreev(split); if (widget) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(widget), id); } } // "tooltip" is deprecated but here for backwards compatibility else if (strcmp(key, "task_tooltip") == 0 || strcmp(key, "tooltip") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tooltip_task_show), atoi(value)); } /* Systray */ else if (strcmp(key, "systray") == 0) { // Obsolete option config_has_systray = 1; config_systray_enabled = atoi(value); } else if (strcmp(key, "systray_padding") == 0) { no_items_systray_enabled = 1; extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_padding_x), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_spacing), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_padding_y), atoi(value2)); if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_spacing), atoi(value3)); } else if (strcmp(key, "systray_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(systray_background), id); } else if (strcmp(key, "systray_sort") == 0) { if (strcmp(value, "descending") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 1); else if (strcmp(value, "ascending") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 0); else if (strcmp(value, "right2left") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 3); else // default to left2right gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 2); } else if (strcmp(key, "systray_icon_size") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_size), atoi(value)); } else if (strcmp(key, "systray_monitor") == 0) { if (strcmp(value, "1") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 0); else if (strcmp(value, "2") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 1); else if (strcmp(value, "3") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 2); else if (strcmp(value, "4") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 3); else if (strcmp(value, "5") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 4); else if (strcmp(value, "6") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 5); } else if (strcmp(key, "systray_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_opacity), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_saturation), atoi(value2)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_brightness), atoi(value3)); } /* Launcher */ else if (strcmp(key, "launcher_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_padding_x), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_spacing), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_padding_y), atoi(value2)); if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_spacing), atoi(value3)); } else if (strcmp(key, "launcher_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(launcher_background), id); } else if (strcmp(key, "launcher_icon_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(launcher_icon_background), id); } else if (strcmp(key, "launcher_icon_size") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_size), atoi(value)); } else if (strcmp(key, "launcher_item_app") == 0) { char *path = expand_tilde(value); load_desktop_file(path, TRUE); load_desktop_file(path, FALSE); free(path); } else if (strcmp(key, "launcher_apps_dir") == 0) { char *path = expand_tilde(value); if (gtk_entry_get_text_length(GTK_ENTRY(launcher_apps_dirs)) > 0) { gtk_entry_append_text(GTK_ENTRY(launcher_apps_dirs), ","); } gtk_entry_append_text(GTK_ENTRY(launcher_apps_dirs), path); free(path); } else if (strcmp(key, "launcher_icon_theme") == 0) { set_current_icon_theme(value); } else if (strcmp(key, "launcher_icon_theme_override") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_icon_theme_override), atoi(value)); } else if (strcmp(key, "launcher_tooltip") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_tooltip), atoi(value)); } else if (strcmp(key, "startup_notifications") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(startup_notifications), atoi(value)); } else if (strcmp(key, "launcher_icon_asb") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_opacity), atoi(value1)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_saturation), atoi(value2)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(launcher_icon_brightness), atoi(value3)); } /* Tooltip */ else if (strcmp(key, "tooltip_show_timeout") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(tooltip_show_after), atof(value)); } else if (strcmp(key, "tooltip_hide_timeout") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(tooltip_hide_after), atof(value)); } else if (strcmp(key, "tooltip_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(tooltip_padding_x), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(tooltip_padding_y), atoi(value2)); } else if (strcmp(key, "tooltip_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(tooltip_background), id); } else if (strcmp(key, "tooltip_font_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(tooltip_font_color), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(tooltip_font_color), (alpha*65535)/100); } } else if (strcmp(key, "tooltip_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(tooltip_font), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tooltip_font_set), TRUE); } /* Mouse actions */ else if (strcmp(key, "mouse_left") == 0) { set_action(value, task_mouse_left); } else if (strcmp(key, "mouse_middle") == 0) { set_action(value, task_mouse_middle); } else if (strcmp(key, "mouse_right") == 0) { set_action(value, task_mouse_right); } else if (strcmp(key, "mouse_scroll_up") == 0) { set_action(value, task_mouse_scroll_up); } else if (strcmp(key, "mouse_scroll_down") == 0) { set_action(value, task_mouse_scroll_down); } /* Executor */ else if (strcmp(key, "execp") == 0) { execp_create_new(); } else if (strcmp(key, "execp_command") == 0) { gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_command), value); } else if (strcmp(key, "execp_interval") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_interval), atoi(value)); } else if (strcmp(key, "execp_has_icon") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_has_icon), atoi(value)); } else if (strcmp(key, "execp_cache_icon") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_cache_icon), atoi(value)); } else if (strcmp(key, "execp_continuous") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_continuous), atoi(value)); } else if (strcmp(key, "execp_markup") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_markup), atoi(value)); } else if (strcmp(key, "execp_tooltip") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_show_tooltip), 1); gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_tooltip), value); } else if (strcmp(key, "execp_lclick_command") == 0) { gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_left_command), value); } else if (strcmp(key, "execp_rclick_command") == 0) { gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_right_command), value); } else if (strcmp(key, "execp_mclick_command") == 0) { gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_mclick_command), value); } else if (strcmp(key, "execp_uwheel_command") == 0) { gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_uwheel_command), value); } else if (strcmp(key, "execp_dwheel_command") == 0) { gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_dwheel_command), value); } else if (strcmp(key, "execp_font") == 0) { gtk_font_button_set_font_name(GTK_FONT_BUTTON(execp_get_last()->execp_font), value); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_font_set), TRUE); } else if (strcmp(key, "execp_font_color") == 0) { extract_values(value, &value1, &value2, &value3); GdkColor col; hex2gdk(value1, &col); gtk_color_button_set_color(GTK_COLOR_BUTTON(execp_get_last()->execp_font_color), &col); if (value2) { int alpha = atoi(value2); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(execp_get_last()->execp_font_color), (alpha*65535)/100); } } else if (strcmp(key, "execp_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_padding_x), atoi(value1)); if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_padding_y), atoi(value2)); } else if (strcmp(key, "execp_background_id") == 0) { int id = background_index_safe(atoi(value)); gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_background), id); } else if (strcmp(key, "execp_icon_w") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_icon_w), atoi(value)); } else if (strcmp(key, "execp_icon_h") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_icon_h), atoi(value)); } else if (strcmp(key, "execp_centered") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_centered), atoi(value)); } if (value1) free(value1); if (value2) free(value2); if (value3) free(value3); } void hex2gdk(char *hex, GdkColor *color) { if (hex == NULL || hex[0] != '#') return; color->red = 257 * (hex_char_to_int(hex[1]) * 16 + hex_char_to_int(hex[2])); color->green = 257 * (hex_char_to_int(hex[3]) * 16 + hex_char_to_int(hex[4])); color->blue = 257 * (hex_char_to_int(hex[5]) * 16 + hex_char_to_int(hex[6])); color->pixel = 0; } void set_action(char *event, GtkWidget *combo) { if (strcmp(event, "none") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0); else if (strcmp(event, "close") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1); else if (strcmp(event, "toggle") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 2); else if (strcmp(event, "iconify") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 3); else if (strcmp(event, "shade") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 4); else if (strcmp(event, "toggle_iconify") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 5); else if (strcmp(event, "maximize_restore") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 6); else if (strcmp(event, "desktop_left") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 7); else if (strcmp(event, "desktop_right") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 8); else if (strcmp(event, "next_task") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 9); else if (strcmp(event, "prev_task") == 0) gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 10); } char *get_action(GtkWidget *combo) { if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 0) return "none"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 1) return "close"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 2) return "toggle"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 3) return "iconify"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 4) return "shade"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 5) return "toggle_iconify"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 6) return "maximize_restore"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 7) return "desktop_left"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 8) return "desktop_right"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 9) return "next_task"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 10) return "prev_task"; return "none"; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/properties_rw.h000066400000000000000000000003601265276141000262230ustar00rootroot00000000000000#ifndef PROPERTIES_RW #define PROPERTIES_RW #include char *get_current_theme_file_name(); gboolean config_is_manual(const char *path); void config_read_file (const char *path); void config_save_file(const char *path); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/theme_view.c000066400000000000000000000123711265276141000254530ustar00rootroot00000000000000/************************************************************************** * * Tint2conf * * Copyright (C) 2009 Thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 "main.h" #include "strnatcmp.h" #include "theme_view.h" // The data columns that we export via the tree model interface GtkWidget *g_theme_view; 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; GtkCellRenderer *renderer; GtkWidget *view; g_store = gtk_list_store_new(NB_COL, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(g_store)); gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); g_object_unref(g_store); // destroy store automatically with view renderer = gtk_cell_renderer_text_new(); col = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_add_attribute(col, renderer, "text", COL_THEME_FILE); gtk_tree_view_column_set_visible(col, FALSE); gtk_tree_view_append_column(GTK_TREE_VIEW(view),col); renderer = gtk_cell_renderer_text_new(); col = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start(col, renderer, TRUE); gtk_tree_view_column_add_attribute(col, renderer, "text", COL_THEME_NAME); gtk_tree_view_append_column(GTK_TREE_VIEW(view),col); g_width_list = 200; g_height_list = 30; g_renderer = gtk_cell_renderer_pixbuf_new(); g_object_set(g_renderer, "xalign", 0.0, NULL); gtk_cell_renderer_set_fixed_size(g_renderer, g_width_list, g_height_list); // specific to gtk-2.18 or higher //gtk_cell_renderer_set_padding(g_renderer, 5, 5); col = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start(col, g_renderer, TRUE); gtk_tree_view_column_add_attribute(col, g_renderer, "pixbuf", COL_SNAPSHOT); gtk_tree_view_append_column(GTK_TREE_VIEW(view),col); 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 *path) { GtkTreeIter iter; gtk_list_store_append(g_store, &iter); gtk_list_store_set(g_store, &iter, COL_THEME_FILE, path, -1); gchar *name = g_strdup(strrchr(path, '/') + 1); gtk_list_store_set(g_store, &iter, COL_THEME_NAME, name, -1); } gboolean update_snapshot() { GtkTreeModel *model; GtkTreeIter iter; GdkPixbuf *icon; gboolean have_iter; gint pixWidth = 200, pixHeight = 30; model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view)); have_iter = gtk_tree_model_get_iter_first(model, &iter); while (have_iter) { gtk_tree_model_get(model, &iter, COL_SNAPSHOT, &icon, -1); if (icon != NULL) { g_object_unref(icon); } // build panel's snapshot GdkPixbuf *pixbuf = NULL; gchar *name, *snap, *cmd; snap = g_build_filename(g_get_user_config_dir(), "tint2", "snap.jpg", NULL); g_remove(snap); gtk_tree_model_get(model, &iter, COL_THEME_FILE, &name, -1); cmd = g_strdup_printf("tint2 -c \'%s\' -s \'%s\'", name, snap); if (system(cmd) == 0) { // load pixbuf = gdk_pixbuf_new_from_file(snap, NULL); if (pixbuf == NULL) { printf("snapshot NULL : %s\n", cmd); } } g_free(snap); g_free(cmd); g_free(name); gint w, h; w = gdk_pixbuf_get_width(pixbuf); h = gdk_pixbuf_get_height(pixbuf); pixWidth = w > pixWidth ? w : pixWidth; pixHeight = h > pixHeight ? h : pixHeight; gtk_list_store_set(g_store, &iter, COL_SNAPSHOT, pixbuf, -1); have_iter = gtk_tree_model_iter_next(model, &iter); } gtk_cell_renderer_set_fixed_size(g_renderer, pixWidth + 30, pixHeight + 30); return FALSE; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/theme_view.h000066400000000000000000000004231265276141000254530ustar00rootroot00000000000000 #ifndef THEME_VIEW #define THEME_VIEW #include extern GtkWidget *g_theme_view; extern GtkListStore *g_store; enum { COL_THEME_FILE = 0, COL_THEME_NAME, COL_SNAPSHOT, NB_COL, }; GtkWidget *create_view(); void custom_list_append(const gchar *path); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/tint2conf.desktop000066400000000000000000000033131265276141000264500ustar00rootroot00000000000000[Desktop Entry] Type=Application Name=Tint2 panel settings Name[am]=ፓነል አስተዳዳሪ Name[ar]=مدير الائحة : Name[ast]=Alministrador de panel Name[be]=Кіраўнік Панэляў Name[ca]=Gestor de quadres Name[cs]=Správce panelu Name[da]=Panelhåndtering Name[de]=Leistenverwaltung Name[dz]=པེ་ནཱལ་འཛིན་སྐྱོང་པ། Name[el]=Διαχειριστής ταμπλό Name[en_GB]=Panel Manager Name[eo]=Administrilo de Panelo Name[es]=Administrador de panel Name[et]=Paneelihaldur Name[eu]=Panel Kudeatzailea: Name[fi]=Paneelin hallinta Name[fr]=Gestionnaire de panneau Name[gl]=Xestor de paneis Name[he]=מנהל הלוח Name[hu]=Panelkezelő Name[id]=Manajer Panel Name[it]=Gestore dei pannelli Name[ja]=パネルマネージャ Name[kk]=Панель менеджері Name[ko]=패널 관리자 Name[ku]=Gerinendeyê panelan Name[lv]=Paneļu pārvaldnieks Name[mk]=Менаџер за панели Name[nb]=Panelbehandler Name[nl]=Paneel Manager Name[nn]=Panelhandsamar Name[pa]=ਪੈਨਲ ਮੈਨੇਜਰ Name[pl]=Ustawienia panelu Name[pt]=Gestor do Painel Name[pt_BR]=Gerenciador do painel Name[ro]=Manager de panouri Name[ru]=Диспетчер панелей Name[si]=පුවරු කළමණාකරු Name[sk]=Nastavenie panelu Name[sq]=Përgjegjës Panelesh Name[sv]=Panelhanterare Name[ta]=பலகை மேளாலர்: Name[tr]=Panel Yöneticisi Name[ug]=Panel باشقۇرغۇ Name[uk]=Менеджер панелей Name[ur]=پینل منیجر Name[ur_PK]=پینل منیجر Name[vi]=Quản lý panel Name[zh_CN]=面板管理器 Name[zh_TW]=面板管理程式 Exec=tint2conf Icon=tint2conf Terminal=false Categories=Settings;DesktopSettings; tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tint2conf/tint2conf.svg000066400000000000000000000433471265276141000256110ustar00rootroot00000000000000 image/svg+xml tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tooltip/000077500000000000000000000000001265276141000227335ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tooltip/tooltip.c000066400000000000000000000241471265276141000246010ustar00rootroot00000000000000/************************************************************************** * * Copyright (C) 2009 Andreas.Fink (Andreas.Fink85@gmail.com) * * 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 #include #include #include #include #include #include "server.h" #include "tooltip.h" #include "panel.h" #include "timer.h" static int x, y, width, height; static gboolean just_shown; // the next functions are helper functions for tooltip handling void start_show_timeout(); void start_hide_timeout(); void stop_tooltip_timeout(); void tooltip_init_fonts(); Tooltip g_tooltip; void default_tooltip() { // give the tooltip some reasonable default values memset(&g_tooltip, 0, sizeof(Tooltip)); g_tooltip.font_color.rgb[0] = 1; g_tooltip.font_color.rgb[1] = 1; g_tooltip.font_color.rgb[2] = 1; g_tooltip.font_color.alpha = 1; just_shown = FALSE; } void cleanup_tooltip() { stop_tooltip_timeout(); tooltip_hide(NULL); tooltip_copy_text(NULL); if (g_tooltip.window) XDestroyWindow(server.display, g_tooltip.window); g_tooltip.window = 0; pango_font_description_free(g_tooltip.font_desc); g_tooltip.font_desc = NULL; } void init_tooltip() { if (!g_tooltip.bg) g_tooltip.bg = &g_array_index(backgrounds, Background, 0); tooltip_init_fonts(); XSetWindowAttributes attr; attr.override_redirect = True; attr.event_mask = StructureNotifyMask; attr.colormap = server.colormap; attr.background_pixel = 0; attr.border_pixel = 0; unsigned long mask = CWEventMask | CWColormap | CWBorderPixel | CWBackPixel | CWOverrideRedirect; if (g_tooltip.window) XDestroyWindow(server.display, g_tooltip.window); g_tooltip.window = XCreateWindow(server.display, server.root_win, 0, 0, 100, 20, 0, server.depth, InputOutput, server.visual, mask, &attr); } void tooltip_init_fonts() { if (!g_tooltip.font_desc) g_tooltip.font_desc = pango_font_description_from_string(get_default_font()); } void tooltip_default_font_changed() { if (g_tooltip.has_font) return; if (!g_tooltip.has_font) { pango_font_description_free(g_tooltip.font_desc); g_tooltip.font_desc = NULL; } tooltip_init_fonts(); tooltip_update(); } void tooltip_trigger_show(Area *area, Panel *p, XEvent *e) { // Position the tooltip in the center of the area x = area->posx + MIN(area->width / 3, 22) + e->xmotion.x_root - e->xmotion.x; y = area->posy + area->height / 2 + e->xmotion.y_root - e->xmotion.y; just_shown = TRUE; g_tooltip.panel = p; if (g_tooltip.mapped && g_tooltip.area != area) { tooltip_copy_text(area); tooltip_update(); stop_tooltip_timeout(); } else if (!g_tooltip.mapped) { start_show_timeout(); } } void tooltip_show(void *arg) { int mx, my; Window w; XTranslateCoordinates(server.display, server.root_win, g_tooltip.panel->main_win, x, y, &mx, &my, &w); Area *area = click_area(g_tooltip.panel, mx, my); if (!g_tooltip.mapped && area->_get_tooltip_text) { tooltip_copy_text(area); g_tooltip.mapped = True; XMapWindow(server.display, g_tooltip.window); tooltip_update(); XFlush(server.display); } } void tooltip_update_geometry() { Panel *panel = g_tooltip.panel; int screen_width = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width; cairo_surface_t *cs = cairo_xlib_surface_create(server.display, g_tooltip.window, server.visual, width, height); cairo_t *c = cairo_create(cs); PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_font_description(layout, g_tooltip.font_desc); PangoRectangle r1, r2; pango_layout_set_text(layout, "1234567890", -1); pango_layout_get_pixel_extents(layout, &r1, &r2); int max_width = MIN(r2.width * 7, screen_width * 2 / 3); pango_layout_set_width(layout, max_width * PANGO_SCALE); pango_layout_set_text(layout, g_tooltip.tooltip_text, -1); pango_layout_set_wrap(layout, PANGO_WRAP_WORD); pango_layout_get_pixel_extents(layout, &r1, &r2); width = 2 * g_tooltip.bg->border.width + 2 * g_tooltip.paddingx + r2.width; height = 2 * g_tooltip.bg->border.width + 2 * g_tooltip.paddingy + r2.height; if (panel_horizontal && panel_position & BOTTOM) y = panel->posy - height; else if (panel_horizontal && panel_position & TOP) y = panel->posy + panel->area.height; else if (panel_position & LEFT) x = panel->posx + panel->area.width; else x = panel->posx - width; g_object_unref(layout); cairo_destroy(c); cairo_surface_destroy(cs); } void tooltip_adjust_geometry() { // adjust coordinates and size to not go offscreen // it seems quite impossible that the height needs to be adjusted, but we do it anyway. Panel *panel = g_tooltip.panel; int screen_width = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width; int screen_height = server.monitors[panel->monitor].y + server.monitors[panel->monitor].height; if (x + width <= screen_width && y + height <= screen_height && x >= server.monitors[panel->monitor].x && y >= server.monitors[panel->monitor].y) return; // no adjustment needed int min_x, min_y, max_width, max_height; if (panel_horizontal) { min_x = 0; max_width = server.monitors[panel->monitor].width; max_height = server.monitors[panel->monitor].height - panel->area.height; if (panel_position & BOTTOM) min_y = 0; else min_y = panel->area.height; } else { max_width = server.monitors[panel->monitor].width - panel->area.width; min_y = 0; max_height = server.monitors[panel->monitor].height; if (panel_position & LEFT) min_x = panel->area.width; else min_x = 0; } if (x + width > server.monitors[panel->monitor].x + server.monitors[panel->monitor].width) x = server.monitors[panel->monitor].x + server.monitors[panel->monitor].width - width; if (y + height > server.monitors[panel->monitor].y + server.monitors[panel->monitor].height) y = server.monitors[panel->monitor].y + server.monitors[panel->monitor].height - height; if (x < min_x) x = min_x; if (width > max_width) width = max_width; if (y < min_y) y = min_y; if (height > max_height) height = max_height; } void tooltip_update() { if (!g_tooltip.tooltip_text) { tooltip_hide(0); return; } tooltip_update_geometry(); if (just_shown) { if (!panel_horizontal) y -= height / 2; // center vertically just_shown = FALSE; } tooltip_adjust_geometry(); XMoveResizeWindow(server.display, g_tooltip.window, x, y, width, height); // Stuff for drawing the tooltip cairo_surface_t *cs = cairo_xlib_surface_create(server.display, g_tooltip.window, server.visual, width, height); cairo_t *c = cairo_create(cs); Color bc = g_tooltip.bg->fill_color; Border b = g_tooltip.bg->border; if (server.real_transparency) { clear_pixmap(g_tooltip.window, 0, 0, width, height); draw_rect(c, b.width, b.width, width - 2 * b.width, height - 2 * b.width, b.radius - b.width / 1.571); cairo_set_source_rgba(c, bc.rgb[0], bc.rgb[1], bc.rgb[2], bc.alpha); } else { cairo_rectangle(c, 0., 0, width, height); cairo_set_source_rgb(c, bc.rgb[0], bc.rgb[1], bc.rgb[2]); } cairo_fill(c); cairo_set_line_width(c, b.width); if (server.real_transparency) draw_rect(c, b.width / 2.0, b.width / 2.0, width - b.width, height - b.width, b.radius); else cairo_rectangle(c, b.width / 2.0, b.width / 2.0, width - b.width, height - b.width); cairo_set_source_rgba(c, b.color.rgb[0], b.color.rgb[1], b.color.rgb[2], b.color.alpha); cairo_stroke(c); Color fc = g_tooltip.font_color; cairo_set_source_rgba(c, fc.rgb[0], fc.rgb[1], fc.rgb[2], fc.alpha); PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_font_description(layout, g_tooltip.font_desc); pango_layout_set_wrap(layout, PANGO_WRAP_WORD); pango_layout_set_text(layout, g_tooltip.tooltip_text, -1); PangoRectangle r1, r2; pango_layout_get_pixel_extents(layout, &r1, &r2); pango_layout_set_width(layout, width * PANGO_SCALE); pango_layout_set_height(layout, height * PANGO_SCALE); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END); // I do not know why this is the right way, but with the below cairo_move_to it seems to be centered (horiz. and // vert.) cairo_move_to(c, -r1.x / 2 + g_tooltip.bg->border.width + g_tooltip.paddingx, -r1.y / 2 + 1 + g_tooltip.bg->border.width + g_tooltip.paddingy); pango_cairo_show_layout(c, layout); g_object_unref(layout); cairo_destroy(c); cairo_surface_destroy(cs); } void tooltip_trigger_hide() { if (g_tooltip.mapped) { tooltip_copy_text(0); start_hide_timeout(); } else { // tooltip not visible yet, but maybe a timeout is still pending stop_tooltip_timeout(); } } void tooltip_hide(void *arg) { if (g_tooltip.mapped) { g_tooltip.mapped = False; XUnmapWindow(server.display, g_tooltip.window); XFlush(server.display); } } void start_show_timeout() { change_timeout(&g_tooltip.timeout, g_tooltip.show_timeout_msec, 0, tooltip_show, 0); } void start_hide_timeout() { change_timeout(&g_tooltip.timeout, g_tooltip.hide_timeout_msec, 0, tooltip_hide, 0); } void stop_tooltip_timeout() { stop_timeout(g_tooltip.timeout); } void tooltip_copy_text(Area *area) { free(g_tooltip.tooltip_text); if (area && area->_get_tooltip_text) g_tooltip.tooltip_text = area->_get_tooltip_text(area); else g_tooltip.tooltip_text = NULL; g_tooltip.area = area; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/tooltip/tooltip.h000066400000000000000000000033261265276141000246020ustar00rootroot00000000000000/************************************************************************** * * Copyright (C) 2009 Andreas.Fink (Andreas.Fink85@gmail.com) * * 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. **************************************************************************/ #ifndef TOOLTIP_H #define TOOLTIP_H #include "task.h" #include "panel.h" #include "timer.h" typedef struct { Area *area; // never ever use the area attribut if you are not 100% sure that this area was not freed char *tooltip_text; Panel *panel; Window window; int show_timeout_msec; int hide_timeout_msec; Bool mapped; int paddingx; int paddingy; gboolean has_font; PangoFontDescription *font_desc; Color font_color; Background *bg; timeout *timeout; } Tooltip; extern Tooltip g_tooltip; // default global data void default_tooltip(); // freed memory void cleanup_tooltip(); void init_tooltip(); void tooltip_trigger_show(Area *area, Panel *p, XEvent *e); void tooltip_show(void * /*arg*/); void tooltip_update(); void tooltip_trigger_hide(); void tooltip_hide(void * /*arg*/); void tooltip_copy_text(Area *area); void tooltip_default_font_changed(); #endif // TOOLTIP_H tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/000077500000000000000000000000001265276141000222165ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/area.c000066400000000000000000000346451265276141000233060ustar00rootroot00000000000000/************************************************************************** * * Tint2 : area * * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include "area.h" #include "server.h" #include "panel.h" #include "common.h" Area *mouse_over_area = NULL; void init_background(Background *bg) { memset(bg, 0, sizeof(Background)); } void initialize_positions(void *obj, int offset) { Area *a = (Area *)obj; for (GList *l = a->children; l; l = l->next) { Area *child = ((Area *)l->data); if (panel_horizontal) { child->posy = offset + a->bg->border.width + a->paddingy; child->height = a->height - (2 * (a->bg->border.width + a->paddingy)); if (child->_on_change_layout) child->_on_change_layout(child); initialize_positions(child, child->posy); } else { child->posx = offset + a->bg->border.width + a->paddingy; child->width = a->width - (2 * (a->bg->border.width + a->paddingy)); if (child->_on_change_layout) child->_on_change_layout(child); initialize_positions(child, child->posx); } } } void relayout_fixed(Area *a) { if (!a->on_screen) return; // Children are resized before the parent GList *l; for (l = a->children; l; l = l->next) relayout_fixed(l->data); // Recalculate size a->_changed = 0; if (a->resize_needed && a->size_mode == LAYOUT_FIXED) { a->resize_needed = 0; if (a->_resize) { if (a->_resize(a)) { // The size hash changed => resize needed for the parent if (a->parent) ((Area *)a->parent)->resize_needed = 1; a->_changed = 1; } } } } void relayout_dynamic(Area *a, int level) { if (!a->on_screen) return; // Area is resized before its children if (a->resize_needed && a->size_mode == LAYOUT_DYNAMIC) { a->resize_needed = 0; if (a->_resize) { a->_resize(a); // resize children with LAYOUT_DYNAMIC for (GList *l = a->children; l; l = l->next) { Area *child = ((Area *)l->data); if (child->size_mode == LAYOUT_DYNAMIC && child->children) child->resize_needed = 1; } } } // Layout children if (a->children) { if (a->alignment == ALIGN_LEFT) { int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr; for (GList *l = a->children; 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->_changed = 1; } } else { if (pos != child->posy) { // pos changed => redraw child->posy = pos; child->_changed = 1; } } relayout_dynamic(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 (GList *l = g_list_last(a->children); 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->_changed = 1; } } else { if (pos != child->posy) { // pos changed => redraw child->posy = pos; child->_changed = 1; } } relayout_dynamic(child, level + 1); pos -= a->paddingx; } } else if (a->alignment == ALIGN_CENTER) { int children_size = 0; for (GList *l = a->children; 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->children) ? 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 (GList *l = a->children; 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->_changed = 1; } } else { if (pos != child->posy) { // pos changed => redraw child->posy = pos; child->_changed = 1; } } relayout_dynamic(child, level + 1); pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx; } } } if (a->_changed) { // pos/size changed a->_redraw_needed = TRUE; if (a->_on_change_layout) a->_on_change_layout(a); } } void relayout(Area *a) { relayout_fixed(a); relayout_dynamic(a, 1); } void draw_tree(Area *a) { if (!a->on_screen) return; if (a->_redraw_needed) { a->_redraw_needed = 0; draw(a); } if (a->pix) XCopyArea(server.display, a->pix, ((Panel *)a->panel)->temp_pmap, server.gc, 0, 0, a->width, a->height, a->posx, a->posy); for (GList *l = a->children; l; l = l->next) draw_tree((Area *)l->data); } int relayout_with_constraint(Area *a, int maximum_size) { int fixed_children_count = 0; int dynamic_children_count = 0; if (panel_horizontal) { // detect free size for LAYOUT_DYNAMIC Areas int size = a->width - (2 * (a->paddingxlr + a->bg->border.width)); for (GList *l = a->children; l; l = l->next) { Area *child = (Area *)l->data; if (child->on_screen && child->size_mode == LAYOUT_FIXED) { size -= child->width; fixed_children_count++; } if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC) dynamic_children_count++; } if (fixed_children_count + dynamic_children_count > 0) size -= (fixed_children_count + dynamic_children_count - 1) * a->paddingx; int width = 0; int modulo = 0; if (dynamic_children_count > 0) { width = size / dynamic_children_count; modulo = size % dynamic_children_count; if (width > maximum_size && maximum_size > 0) { width = maximum_size; modulo = 0; } } // Resize LAYOUT_DYNAMIC objects for (GList *l = a->children; l; l = l->next) { Area *child = (Area *)l->data; if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC) { int old_width = child->width; child->width = width; if (modulo) { child->width++; modulo--; } if (child->width != old_width) child->_changed = 1; } } } else { // detect free size for LAYOUT_DYNAMIC's Area int size = a->height - (2 * (a->paddingxlr + a->bg->border.width)); for (GList *l = a->children; l; l = l->next) { Area *child = (Area *)l->data; if (child->on_screen && child->size_mode == LAYOUT_FIXED) { size -= child->height; fixed_children_count++; } if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC) dynamic_children_count++; } if (fixed_children_count + dynamic_children_count > 0) size -= (fixed_children_count + dynamic_children_count - 1) * a->paddingx; int height = 0; int modulo = 0; if (dynamic_children_count) { height = size / dynamic_children_count; modulo = size % dynamic_children_count; if (height > maximum_size && maximum_size != 0) { height = maximum_size; modulo = 0; } } // Resize LAYOUT_DYNAMIC objects for (GList *l = a->children; l; l = l->next) { Area *child = (Area *)l->data; if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC) { int old_height = child->height; child->height = height; if (modulo) { child->height++; modulo--; } if (child->height != old_height) child->_changed = 1; } } } return 0; } void schedule_redraw(Area *a) { a->_redraw_needed = TRUE; if (a->has_mouse_over_effect) { for (int i = 0; i < MOUSE_STATE_COUNT; i++) { XFreePixmap(server.display, a->pix_by_state[i]); if (a->pix == a->pix_by_state[i]) a->pix = None; a->pix_by_state[i] = None; } if (a->pix) { XFreePixmap(server.display, a->pix); a->pix = None; } } for (GList *l = a->children; l; l = l->next) schedule_redraw((Area *)l->data); panel_refresh = TRUE; } void hide(Area *a) { Area *parent = (Area *)a->parent; a->on_screen = FALSE; if (parent) parent->resize_needed = 1; if (panel_horizontal) a->width = 0; else a->height = 0; } void show(Area *a) { Area *parent = (Area *)a->parent; a->on_screen = TRUE; if (parent) parent->resize_needed = 1; a->resize_needed = 1; } void draw(Area *a) { if (a->pix) { XFreePixmap(server.display, a->pix); if (a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] != a->pix) XFreePixmap(server.display, a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0]); } a->pix = XCreatePixmap(server.display, server.root_win, a->width, a->height, server.depth); a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix; if (!a->_clear) { // Add layer of root pixmap (or clear pixmap if real_transparency==true) if (server.real_transparency) clear_pixmap(a->pix, 0, 0, a->width, a->height); XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0); } else { a->_clear(a); } cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height); cairo_t *c = cairo_create(cs); draw_background(a, c); if (a->_draw_foreground) a->_draw_foreground(a, c); cairo_destroy(c); cairo_surface_destroy(cs); } void draw_background(Area *a, cairo_t *c) { if (a->bg->fill_color.alpha > 0.0 || (panel_config.mouse_effects && (a->has_mouse_over_effect || a->has_mouse_press_effect))) { if (a->mouse_state == MOUSE_OVER) cairo_set_source_rgba(c, a->bg->fill_color_hover.rgb[0], a->bg->fill_color_hover.rgb[1], a->bg->fill_color_hover.rgb[2], a->bg->fill_color_hover.alpha); else if (a->mouse_state == MOUSE_DOWN) cairo_set_source_rgba(c, a->bg->fill_color_pressed.rgb[0], a->bg->fill_color_pressed.rgb[1], a->bg->fill_color_pressed.rgb[2], a->bg->fill_color_pressed.alpha); else cairo_set_source_rgba(c, a->bg->fill_color.rgb[0], a->bg->fill_color.rgb[1], a->bg->fill_color.rgb[2], a->bg->fill_color.alpha); draw_rect(c, a->bg->border.width, a->bg->border.width, a->width - (2.0 * a->bg->border.width), a->height - (2.0 * a->bg->border.width), a->bg->border.radius - a->bg->border.width / 1.571); cairo_fill(c); } if (a->bg->border.width > 0) { cairo_set_line_width(c, a->bg->border.width); // draw border inside (x, y, width, height) if (a->mouse_state == MOUSE_OVER) cairo_set_source_rgba(c, a->bg->border_color_hover.rgb[0], a->bg->border_color_hover.rgb[1], a->bg->border_color_hover.rgb[2], a->bg->border_color_hover.alpha); else if (a->mouse_state == MOUSE_DOWN) cairo_set_source_rgba(c, a->bg->border_color_pressed.rgb[0], a->bg->border_color_pressed.rgb[1], a->bg->border_color_pressed.rgb[2], a->bg->border_color_pressed.alpha); else cairo_set_source_rgba(c, a->bg->border.color.rgb[0], a->bg->border.color.rgb[1], a->bg->border.color.rgb[2], a->bg->border.color.alpha); draw_rect(c, a->bg->border.width / 2.0, a->bg->border.width / 2.0, a->width - a->bg->border.width, a->height - a->bg->border.width, a->bg->border.radius); cairo_stroke(c); } } void remove_area(Area *a) { Area *area = (Area *)a; Area *parent = (Area *)area->parent; if (parent) { parent->children = g_list_remove(parent->children, area); parent->resize_needed = TRUE; panel_refresh = TRUE; schedule_redraw(parent); } if (mouse_over_area == a) { mouse_out(); } } void add_area(Area *a, Area *parent) { g_assert_null(a->parent); a->parent = parent; if (parent) { parent->children = g_list_append(parent->children, a); parent->resize_needed = TRUE; schedule_redraw(parent); panel_refresh = TRUE; } } void free_area(Area *a) { if (!a) return; for (GList *l = a->children; l; l = l->next) free_area(l->data); if (a->children) { g_list_free(a->children); a->children = NULL; } for (int i = 0; i < MOUSE_STATE_COUNT; i++) { XFreePixmap(server.display, a->pix_by_state[i]); if (a->pix == a->pix_by_state[i]) { a->pix = None; } a->pix_by_state[i] = None; } if (a->pix) { XFreePixmap(server.display, a->pix); a->pix = None; } if (mouse_over_area == a) { mouse_over_area = NULL; } } void mouse_over(Area *area, int pressed) { if (mouse_over_area == area && !area) return; MouseState new_state = MOUSE_NORMAL; if (area) { if (!pressed) { new_state = area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL; } else { new_state = area->has_mouse_press_effect ? MOUSE_DOWN : area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL; } } if (mouse_over_area == area && mouse_over_area->mouse_state == new_state) return; mouse_out(); if (new_state == MOUSE_NORMAL) return; mouse_over_area = area; mouse_over_area->mouse_state = new_state; mouse_over_area->pix = mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0]; if (!mouse_over_area->pix) mouse_over_area->_redraw_needed = TRUE; panel_refresh = TRUE; } void mouse_out() { if (!mouse_over_area) return; mouse_over_area->mouse_state = MOUSE_NORMAL; mouse_over_area->pix = mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0]; if (!mouse_over_area->pix) mouse_over_area->_redraw_needed = TRUE; panel_refresh = TRUE; mouse_over_area = NULL; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/area.h000066400000000000000000000226031265276141000233020ustar00rootroot00000000000000/************************************************************************** * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) * **************************************************************************/ #ifndef AREA_H #define AREA_H #include #include #include #include // DATA ORGANISATION // // Areas in tint2 are similar to widgets in a GUI. // All graphical objects (panel, taskbar, task, systray, clock, ...) inherit the abstract class Area. // This class 'Area' stores data about the background, border, size, position, padding and the child areas. // Inheritance is simulated by having an Area member as the first member of each object (thus &object == &area). // // tint2 uses multiple panels, one per monitor. Each panel has an area containing the children objects in a tree of // areas. The level in the tree gives the z-order: child areas are always displayed on top of their parents. // // // LAYOUT // // Sibling areas never overlap. // // The position of an Area (posx, posy) is relative to the window (i.e. absolute) and // is computed based on a simple box model: // * parent position + parent padding + sum of the sizes of the previous siblings and spacing // // The size of an Area is: // * SIZE_BY_CONTENT objects: // * fixed and set by the Area // * childred are resized before the parent // * if a child size has changed then the parent is resized // * SIZE_BY_LAYOUT objects: // * expandable and computed as the total size of the parent - padding - // the size of the fixed sized siblings - spacing and divided by the number of expandable siblings // * the parent is resized before the children // // // RENDERING // // Redrawing an object (like the clock) could come from an 'external event' (date change) // or from a 'layout event' (position change). // // // WIDGET LIFECYCLE // // Each widget that occurs once per panel is defined as a struct (e.g. Clock) which is stored as a member of Panel. // Widgets that can occur more than once should be stored as an array, still as a member of Panel. // // There is a special Panel instance called 'panel_config' which stores the config options and the state variables // of the widgets (however some config options are stored as global variables by the widgets). // // Tint2 maintains an array of Panel instances, one for each monitor. These contain the actual Areas that are used to // render the panels on screen, interact with user input etc. // Each Panel is initialized as a raw copy (memcpy, see init_panel()) of panel_config. // // Normally, widgets should implement the following functions: // // * void default_widget(); // // Called before the config is read and panel_config/panels are created. // Afterwards, the config parsing code creates the widget/widget array in panel_config and // populates the configuration fields. // If the widget uses global variables to store config options or other state variables, they should be initialized // here (e.g. with zero, NULL etc). // // * void init_widget(); // // Called after the config is read and panel_config is populated, but before panels are created. // Initializes the state of the widget in panel_config. // If the widget uses global variables to store config options or other state variables which depend on the config // options but not on the panel instance, they should be initialized here. // panel_config.panel_items can be used to determine which backend items are enabled. // // * void init_widget_panel(void *panel); // // Called after each on-screen panel is created, with a pointer to the panel. // Completes the initialization of the widget. // At this point the widget Area has not been added yet to the GUI tree, but it will be added right afterwards. // // * void cleanup_widget(); // // Called just before the panels are destroyed. Afterwards, tint2 exits or restarts and reads the config again. // Must releases all resources. // The widget itself should not be freed by this function, only its members or global variables that were set. // The widget is freed by the Area tree cleanup function (remove_area). // // * void draw_widget(void *obj, cairo_t *c); // // Called on draw, obj = pointer to the widget instance from the panel that is redrawn. // The Area's _draw_foreground member must point to this function. // // * int resize_widget(void *obj); // // Called on resize, obj = pointer to the front-end Execp item. // Returns 1 if the new size is different than the previous size. // The Area's _resize member must point to this function. // // * void widget_action(void *obj, int button); // // Called on mouse click event. // // * void widget_on_change_layout(void *obj); // // Implemented only to override the default layout algorithm for this widget. // For example, if this widget is a cell in a table, its position and size should be computed here. // The Area's _on_change_layout member must point to this function. // // * char* widget_get_tooltip_text(void *obj); // // Returns a copy of the tooltip to be displayed for this widget. // The caller takes ownership of the pointer. // The Area's _get_tooltip_text member must point to this function. typedef struct Color { // Values are in [0, 1], with 0 meaning no intensity. double rgb[3]; // Values are in [0, 1], with 0 meaning fully transparent, 1 meaning fully opaque. double alpha; } Color; typedef struct Border { // It's essential that the first member is color Color color; // Width in pixels int width; // Corner radius int radius; } Border; typedef struct Background { // Normal state Color fill_color; Border border; // On mouse hover Color fill_color_hover; Color border_color_hover; // On mouse press Color fill_color_pressed; Color border_color_pressed; } Background; typedef enum Layout { LAYOUT_DYNAMIC, LAYOUT_FIXED, } Layout; typedef enum Alignment { ALIGN_LEFT = 0, ALIGN_CENTER = 1, ALIGN_RIGHT = 2, } Alignment; typedef enum MouseState { MOUSE_NORMAL = 0, MOUSE_OVER = 1, MOUSE_DOWN = 2, MOUSE_STATE_COUNT } MouseState; struct Panel; typedef struct Area { // Position relative to the panel window int posx, posy; // Size, including borders int width, height; Background *bg; // List of children, each one a pointer to Area GList *children; // Pointer to the parent Area or NULL void *parent; // Pointer to the Panel that contains this Area void *panel; Layout size_mode; Alignment alignment; gboolean has_mouse_over_effect; gboolean has_mouse_press_effect; // TODO padding/spacing is a clusterfuck // paddingxlr = padding // paddingy = vertical padding, sometimes // paddingx = spacing int paddingxlr, paddingx, paddingy; MouseState mouse_state; // Set to non-zero if the Area is visible. An object may exist but stay hidden. gboolean on_screen; // Set to non-zero if the size of the Area has to be recalculated. gboolean resize_needed; // Set to non-zero if the Area has to be redrawn. // Do not set this directly; use schedule_redraw() instead. gboolean _redraw_needed; // Set to non-zero if the position/size has changed, thus _on_change_layout needs to be called gboolean _changed; // This is the pixmap on which the Area is rendered. Render to it directly if needed. Pixmap pix; Pixmap pix_by_state[MOUSE_STATE_COUNT]; // Callbacks // Called on draw before any drawing takes place, obj = pointer to the Area void (*_clear)(void *obj); // Called on draw, obj = pointer to the Area void (*_draw_foreground)(void *obj, cairo_t *c); // Called on resize, obj = pointer to the Area // Returns 1 if the new size is different than the previous size. gboolean (*_resize)(void *obj); // Implemented only to override the default layout algorithm for this widget. // For example, if this widget is a cell in a table, its position and size should be computed here. void (*_on_change_layout)(void *obj); // Returns a copy of the tooltip to be displayed for this widget. // The caller takes ownership of the pointer. char *(*_get_tooltip_text)(void *obj); } Area; // Initializes the Background member to default values. void init_background(Background *bg); // Layout // Called on startup to initialize the positions of all Areas in the Area tree. // Parameters: // * obj: pointer to Area // * offset: offset in pixels from left/top, relative to the window void initialize_positions(void *obj, int offset); // Relayouts the Area and its children. Normally called on the root of the tree (i.e. the Panel). void relayout(Area *a); // Distributes the Area's size to its children, repositioning them as needed. // If maximum_size > 0, it is an upper limit for the child size. int relayout_with_constraint(Area *a, int maximum_size); // Rendering // Sets the redraw_needed flag on the area and its descendants void schedule_redraw(Area *a); // Recreates the Area pixmap and draws the background and the foreground void draw(Area *a); // Draws the background of the Area void draw_background(Area *a, cairo_t *c); // Explores the entire Area subtree (only if the on_screen flag set) // and draws the areas with the redraw_needed flag set void draw_tree(Area *a); // Clears the on_screen flag, sets the size to zero and triggers a parent resize void hide(Area *a); // Sets the on_screen flag and triggers a parent and area resize void show(Area *a); // Area tree void add_area(Area *a, Area *parent); void remove_area(Area *a); void free_area(Area *a); // Mouse move events void mouse_over(Area *area, int pressed); void mouse_out(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/common.c000066400000000000000000000437401265276141000236620ustar00rootroot00000000000000/************************************************************************** * * Tint2 : common windows function * * Copyright (C) 2007 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "../server.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_RSVG #include #endif void copy_file(const char *path_src, const char *path_dest) { if (g_str_equal(path_src, path_dest)) return; FILE *file_src, *file_dest; char buffer[4096]; int nb; file_src = fopen(path_src, "rb"); if (file_src == NULL) return; file_dest = fopen(path_dest, "wb"); if (file_dest == NULL) { fclose(file_src); return; } while ((nb = fread(buffer, 1, sizeof(buffer), file_src)) > 0) { if (nb != fwrite(buffer, 1, nb, file_dest)) { printf("Error while copying file %s to %s\n", path_src, path_dest); } } fclose(file_dest); fclose(file_src); } int parse_line(const char *line, char **key, char **value) { char *a, *b; /* Skip useless lines */ if ((line[0] == '#') || (line[0] == '\n')) return 0; if (!(a = strchr(line, '='))) return 0; /* overwrite '=' with '\0' */ a[0] = '\0'; *key = strdup(line); a++; /* overwrite '\n' with '\0' if '\n' present */ if ((b = strchr(a, '\n'))) b[0] = '\0'; *value = strdup(a); g_strstrip(*key); g_strstrip(*value); return 1; } void tint_exec(const char *command) { if (command) { if (fork() == 0) { // change for the fork the signal mask // sigset_t sigset; // sigprocmask(SIG_SETMASK, &sigset, 0); // sigprocmask(SIG_UNBLOCK, &sigset, 0); execl("/bin/sh", "/bin/sh", "-c", command, NULL); _exit(0); } } } char *expand_tilde(char *s) { const gchar *home = g_get_home_dir(); if (home && (strcmp(s, "~") == 0 || strstr(s, "~/") == s)) { char *result = calloc(strlen(home) + strlen(s), 1); strcat(result, home); strcat(result, s + 1); return result; } else { return strdup(s); } } char *contract_tilde(char *s) { const gchar *home = g_get_home_dir(); if (!home) return strdup(s); 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) + 2, 1); strcat(result, "~"); strcat(result, s + strlen(home)); free(home_slash); return result; } else { free(home_slash); return strdup(s); } } int hex_char_to_int(char c) { int r; if (c >= '0' && c <= '9') r = c - '0'; else if (c >= 'a' && c <= 'f') r = c - 'a' + 10; else if (c >= 'A' && c <= 'F') r = c - 'A' + 10; else r = 0; return r; } int hex_to_rgb(char *hex, int *r, int *g, int *b) { if (hex == NULL || hex[0] != '#') return (0); int len = strlen(hex); if (len == 3 + 1) { *r = hex_char_to_int(hex[1]); *g = hex_char_to_int(hex[2]); *b = hex_char_to_int(hex[3]); } else if (len == 6 + 1) { *r = hex_char_to_int(hex[1]) * 16 + hex_char_to_int(hex[2]); *g = hex_char_to_int(hex[3]) * 16 + hex_char_to_int(hex[4]); *b = hex_char_to_int(hex[5]) * 16 + hex_char_to_int(hex[6]); } else if (len == 12 + 1) { *r = hex_char_to_int(hex[1]) * 16 + hex_char_to_int(hex[2]); *g = hex_char_to_int(hex[5]) * 16 + hex_char_to_int(hex[6]); *b = hex_char_to_int(hex[9]) * 16 + hex_char_to_int(hex[10]); } else return 0; return 1; } void get_color(char *hex, double *rgb) { int r, g, b; r = g = b = 0; hex_to_rgb(hex, &r, &g, &b); rgb[0] = (r / 255.0); rgb[1] = (g / 255.0); rgb[2] = (b / 255.0); } void extract_values(const char *value, char **value1, char **value2, char **value3) { char *b = 0, *c = 0; if (*value1) free(*value1); if (*value2) free(*value2); if (*value3) free(*value3); if ((b = strchr(value, ' '))) { b[0] = '\0'; b++; } else { *value2 = 0; *value3 = 0; } *value1 = strdup(value); g_strstrip(*value1); if (b) { if ((c = strchr(b, ' '))) { c[0] = '\0'; c++; } else { c = 0; *value3 = 0; } *value2 = strdup(b); g_strstrip(*value2); } if (c) { *value3 = strdup(c); g_strstrip(*value3); } } void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright) { unsigned int x, y; unsigned int a, r, g, b, argb; unsigned long id; int cmax, cmin; float h2, f, p, q, t; float hue, saturation, brightness; float redc, greenc, bluec; for (y = 0; y < h; y++) { for (id = y * w, x = 0; x < w; x++, id++) { argb = data[id]; a = (argb >> 24) & 0xff; // transparent => nothing to do. if (a == 0) continue; r = (argb >> 16) & 0xff; g = (argb >> 8) & 0xff; b = (argb)&0xff; // convert RGB to HSB cmax = (r > g) ? r : g; if (b > cmax) cmax = b; cmin = (r < g) ? r : g; if (b < cmin) cmin = b; brightness = ((float)cmax) / 255.0f; if (cmax != 0) saturation = ((float)(cmax - cmin)) / ((float)cmax); else saturation = 0; if (saturation == 0) hue = 0; else { redc = ((float)(cmax - r)) / ((float)(cmax - cmin)); greenc = ((float)(cmax - g)) / ((float)(cmax - cmin)); bluec = ((float)(cmax - b)) / ((float)(cmax - cmin)); if (r == cmax) hue = bluec - greenc; else if (g == cmax) hue = 2.0f + redc - bluec; else hue = 4.0f + greenc - redc; hue = hue / 6.0f; if (hue < 0) hue = hue + 1.0f; } // adjust saturation += satur; if (saturation < 0.0) saturation = 0.0; if (saturation > 1.0) saturation = 1.0; brightness += bright; if (brightness < 0.0) brightness = 0.0; if (brightness > 1.0) brightness = 1.0; if (alpha != 100) a = (a * alpha) / 100; // convert HSB to RGB if (saturation == 0) { r = g = b = (int)(brightness * 255.0f + 0.5f); } else { h2 = (hue - (int)hue) * 6.0f; f = h2 - (int)(h2); p = brightness * (1.0f - saturation); q = brightness * (1.0f - saturation * f); t = brightness * (1.0f - (saturation * (1.0f - f))); switch ((int)h2) { case 0: r = (int)(brightness * 255.0f + 0.5f); g = (int)(t * 255.0f + 0.5f); b = (int)(p * 255.0f + 0.5f); break; case 1: r = (int)(q * 255.0f + 0.5f); g = (int)(brightness * 255.0f + 0.5f); b = (int)(p * 255.0f + 0.5f); break; case 2: r = (int)(p * 255.0f + 0.5f); g = (int)(brightness * 255.0f + 0.5f); b = (int)(t * 255.0f + 0.5f); break; case 3: r = (int)(p * 255.0f + 0.5f); g = (int)(q * 255.0f + 0.5f); b = (int)(brightness * 255.0f + 0.5f); break; case 4: r = (int)(t * 255.0f + 0.5f); g = (int)(p * 255.0f + 0.5f); b = (int)(brightness * 255.0f + 0.5f); break; case 5: r = (int)(brightness * 255.0f + 0.5f); g = (int)(p * 255.0f + 0.5f); b = (int)(q * 255.0f + 0.5f); break; } } argb = a; argb = (argb << 8) + r; argb = (argb << 8) + g; argb = (argb << 8) + b; data[id] = argb; } } } void create_heuristic_mask(DATA32 *data, int w, int h) { // first we need to find the mask color, therefore we check all 4 edge pixel and take the color which // appears most often (we only need to check three edges, the 4th is implicitly clear) unsigned int topLeft = data[0], topRight = data[w - 1], bottomLeft = data[w * h - w], bottomRight = data[w * h - 1]; int max = (topLeft == topRight) + (topLeft == bottomLeft) + (topLeft == bottomRight); int maskPos = 0; if (max < (topRight == topLeft) + (topRight == bottomLeft) + (topRight == bottomRight)) { max = (topRight == topLeft) + (topRight == bottomLeft) + (topRight == bottomRight); maskPos = w - 1; } if (max < (bottomLeft == topRight) + (bottomLeft == topLeft) + (bottomLeft == bottomRight)) maskPos = w * h - w; // now mask out every pixel which has the same color as the edge pixels unsigned char *udata = (unsigned char *)data; unsigned char b = udata[4 * maskPos]; unsigned char g = udata[4 * maskPos + 1]; unsigned char r = udata[4 * maskPos + 1]; for (int i = 0; i < h * w; ++i) { if (b - udata[0] == 0 && g - udata[1] == 0 && r - udata[2] == 0) udata[3] = 0; udata += 4; } } int pixel_empty(DATA32 argb) { DATA32 a = (argb >> 24) & 0xff; if (a == 0) return 1; DATA32 rgb = argb & 0xffFFff; return rgb == 0; } int image_empty(DATA32 *data, int w, int h) { if (w > 0 && h > 0) { int x = w / 2; int y = h / 2; if (!pixel_empty(data[y * w + x])) { // fprintf(stderr, "Non-empty pixel: [%u, %u] = %x\n", x, y, data[y * w + x]); return 0; } } for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { if (!pixel_empty(data[y * w + x])) { // fprintf(stderr, "Non-empty pixel: [%u, %u] = %x\n", x, y, data[y * w + x]); return 0; } } } // fprintf(stderr, "All pixels are empty\n"); return 1; } void render_image(Drawable d, int x, int y) { if (!server.real_transparency) { 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.display, server.root_win, w, h, 32); imlib_context_set_drawable(pixmap); imlib_context_set_blend(0); imlib_render_image_on_drawable(0, 0); Pixmap mask = XCreatePixmap(server.display, server.root_win, w, h, 32); imlib_context_set_drawable(mask); imlib_context_set_blend(0); imlib_render_image_on_drawable(0, 0); Picture pict = XRenderCreatePicture(server.display, pixmap, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0); Picture pict_drawable = XRenderCreatePicture(server.display, d, XRenderFindVisualFormat(server.display, server.visual), 0, 0); Picture pict_mask = XRenderCreatePicture(server.display, mask, XRenderFindStandardFormat(server.display, PictStandardARGB32), 0, 0); XRenderComposite(server.display, PictOpOver, pict, pict_mask, pict_drawable, 0, 0, 0, 0, x, y, w, h); XRenderFreePicture(server.display, pict_mask); XRenderFreePicture(server.display, pict_drawable); XRenderFreePicture(server.display, pict); XFreePixmap(server.display, mask); XFreePixmap(server.display, pixmap); } void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color, int font_shadow) { if (font_shadow) { const int shadow_size = 3; const double shadow_edge_alpha = 0.0; int i, j; for (i = -shadow_size; i <= shadow_size; i++) { for (j = -shadow_size; j <= shadow_size; j++) { cairo_set_source_rgba(c, 0.0, 0.0, 0.0, 1.0 - (1.0 - shadow_edge_alpha) * sqrt((i * i + j * j) / (double)(shadow_size * shadow_size))); pango_cairo_update_layout(c, layout); cairo_move_to(c, posx + i, posy + j); pango_cairo_show_layout(c, layout); } } } cairo_set_source_rgba(c, color->rgb[0], color->rgb[1], color->rgb[2], color->alpha); pango_cairo_update_layout(c, layout); cairo_move_to(c, posx, posy); pango_cairo_show_layout(c, layout); } Imlib_Image load_image(const char *path, int cached) { Imlib_Image image; #ifdef HAVE_RSVG if (cached) { image = imlib_load_image_immediately(path); } else { image = imlib_load_image_immediately_without_cache(path); } if (!image && g_str_has_suffix(path, ".svg")) { char suffix[128]; sprintf(suffix, "tmpimage-%d.png", getpid()); // We fork here because librsvg allocates memory like crazy pid_t pid = fork(); if (pid == 0) { // Child GError *err = NULL; RsvgHandle *svg = rsvg_handle_new_from_file(path, &err); if (err != NULL) { fprintf(stderr, "Could not load svg image!: %s", err->message); g_error_free(err); } else { gchar *name = g_build_filename(g_get_user_config_dir(), "tint2", suffix, NULL); GdkPixbuf *pixbuf = rsvg_handle_get_pixbuf(svg); gdk_pixbuf_save(pixbuf, name, "png", NULL, NULL); } exit(0); } else { // Parent waitpid(pid, 0, 0); gchar *name = g_build_filename(g_get_user_config_dir(), "tint2", suffix, NULL); image = imlib_load_image_immediately_without_cache(name); g_remove(name); g_free(name); } } else #endif { if (cached) { image = imlib_load_image_immediately(path); } else { image = imlib_load_image_immediately_without_cache(path); } } return image; } Imlib_Image adjust_icon(Imlib_Image original, int alpha, int saturation, int brightness) { if (!original) return NULL; imlib_context_set_image(original); Imlib_Image copy = imlib_clone_image(); imlib_context_set_image(copy); imlib_image_set_has_alpha(1); DATA32 *data = imlib_image_get_data(); adjust_asb(data, imlib_image_get_width(), imlib_image_get_height(), alpha, (float)saturation / 100, (float)brightness / 100); imlib_image_put_back_data(data); return copy; } void draw_rect(cairo_t *c, double x, double y, double w, double h, double r) { if (r > 0.0) { double c1 = 0.55228475 * r; cairo_move_to(c, x + r, y); cairo_rel_line_to(c, w - 2 * r, 0); cairo_rel_curve_to(c, c1, 0.0, r, c1, r, r); cairo_rel_line_to(c, 0, h - 2 * r); cairo_rel_curve_to(c, 0.0, c1, c1 - r, r, -r, r); cairo_rel_line_to(c, -w + 2 * r, 0); cairo_rel_curve_to(c, -c1, 0, -r, -c1, -r, -r); cairo_rel_line_to(c, 0, -h + 2 * r); cairo_rel_curve_to(c, 0, -c1, r - c1, -r, r, -r); } else cairo_rectangle(c, x, y, w, h); } void clear_pixmap(Pixmap p, int x, int y, int w, int h) { Picture pict = XRenderCreatePicture(server.display, p, XRenderFindVisualFormat(server.display, server.visual), 0, 0); XRenderColor col; col.red = col.green = col.blue = col.alpha = 0; XRenderFillRectangle(server.display, PictOpSrc, pict, &col, x, y, w, h); XRenderFreePicture(server.display, pict); } void get_text_size2(PangoFontDescription *font, int *height_ink, int *height, int *width, int panel_height, int panel_width, char *text, int len, PangoWrapMode wrap, PangoEllipsizeMode ellipsis, gboolean markup) { PangoRectangle rect_ink, rect; Pixmap pmap = XCreatePixmap(server.display, server.root_win, panel_height, panel_width, server.depth); cairo_surface_t *cs = cairo_xlib_surface_create(server.display, pmap, server.visual, panel_height, panel_width); cairo_t *c = cairo_create(cs); PangoLayout *layout = pango_cairo_create_layout(c); pango_layout_set_width(layout, panel_width * PANGO_SCALE); pango_layout_set_height(layout, panel_height * PANGO_SCALE); pango_layout_set_wrap(layout, wrap); pango_layout_set_ellipsize(layout, ellipsis); pango_layout_set_font_description(layout, font); if (!markup) pango_layout_set_text(layout, text, len); else pango_layout_set_markup(layout, text, len); pango_layout_get_pixel_extents(layout, &rect_ink, &rect); *height_ink = rect_ink.height; *height = rect.height; *width = rect.width; // printf("dimension : %d - %d\n", rect_ink.height, rect.height); g_object_unref(layout); cairo_destroy(c); cairo_surface_destroy(cs); XFreePixmap(server.display, pmap); } #if !GLIB_CHECK_VERSION (2, 33, 4) GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data) { list = g_list_copy(list); if (func) { for (GList *l = list; l; l = l->next) { l->data = func(l->data, user_data); } } return list; } #endif // Based loosely on close_allv from // https://git.gnome.org/browse/glib/tree/gio/libasyncns/asyncns.c?h=2.21.0#n205 // license: LGPL version 2.1 // but with all the junk removed // and // https://opensource.apple.com/source/sudo/sudo-46/src/closefrom.c // license: BSD void close_all_fds() { const int from_fd = 3; #ifdef __linux__ DIR *d = opendir("/proc/self/fd"); if (d) { for (struct dirent *de = readdir(d); de; de = readdir(d)) { if (de->d_name[0] == '.') continue; int fd = atoi(de->d_name); if (fd < from_fd) continue; if (fd == dirfd(d)) continue; close(fd); } closedir(d); return; } #endif #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) closefrom(from_fd); return; #endif #if defined(__NetBSD__) fcntl(from_fd, F_CLOSEM, 0); #endif // Worst case scenario: iterate over all possible fds int max_fd = sysconf(_SC_OPEN_MAX); for (int fd = from_fd; fd < max_fd; fd++) { close(fd); } return; } char* get_own_path() { const int buf_size = 4096; char *buf = calloc(buf_size, 1); #ifdef __linux__ if (readlink("/proc/self/exe", buf, buf_size) > 0) return buf; #endif #if defined(__FreeBSD__) int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, getpid() }; size_t max_len = buf_size; if (sysctl(mib, 4, buf, &max_len, NULL, 0) == 0) return buf; #endif #if defined(__DragonFly__) if (readlink("/proc/curproc/file", buf, buf_size) > 0) return buf; #endif #if defined(__NetBSD__) if (readlink("/proc/curproc/exe", buf, buf_size) > 0) return buf; #endif #if defined(__OpenBSD__) int mib[4] = { CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_ARGV }; char *path = NULL; size_t len; if (sysctl(mib, 4, NULL, &len, NULL, 0) == 0 && len > 0) { char **argv = malloc(len); if (argv) { if (sysctl(mib, 4, argv, &len, NULL, 0) == 0) { path = realpath(argv[0], NULL); } } free(argv); } if (path) { free(buf); return path; } #endif sprintf(buf, "tint2"); return buf; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/common.h000066400000000000000000000061611265276141000236630ustar00rootroot00000000000000/************************************************************************** * Common declarations * **************************************************************************/ #ifndef COMMON_H #define COMMON_H #define WM_CLASS_TINT "panel" #include #include #include "area.h" #define GREEN "\033[1;32m" #define YELLOW "\033[1;33m" #define RED "\033[1;31m" #define BLUE "\033[1;34m" #define RESET "\033[0m" // mouse actions typedef enum MouseAction { NONE = 0, CLOSE, TOGGLE, ICONIFY, SHADE, TOGGLE_ICONIFY, MAXIMIZE_RESTORE, MAXIMIZE, RESTORE, DESKTOP_LEFT, DESKTOP_RIGHT, NEXT_TASK, PREV_TASK } MouseAction; #define ALL_DESKTOPS 0xFFFFFFFF // Copies a file to another path void copy_file(const char *path_src, const char *path_dest); // Parses lines with the format 'key = value' into key and value. // Strips key and value. // Values may contain spaces and the equal sign. // Returns 1 if both key and value could be read, zero otherwise. int parse_line(const char *line, char **key, char **value); void extract_values(const char *value, char **value1, char **value2, char **value3); // Executes a command in a shell. void tint_exec(const char *command); // Returns a copy of s in which "~" is expanded to the path to the user's home directory. // The caller takes ownership of the string. char *expand_tilde(char *s); // The opposite of expand_tilde: replaces the path to the user's home directory with "~". // The caller takes ownership of the string. char *contract_tilde(char *s); // Color int hex_char_to_int(char c); int hex_to_rgb(char *hex, int *r, int *g, int *b); void get_color(char *hex, double *rgb); Imlib_Image load_image(const char *path, int cached); // Adjusts the alpha/saturation/brightness on an ARGB image. // Parameters: alpha from 0 to 100, satur from 0 to 1, bright from 0 to 1. void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright); Imlib_Image adjust_icon(Imlib_Image original, int alpha, int saturation, int brightness); void create_heuristic_mask(DATA32 *data, int w, int h); int image_empty(DATA32 *data, int w, int h); // Renders the current Imlib image to a drawable. Wrapper around imlib_render_image_on_drawable. void render_image(Drawable d, int x, int y); void get_text_size2(PangoFontDescription *font, int *height_ink, int *height, int *width, int panel_height, int panel_with, char *text, int len, PangoWrapMode wrap, PangoEllipsizeMode ellipsis, gboolean markup); void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color, int font_shadow); // Draws a rounded rectangle void draw_rect(cairo_t *c, double x, double y, double w, double h, double r); // Clears the pixmap (with transparent color) void clear_pixmap(Pixmap p, int x, int y, int w, int h); #define free_and_null(p) { free(p); p = NULL; } #if !GLIB_CHECK_VERSION (2, 33, 4) GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data); #endif #if !GLIB_CHECK_VERSION (2, 38, 0) #define g_assert_null(expr) g_assert((expr) == NULL) #endif void close_all_fds(); char* get_own_path(); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/strnatcmp.c000066400000000000000000000076561265276141000244130ustar00rootroot00000000000000/* -*- mode: c; c-file-style: "k&r" -*- strnatcmp.c -- Perform 'natural order' comparisons of strings in C. Copyright (C) 2000, 2004 by Martin Pool This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* partial change history: * * 2004-10-10 mbp: Lift out character type dependencies into macros. * * Eric Sosman pointed out that ctype functions take a parameter whose * value must be that of an unsigned int, even on platforms that have * negative chars in their default char type. */ #include #include #include #include #include "strnatcmp.h" /* These are defined as macros to make it easier to adapt this code to * different characters types or comparison functions. */ static inline int nat_isdigit(nat_char a) { return isdigit((unsigned char)a); } static inline int nat_isspace(nat_char a) { return isspace((unsigned char)a); } static inline nat_char nat_toupper(nat_char a) { return toupper((unsigned char)a); } static int compare_right(nat_char const *a, nat_char const *b) { int bias = 0; /* The longest run of digits wins. That aside, the greatest * value wins, but we can't know that it will until we've scanned * both numbers to know that they have the same magnitude, so we * remember it in BIAS. */ for (;; a++, b++) { if (!nat_isdigit(*a) && !nat_isdigit(*b)) return bias; else if (!nat_isdigit(*a)) return -1; else if (!nat_isdigit(*b)) return +1; else if (*a < *b) { if (!bias) bias = -1; } else if (*a > *b) { if (!bias) bias = +1; } else if (!*a && !*b) return bias; } return 0; } static int compare_left(nat_char const *a, nat_char const *b) { /* Compare two left-aligned numbers: the first to have a different value wins. */ for (;; a++, b++) { if (!nat_isdigit(*a) && !nat_isdigit(*b)) return 0; else if (!nat_isdigit(*a)) return -1; else if (!nat_isdigit(*b)) return +1; else if (*a < *b) return -1; else if (*a > *b) return +1; } return 0; } static int strnatcmp0(nat_char const *a, nat_char const *b, int fold_case) { int ai, bi; nat_char ca, cb; int fractional, result; assert(a && b); ai = bi = 0; while (1) { ca = a[ai]; cb = b[bi]; /* skip over leading spaces or zeros */ while (nat_isspace(ca)) ca = a[++ai]; while (nat_isspace(cb)) cb = b[++bi]; /* process run of digits */ if (nat_isdigit(ca) && nat_isdigit(cb)) { fractional = (ca == '0' || cb == '0'); if (fractional) { if ((result = compare_left(a + ai, b + bi)) != 0) return result; } else { if ((result = compare_right(a + ai, b + bi)) != 0) return result; } } if (!ca && !cb) { /* The strings compare the same. Perhaps the caller will want to call strcmp to break the tie. */ return 0; } if (fold_case) { ca = nat_toupper(ca); cb = nat_toupper(cb); } if (ca < cb) return -1; else if (ca > cb) return +1; ++ai; ++bi; } } int strnatcmp(nat_char const *a, nat_char const *b) { return strnatcmp0(a, b, 0); } /* Compare, recognizing numeric string and ignoring case. */ int strnatcasecmp(nat_char const *a, nat_char const *b) { return strnatcmp0(a, b, 1); } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/strnatcmp.h000066400000000000000000000024061265276141000244040ustar00rootroot00000000000000/* -*- mode: c; c-file-style: "k&r" -*- strnatcmp.c -- Perform 'natural order' comparisons of strings in C. Copyright (C) 2000, 2004 by Martin Pool This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* CUSTOMIZATION SECTION * * You can change this typedef, but must then also change the inline * functions in strnatcmp.c */ typedef char nat_char; int strnatcmp(nat_char const *a, nat_char const *b); int strnatcasecmp(nat_char const *a, nat_char const *b); tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/timer.c000066400000000000000000000330501265276141000235030ustar00rootroot00000000000000/************************************************************************** * * Copyright (C) 2009 Andreas.Fink (Andreas.Fink85@gmail.com) * * 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 #include #include #include #include "timer.h" GSList *timeout_list; struct timeval next_timeout; GHashTable *multi_timeouts; // functions and structs for multi timeouts typedef struct { int current_count; int count_to_expiration; } multi_timeout; typedef struct { GSList *timeout_list; timeout *parent_timeout; } multi_timeout_handler; struct _timeout { int interval_msec; struct timespec timeout_expires; void (*_callback)(void *); void *arg; multi_timeout *multi_timeout; timeout **self; }; void add_timeout_intern(int value_msec, int interval_msec, void (*_callback)(void *), void *arg, timeout *t); gint compare_timeouts(gconstpointer t1, gconstpointer t2); int timespec_subtract(struct timespec *result, struct timespec *x, struct timespec *y); int align_with_existing_timeouts(timeout *t); void create_multi_timeout(timeout *t1, timeout *t2); void append_multi_timeout(timeout *t1, timeout *t2); int calc_multi_timeout_interval(multi_timeout_handler *mth); void update_multi_timeout_values(multi_timeout_handler *mth); void callback_multi_timeout(void *mth); void remove_from_multi_timeout(timeout *t); void stop_multi_timeout(timeout *t); void default_timeout() { timeout_list = NULL; multi_timeouts = NULL; } void cleanup_timeout() { while (timeout_list) { timeout *t = timeout_list->data; if (t->multi_timeout) stop_multi_timeout(t); if (t->self) *t->self = NULL; free(t); timeout_list = g_slist_remove(timeout_list, t); } if (multi_timeouts) { g_hash_table_destroy(multi_timeouts); multi_timeouts = NULL; } } // Implementation notes for timeouts // // The timeouts are kept in a GSList sorted by their expiration time. // That means that update_next_timeout() only have to consider the first timeout in the list, // and callback_timeout_expired() only have to consider the timeouts as long as the expiration time // is in the past to the current time. // As time measurement we use clock_gettime(CLOCK_MONOTONIC) because this refers to a timer, which // reference point lies somewhere in the past and cannot be changed, but just queried. // If a single shot timer is installed it will be automatically deleted. I.e. the returned value // of add_timeout will not be valid anymore. You do not need to call stop_timeout for these timeouts, // however it's save to call it. timeout *add_timeout(int value_msec, int interval_msec, void (*_callback)(void *), void *arg, timeout **self) { if (self && *self) return *self; timeout *t = calloc(1, sizeof(timeout)); t->self = self; add_timeout_intern(value_msec, interval_msec, _callback, arg, t); return t; } void change_timeout(timeout **t, int value_msec, int interval_msec, void (*_callback)(), void *arg) { if (!((timeout_list && g_slist_find(timeout_list, *t)) || (multi_timeouts && g_hash_table_lookup(multi_timeouts, *t)))) *t = add_timeout(value_msec, interval_msec, _callback, arg, t); else { if ((*t)->multi_timeout) remove_from_multi_timeout(*t); else timeout_list = g_slist_remove(timeout_list, *t); add_timeout_intern(value_msec, interval_msec, _callback, arg, *t); } } void update_next_timeout() { if (timeout_list) { timeout *t = timeout_list->data; struct timespec cur_time; struct timespec next_timeout2 = {.tv_sec = next_timeout.tv_sec, .tv_nsec = next_timeout.tv_usec * 1000}; clock_gettime(CLOCK_MONOTONIC, &cur_time); if (timespec_subtract(&next_timeout2, &t->timeout_expires, &cur_time)) { next_timeout.tv_sec = 0; next_timeout.tv_usec = 0; } else { next_timeout.tv_sec = next_timeout2.tv_sec; next_timeout.tv_usec = next_timeout2.tv_nsec / 1000; } } else next_timeout.tv_sec = -1; } void callback_timeout_expired() { struct timespec cur_time; timeout *t; while (timeout_list) { clock_gettime(CLOCK_MONOTONIC, &cur_time); t = timeout_list->data; if (compare_timespecs(&t->timeout_expires, &cur_time) <= 0) { // it's time for the callback function t->_callback(t->arg); // If _callback() calls stop_timeout(t) the timer 't' was freed and is not in the timeout_list if (g_slist_find(timeout_list, t)) { // Timer still exists timeout_list = g_slist_remove(timeout_list, t); if (t->interval_msec > 0) { add_timeout_intern(t->interval_msec, t->interval_msec, t->_callback, t->arg, t); } else { // Destroy single-shot timer if (t->self) *t->self = NULL; free(t); } } } else { return; } } } void stop_timeout(timeout *t) { if (!t) return; // if not in the list, it was deleted in callback_timeout_expired if ((timeout_list && g_slist_find(timeout_list, t)) || (multi_timeouts && g_hash_table_lookup(multi_timeouts, t))) { if (multi_timeouts && t->multi_timeout) remove_from_multi_timeout(t); if (timeout_list) timeout_list = g_slist_remove(timeout_list, t); if (t->self) *t->self = NULL; free(t); } } void add_timeout_intern(int value_msec, int interval_msec, void (*_callback)(), void *arg, timeout *t) { t->interval_msec = interval_msec; t->_callback = _callback; t->arg = arg; struct timespec cur_time; clock_gettime(CLOCK_MONOTONIC, &cur_time); t->timeout_expires = add_msec_to_timespec(cur_time, value_msec); int can_align = 0; if (interval_msec > 0 && !t->multi_timeout) can_align = align_with_existing_timeouts(t); if (!can_align) timeout_list = g_slist_insert_sorted(timeout_list, t, compare_timeouts); } gint compare_timeouts(gconstpointer t1, gconstpointer t2) { return compare_timespecs(&((const timeout *)t1)->timeout_expires, &((const timeout *)t2)->timeout_expires); } gint compare_timespecs(const struct timespec *t1, const struct timespec *t2) { if (t1->tv_sec < t2->tv_sec) return -1; else if (t1->tv_sec == t2->tv_sec) { if (t1->tv_nsec < t2->tv_nsec) return -1; else if (t1->tv_nsec == t2->tv_nsec) return 0; else return 1; } else return 1; } int timespec_subtract(struct timespec *result, struct timespec *x, struct timespec *y) { /* Perform the carry for the later subtraction by updating y. */ if (x->tv_nsec < y->tv_nsec) { int nsec = (y->tv_nsec - x->tv_nsec) / 1000000000 + 1; y->tv_nsec -= 1000000000 * nsec; y->tv_sec += nsec; } if (x->tv_nsec - y->tv_nsec > 1000000000) { int nsec = (x->tv_nsec - y->tv_nsec) / 1000000000; y->tv_nsec += 1000000000 * nsec; y->tv_sec -= nsec; } /* Compute the time remaining to wait. tv_nsec is certainly positive. */ result->tv_sec = x->tv_sec - y->tv_sec; result->tv_nsec = x->tv_nsec - y->tv_nsec; /* Return 1 if result is negative. */ return x->tv_sec < y->tv_sec; } struct timespec add_msec_to_timespec(struct timespec ts, int msec) { ts.tv_sec += msec / 1000; ts.tv_nsec += (msec % 1000) * 1000000; if (ts.tv_nsec >= 1000000000) { // 10^9 ts.tv_sec++; ts.tv_nsec -= 1000000000; } return ts; } int align_with_existing_timeouts(timeout *t) { GSList *it = timeout_list; while (it) { timeout *t2 = it->data; if (t2->interval_msec > 0) { if (t->interval_msec % t2->interval_msec == 0 || t2->interval_msec % t->interval_msec == 0) { if (!multi_timeouts) multi_timeouts = g_hash_table_new(0, 0); if (!t->multi_timeout && !t2->multi_timeout) { // both timeouts can be aligned, but there is no multi timeout for them create_multi_timeout(t, t2); } else { // there is already a multi timeout, so we append the new timeout to the multi timeout append_multi_timeout(t, t2); } return 1; } } it = it->next; } return 0; } int calc_multi_timeout_interval(multi_timeout_handler *mth) { GSList *it = mth->timeout_list; timeout *t = it->data; int min_interval = t->interval_msec; it = it->next; while (it) { t = it->data; if (t->interval_msec < min_interval) min_interval = t->interval_msec; it = it->next; } return min_interval; } void create_multi_timeout(timeout *t1, timeout *t2) { multi_timeout *mt1 = calloc(1, sizeof(multi_timeout)); multi_timeout *mt2 = calloc(1, sizeof(multi_timeout)); multi_timeout_handler *mth = calloc(1, sizeof(multi_timeout_handler)); timeout *real_timeout = calloc(1, sizeof(timeout)); mth->timeout_list = 0; mth->timeout_list = g_slist_prepend(mth->timeout_list, t1); mth->timeout_list = g_slist_prepend(mth->timeout_list, t2); mth->parent_timeout = real_timeout; g_hash_table_insert(multi_timeouts, t1, mth); g_hash_table_insert(multi_timeouts, t2, mth); g_hash_table_insert(multi_timeouts, real_timeout, mth); t1->multi_timeout = mt1; t2->multi_timeout = mt2; // set real_timeout->multi_timeout to something, such that we see in add_timeout_intern that // it is already a multi_timeout (we never use it, except of checking for 0 ptr) real_timeout->multi_timeout = (void *)real_timeout; timeout_list = g_slist_remove(timeout_list, t1); timeout_list = g_slist_remove(timeout_list, t2); update_multi_timeout_values(mth); } void append_multi_timeout(timeout *t1, timeout *t2) { if (t2->multi_timeout) { // swap t1 and t2 such that t1 is the multi timeout timeout *tmp = t2; t2 = t1; t1 = tmp; } multi_timeout *mt = calloc(1, sizeof(multi_timeout)); multi_timeout_handler *mth = g_hash_table_lookup(multi_timeouts, t1); mth->timeout_list = g_slist_prepend(mth->timeout_list, t2); g_hash_table_insert(multi_timeouts, t2, mth); t2->multi_timeout = mt; update_multi_timeout_values(mth); } void update_multi_timeout_values(multi_timeout_handler *mth) { int interval = calc_multi_timeout_interval(mth); int next_timeout_msec = interval; struct timespec cur_time; clock_gettime(CLOCK_MONOTONIC, &cur_time); GSList *it = mth->timeout_list; struct timespec diff_time; while (it) { timeout *t = it->data; t->multi_timeout->count_to_expiration = t->interval_msec / interval; timespec_subtract(&diff_time, &t->timeout_expires, &cur_time); int msec_to_expiration = diff_time.tv_sec * 1000 + diff_time.tv_nsec / 1000000; int count_left = msec_to_expiration / interval + (msec_to_expiration % interval != 0); t->multi_timeout->current_count = t->multi_timeout->count_to_expiration - count_left; if (msec_to_expiration < next_timeout_msec) next_timeout_msec = msec_to_expiration; it = it->next; } mth->parent_timeout->interval_msec = interval; timeout_list = g_slist_remove(timeout_list, mth->parent_timeout); add_timeout_intern(next_timeout_msec, interval, callback_multi_timeout, mth, mth->parent_timeout); } void callback_multi_timeout(void *arg) { multi_timeout_handler *mth = arg; struct timespec cur_time; clock_gettime(CLOCK_MONOTONIC, &cur_time); GSList *it = mth->timeout_list; while (it) { timeout *t = it->data; if (++t->multi_timeout->current_count >= t->multi_timeout->count_to_expiration) { t->_callback(t->arg); 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; } } void remove_from_multi_timeout(timeout *t) { multi_timeout_handler *mth = g_hash_table_lookup(multi_timeouts, t); g_hash_table_remove(multi_timeouts, t); mth->timeout_list = g_slist_remove(mth->timeout_list, t); free(t->multi_timeout); t->multi_timeout = 0; if (g_slist_length(mth->timeout_list) == 1) { timeout *last_timeout = mth->timeout_list->data; mth->timeout_list = g_slist_remove(mth->timeout_list, last_timeout); free(last_timeout->multi_timeout); last_timeout->multi_timeout = 0; g_hash_table_remove(multi_timeouts, last_timeout); g_hash_table_remove(multi_timeouts, mth->parent_timeout); mth->parent_timeout->multi_timeout = 0; stop_timeout(mth->parent_timeout); free(mth); struct timespec cur_time, diff_time; clock_gettime(CLOCK_MONOTONIC, &cur_time); timespec_subtract(&diff_time, &t->timeout_expires, &cur_time); int msec_to_expiration = diff_time.tv_sec * 1000 + diff_time.tv_nsec / 1000000; add_timeout_intern(msec_to_expiration, last_timeout->interval_msec, last_timeout->_callback, last_timeout->arg, last_timeout); } else update_multi_timeout_values(mth); } void stop_multi_timeout(timeout *t) { multi_timeout_handler *mth = g_hash_table_lookup(multi_timeouts, t); g_hash_table_remove(multi_timeouts, mth->parent_timeout); while (mth->timeout_list) { timeout *t1 = mth->timeout_list->data; mth->timeout_list = g_slist_remove(mth->timeout_list, t1); g_hash_table_remove(multi_timeouts, t1); free(t1->multi_timeout); free(t1); } free(mth); } double profiling_get_time_old_time = 0; double get_time() { struct timespec cur_time; clock_gettime(CLOCK_MONOTONIC, &cur_time); return cur_time.tv_sec + cur_time.tv_nsec * 1.0e-9; } double profiling_get_time() { double t = get_time(); 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; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/timer.h000066400000000000000000000063511265276141000235140ustar00rootroot00000000000000/************************************************************************* * * Copyright (C) 2009 Andreas.Fink (Andreas.Fink85@gmail.com) * * 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. **************************************************************************/ #ifndef TIMER_H #define TIMER_H #include #include #include // Single shot timers (i.e. timers with interval_msec == 0) are deleted automatically as soon as they expire, // i.e. you do not need to stop them, however it is safe to call stop_timeout for these timers. // You can pass the address of the variable storing the pointer to the timer as 'self' in add_timeout, in which // case it is used to clear the pointer if the timer is destroyed automatically. This enforces the timeout pointers // to be either valid or NULL. // Periodic timeouts are aligned to each other whenever possible, i.e. one interval_msec is an // integral multiple of the other. extern struct timeval next_timeout; typedef struct _timeout timeout; // Initializes default global data. void default_timeout(); // Cleans up: stops all timers and frees memory. void cleanup_timeout(); // Installs a timer with the first timeout after 'value_msec' and then an optional periodic timeout every // 'interval_msec' (set it to 0 to prevent periodic timeouts). // '_callback' is the function called when the timer reaches the timeout. // 'arg' is the argument passed to the callback function. // 'self' is an optional pointer to a timeout* variable. If non-NULL, the variable is set to NULL when the timer // is destroyed (with stop_timeout, cleanup_timeout or when the timer expires and it is single-shot). // Returns a pointer to the timer, which is needed for stopping/changing it. timeout *add_timeout(int value_msec, int interval_msec, void (*_callback)(void *), void *arg, timeout **self); // Changes timer 't'. If it does not exist, a new timer is created, with self set to 't'. void change_timeout(timeout **t, int value_msec, int interval_msec, void (*_callback)(void *), void *arg); // Stops the timer 't' void stop_timeout(timeout *t); // Updates next_timeout to the value, when the next installed timeout will expire 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(); double get_time(); #endif // TIMER_H tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/uevent.c000066400000000000000000000113021265276141000236650ustar00rootroot00000000000000/************************************************************************** * * Linux Kernel uevent handler * * Copyright (C) 2015 Sebastian Reichel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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. **************************************************************************/ #ifdef ENABLE_UEVENT #include #include #include #include #include #include #include #include "common.h" #include "uevent.h" static int ueventfd = -1; static struct sockaddr_nl nls; static GList *notifiers = NULL; static const char *has_prefix(const char *str, const char *end, const char *prefix, size_t prefixlen) { if ((end - str) < prefixlen) return NULL; if (!memcmp(str, prefix, prefixlen)) return str + prefixlen; return NULL; } #define HAS_CONST_PREFIX(str, end, prefix) has_prefix((str), end, prefix, sizeof(prefix) - 1) static void uevent_param_free(gpointer data) { struct uevent_parameter *param = data; free(param->key); free(param->val); free(param); } static void uevent_free(struct uevent *ev) { free(ev->path); free(ev->subsystem); g_list_free_full(ev->params, uevent_param_free); free(ev); } static struct uevent *uevent_new(char *buffer, int size) { gboolean first = TRUE; if (size == 0) return NULL; struct uevent *ev = calloc(1, sizeof(*ev)); if (!ev) return NULL; /* ensure nul termination required by strlen() */ buffer[size - 1] = '\0'; const char *s = buffer; const char *end = s + size; for (; s < end; s += strlen(s) + 1) { if (first) { const char *p = strchr(s, '@'); if (!p) { /* error: kernel events contain @ */ /* triggered by udev events, though */ free(ev); return NULL; } ev->path = strdup(p + 1); first = FALSE; } else { const char *val; if ((val = HAS_CONST_PREFIX(s, end, "ACTION=")) != NULL) { if (!strcmp(val, "add")) ev->action = UEVENT_ADD; else if (!strcmp(val, "remove")) ev->action = UEVENT_REMOVE; else if (!strcmp(val, "change")) ev->action = UEVENT_CHANGE; else ev->action = UEVENT_UNKNOWN; } else if ((val = HAS_CONST_PREFIX(s, end, "SEQNUM=")) != NULL) { ev->sequence = atoi(val); } else if ((val = HAS_CONST_PREFIX(s, end, "SUBSYSTEM=")) != NULL) { ev->subsystem = strdup(val); } else { val = strchr(s, '='); if (val) { struct uevent_parameter *param = malloc(sizeof(*param)); if (param) { param->key = strndup(s, val - s); param->val = strdup(val + 1); ev->params = g_list_append(ev->params, param); } } } } } return ev; } void uevent_register_notifier(struct uevent_notify *nb) { notifiers = g_list_append(notifiers, nb); } void uevent_unregister_notifier(struct uevent_notify *nb) { GList *l = notifiers; while (l != NULL) { GList *next = l->next; struct uevent_notify *lnb = l->data; if (memcmp(nb, lnb, sizeof(struct uevent_notify)) == 0) notifiers = g_list_delete_link(notifiers, l); l = next; } } void uevent_handler() { if (ueventfd < 0) return; char buf[512]; int len = recv(ueventfd, buf, sizeof(buf), MSG_DONTWAIT); if (len < 0) return; struct uevent *ev = uevent_new(buf, len); if (ev) { for (GList *l = notifiers; l; l = l->next) { struct uevent_notify *nb = l->data; if (!(ev->action & nb->action)) continue; if (nb->subsystem && strcmp(ev->subsystem, nb->subsystem)) continue; nb->cb(ev, nb->userdata); } uevent_free(ev); } } int uevent_init() { /* Open hotplug event netlink socket */ memset(&nls, 0, sizeof(struct sockaddr_nl)); nls.nl_family = AF_NETLINK; nls.nl_pid = getpid(); nls.nl_groups = -1; /* open socket */ ueventfd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); if (ueventfd < 0) { fprintf(stderr, "Error: socket open failed\n"); return -1; } /* Listen to netlink socket */ if (bind(ueventfd, (void *)&nls, sizeof(struct sockaddr_nl))) { fprintf(stderr, "Bind failed\n"); return -1; } printf("Kernel uevent interface initialized...\n"); return ueventfd; } void uevent_cleanup() { if (ueventfd >= 0) close(ueventfd); } #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/uevent.h000066400000000000000000000035311265276141000236770ustar00rootroot00000000000000/************************************************************************** * * Linux Kernel uevent handler * * Copyright (C) 2015 Sebastian Reichel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * or any later version 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. **************************************************************************/ #ifndef UEVENT_H #define UEVENT_H enum uevent_action { UEVENT_UNKNOWN = 0x01, UEVENT_ADD = 0x02, UEVENT_REMOVE = 0x04, UEVENT_CHANGE = 0x08, }; struct uevent_parameter { char *key; char *val; }; struct uevent { char *path; enum uevent_action action; int sequence; char *subsystem; GList *params; }; struct uevent_notify { int action; /* bitfield */ char *subsystem; /* NULL => any */ void *userdata; void (*cb)(struct uevent *e, void *userdata); }; #if ENABLE_UEVENT int uevent_init(); void uevent_cleanup(); void uevent_handler(); void uevent_register_notifier(struct uevent_notify *nb); void uevent_unregister_notifier(struct uevent_notify *nb); #else static inline int uevent_init() { return -1; } static inline void uevent_cleanup() { } static inline void uevent_handler() { } static inline void uevent_register_notifier(struct uevent_notify *nb) { } static inline void uevent_unregister_notifier(struct uevent_notify *nb) { } #endif #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/window.c000066400000000000000000000212431265276141000236730ustar00rootroot00000000000000/************************************************************************** * * Tint2 : common windows function * * Copyright (C) 2007 Pål Staurland (staura@gmail.com) * Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * 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 #include #include #include #include #include #include #include #include #include "common.h" #include "window.h" #include "server.h" #include "panel.h" #include "taskbar.h" void activate_window(Window win) { send_event32(win, server.atom._NET_ACTIVE_WINDOW, 2, CurrentTime, 0); } void change_window_desktop(Window win, int desktop) { send_event32(win, server.atom._NET_WM_DESKTOP, desktop, 2, 0); } void close_window(Window win) { send_event32(win, server.atom._NET_CLOSE_WINDOW, 0, 2, 0); } void toggle_window_shade(Window win) { send_event32(win, server.atom._NET_WM_STATE, 2, server.atom._NET_WM_STATE_SHADED, 0); } void toggle_window_maximized(Window win) { send_event32(win, server.atom._NET_WM_STATE, 2, server.atom._NET_WM_STATE_MAXIMIZED_VERT, 0); send_event32(win, server.atom._NET_WM_STATE, 2, server.atom._NET_WM_STATE_MAXIMIZED_HORZ, 0); } gboolean window_is_hidden(Window win) { Window window; int count; Atom *at = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count); for (int i = 0; i < count; i++) { if (at[i] == server.atom._NET_WM_STATE_SKIP_TASKBAR) { XFree(at); return TRUE; } // do not add transient_for windows if the transient window is already in the taskbar window = win; while (XGetTransientForHint(server.display, window, &window)) { if (get_task_buttons(window)) { XFree(at); return TRUE; } } } XFree(at); at = server_get_property(win, server.atom._NET_WM_WINDOW_TYPE, XA_ATOM, &count); for (int i = 0; i < count; i++) { if (at[i] == server.atom._NET_WM_WINDOW_TYPE_DOCK || at[i] == server.atom._NET_WM_WINDOW_TYPE_DESKTOP || at[i] == server.atom._NET_WM_WINDOW_TYPE_TOOLBAR || at[i] == server.atom._NET_WM_WINDOW_TYPE_MENU || at[i] == server.atom._NET_WM_WINDOW_TYPE_SPLASH) { XFree(at); return TRUE; } } XFree(at); for (int i = 0; i < num_panels; i++) { if (panels[i].main_win == win) { return TRUE; } } // specification // Windows with neither _NET_WM_WINDOW_TYPE nor WM_TRANSIENT_FOR set // MUST be taken as top-level window. return FALSE; } int get_window_desktop(Window win) { if (!server.viewports) { int desktop = get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL); if (desktop != ALL_DESKTOPS) desktop = MAX(0, MIN(server.num_desktops - 1, desktop)); return desktop; } int x, y, w, h; get_window_coordinates(win, &x, &y, &w, &h); int desktop = get_current_desktop(); // Window coordinates are relative to the current viewport, make them absolute x += server.viewports[desktop].x; y += server.viewports[desktop].y; if (x < 0 || y < 0) { int num_results; long *x_screen_size = server_get_property(server.root_win, server.atom._NET_DESKTOP_GEOMETRY, XA_CARDINAL, &num_results); if (!x_screen_size) return 0; int x_screen_width = x_screen_size[0]; int x_screen_height = x_screen_size[1]; XFree(x_screen_size); // Wrap if (x < 0) x += x_screen_width; if (y < 0) y += x_screen_height; } 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 viewports. // In that case, prefer the viewports which is on the right and bottom of the window's top-left corner. for (int i = 0; i < server.num_desktops; i++) { if (x >= server.viewports[i].x && x <= (server.viewports[i].x + server.viewports[i].width) && y >= server.viewports[i].y && y <= (server.viewports[i].y + server.viewports[i].height)) { int current_right = x < (server.viewports[i].x + server.viewports[i].width); int current_bottom = y < (server.viewports[i].y + server.viewports[i].height); if (best_match < 0 || (!match_right && current_right) || (!match_bottom && current_bottom)) { best_match = i; } } } if (best_match < 0) best_match = 0; //fprintf(stderr, "window %lx %s : viewport %d, (%d, %d)\n", win, get_task(win) ? get_task(win)->title : "??", best_match+1, x, y); return best_match; } int get_window_monitor(Window win) { int x, y, w, h; get_window_coordinates(win, &x, &y, &w, &h); 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 (int i = 0; i < server.num_monitors; i++) { if (x >= server.monitors[i].x && x <= (server.monitors[i].x + server.monitors[i].width) && y >= server.monitors[i].y && y <= (server.monitors[i].y + server.monitors[i].height)) { int current_right = x < (server.monitors[i].x + server.monitors[i].width); int current_bottom = y < (server.monitors[i].y + server.monitors[i].height); if (best_match < 0 || (!match_right && current_right) || (!match_bottom && current_bottom)) { best_match = i; } } } if (best_match < 0) best_match = 0; //fprintf(stderr, "desktop %d, window %lx %s : monitor %d, (%d, %d)\n", 1 + get_current_desktop(), win, get_task(win) ? get_task(win)->title : "??", best_match+1, x, y); return best_match; } void get_window_coordinates(Window win, int *x, int *y, int *w, int *h) { int dummy_int; unsigned ww, wh, bw, bh; Window src; XTranslateCoordinates(server.display, win, server.root_win, 0, 0, x, y, &src); XGetGeometry(server.display, win, &src, &dummy_int, &dummy_int, &ww, &wh, &bw, &bh); *w = ww + bw; *h = wh + bh; } gboolean window_is_iconified(Window win) { // EWMH specification : minimization of windows use _NET_WM_STATE_HIDDEN. // WM_STATE is not accurate for shaded window and in multi_desktop mode. int count; Atom *at = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count); for (int i = 0; i < count; i++) { if (at[i] == server.atom._NET_WM_STATE_HIDDEN) { XFree(at); return TRUE; } } XFree(at); return FALSE; } gboolean window_is_urgent(Window win) { int count; Atom *at = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count); for (int i = 0; i < count; i++) { if (at[i] == server.atom._NET_WM_STATE_DEMANDS_ATTENTION) { XFree(at); return TRUE; } } XFree(at); return FALSE; } gboolean window_is_skip_taskbar(Window win) { int count; Atom *at = server_get_property(win, server.atom._NET_WM_STATE, XA_ATOM, &count); for (int i = 0; i < count; i++) { if (at[i] == server.atom._NET_WM_STATE_SKIP_TASKBAR) { XFree(at); return 1; } } XFree(at); return FALSE; } Window get_active_window() { return get_property32(server.root_win, server.atom._NET_ACTIVE_WINDOW, XA_WINDOW); } gboolean window_is_active(Window win) { return (win == get_property32(server.root_win, server.atom._NET_ACTIVE_WINDOW, XA_WINDOW)); } int get_icon_count(gulong *data, int num) { int count, pos, w, h; count = 0; pos = 0; while (pos + 2 < num) { w = data[pos++]; h = data[pos++]; pos += w * h; if (pos > num || w <= 0 || h <= 0) break; count++; } return count; } gulong *get_best_icon(gulong *data, int icon_count, int num, int *iw, int *ih, int best_icon_size) { int width[icon_count], height[icon_count], pos, i, w, h; gulong *icon_data[icon_count]; /* List up icons */ pos = 0; i = icon_count; while (i--) { w = data[pos++]; h = data[pos++]; if (pos + w * h > num) break; width[i] = w; height[i] = h; icon_data[i] = &data[pos]; pos += w * h; } /* Try to find exact size */ int icon_num = -1; for (i = 0; i < icon_count; i++) { if (width[i] == best_icon_size) { icon_num = i; break; } } /* Take the biggest or whatever */ if (icon_num < 0) { int highest = 0; for (i = 0; i < icon_count; i++) { if (width[i] > highest) { icon_num = i; highest = width[i]; } } } *iw = width[icon_num]; *ih = height[icon_num]; return icon_data[icon_num]; } tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/src/util/window.h000066400000000000000000000020221265276141000236720ustar00rootroot00000000000000/************************************************************************** * window : * - * * Check COPYING file for Copyright * **************************************************************************/ #ifndef WINDOW_H #define WINDOW_H #include #include #include Window get_active_window(); gboolean window_is_iconified(Window win); gboolean window_is_urgent(Window win); gboolean window_is_hidden(Window win); gboolean window_is_active(Window win); gboolean window_is_skip_taskbar(Window win); int get_window_desktop(Window win); int get_window_monitor(Window win); void activate_window(Window win); void close_window(Window win); void get_window_coordinates(Window win, int *x, int *y, int *w, int *h); void toggle_window_maximized(Window win); void toggle_window_shade(Window win); void change_window_desktop(Window win, int desktop); int get_icon_count(gulong *data, int num); gulong *get_best_icon(gulong *data, int icon_count, int num, int *iw, int *ih, int best_icon_size); #endif tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/test/000077500000000000000000000000001265276141000214315ustar00rootroot00000000000000tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/test/workspaces-stress.sh000077500000000000000000000025351265276141000254770ustar00rootroot00000000000000#!/bin/bash # List normal windows # wmctrl -l | awk '{if ($4 != "Desktop") print $1}' # # Change the number of desktops # xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 2 # # Move window to desktop # xprop -id 0x03600007 -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP 0 # # Move window to all desktops # xprop -id 0x03600007 -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP 4294967295 while true do # change the number of desktops to a random value num_desktops=$(( $RANDOM % 8 + 1 )) xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS $num_desktops max_desktop=$(( $num_desktops - 1 )) desktops=$(echo 4294967295; seq 0 $max_desktop) for run in 1 2 3 do # start and stop calculators if (( $RANDOM % 5 == 0 )) then killall gnome-calculator 1>/dev/null 2>/dev/null sleep 0.1 else (gnome-calculator 1>/dev/null 2>/dev/null &) fi # change the current desktop to a random value desktop=$(shuf -n 1 -e $(seq 0 $max_desktop)) xprop -root -f _NET_CURRENT_DESKTOP 32c -set _NET_CURRENT_DESKTOP $desktop # move windows around for win in $(wmctrl -l | awk '!/Terminal/ {if ($4 != "Desktop") print $1}') do desktop=$(shuf -n 1 -e $desktops) xprop -id $win -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP $desktop done sleep 0.1 done sleep 0.1 done tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/tint2.config000066400000000000000000000002161265276141000227000ustar00rootroot00000000000000// ADD PREDEFINED MACROS HERE! #define HAVE_RSVG 1 #define HAVE_SN 1 #define ENABLE_BATTERY 1 #define ENABLE_UEVENT 1 #define GETTEXT_PACKAGE tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/tint2.creator000066400000000000000000000000121265276141000230640ustar00rootroot00000000000000[General] tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/tint2.desktop000066400000000000000000000024331265276141000231070ustar00rootroot00000000000000[Desktop Entry] Type=Application Encoding=UTF-8 Name=Tint2 panel Name[am]=ፓነል tint2 Name[ar]=الشريط tint2 Name[ast]=Panel tint2 Name[be]=Панэль tint2 Name[ca]=Quadre tint2 Name[cs]=Panel tint2 Name[da]=Panel tint2 Name[de]=Leiste tint2 Name[dz]=པེ་ནཱལ། tint2 Name[el]=Ταμπλό tint2 Name[en]=Tint2 panel Name[eo]=Panelo tint2 Name[es]=Panel tint2 Name[et]=Ääreriba tint2 Name[eu]=Panela tint2 Name[fi]=Paneeli tint2 Name[fr]=Panneau tint2 Name[gl]=Panel tint2 Name[he]=לוח tint2 Name[hu]=Panel tint2 Name[id]=Panel tint2 Name[it]=Pannello tint2 Name[ja]=パネル tint2 Name[kk]=Панель tint2 Name[ko]=패널 tint2 Name[ku]=Panel tint2 Name[lv]=Panelis tint2 Name[mk]=Панел tint2 Name[nb]=Panel tint2 Name[nl]=Paneel tint2 Name[nn]=Panel tint2 Name[pa]=ਪੈਨਲ tint2 Name[pl]=Panel tint2 Name[pt]=Painel tint2 Name[ro]=Panou tint2 Name[ru]=Панель tint2 Name[si]=පුවරුව tint2 Name[sk]=Panel tint2 Name[sq]=Panel tint2 Name[sv]=Panel tint2 Name[ta]=பலகை tint2 Name[tr]=Panel tint2 Name[ug]=panel tint2 Name[uk]=Панель tint2 Name[ur]=پینل tint2 Name[vi]=Panel tint2 Name[zh]=面板 tint2 Comment=Lightweight panel Comment[fr]=Panel léger Comment[pl]=Lekki panel Exec=tint2 Icon=tint2 Terminal=false Categories=System;tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/tint2.files000066400000000000000000000073401265276141000225420ustar00rootroot00000000000000doc/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 src/battery/linux.c src/battery/battery.c src/battery/battery.h src/battery/dummy.c src/battery/freebsd.c src/battery/linux.c src/battery/openbsd.c src/util/uevent.c src/util/uevent.h .clang-format src/execplugin/execplugin.c src/execplugin/execplugin.h src/tint2conf/po/bs.po src/tint2conf/po/fr.po src/tint2conf/po/hr.po src/tint2conf/po/pl.po src/tint2conf/po/sr.po README.md tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/tint2.includes000066400000000000000000000005511265276141000232430ustar00rootroot00000000000000. ./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 src/execplugin tint2-0.12.7-107bfc85a3955a8b88ff027d2f6cb4cb7e943cb0/tint2.svg000066400000000000000000000315751265276141000222460ustar00rootroot00000000000000 image/svg+xml