papirus-icon-theme/tools/work/README.md

194 lines
5.6 KiB
Markdown
Raw Normal View History

# For Developers and Designers
2016-12-06 06:42:43 -05:00
Designing icons for Papirus is easy :)
2016-12-07 01:36:55 -05:00
2017-02-25 17:22:08 -05:00
You only need to draw icons for Papirus and then convert colors for ePapirus, Papirus Dark and Papirus-Light using our scripts.
2016-12-08 04:49:09 -05:00
## Basic concepts
2016-12-26 17:49:23 -05:00
2017-02-25 17:22:08 -05:00
Papirus is an SVG-based icon theme for Linux, drawing inspiration from Material Design and flat design.
2016-12-08 04:49:09 -05:00
All elements are clear, distinct and have outlines. Another main feature that distinguishes our theme is its use of warm color tones.
2016-12-08 04:49:09 -05:00
2017-07-29 01:42:36 -04:00
Papirus use layering style - moving from dark (down) to light (up) tone on layers.
2017-07-29 01:42:36 -04:00
Objects have light stroke (#fff 20% or 10% for dark icons) and shadow (always #000 20%), see templates for more info.
Mainly single size for all icons (without shadow):
- 16px draw 16px icon
- 22px draw 20px icon
- 24px draw 20px icon
- 32px draw 28px icon
- 48px draw 40px icon
- 64px draw 56px icon
2016-12-11 02:50:00 -05:00
2016-12-26 17:49:23 -05:00
#### Main icons
Main icons have the following sizes: 16px, 22px, 24px, 32px and 48px. Also available are some 64px icons for Apps, Devices, Places and Mimes.
2016-12-08 04:49:09 -05:00
2017-02-25 17:22:08 -05:00
> Why do we need so many sizes for an SVG?
2016-12-08 04:49:09 -05:00
Because if we use a single size for all then the icons will be blurred. All objects on Papirus have pixelated alignment.
2016-12-08 04:49:09 -05:00
2017-07-29 01:42:36 -04:00
Keeping this in mind, **please do not use** very bright and toxic colors for Papirus.
For compabillity with mostly GTK Themes we use this palette:
2018-01-16 03:58:25 -05:00
- white `#e4e4e4`
2017-08-03 01:12:40 -04:00
- black `#4f4f4f`
2017-07-30 00:06:35 -04:00
For devices used material colors:
- steel `#afafb1`
- aluminium `#8e8e8e`
- plastic `#4f4f4f`
2017-07-29 01:42:36 -04:00
Examples are available in the main icon theme folders. In the `work` directory, you'll only find templates and scripts.
2016-12-26 17:49:23 -05:00
#### Monochrome icons
2016-12-06 07:18:33 -05:00
2016-12-26 17:49:23 -05:00
Papirus now also supports KDE color scheme for monochrome actions, devices, places and panel icons. You can find more detailed info about that [here](https://techbase.kde.org/Development/Tutorials/Plasma5/ThemeDetails#Colors).
2016-12-06 06:42:43 -05:00
Presently we only support the following icons:
2016-12-26 17:49:23 -05:00
2016-12-06 06:42:43 -05:00
- actions (16px, 22px, 24px)
- devices (16px)
- places (16px)
- panel (22px, 24px)
2016-12-11 06:59:31 -05:00
## System Requirements
2016-12-26 17:49:23 -05:00
2017-02-25 17:22:08 -05:00
- Inkscape
2017-05-13 13:39:55 -04:00
- scour
2016-12-06 14:44:52 -05:00
2016-12-08 04:49:09 -05:00
For Debian/Ubuntu/Linux Mint users:
2016-12-26 17:49:23 -05:00
2016-12-06 14:44:52 -05:00
```
2016-12-08 04:49:09 -05:00
sudo apt update
2017-05-13 13:39:55 -04:00
sudo apt install inkscape python-scour
2017-08-30 13:44:25 -04:00
sudo pip install --upgrade scour
2016-12-06 14:44:52 -05:00
```
2016-12-26 17:49:23 -05:00
## Step-by-Step Guide
2016-12-06 14:52:33 -05:00
2016-12-26 17:49:23 -05:00
### 1. Getting Started
2017-02-25 17:22:08 -05:00
Open directory `work` in a file manager and open a terminal in the directory. You can do it from the context menu entry `Open in Terminal` or `Action → Open Terminal Here`.
2016-12-06 06:42:43 -05:00
2016-12-26 17:49:23 -05:00
- #### Create a new icon
2017-07-21 04:18:47 -04:00
Create a new icon from the provided template using the script `tools/work/new-icon.sh`. For all new icons, **please stick to using the template**. It is necessary because the template already has some needed objects, like a CSS stylesheet.
2017-07-21 04:18:47 -04:00
```sh
2016-12-27 00:47:33 -05:00
# For example
2016-12-11 05:08:05 -05:00
2017-07-21 04:18:47 -04:00
./new-icon.sh apps abricotine
2016-12-11 05:08:05 -05:00
2016-12-28 05:35:56 -05:00
# It creates the following files inside work directory
# from the template files:
2017-01-03 14:09:18 -05:00
#
2016-12-26 17:49:23 -05:00
# ./Papirus/apps/abricotine@16x16.svg
# ./Papirus/apps/abricotine@22x22.svg
# ./Papirus/apps/abricotine@24x24.svg
# ./Papirus/apps/abricotine@32x32.svg
# ./Papirus/apps/abricotine@48x48.svg
# ./Papirus/apps/abricotine@64x64.svg
```
2016-12-11 05:08:05 -05:00
2016-12-26 17:49:23 -05:00
- #### Edit an existing icon
2017-07-21 04:18:47 -04:00
If you want to modify an existing icon, you can do that using the script `tools/work/get-from-theme.sh`.
2016-12-26 17:49:23 -05:00
2017-07-21 04:18:47 -04:00
```sh
2016-12-27 00:47:33 -05:00
# For example
2016-12-26 17:49:23 -05:00
2017-07-21 04:18:47 -04:00
./get-from-theme.sh panel transmission-tray-icon.svg
2016-12-26 17:49:23 -05:00
2016-12-28 05:35:56 -05:00
# It copies following files into work directory from the
# main icon theme folders:
2017-01-03 14:09:18 -05:00
#
2017-01-03 14:18:58 -05:00
# ./Papirus/panel/transmission-tray-icon@22x22.svg
# ./Papirus/panel/transmission-tray-icon@24x24.svg
2016-12-26 17:49:23 -05:00
```
2017-02-25 17:22:08 -05:00
- #### Make symlinks to an existing icon
2017-02-25 17:27:17 -05:00
It is a real example of the issue [#354](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/354)
2017-02-25 17:22:08 -05:00
2017-07-21 04:18:47 -04:00
Make sure those icons exist:
2017-02-25 17:22:08 -05:00
2017-07-21 04:18:47 -04:00
```sh
find ../../Papirus -type f -iname '*ardour*' -print
2017-02-25 17:27:17 -05:00
2017-02-25 17:22:08 -05:00
# ./Papirus/16x16/apps/ardour.svg
# ./Papirus/22x22/apps/ardour.svg
# ./Papirus/24x24/apps/ardour.svg
# ./Papirus/32x32/apps/ardour.svg
# ./Papirus/48x48/apps/ardour.svg
# ./Papirus/64x64/apps/ardour.svg
```
2017-07-21 04:18:47 -04:00
Great, it's true, now you have the filename of the icon, it's `ardour.svg`, and the symlink name from the issue [#354](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/354), it's `ardour5`. Create symlinks with the command:
2017-02-25 17:22:08 -05:00
2017-07-21 04:18:47 -04:00
```sh
# Usage: ./new-symlink.sh context <icon filename> <symlink name>...
2017-02-25 17:22:08 -05:00
./new-symlink.sh apps ardour.svg ardour5
2017-02-25 17:22:08 -05:00
```
**NOTE:** Symlinks will look like broken but is ok.
2017-07-21 04:18:47 -04:00
If your symlinks are in apps, emblems or mimetypes you can continue from step **4.3**, else continue from step **3**.
2017-02-25 17:22:08 -05:00
2016-12-27 00:47:33 -05:00
**IMPORTANT:** Please don't remove suffixes from the filename as it's needed for other scripts. Filename extension must be in lowercase.
2016-12-26 17:49:23 -05:00
### 2. Papirus
2017-02-25 17:22:08 -05:00
1. Open the created/copied file in Inkscape.
2016-12-26 17:49:23 -05:00
2. Delete any objects you do not need.
3. Draw new objects.
2017-02-25 17:22:08 -05:00
4. Save the file with the same filename.
2016-12-26 17:49:23 -05:00
5. Repeat it for other sizes.
2017-07-21 04:18:47 -04:00
### 3. Papirus Dark, Papirus Light and ePapirus
2016-12-26 17:49:23 -05:00
2017-07-21 04:18:47 -04:00
1. Run script `tools/work/convert.sh`. It copies needed icons from `work/Papirus` to `work/Papirus-Dark`, `work/Papirus-Light` and `work/ePapirus` and changes their color schemes.
2016-12-26 17:49:23 -05:00
2016-12-28 05:35:56 -05:00
**IMPORTANT:** You should draw icons for Papirus first.
2016-12-26 17:49:23 -05:00
2017-07-21 04:18:47 -04:00
```sh
./convert.sh
2016-12-26 17:49:23 -05:00
```
2016-12-27 00:47:33 -05:00
2. Check result and edit manually if needed.
2016-12-26 17:49:23 -05:00
2017-07-21 04:18:47 -04:00
### 4. Final Steps
2017-07-21 04:18:47 -04:00
1. Run script `tools/work/prepare.sh` to clean the created icons:
2017-07-21 04:18:47 -04:00
```sh
./prepare.sh
2016-12-26 17:49:23 -05:00
```
2. Please check your icons again.
2017-07-21 04:18:47 -04:00
3. If everything is fine then put the icons into main icon theme folders:
2016-12-26 17:49:23 -05:00
2017-07-21 04:18:47 -04:00
```sh
./put-into-theme.sh
2016-12-26 17:49:23 -05:00
```
4. Clean the `work` directory:
2017-07-21 04:18:47 -04:00
```sh
2016-12-26 17:49:23 -05:00
./clean.sh
```
2017-09-30 14:14:34 -04:00
5. Run tests:
2017-02-25 17:22:08 -05:00
2017-07-21 04:18:47 -04:00
```sh
make test
2017-02-25 17:22:08 -05:00
```
6. Everything is ready now! You can commit the changes to GitHub.