pax_global_header00006660000000000000000000000064137765410370014527gustar00rootroot0000000000000052 comment=1a35f65f2fcc70b4594dd9f696607b55626ed73d guake-indicator-1.4.5/000077500000000000000000000000001377654103700146045ustar00rootroot00000000000000guake-indicator-1.4.5/.gitignore000066400000000000000000000005511377654103700165750ustar00rootroot00000000000000install-sh Makefile.in aclocal.m4 config.h data/Makefile.in data/icons/Makefile.in src/Makefile.in Makefile autom4te.cache/ config.log config.status configure data/Makefile data/icons/Makefile plugins/Makefile plugins/Makefile.in src/.deps src/Makefile src/guake-indicator src/*.o compile config.h.in depcomp missing stamp-h1 config.h.in~ src/.vscode/ .vscode/ guake-indicator-1.4.5/AUTHORS000066400000000000000000000000411377654103700156470ustar00rootroot00000000000000Alessio Garzi guake-indicator-1.4.5/COPYING000066400000000000000000000431031377654103700156400ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General Public License instead of this License. guake-indicator-1.4.5/ChangeLog000066400000000000000000000066211377654103700163630ustar00rootroot000000000000002018-08-22 Alessio Garzi 1.4.1 - new release with the following features : - add support for vertical and horizontal split terminal (new feature from Guake 3.4.1) - right click management on each entry 2018-08-22 Alessio Garzi 1.4 - new release with the following features : - dropped gtk2 dependency, replaced with gtk3 - dropped libindicator dependenct, replaced with libayatana-appindicator3 - dropped remote plugin download and python code related to it - better debian packaging - manpaged moved to upstream - guake3 autostart implemented - removed build unnecessary files from repo 2018-06-02 Alessio Garzi 1.3.3 - new release with the following features : - Guake indicator now supports Guake3 as default shell - Gconf2 replaced by gsettings (closes debian bug #892706) - Optional configuration file as argument 2014-12-31 Alessio Garzi 1.1 release with "open in selected tab" option added 2014-12-24 Alessio Garzi and Francesco Minà 1.0 release with the following features : - switch to xml based configuration file - new gui for configuration file builder - suppressed ssh strongly related commands - command passed to guake now is fully customizable - added plugins managment 2014-07-15 Alessio Garzi * src/Changelog : Start of glade based gui development 2014-06-15 Alessio Garzi * src/COPYING : Changed with correct license 2014-06-15 Alessio Garzi * src/guake-indicator-notify.h : Changed notification icon * src/guake-indicator.c : Check if fopen() fails while opening /proc/#pid#/comm * src/guake-indicator-read-json.c : Fixed memory leaks within read_json_cfg_file() function * src/guake-indicator-write-json.c : Added write json configuration file capabilities * src/guake-indicator-write-json.h : Added write json configuration file capabilities * src/Makefile.am : Added guake-indicator-write-json.c and guake-indicator-write-json.h to guake_indicator_CPPFLAGS * src/guake-indicator-read-json.c : Added dont_show_guake option * src/guake-indicator.h : Added dont_show_guake option * src/guake-indicator.c : Added dont_show_guake option * src/guake-indicator.c : Do now write bin/bash if command_after_login is empty * src/guake-indicator-new-entry.c : New file for configuration file management * src/guake-indicator-new-entry.h : New file for configuration file management * src/guake-indicator-new-group.c : New file for configuration file management * src/guake-indicator-new-group.h : New file for configuration file management * src/guake-indicator-delete-entry.group.c : New file for configuration file management * src/guake-indicator-delete-entry-group.h : New file for configuration file management * src/guake-indicator.h : Added error_modal_box() prototype * src/guake-indicator.h : Added reload prototype (it was mispelled) 2014-05-06 Alessio Garzi * src/Makefile.am : Ereased unnecessary libraries * src/guake-indicator-read-json.c : Removed extra parameter on fprintf inside createdefaultfilecfg() function * src/guake-indicator.h : Added x_forwarded in Host struct to support X FORWARDING * src/guake-indicator-read-json.c : Added support for x_forwarding * src/guake-indicator.c : Added support for x_forwarding guake-indicator-1.4.5/INSTALL000066400000000000000000000366101377654103700156430ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command `./configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. guake-indicator-1.4.5/Makefile.am000066400000000000000000000001461377654103700166410ustar00rootroot00000000000000EXTRA_DIST = guake-indicator.desktop org.guake-indicator.gschema.xml README.md SUBDIRS = src data man guake-indicator-1.4.5/NEWS000066400000000000000000000000001377654103700152710ustar00rootroot00000000000000guake-indicator-1.4.5/README000066400000000000000000000000001377654103700154520ustar00rootroot00000000000000guake-indicator-1.4.5/README.md000066400000000000000000000077441377654103700160770ustar00rootroot00000000000000 [![Total alerts](https://img.shields.io/lgtm/alerts/g/Ozzyboshi/guake-indicator.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Ozzyboshi/guake-indicator/alerts/) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/Ozzyboshi/guake-indicator.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Ozzyboshi/guake-indicator/context:cpp) # Guake indicator Guake indicator is a compact and convenient Appindicator that lets you send commands to [Guake](http://guake-project.org/) terminal. Guake indicator 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. ![guake indicator img](http://guake-indicator.ozzyboshi.com/images/out.gif) ![guake indicator img](http://guake-indicator.ozzyboshi.com/images/ubuntu18.png) ### Description of the project Guake indicator is a compact and convenient Ubuntu Appindicator that lets you send commands and perform customized tasks to [Guake virtual terminal](http://guake-project.org/).You can specify the target tab or to create a new one at the same time. Guake indicator comes with a convenient menu editor to create and manage your entries out of the box. Initial versions of Guake indicator was meant for Ubuntu it but later versions are targeting the Debian Operating System with GTK based desktop managers. From version 1.4, Guake indicator relies on Ayatana indicators and GTK3 rather than old libappindicator and GTK2. Guake-indicator sticks to your "Indicator Area" and displays your customized command retrieved from ~/.guake.indicator/guake-indicator.xml. If this file doesn't exist, Guake Indicator will create a small default one that you can use as a base to build your own configuration file depending on your needs. You can customize the configuration file using the Guake indicator built-in GUI under the "Edit Menu" section or, as an alternative, you can do it on your own with your favorite text/xml editor. The guake-indicator.xml fields are quite self-explanatory, however, I'm going to give you a more in-depth description of each one: - menu_name :the name that will show up in the indicator itself - tab_name : the name of the Guake terminal tab once it is opened (leave blank if you don't want automatic autorenaming) - command_after_login : command to send to Guake through his DBUS interface - dont_show_guake : if set to yes Guake is not shown after command execution - open_in_tab : The index of the Guake tab where Guake indicator will execute the command. Guake assigns index 0 to the first tab so put in this field the nth tab-1 number. If this tag has the attribute named="yes" it contains the name of the Guake tab (see Guake indicator select tab by name issue for more informations) If this field contains the value '-1', Guake indicator will execute the command in the currently selected Guake tab (only from version 1.1) - lfcr : if set to yes a LF (Line Feed) + CR (Carriage return) is sent to Guake after each line. Otherwise, only a line feed (ascii code 10) is sent. - guakeindicatorscript : if set to yes enables the Guake indicator scripting function (see related scripting section) ### Requirements for Guake indicator For proper compilation and functionality of Guake indicator, the following packages are REQUIRED: - libayatana-appindicator3-dev - libcairo2-dev (>= 1.10) - libdbus-1-dev - libdbus-glib-1-dev - libglib2.0-dev (>=2.35.4) - libgtk-3-dev (>=3.1.4) - libjson-c-dev (for backward compatibility) - libxml2-dev ### Credits Guake indicator was conceived and initially created by Alessio Garzi Guake indicator was developed By Alessio Garzi and Francesco Minà Guake indicator debian package is mantained by Alessio Garzi . Debian webpage : https://packages.debian.org/sid/guake-indicator We are looking for any type of contribution (code, bug fixing, documentation, translation or just new ideas), if you have an interest in Guake indicator please email me. guake-indicator-1.4.5/TODO000066400000000000000000000002521377654103700152730ustar00rootroot00000000000000To get an updated information about things we're working on, please visit our bug tracker: https://bugs.launchpad.net/guake-indicator -- Alessio Garzi guake-indicator-1.4.5/configure.ac000066400000000000000000000027151377654103700170770ustar00rootroot00000000000000AC_INIT([guake-indicator], [1.4.5], [gun101@email.it]) AM_INIT_AUTOMAKE([-Wall -Werror]) # safety check , make sure that config is not run from outer space AC_CONFIG_SRCDIR([src]) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE([enable]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O AC_STDC_HEADERS # Checks for libraries. AC_CHECK_FUNCS([bzero]) AC_CHECK_FUNCS([mkdir]) AC_CHECK_FUNCS([strdup]) AC_CHECK_FUNCS([strerror]) PKG_PROG_PKG_CONFIG GLIB_REQUIRED=2.50.0 GTK_REQUIRED=3.22.0 APPINDICATOR_REQUIRED=0.0.13 # Glib PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED) # Gtk-3 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) # Ayatana Application Indicator AYATANA_APPINDICATOR_PKG=ayatana-appindicator3-0.1 PKG_CHECK_MODULES(AYATANA_APPINDICATOR, $AYATANA_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED) AC_SUBST(AYATANA_APPINDICATOR_CFLAGS) AC_SUBST(AYATANA_APPINDICATOR_LIBS) # libjson-c PKG_CHECK_MODULES(JSONC, json-c) AC_SUBST(JSONC_CFLAGS) AC_SUBST(JSONC_LIBS) # libxml-2.0 PKG_CHECK_MODULES(XML2, libxml-2.0) AC_SUBST(XML2_CFLAGS) AC_SUBST(XML2_LIBS) # Dbus-Glib PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1) AC_SUBST(DBUSGLIB_CFLAGS) AC_SUBST(DBUSGLIB_LIBS) # needed to install gsettings schema GLIB_GSETTINGS AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile src/Makefile data/Makefile data/icons/Makefile man/Makefile ]) AC_OUTPUT guake-indicator-1.4.5/data/000077500000000000000000000000001377654103700155155ustar00rootroot00000000000000guake-indicator-1.4.5/data/Makefile.am000066400000000000000000000002631377654103700175520ustar00rootroot00000000000000SUBDIRS = icons uidir = $(datadir)/guake-indicator ui_DATA = \ gi_edit_menu_dialog.glade \ hosticon.png \ labelicon.png \ hostgroupicon.png EXTRA_DIST = \ $(ui_DATA) guake-indicator-1.4.5/data/gi_edit_menu_dialog.glade000066400000000000000000002331421377654103700224670ustar00rootroot00000000000000 radiobutton False True True False True True 1000 768 False Guake Indicator Menu Editor False center True True False 10 0 in True False 10 4 True False True False True False 0 none 340 True False True False 12 True True in True True 0 True True 6 0 340 True False 12 True False False True True True True False Collapse go-previous True True True 0 False True True True True False Expand go-next True True 1 False False 0 True False 0 in True False 0 4 4 8 8 True False 2 True False True True True 0 True False True False 0 go-top False True 0 True False Top True True 1 True True 0 False True True True 0 True False True False 0 go-up False True 0 True False Up True True 1 True True 1 False True True True 0 True False True False 0 go-down False True 0 True False Down True True 1 True True 2 False True True True 0 True False True False go-bottom False True 0 True False Bottom True True 1 True True 3 True False <b>Move</b> True False False 1 True False 0 in True False 0 4 4 8 8 True False 2 True False True True True 0 True False True False list-add False False 0 True False Group True True 1 True True 0 False True True True 0 True False True False list-add False False 0 True False Group Label True True 1 True True 1 False True True True 0 True False True False list-add False False 0 True False Entry True True 1 True True 2 False True True True 0 True False True False list-add False False 0 True False Entry Label True True 1 True True 3 True False <b>New</b> True False False 2 False True 2 1 True False <b>Select Menu:</b> True True True 0 True True 0 True True 0 True False 4 140 True False 5 <b>Menu name:</b> True right 0.95999997854232788 False True 0 True False True gtk-clear False Clear True True 1 False True 4 1 True False 4 140 True False 5 <b>Rename Tab with:</b> True right 0.95999997854232788 False True 0 True False True gtk-clear False Clear True True 1 False True 4 2 True False True False 5 <b>Command:</b> True start 0 0 False False 0 75 True False 4 True True True True True True 0 False True 4 1 True True 3 True False 4 Dont show Guake False True False True False If checked Guake does not show up after the command is sent to him True True False 0 Send LFCR False True True False If checked it sends a LF (Line Feed) + RC (Return Carriage) at the end of each line. If not checked it sends only a LF True True False 1 Enable guake-indicator scripting False True True False To learn how to script with guake-indicator refer to the scripting section of http://guake-indicator.ozzyboshi.com True True False 2 False True 4 4 True False True True 5 True False 14 True False 5 <b>Open in:</b> True right 0.95999997854232788 False False 0 new Guake tab False True True False True True radiobutton3 False False 1 current Guake tab False True True False True radiobutton3 False False 2 True False Guake tab index False True True False True radiobutton3 True True 0 True True 10 0.05000000074505806 False False True True True True 1 True True 3 True False True first Guake tab named False True True False True radiobutton3 True True 0 True False True gtk-clear False Clear Clear True True 1 True True 4 True True 4 6 True False True True 7 True False True False 16 True True True True True False True False drive-removable-media False False 0 True False Import True True 1 True True 0 False True True True True False True False drive-removable-media False False 0 True False Export True True 1 True True 1 False True True True True False True False gtk-close False False 0 True False Close True True 1 True True 2 False True False True True True False True False edit-delete True True 0 True False Remove True True 1 True True 3 False True False True True bottom True False True False document-save False False 0 True False Save True True 1 True True 4 False False end 0 True True 8 True False <b>Edit Menu:</b> True 0.49000000953674316 guake-indicator-1.4.5/data/hostgroupicon.png000066400000000000000000000006631377654103700211330ustar00rootroot00000000000000PNG  IHDR7gAMA asRGB cHRMz&u0`:pQ<bKGD̿ pHYs  IDAT(1jQ<\@qqMsY2]ZaR,Pf,Lm{QGY_t<£jB@_0M/Vr3ꢐ PW"ؘ w_p{ΫeE>ՒJDζ>{*'-SSp"NE(%tEXtdate:create2014-08-08T12:30:10+02:00^x,%tEXtdate:modify2014-08-08T12:30:09+02:00vIIENDB`guake-indicator-1.4.5/data/hosticon.png000066400000000000000000000007261377654103700200560ustar00rootroot00000000000000PNG  IHDR7gAMA asRGB cHRMz&u0`:pQ<bKGD̿ pHYs  IDAT(ϵ?JAN)ҦWF i{E^AAXbJ,dȲZ$vx<ޟ(Z,GB&5[NdyB4?oB3;bARsoGwm$ w]=ż-.mErhڽF@ziRD_>*HqM[)IENDB`guake-indicator-1.4.5/data/icons/000077500000000000000000000000001377654103700166305ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/16x16/000077500000000000000000000000001377654103700174155ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/16x16/apps/000077500000000000000000000000001377654103700203605ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/16x16/apps/guake-indicator.png000066400000000000000000000014611377654103700241360ustar00rootroot00000000000000PNG  IHDRabKGD pHYsIIEtIME #غIDAT8˝Mh\U^f2&*@pںT$(B RJiE b)Rq!$Nqх HW](4(*F Ac:7y^3/y~y<:B`JfO} =Kku:<0O1YN/p빊͉qt@ %zm޻ 53(ȓ"q *ʊ4K $IFgu٧y(ɓ"ɨU,}RPh),Sb2-*Jl RJk4dI?!P)6Tqti8òx)F lL>÷_.~tIENDB`guake-indicator-1.4.5/data/icons/22x22/000077500000000000000000000000001377654103700174075ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/22x22/apps/000077500000000000000000000000001377654103700203525ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/22x22/apps/guake-indicator.png000066400000000000000000000023761377654103700241360ustar00rootroot00000000000000PNG  IHDRĴl;bKGD pHYsIIEtIME $MeIDAT8˭kE^=1RU[$DR (Q2C.H AB~+B\J I(TXmG^r]]s{εnIfgn?3===ιp?I!UaoXԞi'Ϟ~k]y<97n,@+ȹbr-3aY\:֍i8dj2368vvw@m<8gq4m,9d.A tu)^hM !m> 9za?:ERK2J)a;uvT6$#Z˽]EJ8?t\裥Z$IJP#\xzڂ҆7!_""yT4A~`p)XCQu.\D!'bdvXmH*)& `"H{x2+W :|ђ,34ZT.a"bra̍Rz{T:Z3#{/^Kk iZd;xsb%{Fؼw|I~ZB4F\\.sϳ|g0OAB~Ԛ+F<~ּCiļ pxx˞c}d:hɤdAd6ߣ3d"? g1g/z}nXg2ot<| KVEyc6߂ #@I%Yr]@ 8&:Pvr1ݴp@8g:zqxMx yV 8|Z[[QJE.}cAjZ@0$@&< *uЅJW{ BUjuSI}mnߡMѬmߓT7222xW;`PmIENDB`guake-indicator-1.4.5/data/icons/24x24/000077500000000000000000000000001377654103700174135ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/24x24/apps/000077500000000000000000000000001377654103700203565ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/24x24/apps/guake-indicator.png000066400000000000000000000027011377654103700241320ustar00rootroot00000000000000PNG  IHDRw=bKGD pHYsIIEtIME $,% NIDATHǵ]]W{sϽ3I4Ѫ؎hjբQT/RDR}0j@)*Ƃ)MӠ(UĤGkf=sϽ|8')> {_{KݻwBDRvg7LH55wEq\E;iUى&Z ֒Pj[WF[$*T"5.]nړZQ# c >PaVq l@z3.( Rmҽ툻^?)a'_Rjq޲]%]Q9(b a#N&6rA3HiPxn逸(rt "My" B!l4Ay7AF1J[O9 JoVvcJZH+Q 8 [9(,tp18<µ"bK+F)O%˝W2Fl$D:&hCN4XkLD`Ńjcq z[2(R.Ȳ>:LM8>tǻ軮dfp8~0\'py.[xk \ xlm_sK^{8^̘ozdlz矢|34;F|wE눑fVRb&FFs-[ϏؙCe߾ߣk1zXkY Cƣ5w$}~켕9ll$Z|ax៿㻏Eiszz7Нgӧxd=ӔM;O,,|d>iZ0W,"=x'p wvSy'|~pPJ- XCc8 q=sU6`KɅ G=kg?D΁o>BhuC;.(si4MY^Yf8Lp\}q,.Er^Vtx㈝kVӴZ-h4A3A,j+`e>8E9vemdX<=g} URWJYq$b!1Nv$g! rd,A no jP~x jY֘$αtYZ[*4[w9[sOO<v)|-̶OaQů ҥ+ϼt9{"f&+IENDB`guake-indicator-1.4.5/data/icons/256x256/000077500000000000000000000000001377654103700175715ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/256x256/apps/000077500000000000000000000000001377654103700205345ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/256x256/apps/guake-indicator.png000066400000000000000000001171511377654103700243160ustar00rootroot00000000000000PNG  IHDR\rfbKGD pHYsIIEtIME  " IDATxg$u&Y}};  A $RE#RH#/ĥH{FьÕvsVQDQ aH$׶lWU̪FNtUfFDFĽ~hmm6Fhmm6Fhmm6Fhmm6Fhmm6ݍ_nգ2FyjD_{ǟhq]wݯAK]6ϭX,t?>D3Gh;70O7޸ootFh;BpP(tY;۵DӶmv@,!.hmۺG!FWgf8Q0F13te"6^a:˲FWg|!F`I ЂXQpEm|R`voI?JFh{nzXGDeYv~oDtx m]6-ѣ+~eY#0F=b`ajjb h4ǹ40BeYkju7޸.᧯qўU/s{mWVU䳦l׎yzsK5s GŧO\|=b Ol۵c.xW3CQ}<σ=<|9qOgmׅ! P*G}dؽHf3zp0=7a5ۘ{z^pԃaPx{܃ge7i}zoWiSA 0 W#|w_PPMItT{$D_FO_;w͑dԵ";ma ƒ_A"·ym8 Z :B3V{ zMjo%rL2> dX|eL1mS[@ذ@ Z||^IgSF² W40d@d> d^r(k{y p_7y`ݨaF ՇY><׆FgI㌘%?4^9{A =_,ݨa卛$8& AKě侭I;gݟGת󰀺PMr wm_σU!<n3h`e?}*6a5c\r=x }yut;*2_GpC C{n @&eozP`ܫܣoJPY;cÊ Wyɾ*{Q7 0@pgo@8$Uot}Moms%n YdƅoeٸZfqgIHq()0C^Ń p}(gUy  }tБo~C?Y< .ZjΛסkh;띋ywfDRz{|.;|sD0 Edh*l}+>{۪pG$CmgX=~p^'rPM}ֳ[w "+D 0ζXjqC>!HH D*GZ R 0f}S,Ԟ2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ny"3}^WQ^!L7zk{#zxۓy0 wf=+W$]J4T]Qu4]jU῵Kʭ@U^a>Wx \_iX4|On#CwX װzkD",GRjR ]7s0|@%=~Vˋ$&vpKv8{0 J A {'.~qC7ť_@ZT9P[*Hg˟79~rIqLeh"? r*q۶=`pDG=N8깧`ڨ k% yoƉ3G׈sH^{_QR8I ղʢG\4K%+; *-yiup\L5e,qDe,O{_ŤYcE,>d'*DN}M/?Pv5< @eAJɪu`6-㍌}:p >((2o nIENDB`guake-indicator-1.4.5/data/icons/32x32/000077500000000000000000000000001377654103700174115ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/32x32/apps/000077500000000000000000000000001377654103700203545ustar00rootroot00000000000000guake-indicator-1.4.5/data/icons/32x32/apps/guake-indicator.png000066400000000000000000000037231377654103700241350ustar00rootroot00000000000000PNG  IHDR szzbKGD pHYsIIEtIME %'_`IDATXŗUG?s}v.]S@,6QIiBlTq&hhHj16V+ 4]h"BX~첻{ 7s9snp{9mzbɍkMSOibc}}C kXt,N#x@CFt1 qqWeo^z4wc|OdyL@ɳDi6!9qLG$b<i6S:R 1,śn&#G/u@$Q\ sk֐ =g&IR@D5Ǯ V(:9ƌX|O%h'1ŤL9qGQ5Tsll)I&ڗ1c,q{e 82KRXЉcزc?M~˺G9%%~KNw3I\IƂTp(DA) Yp!:.qN3>#I"JPc}p" !5A P! 3{&U)t 3jkV @:K0fl@s3T%y<VtY]yZkI @<9hŐi[$ MS؈y:Ԓ9' yHhYlx|Ns!Lbd9^6ާ~VbѬZm:pF1[kpk]5r9 eՒ>6DB(#R yO%RN*KE -q6y>Imc*9ֹ^Ђ3Q]E9GiRY[v#h26qRRT+r[[{%:W;s9U"ޡ=ޏ5FiٽhXxɬ>qG`58AX AEBf*~"Ҹ: Ai1H|akd HjiVK #$;jF$4 YVD&"4F_<\9ߘ#,U-HtT%yPxPZc OæLaR$ΧjF!Ml.tkO$R#Fk6!F0^1ΜS ΃\uf,; 'FbUdtbؠ1MFVY| x mT5CjX fRARՅˁ  'ujs8QǛ5x6DMDdRً̛fs90ER!iS1h(VjT9؀цB'*lc9<JCg1.s b-jlbR_1ե+(}d&ʸeM^(BkSse&ymX'D&Wn;814_~s wS*Gks9|C92<#:a#3ְ響hSxȐ=筀տy%}c-I@Ͷ^]uz_7y٭Tk. )^|Nj){;ʜe@Xfi$8%Pc1#e)k_Jo1Qooan.^]osn?Q,MuDQ3+/_\=vo~c-Ih0  bQ zz{%cV}J&&&(PK8fY(_dǻ;wn˗p|䏹,trUcχp7}aRH.E2iD,X &29|]JeJ"˖- epY);6^ ykW,Gg Klyg?Aq~ LPdExIBk-/{O\DQJ7L?^yk|{|R.|޴#>xiTMP9xBjZIX~{Y؃Ԋ S8_'7C_w}ts߃/''ۻ~* HHMפSVVDqL8AoO73)Te<4RLaXy7+e$8P͚uR#kc- TSjN=T(|. ^P- m OsM'0s0Ơ&xtT*"):={6y ֬GI&@yiZR$ j=T*?v <"]̝{rE@Q:^|/H0O&]Be[I*RP(0g b>.]nK.! i>datt`dЗ./d}WW'0B fϞARj5/ A#GJ!e@omsA} p6⬃D"B((J9rc Z8nlLIg. @2Ns)4<e tztI~FGGZf(ֳ"Sg]u ]?men*'"ŋx*QƗLiZ`Zr´۶Sd*HI{ HT*3zh=\@hsR݇ܿ; ;mxgˇҗsJf;ΆWPc#l~mfZ&l߫xI7{/8oy]tQ)K}GO$mEuujEϧӄR>< :_Q|@#IENDB`guake-indicator-1.4.5/data/icons/Makefile.am000066400000000000000000000021651377654103700206700ustar00rootroot00000000000000iconthemedir = $(datadir)/icons/hicolor appsiconxpmdir=$(datadir)/pixmaps/guake-indicator appsicon16dir = $(iconthemedir)/16x16/apps appsicon22dir = $(iconthemedir)/22x22/apps appsicon24dir = $(iconthemedir)/24x24/apps appsicon32dir = $(iconthemedir)/32x32/apps appsicon48dir = $(iconthemedir)/48x48/apps appsicon256dir = $(iconthemedir)/256x256/apps dist_appsiconxpm_DATA = guake-indicator.xpm dist_appsicon16_DATA = 16x16/apps/guake-indicator.png dist_appsicon22_DATA = 22x22/apps/guake-indicator.png dist_appsicon24_DATA = 24x24/apps/guake-indicator.png dist_appsicon32_DATA = 32x32/apps/guake-indicator.png dist_appsicon48_DATA = 48x48/apps/guake-indicator.png dist_appsicon256_DATA = 256x256/apps/guake-indicator.png update_icon_cache = gtk-update-icon-cache --ignore-theme-index --force install-data-hook: install-update-icon-cache uninstall-hook: uninstall-update-icon-cache install-update-icon-cache: $(AM_V_at)$(POST_INSTALL) test -n "$(DESTDIR)" || $(update_icon_cache) "$(iconthemedir)" uninstall-update-icon-cache: $(AM_V_at)$(POST_UNINSTALL) test -n "$(DESTDIR)" || $(update_icon_cache) "$(iconthemedir)" guake-indicator-1.4.5/data/icons/guake-indicator.xpm000066400000000000000000000275771377654103700224460ustar00rootroot00000000000000/* XPM */ static char * guake_indicator_xpm[] = { "32 32 620 2", " c None", ". c #262626", "+ c #3D3D3D", "@ c #3E3E3E", "# c #656E68", "$ c #6E7B72", "% c #6D7B72", "& c #6D7B71", "* c #6C7A71", "= c #6C7A70", "- c #6B7A70", "; c #6B7A6F", "> c #6B796F", ", c #6A796F", "' c #6A796E", ") c #69796E", "! c #69786E", "~ c #69786D", "{ c #68786D", "] c #68786C", "^ c #5D6A61", "/ c #89A893", "( c #A2CBAF", "_ c #A1CAAD", ": c #A0CAAD", "< c #9FC9AD", "[ c #9FC9AB", "} c #9EC8AB", "| c #9DC8AA", "1 c #9CC7A9", "2 c #9BC7A8", "3 c #9AC6A8", "4 c #99C6A7", "5 c #99C6A6", "6 c #98C5A6", "7 c #97C5A5", "8 c #97C4A4", "9 c #96C4A4", "0 c #95C4A3", "a c #94C3A2", "b c #93C2A1", "c c #92C2A0", "d c #92C1A0", "e c #91C19F", "f c #90C09F", "g c #90C09E", "h c #8FC09D", "i c #749B80", "j c #82A18B", "k c #9AC3A6", "l c #9AC2A6", "m c #99C2A5", "n c #98C1A4", "o c #98C0A4", "p c #97C0A3", "q c #96BFA3", "r c #95C0A2", "s c #94BFA1", "t c #93BEA0", "u c #92BE9F", "v c #92BD9E", "w c #91BC9E", "x c #90BC9D", "y c #8FBC9C", "z c #8EBB9B", "A c #8DBB9B", "B c #8DBA9A", "C c #8CBA99", "D c #8BB999", "E c #8AB898", "F c #8AB897", "G c #89B897", "H c #88B796", "I c #87B796", "J c #87B795", "K c #6D9378", "L c #7C9C85", "M c #93BCA0", "N c #93BC9F", "O c #92BC9E", "P c #92BB9E", "Q c #91BB9D", "R c #90BA9D", "S c #90BA9B", "T c #8EB99B", "U c #8EB99A", "V c #8DB89A", "W c #8CB899", "X c #8CB798", "Y c #8BB798", "Z c #8AB696", "` c #89B596", " . c #88B595", ".. c #87B495", "+. c #87B594", "@. c #86B393", "#. c #85B393", "$. c #85B292", "%. c #84B291", "&. c #83B291", "*. c #81B190", "=. c #82B18F", "-. c #81B18F", ";. c #80B08E", ">. c #80B08D", ",. c #668C71", "'. c #76967F", "). c #8DB699", "!. c #8CB598", "~. c #8BB497", "{. c #8AB496", "]. c #89B396", "^. c #89B395", "/. c #88B294", "(. c #87B293", "_. c #86B193", ":. c #86B192", "<. c #85B191", "[. c #83AF90", "}. c #A4C496", "|. c #F2F3A8", "1. c #F2F3AC", "2. c #F1F3AB", "3. c #F2F3A9", "4. c #BDD397", "5. c #7AA988", "6. c #7CAB89", "7. c #78A886", "8. c #6FA37E", "9. c #527C5E", "0. c #709079", "a. c #86AF92", "b. c #85AE91", "c. c #85AE90", "d. c #84AD90", "e. c #83AD8F", "f. c #82AC8E", "g. c #81AB8D", "h. c #80AB8C", "i. c #7FAA8B", "j. c #7EA98A", "k. c #7CA889", "l. c #AEC892", "m. c #FDFDDC", "n. c #CEDFD5", "o. c #D3E2DA", "p. c #D5E2DC", "q. c #D7E5DE", "r. c #D9E6E0", "s. c #DBE7E2", "t. c #DDE9E4", "u. c #F4F7EF", "v. c #C9D88F", "w. c #5A916B", "x. c #528C62", "y. c #4E895E", "z. c #4F8A5F", "A. c #3E6C4B", "B. c #6A8A73", "C. c #7FA88A", "D. c #7EA78A", "E. c #7EA789", "F. c #7DA688", "G. c #7CA588", "H. c #7BA587", "I. c #7AA586", "J. c #7AA486", "K. c #79A385", "L. c #78A384", "M. c #77A283", "N. c #76A282", "O. c #75A182", "P. c #A9C38E", "Q. c #FBFBD7", "R. c #AAC4B0", "S. c #B0CAB8", "T. c #B4CBBA", "U. c #B8CFBE", "V. c #BAD0BF", "W. c #B7CDBD", "X. c #B4CCBB", "Y. c #E6EEDF", "Z. c #C0D187", "`. c #49835B", " + c #4C865C", ".+ c #3C6848", "++ c #63836D", "@+ c #78A083", "#+ c #77A082", "$+ c #769F82", "%+ c #769E81", "&+ c #749E80", "*+ c #749D7F", "=+ c #739D7F", "-+ c #729C7E", ";+ c #719C7D", ">+ c #719B7C", ",+ c #709A7B", "'+ c #6F9A7B", ")+ c #6D997A", "!+ c #A4BE89", "~+ c #9FBBA7", "{+ c #A7C2AF", "]+ c #A5C0AC", "^+ c #A0BDA8", "/+ c #A0BCA8", "(+ c #A6C1AD", "_+ c #A9C3B1", ":+ c #E4ECDC", "<+ c #BFCF86", "[+ c #467D56", "}+ c #498058", "|+ c #396445", "1+ c #5D7C66", "2+ c #70987C", "3+ c #70987A", "4+ c #6F977A", "5+ c #6E9779", "6+ c #6D9679", "7+ c #6D9577", "8+ c #6C9577", "9+ c #6A9476", "0+ c #699374", "a+ c #689374", "b+ c #689273", "c+ c #669172", "d+ c #A0B984", "e+ c #FAFAD7", "f+ c #8EAE96", "g+ c #8BAC94", "h+ c #8EAE95", "i+ c #93B19B", "j+ c #98B5A0", "k+ c #9DB9A4", "l+ c #A1BBA8", "m+ c #E1E9D9", "n+ c #BECD84", "o+ c #437852", "p+ c #467A54", "q+ c #375F41", "r+ c #56755F", "s+ c #699074", "t+ c #689073", "u+ c #678F72", "v+ c #668E71", "w+ c #658E71", "x+ c #658D70", "y+ c #648C6F", "z+ c #638C6E", "A+ c #628B6E", "B+ c #618A6C", "C+ c #5E886B", "D+ c #5C876A", "E+ c #5B8669", "F+ c #98B17D", "G+ c #F8F9D5", "H+ c #74997D", "I+ c #7FA188", "J+ c #85A58C", "K+ c #89A991", "L+ c #8FAD97", "M+ c #94B09B", "N+ c #97B39E", "O+ c #DEE6D6", "P+ c #BBCA82", "Q+ c #3C704D", "R+ c #3F724E", "S+ c #41734F", "T+ c #345B3E", "U+ c #506E58", "V+ c #61886B", "W+ c #60886B", "X+ c #60876A", "Y+ c #5E8669", "Z+ c #5F8669", "`+ c #5F896A", " @ c #5D8567", ".@ c #5B8466", "+@ c #5A8365", "@@ c #799970", "#@ c #D8DE96", "$@ c #D5DC90", "%@ c #D4DC8E", "&@ c #E0E48F", "*@ c #F4F5D1", "=@ c #6A8F73", "-@ c #75987E", ";@ c #7B9C82", ">@ c #80A088", ",@ c #85A38C", "'@ c #8BA791", ")@ c #8DA995", "!@ c #D9E2D2", "~@ c #EDED93", "{@ c #CED789", "]@ c #CFD789", "^@ c #D1DA8E", "/@ c #87A46D", "(@ c #30553A", "_@ c #496751", ":@ c #597F63", "<@ c #587F62", "[@ c #587E62", "}@ c #598163", "|@ c #243729", "1@ c #37403A", "2@ c #243628", "3@ c #557E5F", "4@ c #537A5C", "5@ c #5E8361", "6@ c #E4E79A", "7@ c #FFFFF7", "8@ c #AEC1B3", "9@ c #B2C4B8", "0@ c #ACBFB2", "a@ c #62876B", "b@ c #6B8E74", "c@ c #719179", "d@ c #76967D", "e@ c #7B9A82", "f@ c #809E88", "g@ c #85A18C", "h@ c #B1C3B6", "i@ c #CBD7D0", "j@ c #F4F7F7", "k@ c #F9F7B0", "l@ c #65875A", "m@ c #2E5237", "n@ c #435F4A", "o@ c #547B5D", "p@ c #557C5E", "q@ c #547D5E", "r@ c #1E3122", "s@ c #C2C5CA", "t@ c #B0B4B7", "u@ c #C2C6CA", "v@ c #1C2F20", "w@ c #487352", "x@ c #3D6A48", "y@ c #517850", "z@ c #EBEC9F", "A@ c #CFD9CA", "B@ c #4A7153", "C@ c #567A5F", "D@ c #5C7E64", "E@ c #618369", "F@ c #67876E", "G@ c #6C8B74", "H@ c #719079", "I@ c #76947E", "J@ c #7C9883", "K@ c #819C88", "L@ c #859F8B", "M@ c #BBCAC0", "N@ c #FEFCBA", "O@ c #749060", "P@ c #376242", "Q@ c #2C4E34", "R@ c #324B38", "S@ c #272612", "T@ c #5A4302", "U@ c #594200", "V@ c #87888C", "W@ c #FFFFFF", "X@ c #575A5D", "Y@ c #87888B", "Z@ c #584200", "`@ c #5A4301", " # c #23230E", ".# c #526E49", "+# c #F4F3A8", "@# c #BAC8BA", "## c #466A4D", "$# c #517459", "%# c #56785E", "&# c #5C7D63", "*# c #628168", "=# c #67866E", "-# c #6D8973", ";# c #728E78", "># c #76927D", ",# c #A2B5A8", "'# c #FFFEC6", ")# c #869D67", "!# c #335C3E", "~# c #365D3F", "{# c #2A4931", "]# c #1E1504", "^# c #E1AB24", "/# c #E8D194", "(# c #CFC4A7", "_# c #DADFE4", ":# c #D8DCE1", "<# c #DBDFE3", "[# c #DBDFE5", "}# c #CFC5A8", "|# c #EAD295", "1# c #E2AC23", "2# c #211F0C", "3# c #668357", "4# c #FCFAB3", "5# c #A2B3A5", "6# c #42644A", "7# c #4C6D53", "8# c #527159", "9# c #57765E", "0# c #5C7A63", "a# c #627F68", "b# c #67846E", "c# c #889E8D", "d# c #FFFFD2", "e# c #9BAB6F", "f# c #30573A", "g# c #32593B", "h# c #27452E", "i# c #543B00", "j# c #EFE5CD", "k# c #FAFAFB", "l# c #EEEFF0", "m# c #E5E7E9", "n# c #E3E5E7", "o# c #E0E3E5", "p# c #DDE0E3", "q# c #D9DCDF", "r# c #D8DBDF", "s# c #D9DEE1", "t# c #ECE2CA", "u# c #583C00", "v# c #305639", "w# c #73895A", "x# c #FFFFC0", "y# c #889D8D", "z# c #3E5F45", "A# c #46664D", "B# c #4C6A53", "C# c #526F58", "D# c #57745E", "E# c #6C8672", "F# c #FDFCDA", "G# c #AFBA77", "H# c #2D5136", "I# c #2F5337", "J# c #2F5237", "K# c #25402B", "L# c #533900", "M# c #F0E9DA", "N# c #CCCCCC", "O# c #969797", "P# c #959696", "Q# c #9C9D9D", "R# c #939595", "S# c #C4C6C7", "T# c #EBEDEF", "U# c #E7E9EC", "V# c #E1E4E7", "W# c #E9E4D5", "X# c #573A00", "Y# c #2F5235", "Z# c #294B31", "`# c #849561", " $ c #FFFFCA", ".$ c #708774", "+$ c #3A5940", "@$ c #415F46", "#$ c #47644C", "$$ c #526D57", "%$ c #F4F5DD", "&$ c #C3C981", "*$ c #2E4F33", "=$ c #2C4D32", "-$ c #223C27", ";$ c #503700", ">$ c #EDE7D9", ",$ c #F8F9F9", "'$ c #E6E6E7", ")$ c #E7E8E8", "!$ c #E2E3E4", "~$ c #F9FAFC", "{$ c #F2F4F5", "]$ c #EFF1F3", "^$ c #E6E8EC", "/$ c #E8E2D4", "($ c #543800", "_$ c #2B4C31", ":$ c #29482E", "<$ c #26452D", "[$ c #95A269", "}$ c #58705D", "|$ c #35523A", "1$ c #3A563E", "2$ c #E4E8D6", "3$ c #D4D78C", "4$ c #314E33", "5$ c #28472E", "6$ c #28482E", "7$ c #203824", "8$ c #4D3500", "9$ c #EBE5D8", "0$ c #EFEFEF", "a$ c #C6C6C6", "b$ c #C5C5C6", "c$ c #BDBDBD", "d$ c #C2C3C4", "e$ c #C5C5C7", "f$ c #BBBCBE", "g$ c #EBECEE", "h$ c #E7E1D4", "i$ c #513600", "j$ c #27452C", "k$ c #25412A", "l$ c #25422A", "m$ c #234029", "n$ c #A8B071", "o$ c #FEFCD9", "p$ c #405943", "q$ c #CFD5C8", "r$ c #E4E497", "s$ c #385134", "t$ c #1D3321", "u$ c #4B3300", "v$ c #E9E3D7", "w$ c #F5F5F6", "x$ c #DEDEDE", "y$ c #DFDFE0", "z$ c #DCDCDD", "A$ c #DEDFE0", "B$ c #D9D9DA", "C$ c #D6D7D8", "D$ c #D8D9DA", "E$ c #E6E1D5", "F$ c #4E3300", "G$ c #244028", "H$ c #223D26", "I$ c #233D27", "J$ c #B9BE79", "K$ c #FFFFE3", "L$ c #F0EEA4", "M$ c #425839", "N$ c #213C26", "O$ c #1A2F1E", "P$ c #483001", "Q$ c #EBEBEB", "R$ c #BFBFBF", "S$ c #C3C3C3", "T$ c #B6B6B7", "U$ c #AFAFAF", "V$ c #C2C2C2", "W$ c #BCBDBE", "X$ c #CDCECF", "Y$ c #F4F6F7", "Z$ c #E3DED3", "`$ c #4B3100", " % c #203A24", ".% c #1E3622", "+% c #253C25", "@% c #B1B776", "#% c #51633F", "$% c #1D3521", "%% c #182B1A", "&% c #452E02", "*% c #E4DFD4", "=% c #E0E0E0", "-% c #E8E9E9", ";% c #E3E3E4", ">% c #FDFEFF", ",% c #F6F7F8", "'% c #E2DDD3", ")% c #492F01", "!% c #1D3320", "~% c #1C301E", "{% c #182E1C", "]% c #1B301D", "^% c #162617", "/% c #432C03", "(% c #E1DDD3", "_% c #F0F0F0", ":% c #B6B6B6", "<% c #B9BABA", "[% c #BBBCBC", "}% c #B6B5B6", "|% c #B2B3B3", "1% c #F0F1F1", "2% c #E0DBD1", "3% c #462D02", "4% c #152717", "5% c #142415", "6% c #101D12", "7% c #402A04", "8% c #DFDBD2", "9% c #F7F7F7", "0% c #E4E4E4", "a% c #DADADA", "b% c #FBFBFB", "c% c #DEDAD1", "d% c #3E2805", "e% c #DCD8D1", "f% c #F1F1F1", "g% c #C8C8C8", "h% c #BEBEBE", "i% c #C1C1C2", "j% c #E2E2E2", "k% c #FCFDFD", "l% c #DCD7D0", "m% c #3B2506", "n% c #D9D6D0", "o% c #E5E5E5", "p% c #DDDDDD", "q% c #FEFDFE", "r% c #D9D5CF", "s% c #392408", "t% c #CEC9C2", "u% c #100B04", "v% c #916A3D", "w% c #B9AB9A", "x% c #BAAC9C", "y% c #916A3C", "z% c #0F0B04", "A% c #010100", "B% c #211507", "C% c #201406", " ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", "+ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ + ", " # $ $ $ % & & & * = = - = - ; ; > > , ' ' ) ) ! ~ { { { ] ^ ", " / ( ( _ : < [ } | | 1 2 3 4 5 6 7 8 9 0 a a b c d e f g h i ", " j k l m n o p q r s s t u v w x x y z A B C D E F G H I J K ", " L M N O P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.;.>.,. ", " '.).!.!.~.{.].^./.(._.:.<.[.}.|.1.2.2.2.2.2.2.3.4.5.6.7.8.9. ", " 0.a.b.c.d.e.f.f.g.h.i.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A. ", " B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. + + +.+ ", " ++@+#+$+%+&+*+=+-+;+>+,+'+)+!+Q.~+{+]+^+/+(+_+:+<+[+}+}+}+|+ ", " 1+2+3+4+5+6+7+8+9+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+p+p+q+ ", " r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+R+S+T+ ", " U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@ ", " _@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@e@f@g@h@i@i@j@k@l@m@ ", " n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@ ", " R@S@T@U@V@W@X@W@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{# ", " ]#^#/#(#_#:#<#:#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#g#h# ", " i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#J#K# ", " L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$=$=$=$-$ ", " ;$>$,$'$)$!$!$~${$]$^$/$($_$:$<$[$d#}$|$1$2$3$4$5$6$6$6$6$7$ ", " 8$9$0$a$b$c$d$b$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$k$k$k$k$k$k$t$ ", " u$v$w$x$y$z$A$B$C$D$]$E$F$G$H$H$H$I$J$K$L$M$N$H$H$H$H$H$H$O$ ", " P$E$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%.%.%.%+%@%#%$%.%.%.%.%.%.%.%%% ", " &%*%,$=%-%)$;%)$y$>%,%'%)%!%~%~%~%~%~%{%]%~%~%~%~%~%~%~%~%^% ", " /%(%_%:%c$S$<%[%}%|%1%2%3%4%5%5%5%5%5%5%5%5%5%5%5%5%5%5%5%6% ", " 7%8%9%0%a%_%W@W@W@W@b%c%7% ", " d%e%f%S$g%g%h%R$i%j%k%l%d% ", " m%n%9%=%o%p%_%W@W@W@q%r%m% ", " s%t%W@W@W@W@W@W@W@W@W@t%s% ", " u%v%w%x%x%x%x%x%x%x%w%y%z% ", " A%B%C%C%C%C%C%C%C%B%A% "}; guake-indicator-1.4.5/data/labelicon.png000066400000000000000000000010231377654103700201470ustar00rootroot00000000000000PNG  IHDR7gAMA asRGB cHRMz&u0`:pQ<bKGD̿ pHYs   IDAT(eK+gf!a3)De33$K2a&,f.ݝy. XL6+FJ-As$;oދh2ܙa!*hIP,TslP_+^VuFuXAm"֢*-,K".߃:1oFܻR1г~%M6D!e/.|EYҵZ7J2P1&zT5lfҚvM7W%tEXtdate:create2014-08-08T10:29:17+02:00%tEXtdate:modify2014-08-08T10:29:17+02:00Es_IENDB`guake-indicator-1.4.5/debian/000077500000000000000000000000001377654103700160265ustar00rootroot00000000000000guake-indicator-1.4.5/debian/changelog000066400000000000000000000021041377654103700176750ustar00rootroot00000000000000guake-indicator (1.4-1) unstable; urgency=low * new upstream release (version 1.4) * Fixed bug - Switch to Ayatana AppIndicator (Closes: #906046) * Fixed bug - No more python code (Closes: #891093) -- Alessio Garzi Tue, 21 Aug 2018 06:00:00 +0100 guake-indicator (1.3.3-1) unstable; urgency=low * new upstream release (version 1.3.3) * Fixed bug - gconf2 replaced by gsettings (Closes: #892706) * Standards-Version updated 3.9.8 -- Alessio Garzi Sat, 2 Jun 2018 10:00:00 +0100 guake-indicator (1.1-2) unstable; urgency=low * Fixed bug in debian/control description (Closes: #774813) -- Alessio Garzi Tue, 13 Jan 2015 19:49:00 +0100 guake-indicator (1.1-1) unstable; urgency=low * new upstream release - commands are now fully customizable (LP: #1337277 and LP: #1340917) -- Alessio Garzi Wed, 31 Dec 2014 14:43:00 +0100 guake-indicator (0.4-1) unstable; urgency=low * Initial release (Closes: #745087) -- Alessio Garzi Tue, 22 Apr 2014 10:29:25 +0100 guake-indicator-1.4.5/debian/compat000066400000000000000000000000021377654103700172240ustar00rootroot000000000000009 guake-indicator-1.4.5/debian/control000066400000000000000000000023031377654103700174270ustar00rootroot00000000000000Source: guake-indicator Section: gnome Priority: optional Maintainer: Alessio Garzi Build-Depends: autotools-dev, debhelper (>= 9), dh-autoreconf, guake, intltool (>= 0.35.0), libayatana-appindicator3-dev, libcairo2-dev (>= 1.10), libdbus-1-dev, libdbus-glib-1-dev, libglib2.0-dev (>= 2.35.4), libgtk-3-dev (>= 3.1.4), libjson-c-dev, libxml2-dev, Standards-Version: 3.9.8 Homepage: http://guake-indicator.ozzyboshi.com Package: guake-indicator Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, guake Description: Guake terminal app indicator Guake indicator lets you send custom commands through the D-Bus System. Commands can be manually edited in a XML file under ~/.guake.indicator or generated through guake-indicator edit-menu system GUI. . Guake-indicator sticks to your "System Tray" and displays your favorites commands retrieved from ~/.guake.indicator/guake-indicator.xml. If guake-indicator.xml does not exist, guake-indicator will create a default configuration file with some examples. guake-indicator-1.4.5/debian/copyright000066400000000000000000000020711377654103700177610ustar00rootroot00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: guake-indicator Source: http://guake-indicator.ozzyboshi.com/sources/ Files: * Copyright: Copyright 2014 Alessio Garzi License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License 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 package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. guake-indicator-1.4.5/debian/docs000066400000000000000000000000211377654103700166720ustar00rootroot00000000000000NEWS README TODO guake-indicator-1.4.5/debian/install000066400000000000000000000017411377654103700174220ustar00rootroot00000000000000guake-indicator.desktop usr/share/applications data/gi_edit_menu_dialog.glade usr/share/guake-indicator/ data/hostgroupicon.png usr/share/guake-indicator/ data/hosticon.png usr/share/guake-indicator/ data/labelicon.png usr/share/guake-indicator/ data/icons/16x16/apps/guake-indicator.png usr/share/guake-indicator/icons/hicolor/16x16/apps/guake-indicator.png data/icons/22x22/apps/guake-indicator.png usr/share/guake-indicator/icons/hicolor/22x22/apps/guake-indicator.png data/icons/24x24/apps/guake-indicator.png usr/share/guake-indicator/icons/hicolor/24x24/apps/guake-indicator.png data/icons/256x256/apps/guake-indicator.png usr/share/guake-indicator/icons/hicolor/256x256/apps/guake-indicator.png data/icons/32x32/apps/guake-indicator.png usr/share/guake-indicator/icons/hicolor/32x32/apps/guake-indicator.png data/icons/48x48/apps/guake-indicator.png usr/share/guake-indicator/icons/hicolor/48x48/apps/guake-indicator.png data/icons/guake-indicator.xpm usr/share/pixmaps/guake-indicator guake-indicator-1.4.5/debian/rules000077500000000000000000000001531377654103700171050ustar00rootroot00000000000000#!/usr/bin/make -f %: dh $@ --with autoreconf,autotools-dev override_dh_clean: rm -f src/*.o dh_clean guake-indicator-1.4.5/debian/source/000077500000000000000000000000001377654103700173265ustar00rootroot00000000000000guake-indicator-1.4.5/debian/source/format000066400000000000000000000000141377654103700205340ustar00rootroot000000000000003.0 (quilt) guake-indicator-1.4.5/debian/watch000066400000000000000000000001741377654103700170610ustar00rootroot00000000000000version=3 http://guake-indicator.ozzyboshi.com/sources/guake-indicator_(\d\S*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) guake-indicator-1.4.5/guake-indicator.desktop000066400000000000000000000004731377654103700212510ustar00rootroot00000000000000[Desktop Entry] Name=Guake Indicator Comment=Use it to launch guake-indicator and a new icon will show up on systemtray TryExec=guake-indicator Exec=guake-indicator Icon=guake-indicator Type=Application Categories=GNOME;GTK;System;Utility;TerminalEmulator; StartupNotify=true Keywords=guake;ssh;terminal;indicator; guake-indicator-1.4.5/man/000077500000000000000000000000001377654103700153575ustar00rootroot00000000000000guake-indicator-1.4.5/man/Makefile.am000066400000000000000000000000661377654103700174150ustar00rootroot00000000000000man_MANS = guake-indicator.1 EXTRA_DIST = $(man_MANS) guake-indicator-1.4.5/man/guake-indicator.1000066400000000000000000000043741377654103700205170ustar00rootroot00000000000000.TH "guake-indicator" "1" .SH "NAME" .B guake-indicator \(em A simple Appindicator that lets you send custom commands to Guake. .SH "SYNOPSIS" .PP \fBguake-indicator .SH "DESCRIPTION" .PP \fBguake-indicator\fR lets you manage your favorite customized commands establishing a new connection with Guake dropdown terminal. .PP \fBguake-indicator\fR sticks to your "System Tray" and displays data retrieved from the Guake indicator configuration file (see FILES section for more details) .SH FILES \fBguake-indicator\fR builds the menu according to .I ~/.guake.indicator/guake-indicator.xml XML file If this configuration file does not exist a default one will be created. .PP Although Guake indicator has a built-in menu editor, you can customize this file according to your needs with your favorite text editor, just use this schema as a base to add new entries. The fields are self-explanatory, however, I'm going to give you a more in-depth description of each one: .TP .B menu_name The name that will show up in the indicator itself .TP .B tab_name the name of the guake terminal tab once it is opened (leave black if you don't want automatic autorenaming) .TP .B command_after_login command to send to Guake through his DBUS interface .TP .B dont_show_guake If set to yes, Guake indicator won't ask Guake to display his main window. .B open_in_tab The index of the Guake tab where guake-indicator will execute the command.Guake assigns index 0 to the first tab so put in this field the nth tab-1 number. If this tag has the attribute named="yes" it contains the name of the Guake tab .B lfcr If set to yes a LF (Line Feed) + CR (Carriage return) is sent to Guake after each line (by default only a line feed (ascii code 10) is sent. .B guakeindicatorscript If set to yes enables the Guake indicator scripting function .PP The above xml field are all optional (except menu_name) and must be stored within a XML Host parent field which in turn is enclosed withing a HostGroup field.You can find more information and a xsd validation file at http://guake-indicator.ozzyboshi.com. .SH BUGS Please report any bug to Alessio Garzi .SH AUTHOR \fBguake-indicator\fP was written by Alessio Garzi .PP This manual page was written by Alessio Garzi . guake-indicator-1.4.5/org.guake-indicator.gschema.xml000066400000000000000000000015331377654103700225720ustar00rootroot00000000000000 '' '' '' '' '' '' '' '' '' '' guake-indicator-1.4.5/src/000077500000000000000000000000001377654103700153735ustar00rootroot00000000000000guake-indicator-1.4.5/src/Makefile.am000066400000000000000000000037511377654103700174350ustar00rootroot00000000000000NULL = bin_PROGRAMS = guake-indicator guake_indicator_SOURCES = \ guake-indicator.c \ guake-indicator-ayatana.c \ guake-indicator-read-json.c \ guake-indicator-notify.c \ guake-indicator-dbus.c \ guake-indicator-write-json.c \ guake-indicator-edit-menu.c \ guake-indicator-write-xml.c \ guake-indicator-read-xml.c \ guake3.h \ guake-indicator-ayatana.h \ guake-indicator-dbus.h \ guake-indicator-edit-menu.h \ guake-indicator.h \ guake-indicator-notify.h \ guake-indicator-read-json.h \ guake-indicator-write-json.h \ guake-indicator-xml.h \ $(NULL) guake_indicator_CPPFLAGS = \ -Wunused-variable \ $(GTK_CFLAGS) \ $(AYATANA_APPINDICATOR_CFLAGS) \ $(JSONC_CFLAGS) \ $(XML2_CFLAGS) \ $(DBUSGLIB_CFLAGS) \ $(GLIB_CFLAGS) \ $(NULL) LIBS = \ $(GTK_LIBS) \ $(AYATANA_APPINDICATOR_LIBS) \ $(JSONC_LIBS) \ $(XML2_LIBS) \ $(DBUSGLIB_LIBS) \ $(GLIB_LIBS) \ -ldl \ $(NULL) AM_CFLAGS = \ -DDATADIR=\"$(datadir)\" \ $(NULL) guake-indicator-1.4.5/src/guake-indicator-ayatana.c000066400000000000000000000356641377654103700222370ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #include #include #include #include #include AppIndicator *GLOBAL_CI = NULL; void build_menu_ayatana(int argc, char **argv,GtkInfo* gtkinfo) { apply_css(); GLOBAL_CI = app_indicator_new ("guake-indicator",DEFAULT_ICON,APP_INDICATOR_CATEGORY_APPLICATION_STATUS); g_assert (IS_APP_INDICATOR (GLOBAL_CI)); g_assert (G_IS_OBJECT (GLOBAL_CI)); app_indicator_set_status (GLOBAL_CI, APP_INDICATOR_STATUS_ACTIVE); app_indicator_set_icon_full(GLOBAL_CI,"guake-indicator","guake-indicator"); app_indicator_set_title (GLOBAL_CI, "Guake indicator"); //g_signal_connect (ci, "scroll-event",G_CALLBACK (scroll_event_cb), NULL); //gtk_style_context_get_padding (menu_context, gtk_style_context_get_state (menu_context), &padding); //gtk_style_context_get_border (menu_context, gtk_style_context_get_state (menu_context), &border); //printf("\n\n%d %d %d %d %d %d\n",padding.left,border.left,padding.top,border.top,padding.bottom,border.bottom); gtk3_build_menu(gtkinfo); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); return ; } void apply_css() { GtkCssProvider *provider; provider = gtk_css_provider_new (); GtkWidget *window; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_css_provider_load_from_data (provider, CSS, -1, NULL); gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (window),GTK_STYLE_PROVIDER (provider),GTK_STYLE_PROVIDER_PRIORITY_USER); } static void activate_clicked_cb (GtkWidget *widget, gpointer data) { AppIndicator * ci = APP_INDICATOR(data); if (active) { app_indicator_set_status (ci, APP_INDICATOR_STATUS_ATTENTION); gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "I'm okay now"); active = FALSE; } else { app_indicator_set_status (ci, APP_INDICATOR_STATUS_ACTIVE); gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Get Attention"); active = TRUE; } } static void local_icon_toggle_cb (GtkWidget *widget, gpointer data) { AppIndicator * ci = APP_INDICATOR(data); if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { app_indicator_set_icon_full(ci, "simple-client-test-icon.png", "Local Icon"); } else { app_indicator_set_icon_full(ci, "indicator-messages", "System Icon"); } return; } static void scroll_event_cb (AppIndicator * ci, gint delta, guint direction, gpointer data) { g_print("Got scroll event! delta: %d, direction: %d\n", delta, direction); } static void append_submenu (GtkWidget *menu,Host* ptr) { GtkWidget *mi; GtkStyleContext *menu_context; gchar* menu_desc; void (*funct_ptr)(GtkAction*,gpointer); //printf("-----------%s %d\n",ptr->menu_name,ptr->open_in_tab==NULL); if (ptr->open_in_tab==NULL) mi = gtk_menu_item_new_with_label (ptr->menu_name); else { if (atol((char*)ptr->open_in_tab)==-1) menu_desc=g_strjoin(NULL,ptr->menu_name," (Current Tab)",NULL); else menu_desc=g_strjoin(NULL,ptr->menu_name," (Tab ",ptr->open_in_tab,")",NULL); mi = gtk_menu_item_new_with_label (menu_desc); g_free(menu_desc); } menu_context = gtk_widget_get_style_context (mi); gtk_style_context_add_class (menu_context, "titlebar"); if (ptr->label==TRUE) gtk_widget_set_sensitive ((GtkWidget *)mi,FALSE); else { // If open all is clicked then the call back function is group guake open if (ptr->group_head!=NULL) funct_ptr=group_guake_open; else if (ptr->dont_show_guake==NULL || g_strcmp0(ptr->dont_show_guake,"yes")) funct_ptr=guake_open_with_show; else funct_ptr=guake_open; ptr->right_click_funct_ptr=funct_ptr; g_signal_connect(mi,"button-press-event",G_CALLBACK(gtk3_detect_clickbutton),(gpointer) ptr); g_signal_connect (mi, "activate",G_CALLBACK (funct_ptr), (gpointer) ptr); } gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); } // Detect click button gboolean gtk3_detect_clickbutton(GtkWidget *btn, GdkEventButton *event, gpointer userdata) { if (event->type == GDK_BUTTON_PRESS && event->button == 3) { GtkWindow *main_app_window; // Window the dialog should show up on GtkWidget *dialog; //GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT; GtkDialogFlags flags = GTK_DIALOG_MODAL ; dialog = gtk_dialog_new_with_buttons ("Chose open method", main_app_window, flags, ("Open in new vertical split on current tab"), 0, ("Open in new horizontal split on current tab"), 1, ("Execute on all terminals on current tab"), 2, ("Execute only on focused terminal on current tab"), 3, NULL); gtk_widget_show_all(dialog); //g_signal_connect(dialog, "destroy", G_CALLBACK(guake_open), userdata); //g_signal_connect(dialog, "destroy", G_CALLBACK(guake_open), userdata); switch (gtk_dialog_run(GTK_DIALOG(dialog))) { case 0: ((Host*)userdata)->force_current_tab=TRUE; ((Host*)userdata)->vertical_split_current_tab=TRUE; ((Host*)userdata)->horizontal_split_current_tab=FALSE; ((Host*)userdata)->force_current_split=FALSE; gtk_widget_destroy (dialog); ((Host*)userdata)->right_click_funct_ptr(NULL,userdata); return TRUE; case 1: ((Host*)userdata)->force_current_tab=TRUE; ((Host*)userdata)->vertical_split_current_tab=FALSE; ((Host*)userdata)->horizontal_split_current_tab=TRUE; ((Host*)userdata)->force_current_split=FALSE; gtk_widget_destroy (dialog); ((Host*)userdata)->right_click_funct_ptr(NULL,userdata); return TRUE; case 2: ((Host*)userdata)->force_current_tab=TRUE; ((Host*)userdata)->vertical_split_current_tab=FALSE; ((Host*)userdata)->horizontal_split_current_tab=FALSE; ((Host*)userdata)->force_current_split=FALSE; gtk_widget_destroy (dialog); ((Host*)userdata)->right_click_funct_ptr(NULL,userdata); return TRUE; case 3: ((Host*)userdata)->force_current_tab=TRUE; ((Host*)userdata)->vertical_split_current_tab=FALSE; ((Host*)userdata)->horizontal_split_current_tab=FALSE; ((Host*)userdata)->force_current_split=TRUE; gtk_widget_destroy (dialog); ((Host*)userdata)->right_click_funct_ptr(NULL,userdata); return TRUE; default: gtk_widget_destroy (dialog); return TRUE; } } if (event->type == GDK_BUTTON_PRESS && event->button == 1) { ((Host*)userdata)->force_current_tab=FALSE; ((Host*)userdata)->vertical_split_current_tab=FALSE; ((Host*)userdata)->horizontal_split_current_tab=FALSE; ((Host*)userdata)->force_current_split=FALSE; return 0; } return 0; } // Function to close the indicator static void gtk3_close_guake_indicator ( GtkAction *action, gpointer user_data) { GArray* grouphostlist= ((GtkInfo*)user_data)->grouphostlist; grouphostlist_free(grouphostlist); g_main_loop_quit(mainloop); //gtk_widget_destroy((GtkWidget *)menu); gtk_main_quit(); return ; } void refresh_indicator_ayatana(gpointer user_data) { gtk3_reload (NULL,user_data); } static void gtk3_build_menu(GtkInfo* gtkinfo) { GtkWidget *menu = NULL; GtkStyleContext *menu_context; GtkWidget *item; unsigned int i; GtkWidget *submenu = NULL; Host* ptr; void (*funct_ptr)(GtkAction*,gpointer); menu = gtk_menu_new (); for (i=0;gtkinfo->grouphostlist!=NULL && igrouphostlist->len;i++) { HostGroup* hostgroup = g_array_index (gtkinfo->grouphostlist, HostGroup* , i); if (hostgroup->title) { GtkWidget *toggle_item = gtk_menu_item_new_with_label (hostgroup->title); menu_context = gtk_widget_get_style_context (toggle_item); gtk_style_context_add_class (menu_context, "titlebar"); if (hostgroup->label==TRUE) gtk_widget_set_sensitive ((GtkWidget *)toggle_item,FALSE); else { submenu = gtk_menu_new (); for (ptr=hostgroup->hostarray;ptr;ptr=ptr->next) { //printf("%s\n",ptr->menu_name); append_submenu (submenu,ptr); } gtk_widget_show_all (submenu); gtk_menu_item_set_submenu (GTK_MENU_ITEM (toggle_item), submenu); } gtk_menu_shell_append (GTK_MENU_SHELL (menu), toggle_item); gtk_widget_show (toggle_item); } else { for (ptr=hostgroup->hostarray;ptr;ptr=ptr->next) { if (ptr->open_in_tab==NULL) { item = gtk_menu_item_new_with_label (ptr->menu_name); menu_context = gtk_widget_get_style_context (item); gtk_style_context_add_class (menu_context, "titlebar"); } else { gchar* menu_desc; if (atol((char*)ptr->open_in_tab)==-1) menu_desc=g_strjoin(NULL,ptr->menu_name," (Current Tab)",NULL); else menu_desc=g_strjoin(NULL,ptr->menu_name," (Tab ",ptr->open_in_tab,")",NULL); item = gtk_menu_item_new_with_label (menu_desc); menu_context = gtk_widget_get_style_context (item); gtk_style_context_add_class (menu_context, "titlebar"); g_free(menu_desc); } if (ptr->label==TRUE) gtk_widget_set_sensitive ((GtkWidget *)item,FALSE); else { if (ptr->dont_show_guake==NULL || g_strcmp0(ptr->dont_show_guake,"yes")) funct_ptr=guake_open_with_show; else funct_ptr=guake_open; ptr->right_click_funct_ptr=funct_ptr; gtk_widget_add_events(item, GDK_BUTTON_PRESS_MASK); g_signal_connect(item,"button-press-event",G_CALLBACK(gtk3_detect_clickbutton),(gpointer) ptr); g_signal_connect (item, "activate",G_CALLBACK (funct_ptr), (gpointer) ptr); } gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); } } } // Build default actions item=gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); for (i=0;i", "Francesco Minà ", NULL }; const gchar* license ="Guake indicator is free software; you can redistribute it and/or\n" " modify it under the terms of the GNU General Public License\n" " as published by the Free Software Foundation; either version 2\n" " of the License, or (at your option) any later version.\n\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " GNU General Public License for more details.\n\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA."; GdkPixbuf *logo = gdk_pixbuf_new_from_file (DATADIR"/"GUAKE_INDICATOR_ICON_DIR"/guake-indicator.png", &error); if (error != NULL) { if (error->domain == GDK_PIXBUF_ERROR) g_print ("GdkPixbufError: %s\n", error->message); else if (error->domain == G_FILE_ERROR) g_print ("GFileError: %s\n", error->message); else g_print ("An error in the domain: %d has occurred!\n", error->domain); g_error_free (error); } gtk_show_about_dialog(NULL, "program-name", "Guake indicator", "authors", authors, "comments", "A simple indicator that lets you send custom commands to Guake/Guake3.", "copyright", "(C) 2013-2020 Alessio Garzi\n(C) 2013-2020 Francesco Mina\n\nDedicated to my daughters\n Ludovica and Mariavittoria", "logo", logo, "version", GUAKE_INDICATOR_VERSION, "website", "http://guake-indicator.ozzyboshi.com", "license",license, NULL); } guake-indicator-1.4.5/src/guake-indicator-ayatana.h000066400000000000000000000041721377654103700222320ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #ifndef _GUAKE_INDICATOR_AYATANA_H_ #define _GUAKE_INDICATOR_AYATANA_H_ #include #define DEFAULT_ICON "guake-indicator" static void scroll_event_cb (AppIndicator * , gint , guint , gpointer ); static void append_submenu (GtkWidget *,Host*); static void activate_clicked_cb (GtkWidget *, gpointer ); static void label_toggle_cb (GtkWidget * , gpointer ); static void apply_css(); static void gtk3_build_menu(GtkInfo*); static void gtk3_close_guake_indicator (GtkAction *,gpointer); static void gtk3_reload (GtkAction*,gpointer); static void gtk3_about (GtkAction*,gpointer ); gboolean gtk3_detect_clickbutton(GtkWidget *, GdkEventButton *, gpointer ); static GMainLoop * mainloop = NULL; static gboolean active = TRUE; static const gchar CSS[] = ".titlebar { " " border-radius: 0px 0px 0px 0px; " " background-color: gray;" " border: 0px; " " padding: 0px; " " margin: 0px; " "}"; static GUAKE_INDICATOR_DEFAULT_ACTION GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY_GTK3[]= { {GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY[0],print_edit_menu_form}, {GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY[1],gtk3_reload}, {GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY[2],gtk3_close_guake_indicator}, {GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY[3],gtk3_about} }; #endif //_GUAKE_INDICATOR_AYATANA_H_guake-indicator-1.4.5/src/guake-indicator-dbus.c000066400000000000000000000136141377654103700215450ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #include "guake-indicator-dbus.h" DBusGProxy* guake_dbus_init() { DBusGConnection* bus; GError* error = NULL; DBusGProxy* remoteValue; bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); if (error != NULL) { g_printf("Couldn't connect to the Session bus %s", error->message); g_error_free (error); return NULL; } remoteValue =dbus_g_proxy_new_for_name(bus,GUAKE3?GUAKE3_URI:GUAKE_URI,GUAKE3?GUAKE3_PATH:GUAKE_PATH,GUAKE3?GUAKE3_IFACE:GUAKE_IFACE); if (remoteValue == NULL) { g_printf("Couldn't create the proxy object"); return NULL; } return remoteValue; } // Send a integer to the dbus system and get a string in return gboolean guake_dbus_send_intparam_with_string_return(const gchar* functname,gint32 param,gchar** ret) { GError* error = NULL; gchar* strret; DBusGProxy* remoteValue = guake_dbus_init(); if (remoteValue==NULL) return FALSE; if (!dbus_g_proxy_call (remoteValue, functname,&error,G_TYPE_INT, param,G_TYPE_INVALID,G_TYPE_STRING,&strret,G_TYPE_INVALID)) { g_printerr ("Error: %s\n", error->message); g_error_free (error); return FALSE; } *ret=strret; return TRUE; } // Get a string from the dbus system gboolean guake_dbus_send_noparams_with_string_return(const gchar* functname,gchar** ret) { GError* error = NULL; gchar* strret; DBusGProxy* remoteValue = guake_dbus_init(); if (remoteValue==NULL) return FALSE; if (!dbus_g_proxy_call (remoteValue, functname,&error,G_TYPE_INVALID,G_TYPE_STRING,&strret,G_TYPE_INVALID)) { g_printerr ("Error: %s\n", error->message); g_error_free (error); return FALSE; } *ret=strret; return TRUE; } // Get an integer from the dbus system gboolean guake_dbus_send_noparams_with_integer_return(const gchar* functname,gint32* ret) { GError* error = NULL; gboolean returnValue; DBusGProxy* remoteValue = guake_dbus_init(); if (remoteValue==NULL) return FALSE; *ret=-1; returnValue = dbus_g_proxy_call (remoteValue, functname,&error,G_TYPE_INVALID,G_TYPE_INT, ret,G_TYPE_INVALID); if (!returnValue) { //g_printerr ("Error: %s\n", error->message); g_error_free (error); return FALSE; } return TRUE; } gboolean guake_dbus_send(const gchar* functname,const gchar* param) { GError* error = NULL; gboolean returnValue; DBusGProxy* remoteValue = guake_dbus_init(); if (remoteValue==NULL) return FALSE; if (param==NULL) returnValue = dbus_g_proxy_call (remoteValue, functname,&error,G_TYPE_INVALID,G_TYPE_INVALID); else returnValue = dbus_g_proxy_call (remoteValue, functname,&error,G_TYPE_STRING,param,G_TYPE_INVALID,G_TYPE_INVALID); if (!returnValue) { g_error_free (error); return FALSE; } return TRUE; } gboolean guake_dbus_send_2strings(const gchar* functname,const gchar* param,const gchar* param2) { GError* error = NULL; gboolean returnValue; DBusGProxy* remoteValue = guake_dbus_init(); if (remoteValue==NULL) return FALSE; returnValue = dbus_g_proxy_call (remoteValue, functname,&error,G_TYPE_STRING,param,G_TYPE_STRING,param2,G_TYPE_INVALID,G_TYPE_INVALID); if (!returnValue) { g_error_free (error); return FALSE; } return TRUE; } gboolean guake_dbus_send_noparam(const gchar* funcname) { return guake_dbus_send(funcname,NULL); } // Perform vertical split on current tab gboolean guake_vsplit_current_tab() { return guake_dbus_send_noparam("v_split_current_terminal"); } // Perform horizontal split on current tab gboolean guake_hsplit_current_tab() { return guake_dbus_send_noparam("h_split_current_terminal"); } // It shows Guake gboolean guake_show() { // Show is not supported on old guake versions, so i set a fallback on show_hide if (guake_dbus_send_noparam("show")==FALSE) return guake_dbus_send_noparam("show_hide"); return TRUE; } // It opens a new Guake tab gboolean guake_newtab(gchar** name) { //return guake_dbus_send_noparam("add_tab"); return guake_dbus_send_noparams_with_string_return("add_tab",name); } // It opens the nth Guake tab gboolean guake_selecttab(const gchar* param) { return guake_dbus_send("select_tab",param); } // Get number of Guake tabs gboolean guake_gettabcount(gint32* numtabs) { return guake_dbus_send_noparams_with_integer_return("get_tab_count",numtabs); } // Get number of the nth Guake tab gboolean guake_getgtktabname(guint tabindex,gchar** name) { return guake_dbus_send_intparam_with_string_return("get_gtktab_name",tabindex,name); } // Rename the current Guake tab gboolean guake_renamecurrenttab(const gchar* param) { return guake_dbus_send("rename_current_tab",param); } // Execute a command on a Guake shell gboolean guake_executecommand(const char* command) { return guake_dbus_send("execute_command",command); } // Execute a command on a Guake terminalbox shell gboolean guake_execute_command_current_termbox(const char* command) { return guake_dbus_send("execute_command_current_termbox",command); } // Execute a command on a Guake shell by uuid gboolean guake_executecommand_by_uuid(gchar* uuid,const char* command) { return guake_dbus_send_2strings("execute_command_by_uuid",uuid,command); } //Get current tab uuid gboolean guake_getcurrenttab_uuid(gchar** uuid) { return guake_dbus_send_noparams_with_string_return("get_selected_uuidtab",uuid); } guake-indicator-1.4.5/src/guake-indicator-dbus.h000066400000000000000000000041531377654103700215500ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. * */ #ifndef _GUAKE_INDICATOR_DBUS_H #define _GUAKE_INDICATOR_DBUS_H #include #include #include #include "guake3.h" #define GUAKE_URI "org.guake.RemoteControl" #define GUAKE_PATH "/org/guake/RemoteControl" #define GUAKE_IFACE "org.guake.RemoteControl" #define GUAKE3_URI "org.guake3.RemoteControl" #define GUAKE3_PATH "/org/guake3/RemoteControl" #define GUAKE3_IFACE "org.guake3.RemoteControl" DBusGProxy* guake_dbus_init(); gboolean guake_dbus_send(const gchar*,const gchar*); gboolean guake_dbus_send_2strings(const gchar*,const gchar*,const gchar*); gboolean guake_dbus_send_intparam_with_string_return(const gchar*,gint32,gchar**); gboolean guake_dbus_send_noparams_with_integer_return(const gchar*,gint32*); gboolean guake_dbus_send_noparam(const gchar*); gboolean guake_show(); gboolean guake_newtab(gchar**); gboolean guake_getcurrenttab_uuid(gchar**); gboolean guake_gettabcount(gint32*); gboolean guake_getgtktabname(guint,gchar**); gboolean guake_selecttab(const gchar*); gboolean guake_renamecurrenttab(const gchar*); gboolean guake_executecommand(const char*); gboolean guake_executecommand_by_uuid(gchar*,const char*); gboolean guake_vsplit_current_tab(); gboolean guake_hsplit_current_tab(); gboolean guake_execute_command_current_termbox(const char*); #endif //_GUAKE_INDICATOR_DBUS_Hguake-indicator-1.4.5/src/guake-indicator-edit-menu.c000066400000000000000000002010361377654103700224740ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #define _GNU_SOURCE #include "guake-indicator.h" #include "guake-indicator-edit-menu.h" #include "guake-indicator-read-json.h" #include "guake-indicator-xml.h" #include "guake-indicator-dbus.h" #include "guake-indicator-notify.h" #include "guake-indicator-write-json.h" #include "guake3.h" GtkTreeStore* global_tree_view; gboolean is_print_edit_menu_form_opened=FALSE; gboolean is_print_custom_form_opened=FALSE; // Function to print edit menu form window void print_edit_menu_form(GtkAction* action, gpointer user_data) { GtkCellRenderer *cell_name; GtkTreeViewColumn* column_name; GError *error = NULL; static EditMenuDialog widgets; GtkBuilder* builder; if (is_print_edit_menu_form_opened) return; builder = gtk_builder_new (); GError *err = NULL; if(0 == gtk_builder_add_from_file (builder, DATADIR GUAKE_INDICATOR_DATADIR "/gi_edit_menu_dialog.glade", &err)) { fprintf(stderr, "[print_edit_menu_form]: Error adding build from file. Error: %s\n", err->message); return ; } // get widget data references from glade file widgets.window = GTK_WIDGET (gtk_builder_get_object (builder, "edit_menu_window")); widgets.entry_menu_name = GTK_WIDGET (gtk_builder_get_object (builder, "entry_menu_name")); widgets.entry_tab_name = GTK_WIDGET (gtk_builder_get_object (builder, "entry_tab_name")); widgets.entry_command = GTK_WIDGET (gtk_builder_get_object (builder, "entry_command")); widgets.cb_show_guake = GTK_WIDGET (gtk_builder_get_object (builder, "cb_show_guake")); widgets.current_guake_tab = GTK_WIDGET (gtk_builder_get_object (builder, "current_guake_tab")); widgets.new_guake_tab = GTK_WIDGET (gtk_builder_get_object (builder, "new_guake_tab")); widgets.existing_guake_tab = GTK_WIDGET (gtk_builder_get_object (builder, "existing_guake_tab")); widgets.nth_guake_tab = GTK_WIDGET (gtk_builder_get_object (builder, "nth_guake_tab")); /*GtkObject * adj = gtk_adjustment_new( 0,0,99,1,1,0); gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(widgets.nth_guake_tab),GTK_ADJUSTMENT(adj));*/ widgets.existing_guake_tab_named=GTK_WIDGET (gtk_builder_get_object (builder, "existing_guake_tab_named")); widgets.named_guake_tab = GTK_WIDGET (gtk_builder_get_object (builder, "named_guake_tab")); widgets.lfcr = GTK_WIDGET (gtk_builder_get_object (builder, "lfcr")); widgets.guakeindicatorscript = GTK_WIDGET (gtk_builder_get_object (builder, "guakeindicatorscript")); widgets.btn_edit_menu_remove = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_remove")); widgets.btn_edit_menu_save = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_save")); widgets.btn_edit_menu_add_group = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_add_group")); widgets.btn_edit_menu_add_host = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_add_host")); widgets.btn_edit_menu_add_host_label = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_add_host_lbl")); widgets.btn_edit_menu_add_group_label = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_add_group_lbl")); widgets.btn_edit_menu_export = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_export")); widgets.btn_edit_menu_import = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_import")); widgets.btn_edit_menu_close_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "btn_edit_menu_close_dialog")); widgets.action=action; widgets.user_data=user_data; widgets.status = STATUS_EDIT; // remove button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_remove), "clicked",G_CALLBACK (remove_edit_menu),&widgets); // save button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_save), "clicked",G_CALLBACK (save_edit_menu),&widgets); // cancel button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_close_dialog), "clicked",G_CALLBACK (close_dialog),&widgets); // add group button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_add_group), "clicked",G_CALLBACK (add_group),&widgets); // add host button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_add_host), "clicked",G_CALLBACK (add_host),&widgets); // add host label button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_add_host_label), "clicked",G_CALLBACK (add_host_label),&widgets); // add group label button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_add_group_label), "clicked",G_CALLBACK (add_group_label),&widgets); // add export button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_export), "clicked",G_CALLBACK (export),&widgets); // add import button g_signal_connect (G_OBJECT (widgets.btn_edit_menu_import), "clicked",G_CALLBACK (import),&widgets); // set signal for clearing gtkentry g_signal_connect (G_OBJECT (widgets.entry_menu_name), "icon-press",G_CALLBACK (clear_gtkentry),&widgets); g_signal_connect (G_OBJECT (widgets.entry_tab_name), "icon-press",G_CALLBACK (clear_gtkentry),&widgets); //set expand and collapse triggers GtkWidget* expandwidget = GTK_WIDGET (gtk_builder_get_object (builder, "expand")); g_signal_connect (G_OBJECT (expandwidget), "button-release-event",G_CALLBACK (expand),&widgets); GtkWidget* collapsewidget = GTK_WIDGET (gtk_builder_get_object (builder, "collapse")); g_signal_connect (G_OBJECT (collapsewidget), "button-release-event",G_CALLBACK (collapse),&widgets); //set ctrl+s keyboard shortcut for entry command g_signal_connect (G_OBJECT (widgets.entry_command), "key_press_event", G_CALLBACK (manage_ctrl_s), &widgets); // move button // top button widgets.topButton = GTK_WIDGET (gtk_builder_get_object(builder,"btn_edit_top")); g_signal_connect (G_OBJECT (widgets.topButton), "clicked",G_CALLBACK (move_top),&widgets); // up button widgets.upButton = GTK_WIDGET (gtk_builder_get_object(builder,"btn_edit_up")); g_signal_connect (G_OBJECT (widgets.upButton), "clicked",G_CALLBACK (move_up),&widgets); // down button widgets.downButton = GTK_WIDGET (gtk_builder_get_object(builder,"btn_edit_down")); g_signal_connect (G_OBJECT (widgets.downButton), "clicked",G_CALLBACK (move_down),&widgets); // bottom button widgets.bottomButton = GTK_WIDGET (gtk_builder_get_object(builder,"btn_edit_bottom")); g_signal_connect (G_OBJECT (widgets.bottomButton), "clicked",G_CALLBACK (move_bottom),&widgets); // Start of treeview // treestore widgets.tree_store = gtk_tree_store_new(N_COLUMNS, G_TYPE_POINTER,GDK_TYPE_PIXBUF,G_TYPE_STRING); // treeview widgets.tree_view = GTK_WIDGET (gtk_builder_get_object(builder,"edit_menu_treeview")); /* Set treeview as the source of the Drag-N-Drop operation */ if (DND_DISABLED!=TRUE) { static const GtkTargetEntry drag_targets = { "STRING", GTK_TARGET_SAME_APP,0 }; /** it doesn't work well for now disabled **/ gtk_drag_source_set(widgets.tree_view,GDK_BUTTON1_MASK, &drag_targets,1, GDK_ACTION_COPY|GDK_ACTION_MOVE); gtk_drag_dest_set(widgets.tree_view,GTK_DEST_DEFAULT_ALL,&drag_targets,1, GDK_ACTION_COPY|GDK_ACTION_MOVE); /* Attach a "drag-data-get" signal to send out the dragged data */ g_signal_connect (widgets.tree_view, "drag-motion",G_CALLBACK (drag_motion_handl), &widgets); g_signal_connect (widgets.tree_view, "drag-begin",G_CALLBACK (drag_begin_handl), &widgets); g_signal_connect (widgets.tree_view, "drag-end",G_CALLBACK (drag_end_handl), &widgets); } // Handling copy cut and paste popup menu g_signal_connect(widgets.tree_view, "button-press-event", (GCallback) view_onButtonPressed, &widgets); g_signal_connect(widgets.tree_view, "popup-menu", (GCallback) view_onPopupMenu, &widgets); // cell cell_name = gtk_cell_renderer_text_new(); widgets.labelicon = gdk_pixbuf_new_from_file (DATADIR GUAKE_INDICATOR_DATADIR "/labelicon.png",&error); if (error) { g_warning ("Could not load icon: %s\n", error->message); g_error_free(error); error = NULL; return; } widgets.hosticon = gdk_pixbuf_new_from_file (DATADIR GUAKE_INDICATOR_DATADIR "/hosticon.png",&error); if (error) { g_warning ("Could not load icon: %s\n", error->message); g_error_free(error); error = NULL; return; } widgets.hostgroupicon = gdk_pixbuf_new_from_file (DATADIR GUAKE_INDICATOR_DATADIR "/hostgroupicon.png",&error); if (error) { g_warning ("Could not load icon: %s\n", error->message); g_error_free(error); error = NULL; return; } column_name=gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column_name, "Name"); GtkCellRenderer *renderer; renderer = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(column_name, renderer, FALSE); gtk_tree_view_column_set_attributes(column_name, renderer,"pixbuf", COL_ICON,NULL); gtk_tree_view_column_pack_start(column_name, cell_name, TRUE); gtk_tree_view_column_set_attributes(column_name, cell_name,"text", NAME_COLUMN,NULL); gtk_tree_view_append_column(GTK_TREE_VIEW (widgets.tree_view), column_name); // Fetch data from the cfg file if (customConfFile) { widgets.grouphostlist = read_xml_cfg_file_from_file(customConfFile); } else { if (check_xml_cfg_file_presence()) widgets.grouphostlist = read_xml_cfg_file(); else widgets.grouphostlist = read_json_cfg_file(NULL); } reload_model_view(&widgets); // store the callback function "selection_func" for the selection GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets.tree_view)); gtk_tree_selection_set_select_function(selection, selection_func, (gpointer)&widgets,NULL); // manage the double click event that causes the row to auto expand g_signal_connect(widgets.tree_view, "row-activated", (GCallback) view_onRowActivated, NULL); // manage the right key press event that causes the row to auto expan g_signal_connect(widgets.tree_view, "key_press_event", (GCallback) on_key_press, &widgets); set_widget_sensitivity(&widgets,FALSE); set_new_widget_sensitivity(&widgets,TRUE); g_object_unref (G_OBJECT (builder)); widgets.reset_flag=&is_print_edit_menu_form_opened; g_signal_connect(widgets.window, "destroy",G_CALLBACK(close_dialog), (gpointer)&widgets); gtk_widget_show_all( widgets.window ); is_print_edit_menu_form_opened=TRUE; // move the window on top gtk_window_present(GTK_WINDOW(widgets.window)); return; } void view_onRowActivated (GtkTreeView* treeview,GtkTreePath* path,GtkTreeViewColumn *col,gpointer userdata) { if (gtk_tree_view_row_expanded (treeview,path)==FALSE) gtk_tree_view_expand_row (treeview,path,FALSE); else gtk_tree_view_collapse_row (treeview,path); } static void build_cmd ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; GArray* hbox=dialog->hbox; guint count=0; GtkWidget* iterator; gchar* cmd = g_strdup(""); gchar* app; while ( iterator = g_array_index (hbox, GtkWidget*, count)) { GList* children = gtk_container_get_children(GTK_CONTAINER(iterator)); if (children) { GList* data = g_list_next(children); if (data) { if (!g_strcmp0(gtk_widget_get_name(GTK_WIDGET(data->data)),"GtkEntry")) { GtkEntry* widget_data = GTK_ENTRY(data->data); const gchar* name = gtk_buildable_get_name(GTK_BUILDABLE(widget_data)); if (strlen((char*)gtk_entry_get_text(widget_data))) { app=cmd; if (!strncasecmp((char*)name,"empty",strlen("empty"))) cmd=g_strconcat(cmd," '",gtk_entry_get_text(widget_data),"'",NULL); else cmd=g_strconcat(cmd," ",name," ",gtk_entry_get_text(widget_data),NULL); g_free(app); } } else if (!g_strcmp0(gtk_widget_get_name(GTK_WIDGET(data->data)),"GtkCheckButton")) { GtkCheckButton* widget_data = GTK_CHECK_BUTTON(data->data); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget_data))) { app=cmd; cmd=g_strconcat(cmd," ",gtk_buildable_get_name(GTK_BUILDABLE(widget_data)),NULL); g_free(app); } //printf("%s %d\n",gtk_buildable_get_name(GTK_BUILDABLE(widget_data)),gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget_data)));fflush(stdout); } else if (!g_strcmp0(gtk_widget_get_name(GTK_WIDGET(data->data)),"GtkLabel")) { GtkLabel* widget_data = GTK_LABEL(data->data); app=cmd; cmd=g_strconcat(cmd," ",gtk_buildable_get_name(GTK_BUILDABLE(widget_data)),NULL); g_free(app); } } g_list_free(children); } count++; } gtk_widget_destroy(dialog->window); TEXTVIEW_SET_TEXT(GET_ENTRY_COMMAND(dialog),cmd) g_free(cmd); return; } // This function is called each time one item of the gtk treeview has been selected gboolean selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata) { GtkTreeIter iter; EditMenuDialog* widgets = (EditMenuDialog*)userdata; gpointer* host; if (gtk_tree_model_get_iter(model, &iter, path) && !path_currently_selected) { gtk_tree_model_get(model, &iter, ID_COLUMN, &host, -1); gchar* pathstring=gtk_tree_path_to_string(path); set_selected_path(widgets,pathstring); g_free(pathstring); if (widgets->status == STATUS_EDIT) { switch( gtk_tree_path_get_depth(path) ) { case 1: // A hostgroup has been selected // Enable all widgets with host retreived data set_widget_sensitivity(widgets,TRUE); activate_label_sensitivity(widgets); ENTRY_SET_TEXT(GET_ENTRY_MENUNAME(widgets),((HostGroup*)host)->title) ENTRY_SET_TEXT(GET_ENTRY_TABNAME(widgets),NULL) TEXTVIEW_SET_TEXT(GET_ENTRY_COMMAND(widgets),"") gtk_toggle_button_set_active((GtkToggleButton *)widgets->cb_show_guake,0); gtk_toggle_button_set_active((GtkToggleButton *)widgets->lfcr,0); gtk_toggle_button_set_active((GtkToggleButton *)widgets->guakeindicatorscript,0); widgets->selected_hostgroup=(HostGroup*)host; widgets->selected_host=NULL; break; case 2: // A host has been selected set_widget_sensitivity(widgets,TRUE); ENTRY_SET_TEXT(GET_ENTRY_MENUNAME(widgets),((Host*)host)->menu_name) ENTRY_SET_TEXT(GET_ENTRY_TABNAME(widgets),((Host*)host)->tab_name) // use get_guake_cmd for backward compatibility (up until guake 0.4) gchar* cmd = get_guake_cmd((Host*)host); TEXTVIEW_SET_TEXT(GET_ENTRY_COMMAND(widgets),cmd) if ( ((Host*)host)->dont_show_guake && !strcmp(((Host*)host)->dont_show_guake,"yes")) gtk_toggle_button_set_active( (GtkToggleButton *)widgets->cb_show_guake,1); else gtk_toggle_button_set_active( (GtkToggleButton *)widgets->cb_show_guake,0 ); if ( ((Host*)host)->lfcr && !strcmp(((Host*)host)->lfcr,"yes")) gtk_toggle_button_set_active( (GtkToggleButton *)widgets->lfcr,1); else gtk_toggle_button_set_active( (GtkToggleButton *)widgets->lfcr,0 ); if ( ((Host*)host)->guakeindicatorscript && !strcmp(((Host*)host)->guakeindicatorscript,"yes")) gtk_toggle_button_set_active( (GtkToggleButton *)widgets->guakeindicatorscript,1); else gtk_toggle_button_set_active( (GtkToggleButton *)widgets->guakeindicatorscript,0 ); gchar* open_in_tab=((Host*)host)->open_in_tab; gboolean named=((Host*)host)->open_in_tab_named; if (open_in_tab==NULL || (atol((char*)open_in_tab)<0 && named==FALSE)) { if (open_in_tab && atol((char*)open_in_tab)==-1) { gtk_toggle_button_set_active( (GtkToggleButton *)widgets->new_guake_tab,0); gtk_toggle_button_set_active( (GtkToggleButton *)widgets->current_guake_tab,1); } else { gtk_toggle_button_set_active( (GtkToggleButton *)widgets->new_guake_tab,1); gtk_toggle_button_set_active( (GtkToggleButton *)widgets->current_guake_tab,0); } gtk_toggle_button_set_active( (GtkToggleButton *)widgets->existing_guake_tab,0); gtk_entry_set_text(GTK_ENTRY(widgets->nth_guake_tab),"0"); gtk_entry_set_text(GTK_ENTRY(widgets->named_guake_tab),""); } else { gtk_toggle_button_set_active( (GtkToggleButton *)widgets->new_guake_tab,0); if (named==FALSE) { gtk_toggle_button_set_active( (GtkToggleButton *)widgets->existing_guake_tab,1); gtk_toggle_button_set_active( (GtkToggleButton *)widgets->existing_guake_tab_named,0); gtk_entry_set_text(GTK_ENTRY(widgets->nth_guake_tab),open_in_tab); gtk_entry_set_text(GTK_ENTRY(widgets->named_guake_tab),""); } else { gtk_toggle_button_set_active( (GtkToggleButton *)widgets->existing_guake_tab,0); gtk_toggle_button_set_active( (GtkToggleButton *)widgets->existing_guake_tab_named,1); gtk_entry_set_text(GTK_ENTRY(widgets->nth_guake_tab),"0"); gtk_entry_set_text(GTK_ENTRY(widgets->named_guake_tab),open_in_tab); } } // disable selection by tab name if the dbus interface is not read (guake has not been patched) gchar* name; if (guake_getgtktabname(0,&name)==FALSE) { gtk_widget_set_sensitive(widgets->existing_guake_tab_named,FALSE); gtk_widget_set_sensitive(widgets->named_guake_tab,FALSE); /*GtkTooltips *tooltip; tooltip = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltip, widgets->named_guake_tab,GUAKE_INDICATOR_DBUS_GTKLABEL_MISSING_ERRMSG, NULL); gtk_tooltips_set_tip (tooltip, widgets->existing_guake_tab_named, GUAKE_INDICATOR_DBUS_GTKLABEL_MISSING_ERRMSG, NULL);*/ } else g_free(name); widgets->selected_host=(Host*)host; widgets->selected_hostgroup=NULL; if (((Host*)host)->label) { activate_label_sensitivity(widgets); } g_free(cmd); break; default: break; } } else { switch( gtk_tree_path_get_depth(path) ) { case 1: widgets->selected_hostgroup=(HostGroup*)host; widgets->selected_host=NULL; break; case 2: widgets->selected_host=(Host*)host; widgets->selected_hostgroup=NULL; break; } } } return TRUE; /* allow selection state to change */ } static void close_dialog ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; if (dialog->tree_store) g_object_unref (dialog->tree_store); set_selected_path(dialog,NULL); if (dialog->grouphostlist) grouphostlist_free(dialog->grouphostlist); gtk_widget_hide(GTK_WIDGET(dialog->window)); if (dialog->reset_flag) *dialog->reset_flag=FALSE; return ; } // Function behind remove button static void remove_edit_menu ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; switch (dialog->status) { case 0: if (dialog->selected_host) { Host* deletehost = dialog->selected_host; // Delete host in first position if (deletehost->previous==NULL) { deletehost->parent->hostarray=dialog->selected_host->next; host_free(dialog->selected_host); } else { deletehost->previous->next=dialog->selected_host->next; host_free(dialog->selected_host); } free(dialog->selected_host); write_and_reload(dialog,"Entry removed successfully"); } else { // Deny "root node" removal if (dialog->selected_hostgroup->title==NULL) { error_modal_box ("You can't remove the Root node"); return; } // Get the root grouphost guint count = 0; gint root_index=-1; HostGroup* iterator; while ( iterator = g_array_index (dialog->grouphostlist, HostGroup*, count)) { if (iterator->title==NULL) { root_index = get_grouphost_index(dialog->grouphostlist,iterator); break; } count++; } if (root_index>=0) { // Delete the open_all host Host* ptr; for (ptr=dialog->selected_hostgroup->hostarray;ptr;ptr=ptr->next) { if (ptr->next && ptr->next->open_all) { host_free(ptr->next); free(ptr->next); ptr->next=NULL; } } HostGroup* root = (HostGroup*)g_array_index (dialog->grouphostlist, HostGroup*, (guint)root_index); if (root->hostarray==NULL) root->hostarray=dialog->selected_hostgroup->hostarray; else { for (ptr=root->hostarray;ptr;ptr=ptr->next) { if (ptr->next==NULL) { ptr->next = dialog->selected_hostgroup->hostarray; break; } } } } guint index = get_grouphost_index(dialog->grouphostlist,dialog->selected_hostgroup); hostgroup_free(dialog->selected_hostgroup); g_array_remove_index(dialog->grouphostlist,index); free(dialog->selected_hostgroup); write_and_reload(dialog,"Entrygroup removed successfully"); } case 1: // cancel add group case 2: // cancel add host case 3: // cancel host label case 4 : // cancel group label set_widget_sensitivity(dialog,FALSE); unselect_treeview(dialog); set_new_widget_sensitivity(dialog,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Remove"); break; default: break; } dialog->status = STATUS_EDIT; } static void add_group ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; // clear all field, enable required field clear_widget(dialog); activate_grouphosts_sensitivity(dialog); unselect_treeview(dialog); // enable only save button gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host_label,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group_label,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Cancel"); dialog->status = STATUS_ADD_GROUP; } static void add_host ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; clear_widget(dialog); set_widget_sensitivity(dialog,FALSE); unselect_treeview(dialog); // enable only save button set_form_widget_sensitivity(dialog,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_export,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_import,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Cancel"); gtk_toggle_button_set_active( (GtkToggleButton *)dialog->new_guake_tab,1); // disable selection by tab name if the dbus interface is not read (guake has not been patched) gchar* name; if (guake_getgtktabname(0,&name)==FALSE) { gtk_widget_set_sensitive(dialog->existing_guake_tab_named,FALSE); gtk_widget_set_sensitive(dialog->named_guake_tab,FALSE); /*GtkTooltips *tooltip; tooltip = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltip, dialog->named_guake_tab,GUAKE_INDICATOR_DBUS_GTKLABEL_MISSING_ERRMSG, NULL); gtk_tooltips_set_tip (tooltip, dialog->existing_guake_tab_named, GUAKE_INDICATOR_DBUS_GTKLABEL_MISSING_ERRMSG, NULL);*/ } else g_free(name); dialog->status = STATUS_ADD_HOST; } static void add_group_label ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); // clear all field, enable required field clear_widget(dialog); activate_grouphosts_sensitivity(dialog); unselect_treeview(dialog); // enable only save button gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host_label,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group_label,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Cancel"); dialog->status = STATUS_ADD_GROUP_LABEL; } static void add_host_label ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); // clear all field, enable required field clear_widget(dialog); activate_grouphosts_sensitivity(dialog); unselect_treeview(dialog); // enable only save button gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host_label,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group_label,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Cancel"); dialog->status = STATUS_ADD_HOST_LABEL; } static void import (GtkWidget *widget, gpointer user_data) { EditMenuDialog* widgets = (EditMenuDialog*) user_data; GtkWidget *dialog; GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; gint res; dialog = gtk_file_chooser_dialog_new ("Open File", GTK_WINDOW(widgets->window), action, ("_Cancel"), GTK_RESPONSE_CANCEL, ("_Open"), GTK_RESPONSE_ACCEPT, NULL); res = gtk_dialog_run (GTK_DIALOG (dialog)); if (res == GTK_RESPONSE_ACCEPT) { char *filename; GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog); filename = gtk_file_chooser_get_filename (chooser); //open_file (filename); GArray* imported_hostlist = read_xml_cfg_file_from_file(filename); Host* imported_host=((HostGroup*)g_array_index(imported_hostlist,HostGroup*,0))->hostarray; if (GTK_IS_TEXT_VIEW((GtkTextView*)widgets->entry_command)) TEXTVIEW_SET_TEXT(GET_ENTRY_COMMAND(widgets),imported_host->command_after_login) if (GTK_IS_ENTRY((GtkEntry*)widgets->entry_tab_name)) ENTRY_SET_TEXT(GET_ENTRY_TABNAME(widgets),imported_host->tab_name); if (GTK_IS_ENTRY((GtkEntry*)widgets->entry_menu_name)) ENTRY_SET_TEXT(GET_ENTRY_MENUNAME(widgets),imported_host->menu_name); if (GTK_IS_TOGGLE_BUTTON((GtkToggleButton *)widgets->cb_show_guake)) if ( ((Host*)imported_host)->dont_show_guake && !strcmp(((Host*)imported_host)->dont_show_guake,"yes")) gtk_toggle_button_set_active( (GtkToggleButton *)widgets->cb_show_guake,1); else gtk_toggle_button_set_active( (GtkToggleButton *)widgets->cb_show_guake,0 ); if (GTK_IS_TOGGLE_BUTTON((GtkToggleButton *)widgets->lfcr)) if ( ((Host*)imported_host)->guakeindicatorscript && !strcmp(((Host*)imported_host)->guakeindicatorscript,"yes")) gtk_toggle_button_set_active( (GtkToggleButton *)widgets->guakeindicatorscript,1); else gtk_toggle_button_set_active( (GtkToggleButton *)widgets->guakeindicatorscript,0 ); gtk_toggle_button_set_active( (GtkToggleButton *)widgets->new_guake_tab,1); grouphostlist_free(imported_hostlist); g_free (filename); } gtk_widget_destroy (dialog); return ; } static void export ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* widgets = (EditMenuDialog*) user_data; GtkWidget *dialog; GtkFileChooser *chooser; GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; gint res; dialog = gtk_file_chooser_dialog_new ("Save File", GTK_WINDOW(widgets->window), action, ("_Cancel"), GTK_RESPONSE_CANCEL, ("_Save"), GTK_RESPONSE_ACCEPT, NULL); chooser = GTK_FILE_CHOOSER (dialog); gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE); gtk_file_chooser_set_current_name (chooser,(DEFAULT_EXPORT_FILENAME)); res = gtk_dialog_run (GTK_DIALOG (dialog)); if (res == GTK_RESPONSE_ACCEPT) { char *filename; Host* head; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); GArray* exportarrray = g_array_new (TRUE, FALSE, sizeof (HostGroup*)); HostGroup* hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); Host* newhost = create_new_host(hostgroup, head, widgets->selected_host->menu_name, widgets->selected_host->tab_name, widgets->selected_host->command_after_login, widgets->selected_host->dont_show_guake&&!strcasecmp((char*)widgets->selected_host->dont_show_guake,"yes")?TRUE:FALSE, NULL, FALSE, widgets->selected_host->lfcr&&!strcasecmp((char*)widgets->selected_host->lfcr,"yes")?TRUE:FALSE, widgets->selected_host->guakeindicatorscript&&!strcasecmp((char*)widgets->selected_host->guakeindicatorscript,"yes")?TRUE:FALSE, FALSE, FALSE); head=host_queue(head,newhost); hostgroup->hostarray=head; g_array_append_val (exportarrray, hostgroup); write_xml_cfg_file_from_file(exportarrray,filename); char* msg; if (asprintf(&msg,"Export to file %s complete",filename)==-1) { guake_notify("Guake indicator",msg); free(msg); } g_free (filename); } gtk_widget_destroy (dialog); } // Function to handle the edit button static void save_edit_menu ( GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; switch (dialog->status) { case STATUS_EDIT: // save edit item { // if root menu: if ( !g_strcmp0(dialog->selected_path,"0")) { error_modal_box ("You're not allowed to save root menu"); return; } if (!strlen((char*)gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog)))) { error_modal_box ("Menu name is blank"); return ; } // A host object has been selected so a Host* object will be updated if (dialog->selected_host) { // Only for backward compatibility UPDATE_ENTRY(dialog->selected_host->hostname,NULL) UPDATE_ENTRY(dialog->selected_host->login,NULL) UPDATE_ENTRY(dialog->selected_host->remote_command,NULL) UPDATE_ENTRY(dialog->selected_host->x_forwarded,NULL) UPDATE_ENTRY(dialog->selected_host->menu_name,gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog))) UPDATE_ENTRY(dialog->selected_host->tab_name,gtk_entry_get_text(GET_ENTRY_TABNAME(dialog))) gchar* text; GET_GTKVIEW_TEXT(GET_ENTRY_COMMAND(dialog),text) UPDATE_ENTRY(dialog->selected_host->command_after_login,text) g_free(text); UPDATE_ENTRY(dialog->selected_host->dont_show_guake,gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_SHOWGUAKE(dialog))?"yes":"no") if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETAB(dialog))) { UPDATE_ENTRY(dialog->selected_host->open_in_tab,gtk_entry_get_text(GET_ENTRY_NTHGUAKETAB(dialog))) dialog->selected_host->open_in_tab_named=FALSE; } else if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETABNAMED(dialog))) { UPDATE_ENTRY(dialog->selected_host->open_in_tab,gtk_entry_get_text(GET_ENTRY_NAMEDGUAKETAB(dialog))) dialog->selected_host->open_in_tab_named=TRUE; } else if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETABCURRENT(dialog))) { UPDATE_ENTRY(dialog->selected_host->open_in_tab,"-1") } else { dialog->selected_host->open_in_tab_named=FALSE; dialog->selected_host->open_in_tab=NULL; } UPDATE_ENTRY(dialog->selected_host->lfcr,gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_LFCR(dialog))?"yes":"no") UPDATE_ENTRY(dialog->selected_host->guakeindicatorscript,gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_GUAKEINDICATORSCRIPT(dialog))?"yes":"no") write_and_reload(dialog,"Entry saved successfully"); // if the "open in nth guake tab" option is selected i check if the dbus call to the tab counter succeed, if not i warn the user check_guake_get_tab_count(dialog); } // A hostgroup object has been selected so a Host* object will be updated else if (dialog->selected_hostgroup) { UPDATE_ENTRY(dialog->selected_hostgroup->title,gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog))) write_and_reload(dialog,"Entry saved successfully"); } else { error_modal_box("Entry or Entry group not selected"); } break; } case STATUS_ADD_GROUP_LABEL: case STATUS_ADD_GROUP: // add group { if (!strlen((char*)gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog)))) { error_modal_box ("Menu name is blank"); return ; } if (dialog->selected_hostgroup == NULL && dialog->grouphostlist->len ) { error_modal_box ("Select a group first. \nThe new group will be added after the selected group"); return; } // save new group gint groupindex = (dialog->grouphostlist->len ) ? get_grouphost_index(dialog->grouphostlist,dialog->selected_hostgroup) : -1; HostGroup* newhostgroup=malloc(sizeof(HostGroup)); bzero((void*)newhostgroup,sizeof(HostGroup)); sethostgroupcounterid(newhostgroup); newhostgroup->title=g_strdup((const gchar*)gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog))); if (dialog->status==STATUS_ADD_GROUP_LABEL) newhostgroup->label=TRUE; g_array_insert_val(dialog->grouphostlist,++groupindex,newhostgroup); if (dialog->status==STATUS_ADD_GROUP_LABEL) write_and_reload(dialog,"Label saved successfully"); else write_and_reload(dialog,"Group saved successfully"); set_widget_sensitivity(dialog,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host_label,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group_label,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Remove"); break; } case STATUS_ADD_HOST_LABEL: case STATUS_ADD_HOST: // add host { if (!strlen((char*)gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog)))) { error_modal_box ("Menu name is blank"); return ; } if (!dialog->grouphostlist->len) { error_modal_box ("Create a new group first."); return; } if (dialog->selected_hostgroup == NULL && dialog->selected_host == NULL) { error_modal_box ("Select a group or a host.The new host will be placed after the selected element"); return; } // check if the selected hostgroup is a label if (dialog->selected_hostgroup != NULL && dialog->selected_hostgroup->label) { error_modal_box ("Selected host group is a label"); return; } Host* newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->menu_name=strdup(gtk_entry_get_text(GET_ENTRY_MENUNAME(dialog))); if (dialog->status==STATUS_ADD_HOST_LABEL) newhost->label=TRUE; else { newhost->tab_name=strdup(gtk_entry_get_text(GET_ENTRY_TABNAME(dialog))); gchar* text; GET_GTKVIEW_TEXT(GET_ENTRY_COMMAND(dialog),text) newhost->command_after_login=g_strdup(text); g_free(text); if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_SHOWGUAKE(dialog))) newhost->dont_show_guake=strdup("yes"); if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETAB(dialog))) { newhost->open_in_tab_named=FALSE; newhost->open_in_tab=strdup(gtk_entry_get_text(GET_ENTRY_NTHGUAKETAB(dialog))); } else if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETABNAMED(dialog))) { newhost->open_in_tab_named=TRUE; newhost->open_in_tab=strdup(gtk_entry_get_text(GET_ENTRY_NAMEDGUAKETAB(dialog))); } else if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETABCURRENT(dialog))) { newhost->open_in_tab=strdup("-1"); } if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_LFCR(dialog))) newhost->lfcr=strdup("yes"); if (gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_GUAKEINDICATORSCRIPT(dialog))) newhost->guakeindicatorscript=strdup("yes"); } if (dialog->selected_hostgroup) { newhost->next=dialog->selected_hostgroup->hostarray; dialog->selected_hostgroup->hostarray=newhost; } else { if (dialog->selected_host->previous==NULL) { newhost->next=dialog->selected_host->parent->hostarray->next; dialog->selected_host->parent->hostarray->next=newhost; } else { newhost->next=dialog->selected_host->next; dialog->selected_host->next=newhost; } } write_and_reload(dialog,"Host saved successfully"); // if the "open in nth guake tab" option is selected i check if the dbus call to the tab counter succeed, if not i warn the user check_guake_get_tab_count(dialog); set_widget_sensitivity(dialog,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host_label,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group_label,TRUE); gtk_button_set_label(GTK_BUTTON(dialog->btn_edit_menu_remove), "Remove"); break; } default: break; } dialog->status = STATUS_EDIT; } // Function to set sensitivity of all entry data widget static void set_widget_sensitivity(EditMenuDialog* dialog,gboolean flag) { set_form_widget_sensitivity(dialog,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_export,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_import,flag); set_new_widget_sensitivity(dialog,flag); set_move_widget_sensitivity(dialog,flag); } static void set_form_widget_sensitivity(EditMenuDialog* dialog,gboolean flag) { gtk_widget_set_sensitive(dialog->entry_menu_name,flag); gtk_widget_set_sensitive(dialog->entry_tab_name,flag); gtk_widget_set_sensitive(dialog->entry_command,flag); gtk_widget_set_sensitive(dialog->cb_show_guake,flag); gtk_widget_set_sensitive(dialog->current_guake_tab,flag); gtk_widget_set_sensitive(dialog->new_guake_tab,flag); gtk_widget_set_sensitive(dialog->existing_guake_tab,flag); gtk_widget_set_sensitive(dialog->nth_guake_tab,flag); gtk_widget_set_sensitive(dialog->existing_guake_tab_named,flag); gtk_widget_set_sensitive(dialog->named_guake_tab,flag); gtk_widget_set_sensitive(dialog->lfcr,flag); gtk_widget_set_sensitive(dialog->guakeindicatorscript,flag); } static void set_new_widget_sensitivity(EditMenuDialog* dialog,gboolean flag) { gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_group_label,flag); gtk_widget_set_sensitive(dialog->btn_edit_menu_add_host_label,flag); } static void set_move_widget_sensitivity(EditMenuDialog* dialog,gboolean flag) { gtk_widget_set_sensitive(dialog->topButton,flag); gtk_widget_set_sensitive(dialog->upButton,flag); gtk_widget_set_sensitive(dialog->downButton,flag); gtk_widget_set_sensitive(dialog->bottomButton,flag); } static void activate_grouphosts_sensitivity(EditMenuDialog* dialog) { set_widget_sensitivity(dialog,FALSE); gtk_widget_set_sensitive(dialog->entry_menu_name,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,TRUE); } static void activate_label_sensitivity(EditMenuDialog* dialog) { set_form_widget_sensitivity(dialog,FALSE); gtk_widget_set_sensitive(dialog->entry_menu_name,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_save,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_remove,TRUE); gtk_widget_set_sensitive(dialog->btn_edit_menu_export,FALSE); gtk_widget_set_sensitive(dialog->btn_edit_menu_import,FALSE); } static void clear_widget(EditMenuDialog* dialog) { ENTRY_SET_TEXT(GET_ENTRY_MENUNAME(dialog),NULL) ENTRY_SET_TEXT(GET_ENTRY_TABNAME(dialog),NULL) TEXTVIEW_SET_TEXT(GET_ENTRY_COMMAND(dialog),"") gtk_toggle_button_set_active(GET_ENTRY_SHOWGUAKE(dialog),0); gtk_toggle_button_set_active(GET_ENTRY_LFCR(dialog),0); gtk_toggle_button_set_active(GET_ENTRY_GUAKEINDICATORSCRIPT(dialog),0); } static void unselect_treeview(EditMenuDialog* dialog) { // unselect all gtk_tree_selection_unselect_all (gtk_tree_view_get_selection(GTK_TREE_VIEW (dialog->tree_view))); set_selected_path(dialog,NULL); dialog->selected_hostgroup = NULL; dialog->selected_host = NULL; } gchar* get_guake_cmd(Host* host) { gchar* cmd = NULL; // set x_forwarded flag gchar* x_forwarded_flag; if (host->x_forwarded==NULL || g_strcmp0(host->x_forwarded,"yes")) x_forwarded_flag=g_strdup(""); else x_forwarded_flag=g_strdup(" -X "); // get the command if (host->hostname == NULL || !strlen((char*)host->hostname)) cmd = g_strjoin(NULL,host->command_after_login!=NULL?host->command_after_login:"",NULL); else if (host->command_after_login==NULL || !strlen((char*)host->command_after_login)) cmd = g_strjoin(NULL,"ssh"," -l ",host->login," ",host->hostname,NULL); else { if (host->remote_command==NULL || g_strcmp0(host->remote_command,"yes")) cmd = g_strjoin(NULL,"ssh",x_forwarded_flag," -t -l ",host->login," ",host->hostname," '",host->command_after_login,";/bin/bash'",NULL); else cmd = g_strjoin(NULL,"ssh",x_forwarded_flag," -t -l ",host->login," ",host->hostname," ",host->command_after_login,NULL); } g_free(x_forwarded_flag); return cmd; } guint get_grouphost_index(GArray* grouphostlist,HostGroup* hostgroup) { guint count = 0; HostGroup* iterator; while ( iterator = g_array_index (grouphostlist, HostGroup*, count)) { if (!g_strcmp0(iterator->id,hostgroup->id)) return count; count++; } return -1; } guint get_grouphost_size(GArray* grouphostlist) { guint count = 0; HostGroup* iterator; while ( iterator = g_array_index (grouphostlist, HostGroup*, count)) { count++; } return count; } void reload_model_view(EditMenuDialog *dialog) { GtkTreeIter iter; GtkTreeIter iter2; dialog->tree_store = gtk_tree_store_new(N_COLUMNS, G_TYPE_POINTER,GDK_TYPE_PIXBUF,G_TYPE_STRING); gtk_tree_store_clear(GTK_TREE_STORE(dialog->tree_store)); int j=0; for (j=0;dialog->grouphostlist!=NULL && jgrouphostlist->len;j++) { HostGroup* hostgroup = g_array_index (dialog->grouphostlist, HostGroup* , j); gtk_tree_store_append(dialog->tree_store, &iter, NULL); GdkPixbuf* icon; if (hostgroup->label) icon=dialog->labelicon; else icon=dialog->hostgroupicon; gtk_tree_store_set (dialog->tree_store, &iter, ID_COLUMN,(gpointer*)hostgroup, COL_ICON, icon, NAME_COLUMN, hostgroup->title!=NULL?hostgroup->title:"Root node", -1); Host* ptr=NULL; for (ptr=hostgroup->hostarray;ptr;ptr=ptr->next) { if (ptr->open_all==TRUE) continue; gtk_tree_store_append(dialog->tree_store, &iter2, &iter); if (ptr->label) icon=dialog->labelicon; else icon=dialog->hosticon; gtk_tree_store_set (dialog->tree_store, &iter2, ID_COLUMN,(gpointer*)ptr, COL_ICON, icon, NAME_COLUMN,ptr->menu_name, -1); } } gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->tree_view), GTK_TREE_MODEL (dialog->tree_store)); /* Tell the theme engine we would like differentiated row colour */ //gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(dialog->tree_view),TRUE); //dialog->tree_view->set_rules_hint(TRUE); // TODO expand and select row if (dialog->selected_path !=NULL) { GtkTreeSelection *sel; GtkTreePath *path; sel = gtk_tree_view_get_selection(GTK_TREE_VIEW (dialog->tree_view)); path = gtk_tree_path_new_from_string(dialog->selected_path); if (gtk_tree_path_get_depth(path)>1) { // expand gtk_tree_view_expand_to_path (GTK_TREE_VIEW (dialog->tree_view), path); } gtk_tree_selection_select_path(sel, path); gtk_tree_path_free(path); } unselect_treeview(dialog); set_widget_sensitivity(dialog,FALSE); set_new_widget_sensitivity(dialog,TRUE); } void move_down(GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; // Moving a host if (dialog->selected_host) { //If the host is the last element i can't move it down if (dialog->selected_host->next==NULL || dialog->selected_host->next->open_all ) return; Host* nexthost=dialog->selected_host->next; if (dialog->selected_host->previous==NULL) { dialog->selected_host->next=nexthost->next; dialog->selected_host->parent->hostarray=nexthost; nexthost->next=dialog->selected_host; } else { dialog->selected_host->next=nexthost->next; dialog->selected_host->previous->next=nexthost; nexthost->next=dialog->selected_host; } write_and_reload(dialog,"Entry moved down successfully"); } // Hostgroup movedown else { // Get the new hostgroup reference, if it doesn't exist we are at the end so i exit guint index=get_grouphost_index(dialog->grouphostlist,dialog->selected_hostgroup); if (index+1>=get_grouphost_size(dialog->grouphostlist)) return; g_array_insert_val(dialog->grouphostlist,index+2,dialog->selected_hostgroup); g_array_remove_index(dialog->grouphostlist,index); write_and_reload(dialog,"Entry moved down successfully"); } } void move_up(GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; // Moving a host if (dialog->selected_host) { //If the host is the first element i can't move it up if (dialog->selected_host->previous==NULL || dialog->selected_host->previous->open_all ) return; Host* previoushost=dialog->selected_host->previous; if (previoushost->previous==NULL) { dialog->selected_host->parent->hostarray=dialog->selected_host; previoushost->next=dialog->selected_host->next; dialog->selected_host->next=previoushost; } else { previoushost->previous->next=dialog->selected_host; previoushost->next=dialog->selected_host->next; dialog->selected_host->next=previoushost; } write_and_reload(dialog,"Entry moved up successfully"); } // Hostgroup movedown else { // Get the new hostgroup reference, if it doesn't exist we are at the end so i exit guint index=get_grouphost_index(dialog->grouphostlist,dialog->selected_hostgroup); if (index<=0) return ; g_array_insert_val(dialog->grouphostlist,index-1,dialog->selected_hostgroup); g_array_remove_index(dialog->grouphostlist,index+1); write_and_reload(dialog,"Entrygroup moved up successfully"); } } // move a host or hostgroup on the bottom of the list void move_bottom(GtkWidget *widget, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; // Moving a host if (dialog->selected_host) { //If the host is the last element i can't move it down if (dialog->selected_host->next==NULL || dialog->selected_host->next->open_all ) return; Host* lasthost=dialog->selected_host; while (lasthost->next && lasthost->next->open_all==FALSE) { lasthost=lasthost->next; } if (lasthost==dialog->selected_host) return ; if (dialog->selected_host->previous==NULL) dialog->selected_host->parent->hostarray=dialog->selected_host->next; else dialog->selected_host->previous->next=dialog->selected_host->next; Host* ptr=lasthost->next; lasthost->next=dialog->selected_host; dialog->selected_host->next=ptr; write_and_reload(dialog,"Entry moved bottom successfully"); } else { // Get the new hostgroup reference, if it doesn't exist we are at the end so i exit guint index=get_grouphost_index(dialog->grouphostlist,dialog->selected_hostgroup); if (index+1>=get_grouphost_size(dialog->grouphostlist)) return; g_array_insert_val(dialog->grouphostlist,get_grouphost_size(dialog->grouphostlist),dialog->selected_hostgroup); g_array_remove_index(dialog->grouphostlist,index); write_and_reload(dialog,"Entrygroup moved down successfully"); } } // expand a treeview static void expand(GtkWidget *widget,GdkEvent *event,gpointer user_data ) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; gtk_tree_view_expand_all( GTK_TREE_VIEW(dialog->tree_view)); } // collapse a treeview static void collapse(GtkWidget *widget,GdkEvent *event,gpointer user_data ) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; gtk_tree_view_collapse_all(GTK_TREE_VIEW(dialog->tree_view)); } // move a host or hostgroup on top of the list void move_top(GtkWidget *widget, gpointer user_data ) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; // Moving a host if (dialog->selected_host) { //If the host is the first element i can't move it up if (dialog->selected_host->previous==NULL || dialog->selected_host->previous->open_all ) return; dialog->selected_host->previous->next=dialog->selected_host->next; dialog->selected_host->next=dialog->selected_host->parent->hostarray; dialog->selected_host->parent->hostarray=dialog->selected_host; write_and_reload(dialog,"Entry moved top successfully"); } else { // Get the new hostgroup reference, if it doesn't exist we are at the end so i exit guint index=get_grouphost_index(dialog->grouphostlist,dialog->selected_hostgroup); if (index<=0) return ; g_array_insert_val(dialog->grouphostlist,0,dialog->selected_hostgroup); g_array_remove_index(dialog->grouphostlist,index+1); write_and_reload(dialog,"Entrygroup moved top successfully"); } } // Write the current configuration to a file (json and xml), print a message, //reload the configuration from the file and reload the model view for the treeview void write_and_reload(EditMenuDialog* dialog,const char* msg) { dialog->copied_host=NULL; dialog->copied_hostgroup=NULL; write_cfg_file(dialog->grouphostlist); write_xml_cfg_file(dialog->grouphostlist); error_modal_box (msg); refresh_indicator(dialog->user_data); grouphostlist_free(dialog->grouphostlist); if (customConfFile) dialog->grouphostlist=read_xml_cfg_file_from_file(customConfFile); else dialog->grouphostlist=read_xml_cfg_file(); reload_model_view(dialog); } // Get all the plugin files into ~/.guake-indicator/plugins GArray* get_custom_glade_files() { char* plugindir; char* pluginpath; GArray* res=g_array_new (TRUE, FALSE, sizeof (char*)); plugindir=checkandcreatedefaultdir(); if (asprintf(&pluginpath,"%s/%s",plugindir,GUAKE_INDICATOR_PLUGIN_DIR)==-1) return NULL; DIR* dir = opendir(pluginpath); free(pluginpath); free(plugindir); if (dir) { struct dirent* de = 0; while ((de = readdir(dir)) != 0) { if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue; if ((rindex(de->d_name,'.') && !strcmp(rindex(de->d_name,'.'),".glade")) || (rindex(de->d_name,'.') && !strcmp(rindex(de->d_name,'.'),".xml"))) { char* filename=strdup(de->d_name); g_array_append_val(res,filename); } } } closedir(dir); return res; } // Selection funct for the select glade file treeview gboolean gladefile_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata) { gpointer* item; GtkTreeIter iter; EditMenuDialog* widgets = (EditMenuDialog*)userdata; if (gtk_tree_model_get_iter(model, &iter, path)) { gtk_tree_model_get(model, &iter, 0, &item, -1); widgets->selected_glade_file=g_strdup((gchar*)item); g_free(item); } return TRUE; } static void drag_begin_handl (GtkWidget *widget, GdkDragContext *context, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; GtkTreeIter iter; GtkTreeModel *list_store; gpointer* generic_data; GtkTreeSelection *selector; if (dialog->status!=STATUS_EDIT) return ; selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); gtk_tree_selection_get_selected(selector,&list_store,&iter); gtk_tree_model_get(GTK_TREE_MODEL(dialog->tree_store), &iter, ID_COLUMN, &generic_data, -1); GtkTreePath * path = gtk_tree_model_get_path (GTK_TREE_MODEL(dialog->tree_store),&iter); if (gtk_tree_path_get_depth(path)==1) { dialog->starthostgroupdrag = (HostGroup*) generic_data; dialog->starthostdrag = NULL; } else { dialog->starthostgroupdrag = NULL ; dialog->starthostdrag = (Host*) generic_data; } gtk_tree_view_set_grid_lines(GTK_TREE_VIEW(widget),GTK_TREE_VIEW_GRID_LINES_BOTH); gtk_tree_path_free(path); } static gboolean drag_motion_handl (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint t,gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; GtkTreeIter iter; GtkTreePath *path; GtkTreeSelection *select; gpointer* generic_data; static int scrolly=0; if (dialog->status!=STATUS_EDIT) return FALSE; gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y-25, &path, 0, 0, 0); if (path==NULL) return FALSE; select = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)); gtk_tree_selection_select_path (select, path); gtk_tree_model_get_iter (GTK_TREE_MODEL(dialog->tree_store),&iter,path); gtk_tree_model_get(GTK_TREE_MODEL(dialog->tree_store), &iter, ID_COLUMN, &generic_data, -1); if (gtk_tree_path_get_depth(path)==1) { if (dialog->starthostdrag && gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget),path)==FALSE) { gtk_tree_view_expand_row (GTK_TREE_VIEW (widget),path,FALSE); } dialog->endhostgroupdrag = (HostGroup*) generic_data; dialog->endhostdrag = NULL; } else if (gtk_tree_path_get_depth(path)==2) { dialog->endhostgroupdrag = NULL ; dialog->endhostdrag = (Host*) generic_data; } if (y>300) { if (scrolly<300) gtk_tree_view_scroll_to_point (GTK_TREE_VIEW (widget),0,scrolly+=15); } else if (y<30) { if (scrolly>0) gtk_tree_view_scroll_to_point (GTK_TREE_VIEW (widget),0,scrolly-=15); } gtk_tree_path_free (path); return TRUE; } static void drag_end_handl (GtkWidget *widget, GdkDragContext *context, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; gtk_tree_view_set_grid_lines(GTK_TREE_VIEW(widget),0); if (dialog->status!=STATUS_EDIT) return ; // Move an hostgroup after another if (dialog->starthostgroupdrag!=NULL && dialog->endhostgroupdrag && dialog->starthostgroupdrag!=dialog->endhostgroupdrag) { guint indexstart=get_grouphost_index(dialog->grouphostlist,dialog->starthostgroupdrag); guint indexend=get_grouphost_index(dialog->grouphostlist,dialog->endhostgroupdrag); if (indexstart-1==indexend) return; g_array_insert_val(dialog->grouphostlist,indexend+1,dialog->starthostgroupdrag); if (indexend>indexstart) g_array_remove_index(dialog->grouphostlist,indexstart); else g_array_remove_index(dialog->grouphostlist,indexstart+1); write_and_reload(dialog,"Entrygroup moved successfully"); } // Move an host after another else if (dialog->starthostdrag!=NULL && dialog->endhostdrag!=NULL && dialog->starthostdrag!=dialog->endhostdrag && dialog->starthostdrag->previous!=dialog->endhostdrag) { Host* ptr = dialog->endhostdrag->next; if (dialog->starthostdrag->previous==NULL) dialog->starthostdrag->parent->hostarray=dialog->starthostdrag->next; else dialog->starthostdrag->previous->next=dialog->starthostdrag->next; dialog->endhostdrag->next=dialog->starthostdrag; dialog->starthostdrag->next=ptr; write_and_reload(dialog,"Entry moved successfully"); } // Move an host in first position of a hostgroup else if (dialog->starthostdrag!=NULL && dialog->endhostgroupdrag!=NULL && dialog->endhostgroupdrag->label==FALSE) { if (dialog->starthostdrag->previous==NULL) dialog->starthostdrag->parent->hostarray=dialog->starthostdrag->next; else dialog->starthostdrag->previous->next=dialog->starthostdrag->next; dialog->starthostdrag->next=dialog->endhostgroupdrag->hostarray; dialog->endhostgroupdrag->hostarray=dialog->starthostdrag; write_and_reload(dialog,"Entry moved successfully"); } } void clear_gtkentry (GtkEntry* entry,GtkEntryIconPosition icon_pos,GdkEvent *event,gpointer user_data) { gtk_entry_set_text( entry, "" ); } // Expand/collapse a hostgroup when the right/left key is pressed gboolean on_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { EditMenuDialog* dialog = (EditMenuDialog*) user_data; GtkTreePath *path; switch (event->keyval) { case GDK_KEY_Right: path = gtk_tree_path_new_from_string (dialog->selected_path); gtk_tree_view_expand_row (GTK_TREE_VIEW(dialog->tree_view),path,FALSE); gtk_tree_path_free (path); break; case GDK_KEY_Left: path = gtk_tree_path_new_from_string (dialog->selected_path); gtk_tree_view_collapse_row (GTK_TREE_VIEW(dialog->tree_view),path); gtk_tree_path_free (path); break; } return FALSE; } // Manage ctrl+s for save host gboolean manage_ctrl_s (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { switch (event->keyval) { case GDK_KEY_S: case GDK_KEY_s: if (event->state & GDK_CONTROL_MASK) { save_edit_menu ( NULL,user_data); } break; } return FALSE; } void set_selected_path(EditMenuDialog* widgets,gchar* value) { if (widgets->selected_path) { g_free(widgets->selected_path); } if (value) widgets->selected_path=g_strdup(value); else widgets->selected_path=NULL; return ; } // check if guake_tab_count dbus interface is available, if not a warning pops up void check_guake_get_tab_count(EditMenuDialog* dialog) { gint32 numtabs; if ((gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETAB(dialog)) || gtk_toggle_button_get_active((GtkToggleButton*)GET_ENTRY_EXISTINGGUAKETABNAMED(dialog))) && guake_gettabcount(&numtabs)==FALSE) { char msg[1000]; sprintf(msg,"Guake indicator detected a Guake version prior to 0.4.5 (dbus call to get_tab_count failed), it's very likely that this host will be opened in a new tab instead of reusing tab number %s.\nI suggest you upgrading Guake to version 0.4.5 or higher to use this feature",gtk_entry_get_text(GET_ENTRY_NTHGUAKETAB(dialog))); error_modal_box(msg); } } gboolean view_onButtonPressed (GtkWidget *treeview, GdkEventButton *event, gpointer userdata) { EditMenuDialog* dialog = (EditMenuDialog*) userdata; gpointer host; GtkTreeIter iter; if (dialog->status!=STATUS_EDIT) return FALSE; /* 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)); 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_model_get_iter(GTK_TREE_MODEL (dialog->tree_store), &iter, path); gtk_tree_model_get(GTK_TREE_MODEL (dialog->tree_store), &iter, ID_COLUMN, &host, -1); switch( gtk_tree_path_get_depth(path) ) { case 1: dialog->selected_hostgroup_for_operation=(HostGroup*)host; dialog->selected_host_for_operation=NULL; break; case 2: dialog->selected_host_for_operation=(Host*)host; dialog->selected_hostgroup_for_operation=NULL; break; } gtk_tree_selection_select_path(selection, path); gtk_tree_path_free(path); } view_popup_menu(treeview, event, userdata); } return FALSE; } void view_popup_menu (GtkWidget *treeview, GdkEventButton *event, gpointer userdata) { EditMenuDialog* dialog = (EditMenuDialog*) userdata; GtkWidget *menu, *copy,*cut,*paste; menu = gtk_menu_new(); copy = gtk_menu_item_new_with_label("Copy"); cut = gtk_menu_item_new_with_label("Cut"); paste = gtk_menu_item_new_with_label("Paste"); // set widget sensitivity gtk_widget_set_sensitive(GTK_WIDGET(paste),dialog->copied_host||dialog->copied_hostgroup?TRUE:FALSE); g_signal_connect(copy, "activate",(GCallback) view_popup_menu_oncopy, userdata); g_signal_connect(cut, "activate",(GCallback) view_popup_menu_oncut, userdata); g_signal_connect(paste, "activate",(GCallback) view_popup_menu_onpaste, userdata); if (dialog->selected_hostgroup_for_operation==NULL) { gtk_menu_shell_append(GTK_MENU_SHELL(menu), copy); gtk_menu_shell_append(GTK_MENU_SHELL(menu), cut); } gtk_menu_shell_append(GTK_MENU_SHELL(menu), paste); gtk_widget_show_all(menu); //gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,(event != NULL) ? event->button : 0,event->time); gtk_menu_popup_at_widget (GTK_MENU (menu), menu, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, (GdkEvent *)event); } // Callback function of copy operations void view_popup_menu_oncopy (GtkWidget *menuitem, gpointer userdata) { EditMenuDialog* dialog = (EditMenuDialog*) userdata; dialog->type_operation=TRUE; view_popup_menu_onperformcutcopyaction (menuitem,userdata); } // Callback function of cut operations void view_popup_menu_oncut (GtkWidget *menuitem, gpointer userdata) { EditMenuDialog* dialog = (EditMenuDialog*) userdata; dialog->type_operation=FALSE; view_popup_menu_onperformcutcopyaction (menuitem,userdata); } void view_popup_menu_onperformcutcopyaction (GtkWidget *menuitem, gpointer userdata) { EditMenuDialog* dialog = (EditMenuDialog*) userdata; if (dialog->selected_host_for_operation) { dialog->copied_host=dialog->selected_host_for_operation; gchar* message=g_strjoin(NULL,"Menu item ",dialog->copied_host->menu_name," stored into the clipboard",NULL); guake_notify("Guake indicator",message ); g_free(message); } else if (dialog->selected_hostgroup_for_operation) { dialog->copied_hostgroup=dialog->selected_hostgroup_for_operation; gchar* message=g_strjoin(NULL,"Menu ",dialog->copied_host->menu_name," stored into the clipboard",NULL); guake_notify("Guake indicator",message ); g_free(message); } else if (dialog->type_operation) error_modal_box("Nothing to copy"); else error_modal_box("Nothing to cut"); } void view_popup_menu_onpaste (GtkWidget *menuitem, gpointer userdata) { EditMenuDialog* dialog = (EditMenuDialog*) userdata; // Manage the copy and paste (duplicate element) if (dialog->type_operation==TRUE) { // Manage the host copy if (dialog->copied_host) { // Create a new host based on the copied element Host*newhost=create_new_host(NULL, NULL, dialog->copied_host->menu_name,dialog->copied_host->tab_name,dialog->copied_host->command_after_login, dialog->copied_host->dont_show_guake&&!strcasecmp(dialog->copied_host->dont_show_guake,"yes")?TRUE:FALSE, dialog->copied_host->open_in_tab, dialog->copied_host->label, dialog->copied_host->lfcr&&!strcasecmp(dialog->copied_host->lfcr,"yes")?TRUE:FALSE, dialog->copied_host->guakeindicatorscript&&!strcasecmp(dialog->copied_host->guakeindicatorscript,"yes")?TRUE:FALSE, dialog->copied_host->open_in_tab_named, FALSE); // Host after another host if (dialog->selected_host_for_operation) { newhost->parent=dialog->selected_host_for_operation->parent; newhost->group_head=dialog->selected_host_for_operation->group_head; newhost->next=dialog->selected_host_for_operation->next; dialog->selected_host_for_operation->next=newhost; write_and_reload(dialog,"Entry copied successfully"); } //Host as a first element of a group else if (dialog->selected_hostgroup_for_operation) { newhost->parent=dialog->selected_hostgroup_for_operation; newhost->group_head=newhost; newhost->next=dialog->selected_hostgroup_for_operation->hostarray; dialog->selected_hostgroup_for_operation->hostarray=newhost; write_and_reload(dialog,"Host copied successfully"); } else error_modal_box("Nothing to paste"); } // Manage the hostgroup copy (not implemented because probably useless) /*else { }*/ } // Manage the cut and paste else { if (dialog->copied_host) { // Host after another host if (dialog->selected_host_for_operation) { Host* ptr = dialog->selected_host_for_operation->next; if (dialog->copied_host->previous==NULL) dialog->copied_host->parent->hostarray=dialog->copied_host->next; else dialog->copied_host->previous->next=dialog->copied_host->next; dialog->selected_host_for_operation->next=dialog->copied_host; dialog->copied_host->next=ptr; write_and_reload(dialog,"Entry cut successfully"); } //Host as a first element of a group else if (dialog->selected_hostgroup_for_operation) { if (dialog->copied_host->previous==NULL) dialog->copied_host->parent->hostarray=dialog->copied_host->next; else dialog->copied_host->previous->next=dialog->copied_host->next; dialog->copied_host->next=dialog->selected_hostgroup_for_operation->hostarray; dialog->selected_hostgroup_for_operation->hostarray=dialog->copied_host; write_and_reload(dialog,"Entry moved successfully"); } else error_modal_box("Nothing to paste"); } } } gboolean view_onPopupMenu (GtkWidget *treeview, gpointer userdata) { view_popup_menu(treeview, NULL, userdata); return TRUE; } guake-indicator-1.4.5/src/guake-indicator-edit-menu.h000066400000000000000000000165341377654103700225100ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #ifndef _GUAKE_INDICATOR_EDIT_MENU_H #define _GUAKE_INDICATOR_EDIT_MENU_H #define DND_DISABLED TRUE #include #include #include #include enum { ID_COLUMN, COL_ICON, NAME_COLUMN, N_COLUMNS }; enum { STATUS_EDIT, STATUS_ADD_GROUP, STATUS_ADD_HOST, STATUS_ADD_HOST_LABEL, STATUS_ADD_GROUP_LABEL, }; #define HOSTGROUP 1 #define HOST 2 #define GUAKE_INDICATOR_DATADIR "/guake-indicator" #define GUAKE_INDICATOR_PLUGIN_MANAGER "/guake-indicator-plugin-manager" #define GUAKE_INDICATOR_DBUS_GTKLABEL_MISSING_ERRMSG "Patch Guake to enable this feature: see http://guake-indicator.ozzyboshi.com/index.html#findtabbynameissue" #define ENTRY_SET_TEXT(var,var2) gtk_entry_set_text(var,var2?var2:""); #define TEXTVIEW_SET_TEXT(var,var2) gtk_text_buffer_set_text(gtk_text_view_get_buffer (var),var2?var2:"",strlen((char*)var2)); // get entry definitions #define GET_ENTRY_MENUNAME(var) (GtkEntry*)var->entry_menu_name #define GET_ENTRY_TABNAME(var) (GtkEntry*)var->entry_tab_name #define GET_ENTRY_COMMAND(var) (GtkTextView*)var->entry_command #define GET_ENTRY_SHOWGUAKE(var) (GtkToggleButton*)var->cb_show_guake #define GET_ENTRY_EXISTINGGUAKETAB(var) (GtkToggleButton*)var->existing_guake_tab #define GET_ENTRY_EXISTINGGUAKETABNAMED(var) (GtkToggleButton*)var->existing_guake_tab_named #define GET_ENTRY_EXISTINGGUAKETABCURRENT(var) (GtkToggleButton*)var->current_guake_tab #define GET_ENTRY_NTHGUAKETAB(var) (GtkEntry*)var->nth_guake_tab #define GET_ENTRY_NAMEDGUAKETAB(var) (GtkEntry*)var->named_guake_tab #define GET_ENTRY_LFCR(var) (GtkToggleButton*)var->lfcr #define GET_ENTRY_GUAKEINDICATORSCRIPT(var) (GtkToggleButton*)var->guakeindicatorscript #define GET_GTKVIEW_TEXT(var,var2) GtkTextIter start, end;\ GtkTextBuffer *buffer = gtk_text_view_get_buffer (var);\ gtk_text_buffer_get_bounds (buffer, &start, &end);\ var2 = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); // update entry definitions #define UPDATE_ENTRY(var,var2) g_free(var);\ var=g_strdup(var2); #define DEFAULT_EXPORT_FILENAME "Untitled document.xml" typedef struct edit_menu_dialog_type { // main window GtkWidget *window; // entries GtkWidget *entry_menu_name; GtkWidget *entry_tab_name; GtkWidget *entry_command; // checkboxes and radiobox GtkWidget *cb_show_guake; GtkWidget *current_guake_tab; GtkWidget *new_guake_tab; GtkWidget *existing_guake_tab; GtkWidget *nth_guake_tab; GtkWidget *existing_guake_tab_named; GtkWidget *named_guake_tab; GtkWidget *lfcr; GtkWidget *guakeindicatorscript; // buttons GtkWidget *btn_edit_menu_save; GtkWidget *btn_edit_menu_remove; GtkWidget *btn_edit_menu_add_group; GtkWidget *btn_edit_menu_add_host; GtkWidget *btn_edit_menu_add_host_label; GtkWidget *btn_edit_menu_add_group_label; GtkWidget *btn_edit_menu_export; GtkWidget *btn_edit_menu_import; GtkWidget *topButton; GtkWidget *upButton; GtkWidget *downButton; GtkWidget *bottomButton; GtkWidget *btn_edit_menu_close_dialog; GArray* hbox; // selection data Host* selected_host; HostGroup* selected_hostgroup; gchar* selected_glade_file; // selection data for copy cut and paste operations Host* selected_host_for_operation; HostGroup* selected_hostgroup_for_operation; gboolean type_operation; // true = copy false = cut Host* copied_host; HostGroup* copied_hostgroup; gchar * selected_path; // treestore GtkTreeStore *tree_store; GtkWidget *tree_view; // action status gint status; gboolean* reset_flag; //Cfg file data GArray* grouphostlist; GtkAction* action; gpointer user_data; //Icons GdkPixbuf *labelicon; GdkPixbuf *hosticon; GdkPixbuf *hostgroupicon; //Drag data HostGroup* starthostgroupdrag; Host* starthostdrag; HostGroup* endhostgroupdrag; Host* endhostdrag; } EditMenuDialog; GArray* get_custom_glade_files(); static void build_cmd ( GtkWidget *, gpointer); static void close_dialog ( GtkWidget *, gpointer ); static void save_edit_menu ( GtkWidget *, gpointer ); static void remove_edit_menu ( GtkWidget *, gpointer ); static void add_group ( GtkWidget *, gpointer ); static void add_host ( GtkWidget *, gpointer ); static void add_host_label ( GtkWidget *, gpointer); static void add_group_label ( GtkWidget *, gpointer); static void export ( GtkWidget *, gpointer); static void import ( GtkWidget *, gpointer); static void populate_dialog(gpointer); static void set_widget_sensitivity(EditMenuDialog*,gboolean); static void set_form_widget_sensitivity(EditMenuDialog*,gboolean); static void activate_grouphosts_sensitivity(EditMenuDialog*); static void activate_label_sensitivity(EditMenuDialog*); static void clear_widget(EditMenuDialog*); static void set_new_widget_sensitivity(EditMenuDialog* ,gboolean); static void set_move_widget_sensitivity(EditMenuDialog* ,gboolean ); static void unselect_treeview(EditMenuDialog*); void write_and_reload(EditMenuDialog*,const char* ); gboolean selection_func (GtkTreeSelection *, GtkTreeModel *, GtkTreePath *,gboolean, gpointer); gboolean gladefile_selection_func (GtkTreeSelection *, GtkTreeModel *, GtkTreePath *, gboolean, gpointer); gchar* get_guake_cmd(Host*); guint get_grouphost_index(GArray*,HostGroup*); guint get_grouphost_size(GArray* grouphostlist); void reload_model_view(EditMenuDialog *dialog); static void move_top(GtkWidget *, gpointer ); static void move_up(GtkWidget *, gpointer ); static void move_down(GtkWidget *, gpointer ); static void move_bottom(GtkWidget *, gpointer ); static void expand(GtkWidget *, GdkEvent*,gpointer ); static void collapse(GtkWidget *, GdkEvent*,gpointer ); static gboolean drag_motion_handl (GtkWidget *, GdkDragContext *, gint , gint , guint ,gpointer ); static void drag_begin_handl(GtkWidget *, GdkDragContext *, gpointer ); static void drag_end_handl (GtkWidget *, GdkDragContext *, gpointer ); void view_onRowActivated (GtkTreeView* ,GtkTreePath* ,GtkTreeViewColumn *,gpointer); gboolean view_onButtonPressed (GtkWidget *, GdkEventButton *, gpointer ); void view_popup_menu (GtkWidget *, GdkEventButton *, gpointer ); void view_popup_menu_oncopy (GtkWidget *, gpointer); void view_popup_menu_onpaste (GtkWidget *, gpointer); void view_popup_menu_oncut (GtkWidget *, gpointer); void view_popup_menu_onperformcutcopyaction (GtkWidget *, gpointer); gboolean view_onPopupMenu (GtkWidget *, gpointer); void clear_gtkentry (GtkEntry* ,GtkEntryIconPosition ,GdkEvent *,gpointer); gboolean on_key_press (GtkWidget *, GdkEventKey *, gpointer ); gboolean manage_ctrl_s (GtkWidget *, GdkEventKey *, gpointer ); void set_selected_path(EditMenuDialog*,gchar*); void check_guake_get_tab_count(EditMenuDialog*); #endif /* _GUAKE_INDICATOR_EDIT_MENU_H */guake-indicator-1.4.5/src/guake-indicator-notify.c000066400000000000000000000036031377654103700221150ustar00rootroot00000000000000/* Copyright (C) 2013-2015 Alessio Garzi Copyright (C) 2013-2015 Francesco Minà 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. */ #include #include int guake_notify(gchar* title,gchar* message ) { void *handle, *n; typedef void (*notify_init_t)(char *); typedef void *(*notify_notification_new_t)( char *, char *, char *, char *); typedef void (*notify_notification_set_timeout_t)( void *, int ); typedef void (*notify_notification_show_t)(void *, char *); handle= dlopen(LIBNOTIFY_SHARED_OBJECT, RTLD_LAZY); if (handle==NULL) return -1; notify_init_t init = (notify_init_t)dlsym(handle, "notify_init"); if (init==NULL) { dlclose(handle); return -1; } init("Basics"); notify_notification_new_t notification_function_ptr = (notify_notification_new_t)dlsym(handle, "notify_notification_new"); if (notification_function_ptr==NULL) { dlclose(handle); return -1; } n = notification_function_ptr(title, message, DATADIR"/"GUAKE_INDICATOR_ICON_DIR"/guake-indicator.png", NULL); notify_notification_show_t show = (notify_notification_show_t)dlsym(handle, "notify_notification_show"); if (show==NULL) { dlclose( handle ); return 1; } show(n, NULL ); return 0; } guake-indicator-1.4.5/src/guake-indicator-notify.h000066400000000000000000000020601377654103700221160ustar00rootroot00000000000000/* Copyright (C) 2013-2018 Alessio Garzi Copyright (C) 2013-2018 Francesco Minà 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. */ #ifndef _GUAKE_INDICATOR_NOTIFY_H #define _GUAKE_INDICATOR_NOTIFY_H #include #include #include #include #define LIBNOTIFY_SHARED_OBJECT "libnotify.so.4" int guake_notify(gchar*,gchar*); #endif //_GUAKE_INDICATOR_NOTIFY_Hguake-indicator-1.4.5/src/guake-indicator-read-json.c000066400000000000000000000345251377654103700224760ustar00rootroot00000000000000/* Copyright (C) 2013-2018 Alessio Garzi Copyright (C) 2013-2018 Francesco Minà 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. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include "guake-indicator.h" #include "guake-indicator-read-json.h" #include "guake-indicator-xml.h" // This function reads the json cfg file and returns a linked list of host GArray* read_json_cfg_file(char * customfilecfg) { FILE* fd; struct json_object *new_obj; struct stat s; char* raw_data=NULL; char* filecfg; char* filedir; size_t numbytes; if (customfilecfg!=NULL) filecfg=strdup(customfilecfg); else { filedir=checkandcreatedefaultdir(); if (asprintf(&filecfg,"%s/%s",filedir,GUAKE_INDICATOR_DEFAULT_FILEJSON)==-1) return NULL; free((void*)filedir); } int err = stat(filecfg, &s); if (err==-1) { if (createdefaultfilecfg(filecfg)) return NULL; //err = stat(filecfg, &s); return read_xml_cfg_file(); } if(!S_ISREG(s.st_mode) && !S_ISLNK(s.st_mode)) { free((void*)filecfg); return NULL; } fd=fopen(filecfg,"r"); free((void*)filecfg); if (fd==NULL) return NULL; raw_data=(char*)malloc(s.st_size+1); bzero((void*)raw_data,s.st_size+1); numbytes=fread((void*)raw_data,1,s.st_size,fd); if (numbytes==0) { free((void*)raw_data); fclose(fd); return NULL; } fclose(fd); new_obj = json_tokener_parse(raw_data); free((void*)raw_data); if (new_obj==NULL) return NULL; GArray* returnarray=json_parse(new_obj); json_object_put(new_obj); return returnarray; } GArray* json_parse(json_object * jobj) { GArray * hostgrouparray; Host* head=NULL; int i; struct json_object * inner_jobj,*data_jobj; enum json_type type; HostGroup* hostgroup; sethostcounterid(NULL); // reset counter id for single hosts sethostgroupcounterid(NULL); // reset counter id for host groups hostgrouparray = g_array_new (TRUE, FALSE, sizeof (HostGroup*)); json_object_object_foreach(jobj, key, val) { type = json_object_get_type(val); switch (type) { case json_type_array: hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); head=NULL; json_object_object_get_ex(jobj, "data",&data_jobj); int arraylen = json_object_array_length(data_jobj); for (i=0;iparent=hostgroup; head=host_queue(head,newhost); } } hostgroup->hostarray=head; g_array_append_val (hostgrouparray, hostgroup); break; case json_type_object: hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); hostgroup->title=g_strdup(key); sethostgroupcounterid(hostgroup); json_object_object_get_ex(jobj, key,&inner_jobj); head=NULL; json_object_object_foreach(inner_jobj, key, val) { if (!strcmp(key,"label")) { struct json_object * lab_obj; json_object_object_get_ex(inner_jobj, key,&lab_obj); char* title=(char*)json_object_get_string(lab_obj); HostGroup* labelhostgroup = malloc(sizeof(HostGroup)); bzero((void*)labelhostgroup,sizeof(HostGroup)); sethostgroupcounterid(labelhostgroup); labelhostgroup->title=g_strdup((const gchar*)title); labelhostgroup->label=TRUE; g_array_append_val (hostgrouparray, labelhostgroup); } else { json_object_object_get_ex(inner_jobj, "data",&data_jobj); int arraylen = json_object_array_length(data_jobj); for (i=0;iparent=hostgroup; head=host_queue(head,new_host); } } // Set the open all row Host* all_host = (Host*) malloc(sizeof(Host)); bzero((void*)all_host,sizeof(Host)); sethostcounterid(all_host); all_host->menu_name=g_strdup((char*)"Open all"); all_host->group_head=head; all_host->open_all=TRUE; head=host_queue(head,all_host); } } hostgroup->hostarray=head; g_array_append_val (hostgrouparray, hostgroup); break; } } return hostgrouparray; } // This function parses a "data" json array Host* create_host_linkedlist(struct json_object * data_jobj,int i) { json_object * jvalue; jvalue = json_object_array_get_idx(data_jobj, i); // check if it's a label struct json_object * new_obj_label; json_object_object_get_ex(jvalue, "label",&new_obj_label); if (new_obj_label!=NULL) { Host* newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->menu_name=strdup((char*)json_object_get_string(new_obj_label)); newhost->label=TRUE; return newhost; } // regular host entry struct json_object * new_obj_hostname; json_object_object_get_ex(jvalue, "hostname",&new_obj_hostname); struct json_object * new_obj_login; json_object_object_get_ex(jvalue, "login",&new_obj_login); struct json_object * new_obj_menu_name; json_object_object_get_ex(jvalue, "menu_name",&new_obj_menu_name); struct json_object * new_obj_tab_name; json_object_object_get_ex(jvalue, "tab_name",&new_obj_tab_name); struct json_object * new_obj_cmd_name; json_object_object_get_ex(jvalue, "command_after_login",&new_obj_cmd_name); struct json_object * new_obj_remote_command; json_object_object_get_ex(jvalue, "remote_command",&new_obj_remote_command); struct json_object * new_obj_x_forwarded; json_object_object_get_ex(jvalue, "x_forwarded",&new_obj_x_forwarded); struct json_object * new_obj_dont_show_guake; json_object_object_get_ex(jvalue, "dont_show_guake",&new_obj_dont_show_guake); if ((char*)json_object_get_string(new_obj_menu_name)==NULL) { return NULL; } Host* newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); if (new_obj_hostname) newhost->hostname=strdup((char*)json_object_get_string(new_obj_hostname)); if (new_obj_login) newhost->login=strdup((char*)json_object_get_string(new_obj_login)); newhost->menu_name=strdup((char*)json_object_get_string(new_obj_menu_name)); if (new_obj_tab_name) newhost->tab_name=strdup((char*)json_object_get_string(new_obj_tab_name)); if ((char*)json_object_get_string(new_obj_cmd_name)) newhost->command_after_login=strdup((char*)json_object_get_string(new_obj_cmd_name)); if (new_obj_remote_command!=NULL) newhost->remote_command=strdup((char*)json_object_get_string(new_obj_remote_command)); if (new_obj_x_forwarded!=NULL) newhost->x_forwarded=strdup((char*)json_object_get_string(new_obj_x_forwarded)); if (new_obj_dont_show_guake!=NULL) newhost->dont_show_guake=strdup((char*)json_object_get_string(new_obj_dont_show_guake)); return newhost; } // This function puts a new host and the end of a queue Host* host_queue(Host* head,Host* newhost) { Host* ptr; if (head==NULL) return newhost; ptr=head; while (ptr->next) ptr=ptr->next; ptr->next=newhost; newhost->previous=ptr; return head; } // Create a directory for hosting a new configuration file if it doesn't exist char* checkandcreatedefaultdir() { char* fulldirpath; struct stat s,s1; char* pluginpath; if (asprintf(&fulldirpath,"%s/%s",getenv("HOME"),GUAKE_INDICATOR_DEFAULT_DIR)==-1) return NULL; int err = stat(fulldirpath, &s); if(ENOENT == err) { if (mkdir(fulldirpath,0744)==-1) fprintf(stderr,"Can't create %s (%d - %s)",GUAKE_INDICATOR_DEFAULT_DIR,errno,strerror(errno)); } else { if(!S_ISDIR(s.st_mode)) { if (mkdir(fulldirpath,0744)) fprintf(stderr,"Can't create %s (%d - %s)",GUAKE_INDICATOR_DEFAULT_DIR,errno,strerror(errno)); } } if (asprintf(&pluginpath,"%s/%s",fulldirpath,GUAKE_INDICATOR_PLUGIN_DIR)==-1) return NULL; err = stat(pluginpath, &s1); if(ENOENT == err) { if (mkdir(pluginpath,0744)==-1) fprintf(stderr,"Can't create %s (%d - %s)",GUAKE_INDICATOR_PLUGIN_DIR,errno,strerror(errno)); } else { if(!S_ISDIR(s1.st_mode)) { if (mkdir(pluginpath,0744)) fprintf(stderr,"Can't create %s (%d - %s)",GUAKE_INDICATOR_PLUGIN_DIR,errno,strerror(errno)); } } free(pluginpath); return fulldirpath; } // Create a new default cfg file int createdefaultfilecfg(const char* path) { char* user=getenv("LOGNAME"); Host* head; HostGroup* hostgroup; GArray* hostgrouparray; // Start root section hostgrouparray = g_array_new (TRUE, FALSE, sizeof (HostGroup*)); hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); Host* newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->label=TRUE; newhost->menu_name=g_strdup("SSH Hosts"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup("localhost"); newhost->login=g_strdup(user!=NULL?user:""); newhost->menu_name=g_strdup("SSH on localhost"); newhost->tab_name=g_strdup("LocalHost"); head=host_queue(head,newhost); hostgroup->hostarray=head; g_array_append_val (hostgrouparray, hostgroup); //End root section // Start mysql server section head=NULL; hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); hostgroup->title=g_strdup("Mysql Servers"); hostgroup->label=TRUE; g_array_append_val (hostgrouparray, hostgroup); hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); hostgroup->title=g_strdup("MYSQL"); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->label=TRUE; newhost->hostname=g_strdup(""); newhost->login=g_strdup(""); newhost->tab_name=g_strdup(""); newhost->menu_name=g_strdup("Local Mysql Servers"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup("localhost"); newhost->login=g_strdup(user!=NULL?user:""); newhost->menu_name=g_strdup("Mysql on localhost"); newhost->tab_name=g_strdup("Mysql"); newhost->command_after_login=g_strdup("mysql -u root --pass --host localhost -A mysql"); newhost->remote_command=g_strdup("yes"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup("127.0.0.1"); newhost->login=g_strdup(user!=NULL?user:""); newhost->menu_name=g_strdup("Mysql on 127.0.0.1"); newhost->tab_name=g_strdup("Mysql on 127.0.0.1"); newhost->command_after_login=g_strdup("mysql -u root --pass --host 127.0.0.1 -A mysql"); newhost->remote_command=g_strdup("yes"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->label=TRUE; newhost->hostname=g_strdup(""); newhost->login=g_strdup(""); newhost->tab_name=g_strdup(""); newhost->menu_name=g_strdup("Remote Mysql Servers"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup("192.168.1.1"); newhost->login=g_strdup(user!=NULL?user:""); newhost->menu_name=g_strdup("Mysql on 192.168.1.1"); newhost->tab_name=g_strdup("Mysql on 192.168.1.1"); newhost->command_after_login=g_strdup("mysql -u root --pass --host 192.168.1.1 -A mysql"); newhost->remote_command=g_strdup("yes"); head=host_queue(head,newhost); hostgroup->hostarray=head; g_array_append_val (hostgrouparray, hostgroup); // End of mysql server section //Start of localhost tasks head=NULL; hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); hostgroup->title=g_strdup("Localhost tasks"); hostgroup->label=TRUE; g_array_append_val (hostgrouparray, hostgroup); hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); hostgroup->title=g_strdup("MISC"); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup(""); newhost->login=g_strdup(""); newhost->menu_name=g_strdup("tmp folder"); newhost->tab_name=g_strdup("tmp folder"); newhost->command_after_login=g_strdup("cd /tmp"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup(""); newhost->login=g_strdup(""); newhost->menu_name=g_strdup("top"); newhost->tab_name=g_strdup("top"); newhost->command_after_login=g_strdup("top"); head=host_queue(head,newhost); newhost = malloc(sizeof(Host)); bzero((void*)newhost,sizeof(Host)); sethostcounterid(newhost); newhost->hostname=g_strdup(""); newhost->login=g_strdup(""); newhost->menu_name=g_strdup("ping www.google.com"); newhost->tab_name=g_strdup("Ping google"); newhost->command_after_login=g_strdup("ping www.google.com"); head=host_queue(head,newhost); hostgroup->hostarray=head; g_array_append_val (hostgrouparray, hostgroup); // End of localhost tasks return write_xml_cfg_file(hostgrouparray); } void sethostcounterid(Host* host) { static int counter=0; if (host==NULL) { counter=0; return ; } host->id = g_strdup_printf("host%d", counter++); } void sethostgroupcounterid(HostGroup* hostgroup) { static int counter=0; if (hostgroup==NULL) { counter=0; return; } hostgroup->id = g_strdup_printf("hostgroup%d", counter++); } guake-indicator-1.4.5/src/guake-indicator-read-json.h000066400000000000000000000024311377654103700224720ustar00rootroot00000000000000/* Copyright (C) 2013-2018 Alessio Garzi Copyright (C) 2013-2018 Francesco Minà 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. */ #ifndef _GUAKE_INDICATOR_READ_JSON_H #define _GUAKE_INDICATOR_READ_JSON_H #include "json.h" #define GUAKE_INDICATOR_DEFAULT_FILEJSON "guake-indicator.json" GArray* json_parse(json_object *); GArray* read_json_cfg_file(char *); char* checkandcreatedefaultdir(); Host* host_queue(Host* ,Host* ); Host* create_host_linkedlist(struct json_object*,int); void sethostcounterid(Host*); void sethostgroupcounterid(HostGroup*); int createdefaultfilecfg(const char*); #endif //_GUAKE_INDICATORREAD_JSON_Hguake-indicator-1.4.5/src/guake-indicator-read-xml.c000066400000000000000000000147011377654103700223170ustar00rootroot00000000000000/* Copyright (C) 2013-2018 Alessio Garzi Copyright (C) 2013-2018 Francesco Minà 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. */ #define _GNU_SOURCE #include #include #include #include GArray* read_xml_cfg_file() { return read_xml_cfg_file_from_file(NULL); } GArray* read_xml_cfg_file_from_file(char* filecfginput) { char* filedir,*filecfg; GArray* hostgrouparray; Host* head=NULL; hostgrouparray = g_array_new (TRUE, FALSE, sizeof (HostGroup*)); filedir=checkandcreatedefaultdir(); if (filecfginput==NULL) { if (asprintf(&filecfg,"%s/%s",filedir,GUAKE_INDICATOR_DEFAULT_FILEXML)==-1) return NULL; } else { if (asprintf(&filecfg,"%s",filecfginput)==-1) return NULL; } free((void*)filedir); xmlNode *cur_node = NULL; LIBXML_TEST_VERSION xmlDoc *doc = NULL; doc = xmlReadFile(filecfg, NULL, 0); if (doc == NULL) { return NULL; } xmlNode *root_element = xmlDocGetRootElement(doc); cur_node = root_element->xmlChildrenNode; while (cur_node != NULL) { if (!xmlStrcmp(cur_node->name, (const xmlChar *)"HostGroup")) { xmlChar* label=xmlGetProp(cur_node,"label"); head=NULL; HostGroup* hostgroup = malloc(sizeof(HostGroup)); bzero((void*)hostgroup,sizeof(HostGroup)); sethostgroupcounterid(hostgroup); xmlChar* hostgrouplabel = xmlGetProp(cur_node,"name"); hostgroup->title=g_strdup((const gchar*)hostgrouplabel); xmlFree(hostgrouplabel); // read all the hosts xmlNode * host_node=cur_node->xmlChildrenNode; while (host_node != NULL) { if (!xmlStrcmp(host_node->name, (const xmlChar *)"Host")) { xmlChar* hostlabel=xmlGetProp(host_node,"label"); xmlNode * data_node=host_node->xmlChildrenNode; xmlChar* menu_name=NULL,*tab_name=NULL,*command_after_login=NULL,*dont_show_guake=NULL,*open_in_tab=NULL,*lfcr=NULL,*guakeindicatorscript=NULL,*named=NULL; while (data_node != NULL) { if (!xmlStrcmp(data_node->name, (const xmlChar *)"menu_name")) menu_name=xmlNodeListGetString(doc, data_node->children, 1); if (!xmlStrcmp(data_node->name, (const xmlChar *)"tab_name")) tab_name=xmlNodeListGetString(doc, data_node->children, 1); if (!xmlStrcmp(data_node->name, (const xmlChar *)"command_after_login")) command_after_login=xmlNodeListGetString(doc, data_node->children, 1); if (!xmlStrcmp(data_node->name, (const xmlChar *)"dont_show_guake")) dont_show_guake=xmlNodeListGetString(doc, data_node->children, 1); if (!xmlStrcmp(data_node->name, (const xmlChar *)"open_in_tab")) { open_in_tab=xmlNodeListGetString(doc, data_node->children, 1); if (open_in_tab) named=xmlGetProp(data_node,"named"); } if (!xmlStrcmp(data_node->name, (const xmlChar *)"lfcr")) lfcr=xmlNodeListGetString(doc, data_node->children, 1); if (!xmlStrcmp(data_node->name, (const xmlChar *)"guakeindicatorscript")) guakeindicatorscript=xmlNodeListGetString(doc, data_node->children, 1); data_node=data_node->next; } Host* newhost = create_new_host(hostgroup, head, menu_name, tab_name, command_after_login, dont_show_guake&&!strcasecmp((char*)dont_show_guake,"yes")?TRUE:FALSE, open_in_tab,hostlabel&&!strcasecmp((char*)hostlabel,"yes")?TRUE:FALSE, lfcr&&!strcasecmp((char*)lfcr,"yes")?TRUE:FALSE,\ guakeindicatorscript&&!strcasecmp((char*)guakeindicatorscript,"yes")?TRUE:FALSE, named&&!strcasecmp((char*)named,"yes")?TRUE:FALSE, FALSE); head=host_queue(head,newhost); hostgroup->hostarray=head; xmlFree(hostlabel); xmlFree(command_after_login); xmlFree(menu_name); xmlFree(tab_name); xmlFree(dont_show_guake); xmlFree(open_in_tab); xmlFree(lfcr); xmlFree(guakeindicatorscript); xmlFree(named); } host_node=host_node->next; } if ((!xmlStrcmp(label, (const xmlChar *)"yes"))) { hostgroup->label=TRUE; } // create a regular hostgroup else { // Set the open all row if we are not on the root node if (hostgroup->title) { Host* newhost = create_new_host( hostgroup,head,"Open all",NULL,NULL,FALSE,"",FALSE,FALSE,FALSE,FALSE,TRUE); head=host_queue(head,newhost); hostgroup->hostarray=head; } } xmlFree(label); g_array_append_val (hostgrouparray, hostgroup); } cur_node = cur_node->next; } xmlFree(cur_node); free(filecfg); xmlFreeDoc(doc); return hostgrouparray; } gboolean check_xml_cfg_file_presence() { char* filedir,*filecfg; gboolean ret; filedir=checkandcreatedefaultdir(); if (asprintf(&filecfg,"%s/%s",filedir,GUAKE_INDICATOR_DEFAULT_FILEXML)==-1) return FALSE; if( access( filecfg, F_OK ) != -1 ) ret=TRUE; else ret=FALSE; free((void*)filedir); free((void*)filecfg); return ret; } // Function for new host creation Host* create_new_host(HostGroup* parent, Host* head,const gchar* menu_name,const gchar* tab_name,const gchar* command,gboolean dont_show_guake,const gchar* open_in_tab,gboolean label,gboolean lfcr,gboolean guakeindicatorscript,gboolean named,gboolean open_all) { Host* host = (Host*) malloc(sizeof(Host)); bzero((void*)host,sizeof(Host)); sethostcounterid(host); host->parent=parent; host->menu_name=g_strdup(menu_name); if (label==TRUE) { host->label=TRUE; return host; } if (open_all==TRUE) { host->group_head=head; host->open_all=TRUE; return host; } host->tab_name=g_strdup(tab_name); host->command_after_login=g_strdup(command); if (dont_show_guake==TRUE) host->dont_show_guake=g_strdup("yes"); if (open_in_tab) { host->open_in_tab=g_strdup(open_in_tab); host->open_in_tab_named=named; } if (lfcr==TRUE) host->lfcr=g_strdup("yes"); if (guakeindicatorscript==TRUE) host->guakeindicatorscript=g_strdup("yes"); return host; } guake-indicator-1.4.5/src/guake-indicator-write-json.c000066400000000000000000000114631377654103700227110ustar00rootroot00000000000000/* Copyright (C) 2013-2018 Alessio Garzi Copyright (C) 2013-2018 Francesco Minà 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. */ #define _GNU_SOURCE #include "guake-indicator.h" #include "guake-indicator-read-json.h" #include "guake-indicator-write-json.h" #include const char* write_json_cfg_file_to_str(GArray* grouphostlist) { size_t i=0; json_object * outer_label_string=NULL; json_object * j_outerobj = json_object_new_object(); for (i=0;grouphostlist!=NULL && ilen;i++) { HostGroup* hostgroup = g_array_index (grouphostlist, HostGroup* , i); // Case of label outside the data array if (hostgroup->title!=NULL && hostgroup->label==TRUE) { outer_label_string = json_object_new_string(hostgroup->title); continue; } if (hostgroup->title!=NULL) { json_object * data_array_obj = json_object_new_object(); // Remember that there is a label outside the data array to apply if (outer_label_string!=NULL) { json_object_object_add(data_array_obj, "label",outer_label_string); outer_label_string=NULL; } json_object * data_array = json_object_new_array(); Host* hostPtr; for (hostPtr=hostgroup->hostarray;hostPtr;hostPtr=hostPtr->next) { // Open all hosts don't count because they are automatically created thus not written in the cfg file if (hostPtr->open_all==TRUE) continue; // Label inside data array if (hostPtr->label==TRUE) json_object_array_add(data_array,build_json_label_obj(hostPtr)); // Regular host else json_object_array_add(data_array,build_json_data_obj(hostPtr)); } json_object_object_add(data_array_obj,"data",data_array); json_object_object_add(j_outerobj, hostgroup->title,data_array_obj); } // data array in the root object else { json_object * data_array = json_object_new_array(); Host* hostPtr; for (hostPtr=hostgroup->hostarray;hostPtr;hostPtr=hostPtr->next) { // Label inside data array if (hostPtr->label==TRUE) json_object_array_add(data_array,build_json_label_obj(hostPtr)); // Regular host else json_object_array_add(data_array,build_json_data_obj(hostPtr)); } json_object_object_add(j_outerobj, "data",data_array); } } const char* retvalue = strdup(json_object_to_json_string_ext(j_outerobj, JSON_C_TO_STRING_PRETTY)); json_object_put(j_outerobj); return retvalue; } json_object * build_json_label_obj(Host* hostPtr) { json_object * label_obj = json_object_new_object(); json_object_object_add(label_obj,"label",json_object_new_string(hostPtr->menu_name)); return label_obj; } json_object * build_json_data_obj(Host* hostPtr) { json_object * data_obj = json_object_new_object(); if (hostPtr->hostname) json_object_object_add(data_obj,"hostname",json_object_new_string(hostPtr->hostname)); if (hostPtr->login) json_object_object_add(data_obj,"login",json_object_new_string(hostPtr->login)); json_object_object_add(data_obj,"menu_name",json_object_new_string(hostPtr->menu_name)); if (hostPtr->tab_name) json_object_object_add(data_obj,"tab_name",json_object_new_string(hostPtr->tab_name)); if (hostPtr->command_after_login!=NULL) json_object_object_add(data_obj,"command_after_login",json_object_new_string(hostPtr->command_after_login)); if (hostPtr->remote_command!=NULL) json_object_object_add(data_obj,"remote_command",json_object_new_string(hostPtr->remote_command)); if (hostPtr->x_forwarded!=NULL) json_object_object_add(data_obj,"x_forwarded",json_object_new_string(hostPtr->x_forwarded)); if (hostPtr->dont_show_guake!=NULL) json_object_object_add(data_obj,"dont_show_guake",json_object_new_string(hostPtr->dont_show_guake)); return data_obj; } int write_cfg_file(GArray* grouphostlist) { char* filedir,*filecfg; filedir=checkandcreatedefaultdir(); if (asprintf(&filecfg,"%s/%s",filedir,GUAKE_INDICATOR_DEFAULT_FILEJSON)==-1) return -1; free((void*)filedir); FILE * fd=fopen(filecfg,"w"); if (fd==NULL) { free((void*)filecfg); return -1; } const char* data = write_json_cfg_file_to_str(grouphostlist); fwrite((const void*)data,strlen(data),1,fd); fclose(fd); free((void*)filecfg); free((void*)data); return 0; } guake-indicator-1.4.5/src/guake-indicator-write-json.h000066400000000000000000000021231377654103700227070ustar00rootroot00000000000000/* Copyright (C) 2013-2015 Alessio Garzi Copyright (C) 2013-2015 Francesco Minà 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. */ #ifndef _GUAKE_INDICATOR_WRITE_JSON_H #define _GUAKE_INDICATOR_WRITE_JSON_H #include "json.h" const char* write_json_cfg_file_to_str(GArray*); json_object * build_json_data_obj(Host*); json_object * build_json_label_obj(Host*); int write_cfg_file(GArray*); #endif // _GUAKE_INDICATOR_WRITE_JSON_Hguake-indicator-1.4.5/src/guake-indicator-write-xml.c000066400000000000000000000070031377654103700225330ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #define _GNU_SOURCE #include #include #include #include "guake-indicator-edit-menu.h" #include int write_xml_cfg_file(GArray* grouphostlist) { return write_xml_cfg_file_from_file(grouphostlist,customConfFile?customConfFile:NULL); } int write_xml_cfg_file_from_file(GArray* grouphostlist,char* file) { char* filedir,*filecfg; if (file==NULL) { filedir=checkandcreatedefaultdir(); if (asprintf(&filecfg,"%s/%s",filedir,GUAKE_INDICATOR_DEFAULT_FILEXML)==-1) return -1; free((void*)filedir); FILE * fd=fopen(filecfg,"w"); if (fd==NULL) { free((void*)filecfg); return -1; } fclose(fd); } else filecfg=strdup(file); xmlDocPtr doc = NULL; xmlNodePtr node = NULL; xmlNodePtr node2 = NULL; xmlNodePtr root_node = NULL;/* node pointers */ doc = xmlNewDoc(BAD_CAST "1.0"); root_node = xmlNewNode(NULL, BAD_CAST "Configuration"); xmlDocSetRootElement(doc, root_node); guint count = 0; HostGroup* iterator; while ( iterator = g_array_index (grouphostlist, HostGroup*, count)) { node=xmlNewChild(root_node, NULL, BAD_CAST "HostGroup", BAD_CAST ""); if (iterator->title) xmlNewProp(node, BAD_CAST "name", BAD_CAST iterator->title); if (iterator->label) xmlNewProp(node, BAD_CAST "label", BAD_CAST "yes"); Host* ptr; for (ptr=iterator->hostarray;ptr;ptr=ptr->next) { if (ptr->open_all) continue; node2=xmlNewChild(node, NULL, BAD_CAST "Host", BAD_CAST ""); if (ptr->label) xmlNewProp(node2, BAD_CAST "label", BAD_CAST "yes"); xmlNewTextChild(node2, NULL, BAD_CAST "menu_name", BAD_CAST ptr->menu_name); if (ptr->label==FALSE) { xmlNewTextChild(node2, NULL, BAD_CAST "tab_name", BAD_CAST ptr->tab_name); gchar* guakecmd=get_guake_cmd(ptr); xmlNewTextChild(node2, NULL, BAD_CAST "command_after_login",BAD_CAST guakecmd); g_free(guakecmd); xmlNewTextChild(node2, NULL, BAD_CAST "dont_show_guake", BAD_CAST ptr->dont_show_guake&&!strcmp((char*)ptr->dont_show_guake,"yes")?"yes":"no"); if (ptr->open_in_tab) { xmlNodePtr open_in_tab_node = xmlNewTextChild(node2, NULL, BAD_CAST "open_in_tab", BAD_CAST ptr->open_in_tab); if (ptr->open_in_tab_named) xmlNewProp(open_in_tab_node, BAD_CAST "named", BAD_CAST "yes"); } xmlNewTextChild(node2, NULL, BAD_CAST "lfcr", BAD_CAST ptr->lfcr&&!strcmp((char*)ptr->lfcr,"yes")?"yes":"no"); xmlNewTextChild(node2, NULL, BAD_CAST "guakeindicatorscript", BAD_CAST ptr->guakeindicatorscript&&!strcmp((char*)ptr->guakeindicatorscript,"yes")?"yes":"no"); } } count++; } xmlSaveFormatFileEnc(filecfg, doc, "UTF-8", 1); xmlFreeDoc(doc); xmlCleanupParser(); free((void*)filecfg); return 0; } guake-indicator-1.4.5/src/guake-indicator-xml.h000066400000000000000000000026111377654103700214100ustar00rootroot00000000000000/* Copyright (C) 2013-2015 Alessio Garzi Copyright (C) 2013-2015 Francesco Minà 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. */ #ifndef _GUAKE_INDICATOR_XML_H #define _GUAKE_INDICATOR_XML_H #include #include #include #define GUAKE_INDICATOR_DEFAULT_FILEXML "guake-indicator.xml" #define ENCODING "UTF-8" Host* create_new_host(HostGroup*, Host* ,const gchar* ,const gchar* ,const gchar* ,gboolean ,const gchar*,gboolean ,gboolean,gboolean,gboolean,gboolean ); gboolean check_xml_cfg_file_presence(); int write_xml_cfg_file(GArray*); int write_xml_cfg_file_from_file(GArray*,char*); GArray* read_xml_cfg_file(); GArray* read_xml_cfg_file_from_file(char* ); #endif //_GUAKE_INDICATOR_XML_Hguake-indicator-1.4.5/src/guake-indicator.c000066400000000000000000000324641377654103700206160ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. */ #include #include #include "guake-indicator.h" #include "guake-indicator-read-json.h" #include "guake-indicator-write-json.h" #include "guake-indicator-edit-menu.h" #include "guake-indicator-xml.h" #include "guake-indicator-dbus.h" #include "guake-indicator-notify.h" int GUAKE3; char* customConfFile; // Open a group of tabs void group_guake_open(GtkAction* action,gpointer user_data) { Host host = *((Host*) user_data); Host* ptr = host.group_head; void (*guake_funct)(GtkAction*,gpointer); while (ptr) { // If it's the last host or the host after is the "open all" // i call guake_open_with_show() for showing the terminal // otherwise i call guake_open() that doesn't show the terminal if (ptr->next==NULL || ptr->next->group_head!=NULL) guake_funct=guake_open_with_show; else guake_funct=guake_open; // Group Right click management if (((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->vertical_split_current_tab==TRUE) { ptr->force_current_tab=TRUE; ptr->vertical_split_current_tab=TRUE; ptr->horizontal_split_current_tab=FALSE; } if (((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->horizontal_split_current_tab==TRUE) { ptr->force_current_tab=TRUE; ptr->vertical_split_current_tab=FALSE; ptr->horizontal_split_current_tab=TRUE; } // End of group right click management if (ptr->group_head==NULL && ptr->label==FALSE) guake_funct(action,(gpointer)ptr); ptr=ptr->next; } } void guake_open_with_show(GtkAction* action,gpointer user_data) { // open new terminal and execute command guake_open(action,user_data); // try to show Guake guake_show(); } // Open a new terminal tab on guake void guake_open(GtkAction* action,gpointer user_data) { Host host = *((Host*) user_data); gchar* cmd = NULL; gint32 numtabs; gchar* uuid = NULL; // open a new Guake tab if (guake_gettabcount(&numtabs)==FALSE && ((Host*)user_data)->force_current_tab==FALSE) guake_newtab(NULL); // if current guake tab is selected i skip this part else if (((Host*)user_data)->force_current_tab==TRUE || (host.open_in_tab && atol((char*)host.open_in_tab)==-1)) { if (guake_getcurrenttab_uuid(&uuid)==FALSE) uuid=NULL; if (((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->vertical_split_current_tab==TRUE) guake_vsplit_current_tab(); if (((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->horizontal_split_current_tab==TRUE) guake_hsplit_current_tab(); } else if (host.open_in_tab==NULL || !strlen(host.open_in_tab) || ((long)numtabs<=atol((char*)host.open_in_tab) && host.open_in_tab_named==FALSE)) { if (guake_newtab(&uuid)==FALSE) uuid=NULL; } else { if (host.open_in_tab_named==FALSE) guake_selecttab(host.open_in_tab); // Search a tab by name else { gint32 i =0; gchar* name; for (i=0;istr)==-1) { guake_notify("Guake indicator","Cannot spawn system call"); } g_string_free (systemstring,TRUE); continue; } //Manage the tags else if (host.guakeindicatorscript && !strcmp(host.guakeindicatorscript,"yes") && cmd[i]=='<' && cmd[i+1]=='!') { i+=2; gchar* start=cmd+(i*sizeof(gchar)); gchar* end = g_strstr_len(start,-1,"!>"); if (end>start) { gchar* envstring = g_strndup(start,(end-start)*sizeof(gchar)); GSettings* editor_settings = g_settings_new (GUAKE_INDICATOR_DCONF_SCHEMA_ROOT); gchar* str =NULL; if ( !strcmp(envstring,"param0")||!strcmp(envstring,"param1")||!strcmp(envstring,"param2")||!strcmp(envstring,"param3")||!strcmp(envstring,"param4")||!strcmp(envstring,"param5")||!strcmp(envstring,"param6")||!strcmp(envstring,"param7")||!strcmp(envstring,"param8")||!strcmp(envstring,"param9") ) str = g_settings_get_string (editor_settings, envstring); if (str) { g_string_append (newstring,str); free(str); } g_free(envstring); i=i+((end-start)*sizeof(gchar))+1; continue; } } g_string_append_c (newstring,cmd[i]); if (cmd[i]==10) { // Add a cr to the end line will be lfcr if (host.lfcr && !g_strcmp0(host.lfcr,"yes")) g_string_append_c (newstring,13); if ( ((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->force_current_split==TRUE) guake_execute_command_current_termbox(newstring->str); // Execute on split on current tab else if ( ((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->force_current_split==FALSE && ((Host*)user_data)->horizontal_split_current_tab==FALSE && ((Host*)user_data)->vertical_split_current_tab==FALSE) guake_executecommand_by_uuid(uuid,newstring->str); // Execute on all splits on current tab from right click menu else if (((Host*)user_data)->force_current_tab==TRUE && (((Host*)user_data)->horizontal_split_current_tab==TRUE || ((Host*)user_data)->vertical_split_current_tab==TRUE) ) guake_execute_command_current_termbox(newstring->str); //else if (uuid) guake_executecommand_by_uuid(uuid,newstring->str); else guake_execute_command_current_termbox(newstring->str); // default behaviour with left click, execute only on one split on current tab g_string_free (newstring,TRUE); newstring = g_string_new (NULL); } } if (newstring->len>0) { if ( ((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->force_current_split==TRUE) guake_execute_command_current_termbox(newstring->str); // Execute on split on current tab else if ( ((Host*)user_data)->force_current_tab==TRUE && ((Host*)user_data)->force_current_split==FALSE && ((Host*)user_data)->horizontal_split_current_tab==FALSE && ((Host*)user_data)->vertical_split_current_tab==FALSE) guake_executecommand_by_uuid(uuid,newstring->str); // Execute on all splits on current tab from right click menu else if (((Host*)user_data)->force_current_tab==TRUE && (((Host*)user_data)->horizontal_split_current_tab==TRUE || ((Host*)user_data)->vertical_split_current_tab==TRUE) ) guake_execute_command_current_termbox(newstring->str); //else if (uuid) guake_executecommand_by_uuid(uuid,newstring->str); else guake_execute_command_current_termbox(newstring->str); // default behaviour with left click, execute only on one split on current tab } g_string_free (newstring,TRUE); if (uuid) g_free(uuid); g_free(x_forwarded_flag); g_free(cmd); // Reset right click flags ((Host*)user_data)->force_current_tab=FALSE; ((Host*)user_data)->force_current_split=FALSE; ((Host*)user_data)->vertical_split_current_tab=FALSE; ((Host*)user_data)->horizontal_split_current_tab=FALSE; } // Reload hosts reading them from the configuration file void reload(GtkInfo* gtkinfo) { if (gtkinfo->grouphostlist) grouphostlist_free(gtkinfo->grouphostlist); if (customConfFile) gtkinfo->grouphostlist=read_xml_cfg_file_from_file(customConfFile); else { if (check_xml_cfg_file_presence()) gtkinfo->grouphostlist = read_xml_cfg_file(); else gtkinfo->grouphostlist = read_json_cfg_file(NULL); if (gtkinfo->grouphostlist==NULL) { error_modal_box("Couldn't retrieve host from your guake indicator configuration file"); return ; } } return ; } void refresh_indicator(gpointer user_data) { refresh_indicator_ayatana(user_data); } void error_modal_box (const char* alerttext) { GtkWidget *dialog; dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s", alerttext); g_signal_connect (dialog, "response",G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); } // Free a grouphostlist void grouphostlist_free(GArray* grouphostlist) { Host* ptr,*newptr; gint i; for (i=0;grouphostlist!=NULL && ilen;i++) { HostGroup* hostgroup = g_array_index (grouphostlist, HostGroup* , i); for (ptr=hostgroup->hostarray;ptr;ptr=newptr) { host_free(ptr); newptr=ptr->next; free(ptr); } if (hostgroup->id) free(hostgroup->id); if (hostgroup->title) free(hostgroup->title); free(hostgroup); } g_array_free(grouphostlist,TRUE); } // Free a host structure void host_free(Host* ptr) { if (ptr->menu_name) free(ptr->menu_name); if (ptr->tab_name) free(ptr->tab_name); if (ptr->command_after_login) free(ptr->command_after_login); if (ptr->dont_show_guake) free(ptr->dont_show_guake); if (ptr->lfcr) free(ptr->lfcr); if (ptr->guakeindicatorscript) free(ptr->guakeindicatorscript); if (ptr->id) free(ptr->id); if (ptr->open_in_tab) free(ptr->open_in_tab); } // Free a hostgroup structure void hostgroup_free(HostGroup* ptr) { if (ptr->id) free(ptr->id); if (ptr->title) free(ptr->title); } // close the indicator static void close_guake ( GtkWidget *widget, gpointer user_data) { GArray* grouphostlist= ((GtkInfo*)user_data)->grouphostlist; grouphostlist_free(grouphostlist); gtk_main_quit(); return ; } int main (int argc, char **argv) { GArray* grouphostlist; GtkInfo gtkinfo; GUAKE3=1; // Guake 3 is the default customConfFile = NULL; gint32 numtabs; gtk_init (&argc, &argv); if (argc>1 && strlen(argv[1])>0 && !strcasecmp(argv[1],"-guake3")) { GUAKE3=1; if (argc>2) { customConfFile = argv[2]; grouphostlist=read_xml_cfg_file_from_file(customConfFile); } else if (check_xml_cfg_file_presence()) grouphostlist = read_xml_cfg_file(); else grouphostlist = read_json_cfg_file(NULL); } else if (argc>1 && strlen(argv[1])>0 && !strcasecmp(argv[1],"-guake0")) { GUAKE3=0; if (argc>2) { customConfFile = argv[2]; grouphostlist=read_xml_cfg_file_from_file(customConfFile); } else if (check_xml_cfg_file_presence()) grouphostlist = read_xml_cfg_file(); else grouphostlist = read_json_cfg_file(NULL); } else if (argc>1 && strlen(argv[1])>0) { customConfFile = argv[1]; grouphostlist=read_xml_cfg_file_from_file(customConfFile); } else if (check_xml_cfg_file_presence()) grouphostlist = read_xml_cfg_file(); else grouphostlist = read_json_cfg_file(NULL); if (grouphostlist==NULL) error_modal_box("Couldn't retrieve list of entries from your guake indicator configuration file"); // Test dbus responsiveness to know if it's running, if it's not i try to start it if (guake_gettabcount(&numtabs)==FALSE) { if (GUAKE3) { if (system ("/usr/bin/python3 /usr/bin/guake &")==-1) guake_notify("Guake indicator","Cannot spawn system call for Guake GTK3 version start"); } else { if (system ("guake &")==-1) guake_notify("Guake indicator","Cannot spawn system call for Guake GTK2 version start"); } } guake_notify("Guake indicator","Guake indicator is running"); gtkinfo.grouphostlist=grouphostlist; build_menu_ayatana(argc,argv,>kinfo); return 0; } guake-indicator-1.4.5/src/guake-indicator.h000066400000000000000000000062301377654103700206130ustar00rootroot00000000000000/* Copyright (C) 2013-2019 Alessio Garzi Copyright (C) 2013-2019 Francesco Minà 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. * */ #ifndef _GUAKE_INDICATOR_H #define _GUAKE_INDICATOR_H #include #include #define GUAKE_INDICATOR_DEFAULT_DIR ".guake-indicator" #define GUAKE_INDICATOR_PLUGIN_DIR "plugins" #define GUAKE_INDICATOR_ICON_DIR "icons/hicolor/256x256/apps/" #define GUAKE_INDICATOR_DCONF_SCHEMA_ROOT "org.guake-indicator.data" #define GUAKE_INDICATOR_VERSION "1.4.5" // Define default actions #define GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY_SIZE 4 #define GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY_MAXLENGTH 20 static const gchar GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY[GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY_SIZE][GUAKE_INDICATOR_DEFAULT_MENUITEMS_ARRAY_MAXLENGTH]= { "Edit Menu", "Reload", "Quit", "About" }; typedef struct GUAKE_INDICATOR_DEFAULT_ACTION { gchar const* label; void(* action_function)(GtkAction *,gpointer); }GUAKE_INDICATOR_DEFAULT_ACTION; typedef struct Host { gchar* id; gboolean label; gchar* hostname; gchar* login; gchar* menu_name; gchar* tab_name; gchar* command_after_login; gchar* remote_command; gchar* x_forwarded; gchar* dont_show_guake; gchar* open_in_tab; gboolean open_in_tab_named; gchar* lfcr; gchar* guakeindicatorscript; gboolean open_all; struct Host* next; struct Host* previous; struct Host* group_head; struct HostGroup* parent; gboolean force_current_tab; gboolean vertical_split_current_tab; gboolean horizontal_split_current_tab; gboolean force_current_split; void (*right_click_funct_ptr)(GtkAction*,gpointer); } Host; typedef struct HostGroup { gchar* id; gchar* title; Host* hostarray; gboolean label; }HostGroup; typedef struct GtkInfo { GtkActionGroup* action_group; GtkUIManager * uim; GArray* grouphostlist; } GtkInfo; //void reload(GtkAction*,gpointer); void reload(GtkInfo* gtkinfo); static void activate_action (GtkAction* ); void guake_open(GtkAction*,gpointer); void guake_open_with_show(GtkAction*,gpointer); void group_guake_open(GtkAction*,gpointer); static void close_guake ( GtkWidget *, gpointer); static void update_json(gpointer); void grouphostlist_free(GArray*); void host_free(Host*); void hostgroup_free(HostGroup*); void error_modal_box (const char*); void build_menu_ayatana(int , char **,GtkInfo* ); void refresh_indicator_ayatana(gpointer); void print_edit_menu_form(GtkAction*,gpointer); void refresh_indicator(gpointer); #endif //_GUAKE_INDICATOR_Hguake-indicator-1.4.5/src/guake3.h000066400000000000000000000016221377654103700167240ustar00rootroot00000000000000/* Copyright (C) 2013-2018 Alessio Garzi Copyright (C) 2013-2018 Francesco Minà 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. * */ #ifndef _GUAKE3_H #define _GUAKE3_H extern int GUAKE3; extern char* customConfFile; #endif //_GUAKE3_H