makedbicons.sh 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. #!/usr/bin/env bash
  2. # Assemble database icons from the icons8 collection
  3. # by Wolfram Rösler 2020-04-30
  4. NC='\033[0m'
  5. RED='\033[0;31m'
  6. YELLOW='\033[0;33m'
  7. # Check parameters
  8. if [[ $# != 1 ]]; then
  9. echo "Usage: $0 ICONS8"
  10. echo "ICONS8 is the directory containing the Icons8 flat-color-icons repository"
  11. echo "(git clone https://github.com/icons8/flat-color-icons)".
  12. exit
  13. fi
  14. # Check source directory
  15. SRCDIR=$1
  16. if [[ ! -d $SRCDIR ]]; then
  17. echo -e "${RED}icons8 directory doesn't exist: ${SRCDIR}${NC}"
  18. exit 1
  19. fi
  20. # Check destination directory
  21. DSTDIR=share/icons/database
  22. if [[ ! -d $DSTDIR ]]; then
  23. echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
  24. exit 1
  25. fi
  26. # Copy one icon from the icons8 collection.
  27. #
  28. # Usage: copy I8NAME Cnn
  29. # I8NAME is the file name (without extender and without
  30. # the "icon8-" prefix) in the icons8 directory.
  31. # Cnn is C plus the number of the database icon.
  32. #
  33. # Example: copy key C00
  34. copy() {
  35. # The source file is:
  36. SRC="${SRCDIR}/svg/${1}.svg"
  37. if [[ ! -f $SRC ]]; then
  38. echo -e "${RED}Cannot find source icon for ${2} (${SRC})${NC}"
  39. return
  40. fi
  41. # Copy the source file to the destination, keeping
  42. # the source file's extension
  43. DST="$DSTDIR/${2}.svg"
  44. cp -- "$SRC" "$DST"
  45. echo "Copied icon for ${1} to ${DST}"
  46. }
  47. # Now do the actual work
  48. #copy key C00_Password # Derivative work from key
  49. copy globe C01_Package_Network
  50. copy high_priority C02_MessageBox_Warning
  51. copy data_protection C03_Server # No exact match
  52. copy survey C04_Klipper
  53. copy businessman C05_Edu_Languages
  54. copy services C06_KCMDF
  55. #copy notepad C07_Kate # Provided by paomedia/small-n-flat
  56. copy external C08_Socket
  57. copy business_contact C09_Identity
  58. copy address_book C10_Kontact
  59. copy old_time_camera C11_Camera
  60. copy entering_heaven_alive C12_IRKickFlash # No exact match
  61. #copy keys-holder C13_KGPG_Key3 # Derivative work from key
  62. copy crystal_oscillator C14_Laptop_Power
  63. copy video_projector C15_Scanner
  64. copy bookmark C16_Mozilla_Firebird
  65. #copy cd C17_CDROM_Unmount # Provided by paomedia/small-n-flat
  66. #copy monitor C18_Display # Provided by paomedia/small-n-flat
  67. #copy feedback C19_Mail_Generic # Derivative work from feedback
  68. copy settings C20_Misc
  69. copy inspection C21_KOrganizer
  70. copy file C22_ASCII
  71. copy template C23_Icons
  72. copy flash_on C24_Connect_Established
  73. copy safe C25_Folder_Mail # No exact match
  74. #copy save C26_FileSave # Provided by paomedia/small-n-flat
  75. #copy cloud-storage C27_NFS_Unmount # Provided by paomedia/small-n-flat
  76. copy film_reel C28_QuickTime
  77. #copy C29_KGPG_Term # Derivative work from command_line and key
  78. #copy command_line C30_Konsole # Derivative work from command_line
  79. copy print C31_FilePrint
  80. copy org_unit C32_FSView
  81. copy cloth C33_Run
  82. copy support C34_Configure
  83. #copy vpn C35_KRFB # Derivative work from paomedia/small-n-flat
  84. #copy archive-folder C36_Ark # Derivative work from folder
  85. #copy percentage C37_KPercentage # Original work
  86. #copy windows-client C38_Samba_Unmount # Derivative work from paomedia/small-n-flat
  87. copy clock C39_History
  88. copy search C40_Mail_Find
  89. copy landscape C41_VectorGfx
  90. copy electronics C42_KCMMemory
  91. copy empty_trash C43_EditTrash
  92. #copy C44_KNotes # Provided by paomedia/small-n-flat
  93. #copy C45_Cancel # Original work
  94. #copy C46_Help # Original work
  95. copy package C47_KPackage
  96. copy folder C48_Folder
  97. copy opened_folder C49_Folder_Blue_Open
  98. copy data_encryption C50_Folder_Tar
  99. #copy unlock C51_Decrypted # Provided by paomedia/small-n-flat
  100. #copy lock C52_Encrypted # Provided by paomedia/small-n-flat
  101. #copy C53_Apply # Original work
  102. #copy pencil C54_Signature # Provided by paomedia/small-n-flat
  103. copy image_file C55_Thumbnail
  104. copy contacts C56_KAddressBook
  105. copy data_sheet C57_View_Text
  106. copy podium_with_speaker C58_KPGP # No exact match
  107. #copy hammer C59_Package_Development # Provided by paomedia/small-n-flat
  108. copy home C60_KFM_Home
  109. #copy C61_Services # Original work
  110. copy linux C62_Tux
  111. copy android_os C63_Feather
  112. #copy C64_Apple # Derivative work created from simple-icons apple.svg
  113. copy wikipedia C65_W
  114. #copy currency_exchange C66_Money # Provided by paomedia/small-n-flat
  115. copy diploma_1 C67_Certificate
  116. copy smartphone_tablet C68_Blackberry