Giter Site home page Giter Site logo

egeesin / pywal2alacritty Goto Github PK

View Code? Open in Web Editor NEW
65.0 4.0 9.0 22 KB

๐ŸŽจ A shell script to get colors from Pywal and apply to Alacritty config.

License: Do What The F*ck You Want To Public License

Shell 100.00%
alacritty wal macos mac personalization regex shell-script theme toml yaml

pywal2alacritty's Introduction

pywal2alacritty

๐ŸŽจ A shell script to get colors from Pywal and apply to Alacritty TOML config with regular expressions.

๐Ÿค” Why?

Currently, there's no easy way to send wal colors to Alacritty config in macOS. So I wrote this script to auto-update colors as a workaround.

๐Ÿ”ฝ Setup

Dependencies: grep, sed

Go to raw file and save to your script directory ($PATH) or open your terminal emulator:

Note: If you're behind Alacritty 13.0.0, get the script from v0.1.1 release in Tags list in order to import colors to .

git clone https://github.com/egeesin/alacritty-color-export
cd alacritty-color-export
chmod +x script.sh

๐ŸŽ›๏ธ Usage

Before executing the script, comment existing color declarations out in order to avoid duplication errors and keep your initial colors (No need if you have your colors imported somewhere else). Also make sure you run wal -i <image.png> (or wal -ni <image.png> if you're on macOS) at least once to have the colors ready in your Wal cache folder so the script can convert it.

# Run the script
./path/to/script.sh

# Run the script with custom config path
./path/to/script.sh <config.toml>

๐Ÿšง Example

1. Terminal Emulator

$ ./path/to/script.sh

2. Input (~/.cache/wal/colors.sh):

...
# Special
background='#180f18'
foreground='#cbc2e1'
cursor='#cbc2e1'

# Colors
color0='#180f18'
color1='#6A538E'
color2='#464AAB'
color3='#916A98'
color4='#C569B5'
color5='#EBB0B2'
color6='#AD93D5'
color7='#cbc2e1'
color8='#8e879d'
color9='#6A538E'
color10='#464AAB'
color11='#916A98'
color12='#C569B5'
color13='#EBB0B2'
color14='#AD93D5'
color15='#cbc2e1'
...

3. Output (Default Alacritty config path: ~/.config/alacritty/alacritty.toml):

...

[window.padding]
x = 12
y = 22

# BEGIN ACE
[colors.primary]
background = '#180f18'
foreground = '#cbc2e1'

[colors.cursor]
text   = '#180f18' # Apply background color to color of text inside cursor
cursor = '#cbc2e1' # Apply foreground color to color of cursor

[colors.vi_mode_cursor]
text    = '#180f18' # Same as above
cursor  = '#cbc2e1'

[colors.search.matches]
foreground = '#180f18' # Same as above
background = '#cbc2e1' # Apply bright/white color to bg color of matching search

[colors.search.focused_match]
foreground = 'CellBackground'
background = 'CellForeground'

[colors.line_indicator]
foreground = 'None'
background = 'None'

[colors.footer_bar]
foreground = '#8e879d'
background = '#cbc2e1'

[colors.selection]
text       = 'CellBackground'
background = 'CellForeground'

[colors.normal]
black   = '#180f18'
red     = '#6A538E'
green   = '#464AAB'
yellow  = '#916A98'
blue    = '#C569B5'
magenta = '#EBB0B2'
cyan    = '#AD93D5'
white   = '#cbc2e1'

[colors.bright]
black   = '#8e879d'
red     = '#6A538E'
green   = '#464AAB'
yellow  = '#916A98'
blue    = '#C569B5'
magenta = '#EBB0B2'
cyan    = '#AD93D5'
white   = '#cbc2e1'
# END ACE

Note: If you'd like to have different colors for cursor, search matches/focuses from Vi-mode of Alacritty, edit the script.sh based on variables like $color1, $color2 etc.

๐Ÿ”— Related Links

๐Ÿค Contribution

Don't forget to backup config and thank you for your contribution in advance. Any information from testing on different systems would valuable to anyone who interested in this script. Issues and PR's are welcomed.

๐Ÿคท License

This software is under The Do What The Fuck You Want To Public License (WTFPL).

pywal2alacritty's People

Contributors

egeesin avatar rugglcon avatar thezeroalpha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pywal2alacritty's Issues

Configuration bugged and have 1 and half config file in alacritty.yml

I sometimes just reload my awesome, which is changing the background and the alacritty color then.

Sometimes it does change the color but put the config in double with one or two lines missing and that makes the entire alacritty config bug :

example :

# BEGIN ACE
colors:
  primary:
    background: '#170806'
    foreground: '#8b8382'
  cursor:
    text:       '#170806'
    cursor:     '#8b8382'
  normal:
    black:      '#170806'
    red:        '#be8685'
    green:      '#be9387'
    yellow:     '#ab8290'
    blue:       '#be8d92'
    magenta:    '#bf9a9d'
    cyan:       '#bfa8a3'
    white:      '#8b8382'
  bright:
    black:      '#514544'
    red:        '#FEB3B2'
    green:      '#FEC5B5'
    yellow:     '#E4AEC1'
    blue:       '#FEBDC3'
    magenta:    '#FFCED2'
    cyan:       '#FFE1DA'
    white:      '#c5c1c0'
font:
  size: 8
  offset:
    x: 0
    y: 1
window:
    opacity: 0.8
mouse:
  double_click: { threshold: 300 }
  triple_click: { threshold: 300 }
  hide_when_typing: true
selection:
  save_to_clipboard: true
cursor:
  style: Block
  unfocused_hollow: true
# END ACE primary:
    background: '#170806'
    foreground: '#8b8382'
  cursor:
    text:       '#170806'
    cursor:     '#8b8382'
  normal:
    black:      '#170806'
    red:        '#be8685'
    green:      '#be9387'
    yellow:     '#ab8290'
    blue:       '#be8d92'
    magenta:    '#bf9a9d'
    cyan:       '#bfa8a3'
    white:      '#8b8382'
  bright:
    black:      '#514544'
    red:        '#FEB3B2'
    green:      '#FEC5B5'
    yellow:     '#E4AEC1'
    blue:       '#FEBDC3'
    magenta:    '#FFCED2'
    cyan:       '#FFE1DA'
    white:      '#c5c1c0'
font:
  size: 8
  offset:
    x: 0
    y: 1
window:
    opacity: 0.8
mouse:
  double_click: { threshold: 300 }
  triple_click: { threshold: 300 }
  hide_when_typing: true
selection:
  save_to_clipboard: true
cursor:
  style: Block
  unfocused_hollow: true
# END ACE

EDIT : it's just that the primary go next to the END instead of going one down.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.