Minor documentation and script cleanups (#6868)

* Remove mention of no longer used IRC network

Channels exist on matrix, and on libera.chat now.

* Correctly match only files with .png extension

The current search would match files such as 'createpng'.

* Fix comparison in script

The result was always false, due to comparing a literal string instead of a variable.

* Use correct license files from upstream

Correct license files obtained from:
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
https://www.gnu.org/licenses/gpl-3.0.txt
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
https://www.gnu.org/licenses/lgpl-3.0.txt

* Refresh several shell scripts

This fixes several shellcheck warnings, as well as makes the code more
robust and have consistent codestyle between all the files.

* Trim excess whitespace
This commit is contained in:
a1346054 2021-09-21 04:17:46 +00:00 committed by GitHub
parent 9aec84dee7
commit e3c7b570ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 93 additions and 98 deletions

View File

@ -19,7 +19,7 @@ AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterControlStatement: false
@ -44,7 +44,7 @@ DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
@ -85,4 +85,3 @@ Standard: Cpp11
TabWidth: 4
UseTab: Never
...

View File

@ -63,7 +63,7 @@ Before submitting a bug report, check if the problem has already been reported.
### Discuss with the team
As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, or in the IRC channel on Freenode (`#keepassxc-dev` on `irc.freenode.net`, or use a [webchat link](https://webchat.freenode.net/?channels=%23keepassxc-dev)).
As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, on the [Matrix development channel](https://matrix.to/#/!RhJPJPGwQIFVQeXqZa:matrix.org?via=matrix.org), or in the IRC channel on Libera.Chat (`#keepassxc-dev` on `irc.libera.chat`, or use a [webchat link](https://web.libera.chat/#keepassxc-dev)).
### Your first code contribution

View File

@ -263,7 +263,7 @@
- Return keyboard focus after saving database edits [#4287]
- Windows: Use bare minimum settings in portable version [#4131]
- Windows: Use SHA256 code signing [#4129]
- macOS: Fix code signing incompatibility in latest macOS release [#4564]
- macOS: Fix code signing incompatibility in latest macOS release [#4564]
## 2.5.3 (2020-01-19)
@ -395,8 +395,8 @@
- Redesign database unlock dialog [ #3287]
- Rework the entry preview panel [ #3306]
- Move notes to General tab on Group Preview Panel [#3336]
- Enable entry actions when editing an entry and cleanup entry context menu [#3641]
- Improve detection of external database changes [#2389]
- Enable entry actions when editing an entry and cleanup entry context menu [#3641]
- Improve detection of external database changes [#2389]
- Warn if user is trying to use a KDBX file as a key file [#3625]
- Add option to disable KeePassHTTP settings migrations prompt [#3349, #3344]
- Re-enabled Wayland support (no Auto-Type yet) [#3520, #3341]

View File

@ -103,7 +103,7 @@ These steps place the compiled KeePassXC binary inside the `./build/src/` direct
-DWITH_XC_KEESHARE=[ON|OFF] Enable/Disable KeeShare group synchronization extension (default: OFF)
-DWITH_XC_KEESHARE_SECURE=[ON|OFF] Enable/Disable KeeShare signed containers, requires libquazip5 (default: OFF)
-DWITH_XC_ALL=[ON|OFF] Enable/Disable compiling all plugins above (default: OFF)
-DWITH_XC_UPDATECHECK=[ON|OFF] Enable/Disable automatic updating checking (requires WITH_XC_NETWORKING) (default: ON)
-DWITH_TESTS=[ON|OFF] Enable/Disable building of unit tests (default: ON)

View File

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
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
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@ -56,7 +56,7 @@ 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
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@ -255,7 +255,7 @@ 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
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
@ -277,9 +277,9 @@ 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
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
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

View File

@ -1,12 +1,11 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
@ -69,7 +68,7 @@ patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
TERMS AND CONDITIONS
0. Definitions.
@ -77,7 +76,7 @@ modification follow.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
@ -510,7 +509,7 @@ actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
@ -619,9 +618,9 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
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
@ -646,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
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, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -665,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU 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. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@ -158,7 +158,7 @@ Library.
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 Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@ -370,7 +370,7 @@ 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 with
this License.
11. 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
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@ -456,7 +456,7 @@ 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 Libraries
If you develop a new library, and you want it to be of the greatest

View File

@ -1,7 +1,7 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

View File

@ -48,7 +48,7 @@ Detailed instructions are available in the [Build and Install](./INSTALL.md) pag
## Contributing
We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub or join us on IRC in [freenode](https://webchat.freenode.net/) channels #keepassxc and #keepassxc-dev.
We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub, or join us on [Matrix community channel](https://matrix.to/#/!zUxwGnFkUyycpxeHeM:matrix.org?via=matrix.org) or [Matrix development channel](https://matrix.to/#/!RhJPJPGwQIFVQeXqZa:matrix.org?via=matrix.org), or on IRC in [Libera.Chat](https://web.libera.chat/) channels #keepassxc and #keepassxc-dev.
You may directly contribute your own code by submitting a pull request. Please read the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information.

View File

@ -70,7 +70,7 @@ include(CMakeParseArguments)
# Check prereqs
find_program( GCOV_PATH gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( SIMPLE_PYTHON_EXECUTABLE python )
@ -300,4 +300,4 @@ function(APPEND_COVERAGE_COMPILER_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
endfunction() # APPEND_COVERAGE_COMPILER_FLAGS
endfunction() # APPEND_COVERAGE_COMPILER_FLAGS

View File

@ -47,4 +47,3 @@ mark_as_advanced(
Readline_INCLUDE_DIR
Readline_LIBRARY
)

View File

@ -53,7 +53,7 @@ if(UNIX)
VERBATIM)
add_custom_target(manpages ALL DEPENDS keepassxc.1 keepassxc-cli.1)
install(FILES
install(FILES
${OUT_DIR}/keepassxc.1
${OUT_DIR}/keepassxc-cli.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)

View File

@ -80,7 +80,7 @@ Search the unlocked databases by activating Search Database radio button. Use th
.Additional Auto-Type choices
image::autotype_selection_dialog_type_menu.png[,70%]
The option to type just the username, password, or current TOTP value is available by right clicking the desired row or expanding the Type Sequence button options.
The option to type just the username, password, or current TOTP value is available by right clicking the desired row or expanding the Type Sequence button options.
=== Performing Entry-Level Auto-Type
You can quickly activate the default Auto-Type sequence for a particular entry using Entry-Level Auto-Type. For this operation, the KeePassXC window will be minimized and the Auto-Type sequence occurs in the previously selected window. You can perform Entry-Level Auto-Type from the toolbar icon *(A)*, entry context menu *(B)*, or by pressing `Ctrl+Shift+V`.
@ -89,4 +89,4 @@ WARNING: Be careful when using Entry-Level Auto-Type as you can inadvertently ty
.Entry-Level Auto-Type
image::autotype_entrylevel.png[]
// end::content[]
// end::content[]

View File

@ -48,7 +48,7 @@ image::browser_settings.png[]
.Connect Extension to KeePassXC
image::browser_extension_connect.png[,80%]
6. Click the _Connect_ button *(B)* in the pop-up window to complete integrating the KeePassXC-Browser extension with your KeePassXC desktop application.
6. Click the _Connect_ button *(B)* in the pop-up window to complete integrating the KeePassXC-Browser extension with your KeePassXC desktop application.
7. You are now prompted to enter a unique name to identify the connection between this browser and your database. Enter a unique name in the field (e.g., firefox-laptop) and click the _Save and allow access_ button.
+
@ -62,7 +62,7 @@ The KeePassXC-Browser extension lets you automatically populate the entries from
1. Open your KeePassXC desktop application and unlock your database.
2. Open your web browser. The KeePassXC-Browser extension icon in your browser window will change based on its connection state. The figure below shows the different states.
2. Open your web browser. The KeePassXC-Browser extension icon in your browser window will change based on its connection state. The figure below shows the different states.
+
*(A)* KeePassXC is not running or is disconnected +
*(B)* Connected to KeePassXC, but database is locked +

View File

@ -48,7 +48,7 @@ This section contains full details on advanced features available in KeePassXC.
|===
=== Entry Cross-Reference
A reference to another entry's field is possible using the short-hand syntax:
A reference to another entry's field is possible using the short-hand syntax:
`{REF:<FIELD>@<SEARCH_IN>:<SEARCH_TEXT>}`
`<FIELD>` and `<SEARCH_IN>` can be one of following:

View File

@ -70,8 +70,8 @@ Open a terminal window and type the following command to generate a key:
$ ssh-keygen -o -f keepassxc -C johndoe@example
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in keepassxc
Your public key has been saved in keepassxc.pub
The key fingerprint is:
@ -110,7 +110,7 @@ The last step is to setup an entry to contain the SSH Agent settings and key fil
1. Create a new entry, or open an existing entry in edit mode.
2. Set the password you used for the key file in the password field.
3. Go to the advanced category and attach the key file you generated previously.
4. Go to the SSH Agent category *(1)* and select the attachment from the list *(2)*.
4. Go to the SSH Agent category *(1)* and select the attachment from the list *(2)*.
5. Alternatively, you can load an external file dynamically using the file selection.
6. Choose the options for this key.
7. Press *OK* to accept the entry. Depending on the options you chose, KeePassXC will load the key and present it for use.

View File

@ -62,7 +62,7 @@ printUsage() {
cmd="COMMAND"
fi
printf "\e[1mUsage:\e[0m $(basename $0) $cmd [options]\n"
printf "\e[1mUsage:\e[0m $(basename "$0") $cmd [options]\n"
if [ "COMMAND" == "$cmd" ]; then
cat << EOF

View File

@ -18,4 +18,4 @@ minify -o icons/database --match=.svg icons/database
# Crush PNG's
echo "Crushing PNG's..."
find "." -iname '*png' -exec pngcrush -ow -brute {} \;
find . -iname '*.png' -exec pngcrush -ow -brute {} \;

View File

@ -16,23 +16,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
BASEDIR="$(dirname $0)"
BASEDIR=$(dirname "$0")
PUSH=true
PULL=true
UPDATE=true
if [ "$1" == "push" ]; then
if [[ $1 == "push" ]]; then
PULL=false
elif [ "$1" == "pull" ]; then
elif [[ $1 == "pull" ]]; then
PUSH=false
UPDATE=false
elif [ "$1" == "update" ]; then
elif [[ $1 == "update" ]]; then
PUSH=false
PULL=false
elif [ "$1" != "" ]; then
elif [[ $1 != "" ]]; then
echo "Unknown command '${1}'"
echo "Usage: $(basename $0) [update|pull|push] [additional tx options]"
echo "Usage: $(basename "$0") [update|pull|push] [additional tx options]"
exit 1
fi
@ -45,7 +45,7 @@ if $UPDATE; then
LUPDATE=lupdate-qt5
command -v $LUPDATE > /dev/null
if [ $? -ne 0 ]; then
if [[ $? -ne 0 ]]; then
LUPDATE=lupdate
fi
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete src -ts share/translations/keepassx_en.ts

View File

@ -4,28 +4,28 @@ NC='\033[0m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
if [[ -z "$1" ]]; then
if [[ -z $1 ]]; then
echo -e "${RED}You must include an SVG file to convert!${NC}"
exit 1
fi
outfile=$2
if [[ -z "outfile" ]]; then
if [[ -z $outfile ]]; then
outfile="logo.ico"
fi
if ! command -v "inkscape" &> /dev/null; then
if ! command -v inkscape &> /dev/null; then
echo -e "${YELLOW}Could not find inkscape; $outfile not built!${NC}"
exit 0
fi
echo "Generating $outfile from $1..."
size_list=(16 24 32 48 64 128 256)
for size in ${size_list[@]}; do
inkscape -z -e $size.png -w $size -h $size "$1" >/dev/null 2>/dev/null
for size in "${size_list[@]}"; do
inkscape -z -e $size.png -w $size -h $size "$1" >/dev/null 2>/dev/null
done
images=`printf "%s.png " "${size_list[@]}"`
images=$(printf "%s.png " "${size_list[@]}")
convert $images $outfile
rm $images

View File

@ -61,7 +61,7 @@
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="KeePassXC">
<Component Id="ApplicationShortcuts" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut"
<Shortcut Id="ApplicationStartMenuShortcut"
Name="KeePassXC"
Target="[#CM_FP_KeePassXC.exe]"
WorkingDirectory="INSTALL_ROOT"/>

View File

@ -8,4 +8,3 @@ apps:
_app_name_:
command: foo-launch bar-launch _app_command_
```

View File

@ -8,7 +8,7 @@ sonar.projectKey=keepassxc
sonar.organization=droidmonkey-github
sonar.projectName=keepassxc
sonar.host.url=https://sonarcloud.io
# path to source directories (required)
sonar.sources=src
sonar.tests=tests

View File

@ -17,4 +17,4 @@ Then just run
```shell
keepass-cr-recovery path-to-your-password-database path-of-the-new-keyfile
```
It will prompt for the challenge-response secret. You will get a keyfile at the specified destination path. Then, to unlock your database in KeePassXC, you need to check "key file" instead of "challenge response" and load the file.
It will prompt for the challenge-response secret. You will get a keyfile at the specified destination path. Then, to unlock your database in KeePassXC, you need to check "key file" instead of "challenge response" and load the file.

View File

@ -4,10 +4,10 @@
### change the path to suit your installation or set KDBX_SEARCH before calling ###
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
PROG="${0##*/}"
PROG=${0##*/}
KEEPASSXC=$(which -a keepassxc | sed -e "\\,$0,d" -e 'q')
function daemon_main {
daemon_main() {
# open kdewallet
handle=$(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.open kdewallet 0 "$PROG")
while [[ true != $(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.isOpen kdewallet) ]]; do
@ -27,7 +27,7 @@ function daemon_main {
qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.close "$handle" "false" "$PROG"
}
if [[ '-d' = "$1" ]]; then
if [[ $1 == '-d' ]]; then
exec >&~/tmp/$PROG.log
set -vx
daemon_main

View File

@ -4,10 +4,10 @@
### change the path to suit your installation or set KDBX_SEARCH before calling ###
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
PROG="$(basename $0)"
PROG=$(basename "$0")
KeePassXC=$(ls -f {/usr/local,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1)
function daemon_main {
daemon_main() {
declare -A DBs
for DBPATH in $KDBX_SEARCH; do
DBs[$(python -c "import os; print os.path.realpath('$DBPATH')")]=$(security find-generic-password -a $USER -s "${DBPATH##*/}" -w)
@ -18,7 +18,7 @@ function daemon_main {
$KeePassXC --pw-stdin "${!DBs[@]}" <<<"${DBs[*]}" &
}
if [[ '-d' = "$1" ]]; then
if [[ $1 == '-d' ]]; then
exec >&~/tmp/$PROG.log
set -vx
daemon_main

View File

@ -118,9 +118,9 @@ BROWSER=$(whiptail \
clear
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [[ $exitstatus == 0 ]]; then
# Configure settings for the chosen browser
case "$BROWSER" in
case $BROWSER in
1) setupFirefox ;;
2) setupChrome ;;
3) setupChromium ;;
@ -132,7 +132,7 @@ if [ $exitstatus = 0 ]; then
# Install the JSON file
cd ~
mkdir -p "$INSTALL_DIR"
echo "$JSON_OUT" > ${INSTALL_DIR}/${INSTALL_FILE}
echo "$JSON_OUT" > "${INSTALL_DIR}/${INSTALL_FILE}"
whiptail \
--title "Installation Complete" \

View File

@ -42,22 +42,22 @@ NC='\033[0m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
if [ $# != 1 ];then
if [[ $# != 1 ]]; then
echo "Usage: $0 MATERIAL"
echo "MATERIAL is the directory containing the material icons repository"
echo "(git clone https://github.com/Templarian/MaterialDesign.git)".
exit
fi
MATERIAL="$1"
if [ ! -d "$MATERIAL" ];then
MATERIAL=$1
if [[ ! -d $MATERIAL ]]; then
echo -e "${RED}Material Icons directory does not exist: ${MATERIAL}${NC}"
exit 1
fi
# Check destination dir
DSTDIR=share/icons/application
if [ ! -d "$DSTDIR" ];then
if [[ ! -d $DSTDIR ]]; then
echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
exit 1
fi
@ -69,7 +69,7 @@ fi
# extension, e. g. "folder-plus") to stdout.
# If the icon name is unknown, outputs nothing.
map() {
case "$1" in
case $1 in
application-exit) echo exit-run ;;
auto-type) echo keyboard-variant ;;
bugreport) echo bug-outline ;;
@ -148,27 +148,27 @@ map() {
}
# Now do the actual work
find $DSTDIR -type f -name "*.svg" | while read -r DST;do
find "$DSTDIR" -type f -name "*.svg" | while read -r DST; do
# Find the icon name (base name without extender)
NAME=$(basename $DST .svg)
NAME=$(basename "$DST" .svg)
# Find the base name of the svg file for this icon
MAT=$(map $NAME)
if [[ -z $MAT ]];then
MAT=$(map "$NAME")
if [[ -z $MAT ]]; then
echo -e "${YELLOW}Warning: No MaterialDesign mapping for ${NAME}${NC}"
continue
fi
# So the source file is:
SRC="$MATERIAL/svg/$MAT.svg"
if [ ! -f "$SRC" ];then
if [[ ! -f $SRC ]]; then
echo -e "${RED}Error: Source for ${NAME} doesn't exist: ${SRC}${NC}"
continue
fi
# Replace the icon file with the source file
cp "$SRC" "$DST" || exit
cp -- "$SRC" "$DST" || exit
echo "Copied icon for ${NAME}"
done

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Assemble database icons from the icons8 collection
# by Wolfram Rösler 2020-04-30
@ -7,7 +7,7 @@ RED='\033[0;31m'
YELLOW='\033[0;33m'
# Check parameters
if [[ $# != 1 ]];then
if [[ $# != 1 ]]; then
echo "Usage: $0 ICONS8"
echo "ICONS8 is the directory containing the Icons8 flat-color-icons repository"
echo "(git clone https://github.com/icons8/flat-color-icons)".
@ -15,15 +15,15 @@ if [[ $# != 1 ]];then
fi
# Check source directory
SRCDIR="$1"
if [ ! -d "$SRCDIR" ];then
SRCDIR=$1
if [[ ! -d $SRCDIR ]]; then
echo -e "${RED}icons8 directory doesn't exist: ${SRCDIR}${NC}"
exit 1
fi
# Check destination directory
DSTDIR=share/icons/database
if [ ! -d "$DSTDIR" ];then
if [[ ! -d $DSTDIR ]]; then
echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
exit 1
fi
@ -39,7 +39,7 @@ fi
copy() {
# The source file is:
SRC="${SRCDIR}/svg/${1}.svg"
if [ ! -f "$SRC" ];then
if [[ ! -f $SRC ]]; then
echo -e "${RED}Cannot find source icon for ${2} (${SRC})${NC}"
return
fi
@ -47,7 +47,7 @@ copy() {
# Copy the source file to the destination, keeping
# the source file's extension
DST="$DSTDIR/${2}.svg"
cp $SRC $DST
cp -- "$SRC" "$DST"
echo "Copied icon for ${1} to ${DST}"
}