summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasdfasdf <67588957+asdf8dfafjk@users.noreply.github.com>2024-04-17 14:24:22 +0530
committerGitHub <noreply@github.com>2024-04-17 14:24:22 +0530
commit306c504ae46fe1d003772a0009afca624d3118dc (patch)
tree6386ff3603e2565108d558b1beaa8db99b6e0ba6
parent30f2003c058a151f553f573802947758f122903d (diff)
Update icons.md
Remove duplication
-rw-r--r--website/docs/icons.md142
1 files changed, 64 insertions, 78 deletions
diff --git a/website/docs/icons.md b/website/docs/icons.md
index 7010645..d027442 100644
--- a/website/docs/icons.md
+++ b/website/docs/icons.md
@@ -1,9 +1,15 @@
# Icons Overview
-You may configure broot to display icons in two ways.
+Broot supports showing icons in terminal if a supported font is installed.
+Currently, two fonts are supported, `nerdfonts` and `vscode`.
-For this you need one of those in your broot config:
+Here is a screenshot, with nerdfont to the left and vscode at right:
+![Broot icon comparison](img/20240225-icon-comparison.png)
+
+# Configuration
+
+First add the appropriate lines to your broot config.
```hjson
icon_theme: vscode
@@ -21,114 +27,86 @@ icon_theme: nerdfont
icon_theme = "nerdfont"
```
+If the appropriate fonts are already installed correctly on your system then new instances of broot will show icons correctly.
-Here is a comparison, with nerdfont to the left and vscode at right:
+# Installation and checking for presence
-![Broot icon comparison](img/20240225-icon-comparison.png)
+## Checking the font
-# Nerdfont Icons:
+### VSCode
-## Installation
+#### Bash (and compatible):
+```bash
+echo -e "file_type_rust looks like \U001002D2"
+```
-1. In order for the nerdfont setting to work you need to have a <a href="https://github.com/ryanoasis/nerd-fonts" target="_blank">patched nerdfont
-</a> installed and set as your font in the terminal emulator of your choice.
-2. After a successful installation, you need to add or uncomment the `icon_theme: "nerdfont"` line in broot's config file
-3. You should now be able to see icons when opening broot in your terminal.
+#### powershell
-## Checking the font
+```powershell
+echo "Rust is `u{1002D2}"
+```
+If you see a rust gear icon, your terminal is displaying the correct font.
-If you want to make sure your nerdfont was installed correctly. Try printing out the utf code for the rust icon in your terminal:
+### Nerdfont
-### Bash (and compatible):
+#### Bash (and compatible):
```bash
echo -e "file_type_rust looks like \ue7a8"
```
This should display a rust icon
-## FAQ
-
-**Q:** I don't see icons for my favourite common file type.
-
-**A:** There could be three reasons why you don't see your file type icon
-
-1. check if your font was setup correctly. See [Installation](icons.md#minstallation) and #checking the font
-2. The iconset is limited by available nerdfont icons. Some icons simply don't exist as of yet.
- Eg. a vite or prettier icon. You can find available icons in the nerdfont [cheat-sheet](https://www.nerdfonts.com/cheat-sheet)
-3. If both of those are true and you think you found an icon we mapped wrong or is missing, we welcome your contribution! Send us a message in the [Miaou chat](https://miaou.dystroy.org/3490?broot) or create a pull request
-
-**Q:** Why does broot show a generic icon for this very common file type?
-
-**A:** The icon mappings aren't complete. You can help out very easily without any coding knowledge. Go to the github repository. Enter the directory corresponding to your theme. Inside data, edit extension_to_icon_name_map.rs and add a line corresponding to your extension. The first field would be the extensions you would like, and the second field should be referred from icon_name_to_icon_code_point_map.rs. Submit a PR.
-
-**Q:** Can I set up a totally different set of icons or mappings ?
-
-**A:** Broot can be configured for a different mapping or a different font, but this needs some coding and a new compilation.
-To get started, have a look at look at the resources/icons/nerdfont directory and, if necessary, come and chat on miaou.
-
-If you want to map or remap icons, please go to <a href="https://www.nerdfonts.com/cheat-sheet" target="_blank">nerdfont-cheat-sheet</a> and search for an icon you would like to set in its place.
-In order to correctly fix the icon mapping you need a FILE_EXTENSION and a NERDFONT_ICON_CODE. For this example we are remapping the json file extension.
-
-The first thing you need to do is find the "json" icon you want to map to in the cheatsheet and copy its iconCode ("the code inside the red box in the screenshot below").
-Once done, find the corresponding file mapping in resources/icons/nerdfont by searching for your filetype in icon_name_to_icon_code_point_map:
-In this case its this line:
-```
-( "file_type_json", 0xe60b ),
-```
-As you can see: the icon is mapped by "0x" followed by your iconCode. After changing this you should be able to recompile broot and see your new icon. If this is a new file mapping or a missing icon. Please consider contributing!
+Unless you're really unlucky (there is some font that has the rust gear icon at the exact unicode point as the query but doesn't have other glyphs), you probably have the font installed correctly. If not, move to the installation section.
-![nerdfont cheatsheet iconCode](img/20240225-nerdfont-cheatsheet.png)
-
+## Installation
-# Vscode Icons:
+### VSCode
-## Checking the font
+If the font isn't installed, you may
-This feature needs the vscode font to be installed and available on your system.
+* take it from `/resources/icons/vscode/vscode.ttf` if you have broot sources
+* download it from [https://github.com/Canop/broot/blob/main/resources/icons/vscode/vscode.ttf](https://github.com/Canop/broot/blob/main/resources/icons/vscode/vscode.ttf),
+* or take it from the release archive if you installed broot from its zipped archive.
-It's possible the font was installed with broot's package, depending on the chosen package.
+#### Installation on linux:
-Here's how you can check its presence:
+Copy the `vscode.ttf` file to `~/.local/share/fonts`.
-### Bash (and compatible):
-```bash
-echo -e "file_type_rust looks like \U001002D2"
-```
+#### Installation on Windows
-### powershell
+Double click the `vscode.ttf` file icon and click on "Install font".
-```powershell
-echo "Rust is `u{1002D2}"
-```
-If you see a rust gear icon, your terminal is displaying the correct font.
-## Setting up the font
+### Nerdfonts
-If the font isn't installed, you may
+1. In order for the nerdfont setting to work you need to have a <a href="https://github.com/ryanoasis/nerd-fonts" target="_blank">patched nerdfont
+</a> installed and set as your font in the terminal emulator of your choice.
+2. After a successful installation, you need to add or uncomment the `icon_theme: "nerdfont"` line in broot's config file
+3. You should now be able to see icons when opening broot in your terminal.
-* take it in `/resources/icons/vscode/vscode.ttf` if you have broot sources
-* download it from [https://github.com/Canop/broot/blob/main/resources/icons/vscode/vscode.ttf](https://github.com/Canop/broot/blob/main/resources/icons/vscode/vscode.ttf),
-* or take it in the release archive if you installed broot from its zipped archive.
-### Installation on linux:
-Copy the `vscode.ttf` file to `~/.local/share/fonts`.
+## FAQ
-### Installation on Windows
+**Q:** I don't see icons for my favourite common file type.
-Double click the `vscode.ttf` file icon and click on "Install font".
+**A:** There could be three reasons why you don't see your file type icon
-## Setting up your broot config
+1. Check if your font was setup correctly. See [Installation](icons.md#minstallation) and #checking the font
+2. The iconset is limited by available nerdfont icons. Some icons simply don't exist as of yet.
+ Eg. a vite or prettier icon. You can find available icons in the nerdfont [cheat-sheet](https://www.nerdfonts.com/cheat-sheet)
+3. If both of those are true and you think you found an icon we mapped wrong or is missing, we welcome your contribution! Send us a message in the [Miaou chat](https://miaou.dystroy.org/3490?broot) or create a pull request
-In broot's config file, add or uncomment the `icon_theme: "vscode"` line.
+**Q:** Why does broot show a generic icon for this very common file type?
+**A:** The icon mappings aren't complete. You can help out very easily without any coding knowledge. Go to the github [repository](https://github.com/Canop/broot/tree/main/resources/icons). Enter the directory corresponding to your theme. Inside `data`, edit `extension_to_icon_name_map.rs` and add a line corresponding to your extension. The first field would be the extensions you would like, and the second field should be referred from `icon_name_to_icon_code_point_map.rs`. Submit a PR.
-## FAQ
-**Q:** I don't see icons for my favourite common file type.
+**Q:** Can I set up a totally different set of icons or mappings ?
-**A:** This is a work in progress, you can help out
+**A:** Broot can be configured for a different mapping or a different font, but this needs some coding and a new compilation.
+To get started, have a look at look at the resources/icons/nerdfont directory and, if necessary, come and chat on miaou.
**Q:** Why isn't the icon mapping configurable?
@@ -136,12 +114,20 @@ In broot's config file, add or uncomment the `icon_theme: "vscode"` line.
**A:** For performance reasons, icon mapping is hardcoded. If this looks like a problem, please come and chat with us.
-**Q:** Why does broot show a generic icon for this very common file type?
+**Q:** How do I remap in nerdfont?
-**A:** The icon mappings aren't complete. You can help out very easily without any coding knowledge. Go to the github [repository](https://github.com/Canop/broot/tree/main/resources/icons). Enter the directory corresponding to your theme. Inside `data`, edit `extension_to_icon_name_map.rs` and add a line corresponding to your extension. The first field would be the extensions you would like, and the second field should be referred from `icon_name_to_icon_code_point_map.rs`. Submit a PR.
+**A:** If you want to map or remap icons, please go to <a href="https://www.nerdfonts.com/cheat-sheet" target="_blank">nerdfont-cheat-sheet</a> and search for an icon you would like to set in its place.
+In order to correctly fix the icon mapping you need a FILE_EXTENSION and a NERDFONT_ICON_CODE. For this example we are remapping the json file extension.
+The first thing you need to do is find the "json" icon you want to map to in the cheatsheet and copy its iconCode ("the code inside the red box in the screenshot below").
+Once done, find the corresponding file mapping in resources/icons/nerdfont by searching for your filetype in icon_name_to_icon_code_point_map:
+In this case its this line:
+```
+( "file_type_json", 0xe60b ),
+```
+As you can see: the icon is mapped by "0x" followed by your iconCode. After changing this you should be able to recompile broot and see your new icon. If this is a new file mapping or a missing icon. Please consider contributing!
+
+
+![nerdfont cheatsheet iconCode](img/20240225-nerdfont-cheatsheet.png)
-**Q:** Can I set up a totally different set of icons or mappings ?
-**A:** Broot can be configured for a different mapping or a different font, but this needs some coding and a new compilation.
-To get started, have a look at look at the `resources/icons` directory and, if necessary, come and chat on miaou.