Skip to content

Commit

Permalink
build: add icon generator and update icons
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii Shartsev <[email protected]>
  • Loading branch information
ShGKme committed Mar 2, 2023
1 parent 789f827 commit d5dd93a
Show file tree
Hide file tree
Showing 14 changed files with 721 additions and 1 deletion.
2 changes: 1 addition & 1 deletion forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require('dotenv').config()

module.exports = {
packagerConfig: {
icon: './img/talk-icon-rounded',
icon: './img/icons/icon',
},
rebuildConfig: {},
makers: [
Expand Down
50 changes: 50 additions & 0 deletions img/generate-icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* @copyright Copyright (c) 2023 Grigorii Shartsev <[email protected]>
*
* @author Grigorii Shartsev <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

const path = require('node:path')
const fs = require('node:fs/promises')
const icongen = require('icon-gen')

const originalPath = path.join(__dirname, './talk-icon-rounded.svg')
const outputPath = path.join(__dirname, './icons')

icongen(originalPath, path.join(__dirname, './icons'), {
// Windows
ico: {
name: 'icon',
sizes: [16, 24, 32, 48, 256],
},
// Mac
icns: {
name: 'icon',
sizes: [16, 32, 64, 128, 256, 512, 1024],
},
// Linux (PNG)
favicon: {
name: 'icon',
pngSizes: [512],
icoSizes: [],
},
})
.then(() => fs.rename(path.join(outputPath, 'icon512.png'), path.join(outputPath, 'icon.png')))
.then(() => fs.unlink(path.join(outputPath, 'favicon.ico')))
.then(() => console.log('✅ Done'))
.catch((err) => console.error(err))
Empty file added img/icons/.gitkeep
Empty file.
Binary file added img/icons/icon.icns
Binary file not shown.
Binary file added img/icons/icon.ico
Binary file not shown.
Binary file added img/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/talk-icon-rounded.icns
Binary file not shown.
Binary file removed img/talk-icon-rounded.ico
Binary file not shown.
Binary file removed img/[email protected]
Binary file not shown.
Binary file removed img/[email protected]
Binary file not shown.
Binary file removed img/[email protected]
Binary file not shown.
Binary file removed img/[email protected]
Binary file not shown.
Loading

0 comments on commit d5dd93a

Please sign in to comment.