Skip to content

Commit

Permalink
Merge pull request #38 from acrisci/rust-rewrite
Browse files Browse the repository at this point in the history
Rust rewrite
  • Loading branch information
Tony Crisci authored Nov 19, 2018
2 parents b090e1a + 96c0514 commit af8ee52
Show file tree
Hide file tree
Showing 45 changed files with 2,791 additions and 16 deletions.
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ lib-cov
*.pid
*.gz

pids
logs
results
/target/
Cargo.lock
**/*.rs.bk

npm-debug.log
# legacy npm
node_modules
package-lock.json
22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "i3-style"
version = "1.0.1"
authors = ["Tony Crisci <tony@dubstepdish.com>"]
build = "build.rs"
include = ["./themes"]

[dependencies]
yaml-rust = "0.4"
clap = "2.31.2"
phf = "0.7.21"
includedir = "0.4.0"
colornamer = "0.1.0"
regex = "1.0.0"
lazy_static = "1.0.0"
linked-hash-map = "0.5.1"

[dev-dependencies]
tempfile = "3.0.1"

[build-dependencies]
includedir_codegen = "0.4.0"
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

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

[![NPM](https://nodei.co/npm/i3-style.png?compact=true)](https://nodei.co/npm/i3-style/)

[![NPM](https://nodei.co/npm-dl/i3-style.png?months=6)](https://nodei.co/npm/i3-style/)

## About

`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.
Expand All @@ -14,15 +10,13 @@ Make your [i3](http://i3wm.org) config a little more stylish.
* Themes are easy to read, modify, and share.
* Modifies your theme in place - extra template files are not needed.

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

## Installing

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

npm install -g i3-style
cargo install i3-style

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

## Usage

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

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

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.

i3-style ~/.config/i3/solarized.yaml -o ~/.config/i3/config

Just keep doing that until you get it perfect (which might be never).
Expand Down
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extern crate includedir_codegen;

use includedir_codegen::Compression;

fn main() {
includedir_codegen::start("FILES")
.dir("./themes", Compression::Gzip)
.build("data.rs")
.unwrap();
}
16 changes: 16 additions & 0 deletions legacy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.swp
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

npm-debug.log
node_modules
File renamed without changes.
26 changes: 26 additions & 0 deletions legacy/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2013, Tony Crisci
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
55 changes: 55 additions & 0 deletions legacy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# i3-style

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

[![NPM](https://nodei.co/npm/i3-style.png?compact=true)](https://nodei.co/npm/i3-style/)

[![NPM](https://nodei.co/npm-dl/i3-style.png?months=6)](https://nodei.co/npm/i3-style/)

## About

`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.

* Easy to try out new themes right after you install.
* Themes are easy to read, modify, and share.
* Modifies your theme in place - extra template files are not needed.

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

## Installing

To install with [npm](https://npmjs.org/):

npm install -g i3-style

The `i3-style` executable should now be in your PATH.

## Usage

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.

i3-style solarized -o ~/.config/i3/config --reload

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

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.

i3-style ~/.config/i3/solarized.yaml -o ~/.config/i3/config

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

## Send us themes!

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:

i3-style --to-theme ~/.config/i3/config -o my-theme.yaml

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!

## License

This work is available under a FreeBSD License (see LICENSE).

Copyright © 2013, Tony Crisci

All rights reserved.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions legacy/themes/alphare
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# vim: filetype=yaml
---
meta:
description: A beige theme by Alphare
colors:
black: '#000000'
oldlace: '#FDF6E3'
darkslategray: '#002B36'
steelblue: '#268BD2'
dimgray: '#5F676A'
darkslategrey: '#484E50'
crimson: '#DC322F'
steelblue1: '#4C7899'
steelblue2: '#285577'
white: '#FFFFFF'
darkslategrey1: '#333333'
black1: '#222222'
gray: '#888888'
darkslategray1: '#2F343A'
darkred: '#900000'
window_colors:
focused:
border: black
background: oldlace
text: darkslategray
indicator: black
focused_inactive:
border: black
background: dimgray
text: oldlace
indicator: darkslategrey
unfocused:
border: black
background: black
text: oldlace
indicator: black
urgent:
border: black
background: crimson
text: oldlace
indicator: crimson
bar_colors:
background: oldlace
statusline: darkslategray
separator: black
focused_workspace:
border: black
background: steelblue
text: white
active_workspace:
border: darkslategrey1
background: black1
text: white
inactive_workspace:
border: darkslategrey1
background: black1
text: gray
urgent_workspace:
border: darkslategray1
background: darkred
text: white
46 changes: 46 additions & 0 deletions legacy/themes/archlinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# vim: filetype=yaml
# TODO: use color aliases to make the theme more readable
---
meta:
description: 'Archlinux theme by okraits <http://okraits.de>'
window_colors:
focused:
border: '#0088CC'
background: '#0088CC'
text: '#ffffff'
indicator: '#dddddd'
focused_inactive:
border: '#333333'
background: '#333333'
text: '#888888'
indicator: '#292d2e'
unfocused:
border: '#333333'
background: '#333333'
text: '#888888'
indicator: '#292d2e'
urgent:
border: '#2f343a'
background: '#900000'
text: '#ffffff'
indicator: '#900000'
bar_colors:
separator: '#666666'
background: '#222222'
statusline: '#dddddd'
focused_workspace:
border: '#0088CC'
background: '#0088CC'
text: '#ffffff'
active_workspace:
border: '#333333'
background: '#333333'
text: '#ffffff'
inactive_workspace:
border: '#333333'
background: '#333333'
text: '#888888'
urgent_workspace:
border: '#2f343a'
background: '#900000'
text: '#ffffff'
63 changes: 63 additions & 0 deletions legacy/themes/base16-tomorrow
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# vim: filetype=yaml
---
colors:
base00: '#1d1f21'
base01: '#282a2e'
base02: '#373b41'
base03: '#969896'
base04: '#b4b7b4'
base05: '#c5c8c6'
base06: '#e0e0e0'
base07: '#ffffff'
base08: '#cc6666'
base09: '#de935f'
base0A: '#f0c674'
base0B: '#b5bd68'
base0C: '#8abeb7'
base0D: '#81a2be'
base0E: '#b294bb'
base0F: '#a3685a'

meta:
description: 'Base16 Tomorrow, by Chris Kempson (http://chriskempson.com)'
window_colors:
focused:
border: 'base0D'
background: 'base0D'
text: 'base00'
indicator: 'base01'
focused_inactive:
border: 'base02'
background: 'base02'
text: 'base03'
indicator: 'base01'
unfocused:
border: 'base01'
background: 'base01'
text: 'base03'
indicator: 'base01'
urgent:
border: 'base02'
background: 'base08'
text: 'base07'
indicator: 'base08'
bar_colors:
separator: 'base03'
background: 'base00'
statusline: 'base05'
focused_workspace:
border: 'base0D'
background: 'base0D'
text: 'base00'
active_workspace:
border: 'base02'
background: 'base02'
text: 'base07'
inactive_workspace:
border: 'base01'
background: 'base01'
text: 'base03'
urgent_workspace:
border: 'base08'
background: 'base08'
text: 'base07'
Loading

0 comments on commit af8ee52

Please sign in to comment.