Skip to content

Commit aa28f75

Browse files
Transfer and polish existing "Nord dircolors" docs and assets
Inititially this includes the install & activation guide and supported data and node types. GH-159
1 parent 37f100d commit aa28f75

14 files changed

+311
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import Link from "atoms/core/Link";
2+
import { Banner, Image, ShrinkedWidth, SpaceBox } from "atoms/core/mdx-elements";
3+
import { Code } from "atoms/core/html-elements";
4+
import { ReactComponent as WindowCode } from "assets/images/illustrations/window-code.svg";
5+
import { ROUTE_DOCS_COLOR_AND_PALETTES, ROUTE_PORTS } from "config/routes/mappings";
6+
7+
import WIPNotice from "../../../../shared/docs/wip-notice";
8+
9+
export const frontmatter = {
10+
title: "Installation & Activation",
11+
subline: "Get up and running in one line of code for your favorite shell"
12+
};
13+
14+
<ShrinkedWidth value={25}>
15+
16+
<SpaceBox mTop={4} mBottom={4}>
17+
<WindowCode />
18+
</SpaceBox>
19+
20+
</ShrinkedWidth>
21+
22+
<ShrinkedWidth value={80}>
23+
24+
<WIPNotice />
25+
26+
<Banner
27+
title={
28+
<>
29+
The theme <strong>must</strong> be used with a <Link to={ROUTE_PORTS}>Nord terminal emulator theme</Link> in order to work properly!
30+
</>
31+
}
32+
>
33+
Make sure to install one of the currently supported <Link to={ROUTE_PORTS}>terminal emulator port projects</Link> <strong>before</strong> installing Nord dircolors.
34+
35+
[`dircolors`][gnu-docs-dircolors] uses the 16 color codes provided by the terminal emulator.
36+
**When used with another color theme** than the one provided by one of Nord's terminal emulator ports, the colors for dircolors won't use <Link to={ROUTE_DOCS_COLOR_AND_PALETTES}>Nord's color palettes</Link>!
37+
This will result in different styles than those defined by Nord dircolors and could make it appear that there is a problem with the theme while the actual problem are missing Nord colors.
38+
39+
Read the GitHub Gist about [terminal colors][gh-gist-terminal-colors] for more information about terminal color specifications.
40+
41+
</Banner>
42+
43+
## Installation
44+
45+
Nord dircolors can be installed for all application that respect the `LS_COLORS` environment variable like GNU core utils [`ls`][wiki-ls], [`tree`][wiki-tree] or modern projects like [`fd`][gh-sharkdp/fd].
46+
47+
To automatically load Nord dircolors for every shell session, download the [`dir_colors`][gh-tree-dir_colors] file and place it as `~/.dir_colors` in your [home directory][wiki-home_dir].
48+
49+
### Latest Development State
50+
51+
To always use the latest development state of Nord dircolors, [clone the repository][repo] and create a [symbolic link][wiki-symlink] of the `src/dir_colors` file to `~/.dir_colors` in your [home directory][wiki-home_dir] afterwards:
52+
53+
```sh
54+
ln -sr "$PWD/src/dir_colors" "~/.dir_colors"
55+
```
56+
57+
## Activation
58+
59+
To activate and use Nord dircolors as your default color theme for all sessions, load the theme with `dircolors` by adding the following snippet to the configuration file of your shell (`~/.bashrc`, `~/.zshrc`, …):
60+
61+
```sh
62+
test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors)
63+
```
64+
65+
<Image
66+
dropShadow
67+
fluid={props.images["shell-rc.png"]}
68+
rounded
69+
alt="Screenshot showing an example of a shell configuration file to load Nord through dircolors"
70+
>
71+
<span>
72+
<em>Oneliner</em> for a shell configuration to automatically load the theme.
73+
</span>
74+
</Image>
75+
76+
</ShrinkedWidth>
77+
78+
[gh-gist-terminal-colors]: https://gist.github.com/XVilka/8346728
79+
[gh-sharkdp/fd]: https://github.com/sharkdp/fd
80+
[gh-tree-dir_colors]: https://github.com/arcticicestudio/nord-dircolors/blob/develop/src/dir_colors
81+
[gnu-docs-dircolors]: https://www.gnu.org/software/coreutils/manual/html_node/dircolors-invocation.html
82+
[repo]: https://github.com/arcticicestudio/nord-dircolors
83+
[wiki-home_dir]: https://en.wikipedia.org/wiki/Home_directory
84+
[wiki-ls]: https://en.wikipedia.org/wiki/Ls
85+
[wiki-symlink]: https://en.wikipedia.org/wiki/Symbolic_link
86+
[wiki-tree]: https://en.wikipedia.org/wiki/Tree_(command)
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
import Link from "atoms/core/Link";
2+
import { Banner, Image, ShrinkedWidth, SpaceBox } from "atoms/core/mdx-elements";
3+
import { Code } from "atoms/core/html-elements";
4+
import { ReactComponent as DataNodesSSD } from "assets/images/illustrations/data-nodes-ssd.svg";
5+
import { ROUTE_DOCS_PORTS_DIRCOLORS_INSTALLATION } from "config/routes/mappings";
6+
7+
import WIPNotice from "../../../../shared/docs/wip-notice";
8+
9+
export const frontmatter = {
10+
title: "Type Support",
11+
subline:
12+
"Learn about the wide range of supported data and node types — From symbolic links, executables up to file system permissions."
13+
};
14+
15+
<ShrinkedWidth value={25}>
16+
17+
<SpaceBox mTop={4} mBottom={4}>
18+
<DataNodesSSD />
19+
</SpaceBox>
20+
21+
</ShrinkedWidth>
22+
23+
<ShrinkedWidth value={80}>
24+
25+
<WIPNotice />
26+
27+
<Banner
28+
title={
29+
<>
30+
This theme is only compatible for <Link href="https://en.wikipedia.org/wiki/Ls">GNU <Code>ls</Code></Link> and will have no effect with commands from other distributions like BSD (macOS) or Slackware!
31+
</>
32+
}
33+
variant="warn"
34+
>
35+
36+
[dircolors][gnu-docs-dircolors] is a utility that sets the `LS_COLORS` environment variable respected by [GNU `ls`][wiki-ls] when used with the `--color` option. It converts the _color database file_ provided by this theme (`dir_colors`), converts it into the parsable format for the GNU `ls` command and stores it in the `LS_COLOR` environment variable.
37+
38+
Other distributions/platforms/operating systems like [macOS][wiki-macos] are based on [BSD][wiki-bsd] and using a different implementation of the `ls` command that uses a different format for color definitions stored in the `LSCOLOR` environment variable (no underscore).
39+
40+
The `dircolors` utility only supports GNU `ls` and therefore this theme is also only compatible with the GNU `ls` command. It has no effect when used with different implementations.
41+
42+
Please read the [manual pages of the `dircolors(1)` utility][linux-man-dircolors] and it's [configuration file `dir_colors(5)`][linux-man-dir_colors] for more information about supported terminal codes/sequences and platforms.
43+
44+
</Banner>
45+
46+
Nord dircolors provides highlighting for a lot of different data types, their attributes and file system permissions. This document contains a general overview of these types including descriptions about their applied Nord styles.
47+
48+
<Image
49+
alt="Screenshot showing an overview of various file and node types colorized by Nord"
50+
dropShadow
51+
fluid={props.images["overview.png"]}
52+
rounded
53+
>
54+
<span>Overview of various file and node types colorized by Nord.</span>
55+
</Image>
56+
57+
## Global Defaults
58+
59+
The following styles are applied globally to essential data and node types as well as their file system permissions.
60+
61+
### Permissions
62+
63+
The styles are applied for files and directories with different [file system permissions][wiki-fs_perm].
64+
65+
Directories using `nord9` as foreground color and a `bold` font style.
66+
If the `t` permission flag is set the background color is `nord9` instead while `nord4` is used as foreground color using the `underline` font style. Also if the `o+w` permission flags are set too the font uses the `bold` style instead.
67+
68+
For directories with the `777` permission value both the `bold` and `underline` font styles are used.
69+
70+
<Image
71+
alt="Screenshot showing directories with different file system permissions"
72+
dropShadow
73+
fluid={props.images["permissions.png"]}
74+
rounded
75+
>
76+
<span>
77+
Directories with different{" "}
78+
<Link href="https://en.wikipedia.org/wiki/File_system_permissions">file system permissions</Link>.
79+
</span>
80+
</Image>
81+
82+
### Links
83+
84+
The styles are applied for [symbolic][wiki-symlink] and [hard][wiki-hardlink] links using `nord8` as foreground color. Hard links additionally have a `underline` font style.
85+
86+
The foreground color of invalid symbolic links are colored by `nord11` while non-existent link targets using `nord11` as background color and `nord4` foreground with `bold` font styles.
87+
88+
<Image alt="Screenshot showing symbolic and hard links" dropShadow fluid={props.images["links.png"]} rounded>
89+
<span>
90+
Different link types like <Link href="https://en.wikipedia.org/wiki/Symbolic_link">symbolic</Link> and{" "}
91+
<Link href="https://en.wikipedia.org/wiki/Hard_link">hard</Link> links.
92+
</span>
93+
</Image>
94+
95+
### Executables
96+
97+
The styles are applied for [executables][wiki-exec] using `nord7` as foreground color with a `bold` font style.
98+
99+
<Image alt="Screenshot showing executable files" dropShadow fluid={props.images["executables.png"]} rounded>
100+
<span>
101+
<Link href="https://en.wikipedia.org/wiki/Executable">Executables</Link> are recognizable at a glance.
102+
</span>
103+
</Image>
104+
105+
### Blocks and Sockets
106+
107+
The styles are applied for [Unix file types][wiki-unix_ft] like [device files][wiki-dev_file] and [domain sockets][wiki-unix_sock].
108+
109+
Character device files are using `nord13` as foreground while block devices additionally having the `bold` font style. Sockets are also colored by `nord13` with a the `underline` font style.
110+
111+
<Image
112+
alt="Screenshot showing various Unix file types"
113+
dropShadow
114+
fluid={props.images["blocks-and-sockets.png"]}
115+
rounded
116+
>
117+
Various <Link href="https://en.wikipedia.org/wiki/Unix_file_types">Unix file types</Link> like{" "}
118+
<Link href="https://en.wikipedia.org/wiki/Device_file">device files</Link> and{" "}
119+
<Link href="https://en.wikipedia.org/wiki/Unix_domain_socket">domain sockets</Link>.
120+
</Image>
121+
122+
### Capabilities
123+
124+
The styles are applied for files with different [capabilities][wiki-setuid].
125+
126+
The GID `g+s` and UID `u+s` capability flags are colored by `nord4` with the `bold` and `underline` font styles.
127+
128+
<Image
129+
alt="Screenshot showing files with different capabilities"
130+
dropShadow
131+
fluid={props.images["capabilities.png"]}
132+
rounded
133+
>
134+
<Link href="https://en.wikipedia.org/wiki/Setuid">Capabilities</Link> are also styled to be more prominent.
135+
</Image>
136+
137+
### Named Pipe (FIFO)
138+
139+
The styles are applied for [named pipe][wiki-named_pipe], also known as FIFO, using `nord7` as foreground color with the `underline` font style.
140+
141+
<Image
142+
alt="Screenshot showing a named pipe also know as FIFO"
143+
dropShadow
144+
fluid={props.images["named_pipes.png"]}
145+
rounded
146+
>
147+
A <Link href="https://en.wikipedia.org/wiki/Named_pipe">named pipe</Link> also know as FIFO.
148+
</Image>
149+
150+
## Extension Pattern
151+
152+
The following styles are for files with specific file extensions.
153+
154+
### Media
155+
156+
Extension for media based types like images, audio, videos and documents are colored by `nord14` while archive- and compression types additionally using the `bold` font style.
157+
158+
<Image
159+
alt="Screenshot showing file extensions for multimedia files"
160+
dropShadow
161+
fluid={props.images["extension-pattern-media.png"]}
162+
rounded
163+
>
164+
Common file extensions like multimedia files.
165+
</Image>
166+
167+
### Ignore Pattern
168+
169+
Extensions for common [VCS][wiki-vcs] ignore pattern using the `dim` terminal effect applied to `nord4`.
170+
171+
<Image
172+
alt="Screenshot showing ignore pattern files"
173+
dropShadow
174+
fluid={props.images["extension-pattern-ignore.png"]}
175+
rounded
176+
>
177+
Common VSC ignore pattern files.
178+
</Image>
179+
180+
</ShrinkedWidth>
181+
182+
[gnu-docs-dircolors]: https://www.gnu.org/software/coreutils/manual/html_node/dircolors-invocation.html
183+
[linux-man-dir_colors]: https://linux.die.net/man/5/dir_colors
184+
[linux-man-dircolors]: https://linux.die.net/man/1/dircolors
185+
[wiki-bsd]: https://en.wikipedia.org/wiki/Berkeley_Software_Distribution
186+
[wiki-ls]: https://en.wikipedia.org/wiki/Ls
187+
[wiki-macos]: https://en.wikipedia.org/wiki/MacOS
188+
[wiki-symlink]: https://en.wikipedia.org/wiki/Symbolic_link
189+
[wiki-hardlink]: https://en.wikipedia.org/wiki/Hard_link
190+
[wiki-fs_perm]: https://en.wikipedia.org/wiki/File_system_permissions
191+
[wiki-exec]: https://en.wikipedia.org/wiki/Executable
192+
[wiki-unix_ft]: https://en.wikipedia.org/wiki/Unix_file_types
193+
[wiki-dev_file]: https://en.wikipedia.org/wiki/Device_file
194+
[wiki-unix_sock]: https://en.wikipedia.org/wiki/Unix_domain_socket
195+
[wiki-setuid]: https://en.wikipedia.org/wiki/Setuid
196+
[wiki-named_pipe]: https://en.wikipedia.org/wiki/Named_pipe
197+
[wiki-vcs]: https://en.wikipedia.org/wiki/Version_control
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)