Skip to content

Commit af8ee52

Browse files
author
Tony Crisci
authored
Merge pull request #38 from acrisci/rust-rewrite
Rust rewrite
2 parents b090e1a + 96c0514 commit af8ee52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2791
-16
lines changed

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ lib-cov
88
*.pid
99
*.gz
1010

11-
pids
12-
logs
13-
results
11+
/target/
12+
Cargo.lock
13+
**/*.rs.bk
1414

15-
npm-debug.log
15+
# legacy npm
1616
node_modules
17+
package-lock.json

Cargo.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "i3-style"
3+
version = "1.0.1"
4+
authors = ["Tony Crisci <tony@dubstepdish.com>"]
5+
build = "build.rs"
6+
include = ["./themes"]
7+
8+
[dependencies]
9+
yaml-rust = "0.4"
10+
clap = "2.31.2"
11+
phf = "0.7.21"
12+
includedir = "0.4.0"
13+
colornamer = "0.1.0"
14+
regex = "1.0.0"
15+
lazy_static = "1.0.0"
16+
linked-hash-map = "0.5.1"
17+
18+
[dev-dependencies]
19+
tempfile = "3.0.1"
20+
21+
[build-dependencies]
22+
includedir_codegen = "0.4.0"

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Make your [i3](http://i3wm.org) config a little more stylish.
44

5-
[![NPM](https://nodei.co/npm/i3-style.png?compact=true)](https://nodei.co/npm/i3-style/)
6-
7-
[![NPM](https://nodei.co/npm-dl/i3-style.png?months=6)](https://nodei.co/npm/i3-style/)
8-
95
## About
106

117
`i3-style` applies a theme to your i3 config file to change the colorscheme of the window decorations and the different parts of i3bar. It's designed especially for people who make frequent changes to their colorscheme to get things just right.
@@ -14,15 +10,13 @@ Make your [i3](http://i3wm.org) config a little more stylish.
1410
* Themes are easy to read, modify, and share.
1511
* Modifies your theme in place - extra template files are not needed.
1612

17-
For an overview of the capabilities of i3-style, see my [blog post](http://dubstepdish.com/blog/2013/11/06/introducing-i3-style/).
18-
1913
## Installing
2014

21-
To install with [npm](https://npmjs.org/):
15+
If you have a Rust toolchain available, you can install with Cargo:
2216

23-
npm install -g i3-style
17+
cargo install i3-style
2418

25-
The `i3-style` executable should now be in your PATH.
19+
Otherwise, check the [releases](https://github.com/acrisci/i3-style/releases) page where I post precompiled binaries.
2620

2721
## Usage
2822

@@ -32,8 +26,6 @@ Just call `i3-style` with the name of the theme you want to try and where you wa
3226

3327
Check the `themes` directory for the list of built-in themes.
3428

35-
If you want to modify a theme, copy it from `themes` and give it a `.yaml` extension. The object format is [well-documented](https://github.com/acrisci/i3-style/blob/master/doc/spec.md) and includes support for color aliases. Then back up your config and call i3-style.
36-
3729
i3-style ~/.config/i3/solarized.yaml -o ~/.config/i3/config
3830

3931
Just keep doing that until you get it perfect (which might be never).

build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extern crate includedir_codegen;
2+
3+
use includedir_codegen::Compression;
4+
5+
fn main() {
6+
includedir_codegen::start("FILES")
7+
.dir("./themes", Compression::Gzip)
8+
.build("data.rs")
9+
.unwrap();
10+
}

legacy/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.swp
2+
lib-cov
3+
*.seed
4+
*.log
5+
*.csv
6+
*.dat
7+
*.out
8+
*.pid
9+
*.gz
10+
11+
pids
12+
logs
13+
results
14+
15+
npm-debug.log
16+
node_modules
File renamed without changes.

legacy/LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2013, Tony Crisci
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
24+
The views and conclusions contained in the software and documentation are those
25+
of the authors and should not be interpreted as representing official policies,
26+
either expressed or implied, of the FreeBSD Project.

legacy/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# i3-style
2+
3+
Make your [i3](http://i3wm.org) config a little more stylish.
4+
5+
[![NPM](https://nodei.co/npm/i3-style.png?compact=true)](https://nodei.co/npm/i3-style/)
6+
7+
[![NPM](https://nodei.co/npm-dl/i3-style.png?months=6)](https://nodei.co/npm/i3-style/)
8+
9+
## About
10+
11+
`i3-style` applies a theme to your i3 config file to change the colorscheme of the window decorations and the different parts of i3bar. It's designed especially for people who make frequent changes to their colorscheme to get things just right.
12+
13+
* Easy to try out new themes right after you install.
14+
* Themes are easy to read, modify, and share.
15+
* Modifies your theme in place - extra template files are not needed.
16+
17+
For an overview of the capabilities of i3-style, see my [blog post](http://dubstepdish.com/blog/2013/11/06/introducing-i3-style/).
18+
19+
## Installing
20+
21+
To install with [npm](https://npmjs.org/):
22+
23+
npm install -g i3-style
24+
25+
The `i3-style` executable should now be in your PATH.
26+
27+
## Usage
28+
29+
Just call `i3-style` with the name of the theme you want to try and where you want to write the config file to. i3-style will look for your config in the default place and apply the theme.
30+
31+
i3-style solarized -o ~/.config/i3/config --reload
32+
33+
Check the `themes` directory for the list of built-in themes.
34+
35+
If you want to modify a theme, copy it from `themes` and give it a `.yaml` extension. The object format is [well-documented](https://github.com/acrisci/i3-style/blob/master/doc/spec.md) and includes support for color aliases. Then back up your config and call i3-style.
36+
37+
i3-style ~/.config/i3/solarized.yaml -o ~/.config/i3/config
38+
39+
Just keep doing that until you get it perfect (which might be never).
40+
41+
## Send us themes!
42+
43+
Do you have a cool colorscheme in your config file that you want to share with other people? i3-style can automatically convert it to a theme file:
44+
45+
i3-style --to-theme ~/.config/i3/config -o my-theme.yaml
46+
47+
If you have a new theme, or made an improvement to an existing theme, please make a pull request adding your theme to the `themes` directory!
48+
49+
## License
50+
51+
This work is available under a FreeBSD License (see LICENSE).
52+
53+
Copyright © 2013, Tony Crisci
54+
55+
All rights reserved.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)