sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

README.md (6413B)


      1 ![ls](image/ls.jpg)
      2 
      3 ## Overview
      4 
      5 - `icons-in-terminal` allows you to get any fonts in your terminal without replacing or patching your font.  
      6 - You can add as many fonts as you want easily, you just need the ttf/odf file and add it to `config.json`.  
      7 - `icons-in-terminal` can also be use with graphical applications.  
      8 
      9 ## Table of Contents
     10 
     11 1. [**Installation**](#installation)  
     12 2. [**Building**](#building)  
     13 3. [**How it works**](#how-it-works)  
     14 4. [**Included icons**](#included-icons)  
     15 5. [**Screenshots**](#screenshots)  
     16 6. [**Integrations**](#integrations)  
     17     * [**fish-shell**](#fish-integration)  
     18     * [**bash**](#bash-integration)  
     19     * [**emacs**](#emacs-integration)  
     20 7. [**Projects using icons-in-terminal**](#projects-using-icons-in-terminal)  
     21     * [**ls**](#ls)  
     22     * [**emacs**](#emacs)  
     23 8. [**Todos**](#todos)  
     24 
     25 ## Installation
     26 
     27 ```bash
     28 $ git clone https://github.com/sebastiencs/icons-in-terminal.git
     29 ```
     30 
     31 To install `icons-in-terminal`, run:  
     32 ```bash
     33 $ ./install.sh  
     34 $ # Follow the instructions to edit ~/.config/fontconfig/conf.d/30-icons.conf
     35 ```
     36 Or if your terminal is [supported](https://github.com/sebastiencs/icons-in-terminal/issues/1) (Experimental)
     37 ```bash
     38 $ ./install-autodetect.sh 
     39 ```
     40 Done ! You can start a new terminal and run `print_icons.sh` to see the installed gryphs.  
     41 You can see names of each icon by giving any parameter to `print_icons.sh`:  
     42 ```bash
     43 $ ./print_icons.sh
     44 $ ./print_icons.sh --names
     45 $ ./print_icons.sh --names | grep ANY_NAME
     46 ```
     47 To use icons in your terminal, **do not copy-paste icons** from the output of `print_icons.sh` but use their variable name: see [integrations](#integrations).  
     48 When one of the provided font will be updated and add new icons, some codepoints in `icons-in-terminal.ttf` will be changed, the variable names won't.  
     49 
     50 ## Building
     51 
     52 If you want to add new font, follow these instructions:  
     53 
     54 There are a few dependencies to install:  
     55 
     56 - Python 3
     57 - [fontforge (with python extension)](https://fontforge.github.io)
     58 
     59 You can add the name and path of your font to the file `config.json`.  
     60 Each font can take parameters:  
     61 - `start-from`: exclude all glyphes before the given codepoint.
     62 - `until`: exclude all glyphes at the given codepoint and after.
     63 - `excludes`: exclude the given codepoints.
     64 - `move-vertically`: Use this parameter if your font and its glyphes are not centered vertically.
     65 - `short-name`: Prefix to insert before the glyph name when you want to use the icon in your shell or anywhere else
     66 - `map-names`: Define a name to the glyph. If not provided, the name will be read from the ttf file
     67 
     68 Once done, you can run:  
     69 ```bash
     70 $ ./build.sh
     71 ```
     72 ## How it works
     73 
     74 This project is inspired by [awesome-terminal-fonts](https://github.com/gabrielelana/awesome-terminal-fonts) but is different.  
     75 I don't modify any existing font, I merge all glyphes from the provided fonts in a new font file and insert them in the [private use areas](https://en.wikipedia.org/wiki/Private_Use_Areas).  
     76 The file `~/.config/fontconfig/conf.d/30-icons.conf` tells to freetype to search the glyph in `icons-in-terminal.ttf` if it fails in your default font file. As the codepoints generated are in the private use areas, freetype should always fail and fallback to icons-in-terminal.ttf  
     77 The only requirement is that your default font shouldn't be already patched/modified. But why use a patched font with a limited number of glyphes when they are all included here :)  
     78 Your terminal emulator should also support [fallback font](https://en.wikipedia.org/wiki/Fallback_font) (most of them support it)  
     79 
     80 ## Included icons
     81 
     82 There are already 3618 glyphes included:  
     83 
     84 | Name                                                                             | Version        | Notes |
     85 | ---------------------------------------------------------------------------------|---------------:|--------|
     86 | [powerline-extra-symbols](https://github.com/ryanoasis/powerline-extra-symbols)  | commit 4eae6e8 | |
     87 | [octicons](https://octicons.github.com/)                                         | 4.4.0          | |
     88 | [fontawesome](http://fontawesome.io/)                                            | 4.7            | |
     89 | [material-design-icons](https://github.com/google/material-design-icons)         | 3.0.1          | |
     90 | [file-icons](https://atom.io/packages/file-icons)                                | 2.1.4          | |
     91 | [weather-icons](https://erikflowers.github.io/weather-icons/)                    | 2.0.10         | |
     92 | [font-linux](https://github.com/Lukas-W/font-linux)                              | 0.9            | |
     93 | [devicons](https://github.com/vorillaz/devicons)                                 | 1.8.0          | |
     94 | [Pomicons](https://github.com/gabrielelana/pomicons)                             | commit bb0a579 | |
     95 | [linea](http://linea.io/)                                                        | 1.0            | |
     96 | [font-mfizz](https://github.com/fizzed/font-mfizz)                               | 2.4.1          | |
     97 | [FiraCode](https://github.com/tonsky/FiraCode)                                   | [1.200](https://github.com/tonsky/FiraCode/issues/211#issuecomment-239058632) | See if your terminal is [compatible](https://github.com/tonsky/FiraCode#terminal-support) |
     98 
     99 ## Screenshots
    100 
    101 ![Screenshot the included icons](image/icons.jpg)
    102 ![Screenshot with fish](image/icons-fish.jpg)
    103 
    104 ## Integrations
    105 
    106 ### Fish integration
    107 
    108 To use `icons-in-terminal` with fish, add this line to `~/.config/fish/config.fish`:  
    109 ```bash
    110 source ~/.local/share/icons-in-terminal/icons.fish
    111 ```
    112 Restart a terminal, now you can print any icons with its name:  
    113 ```bash
    114 $ echo $oct_location
    115 ```
    116 
    117 ### Bash integration
    118 
    119 Add this line to your .bashrc:  
    120 ```bash
    121 source ~/.local/share/icons-in-terminal/icons_bash.sh
    122 ```
    123 Restart a terminal, now you can print any icons with its name:  
    124 ```bash
    125 $ echo -e $oct_location # note the '-e'
    126 ```
    127 
    128 ### Emacs integration
    129 
    130 Add this line to your emacs init file:
    131 ```el
    132 (add-to-list 'load-path "~/.local/share/icons-in-terminal/")
    133 ```
    134 To use icons-in-terminal in your package:
    135 ```el
    136 (require 'icons-in-terminal)
    137 (insert (icons-in-terminal 'oct_flame)) ; C-h f icons-in-terminal[RET] for more info
    138 ```
    139 
    140 ## Projects using icons-in-terminal
    141 
    142 ### ls
    143 
    144 https://github.com/sebastiencs/ls-icons
    145 
    146 ### emacs
    147 
    148 https://github.com/sebastiencs/sidebar.el
    149 
    150 ## Todos
    151 
    152 - Integrate with differents shells