From ce2ccc09ed79c6a94efed22f73d733c2208639c6 Mon Sep 17 00:00:00 2001 From: lelgenio Date: Sun, 25 Oct 2020 18:10:20 -0300 Subject: [PATCH] add accent_color autoconfig --- config.yaml | 20 +++++++++++++++----- dotfiles/alacritty.yml | 2 +- dotfiles/blenderTheme.xml | 2 +- dotfiles/fish.fish | 13 +++++++------ dotfiles/kitty.conf | 2 +- dotfiles/mako.conf | 4 ++-- dotfiles/nvim/init.vim | 4 ++-- dotfiles/qutebrowser.py | 14 +++++++------- dotfiles/scripts/_make_theme | 24 ++++++++++++++++++------ dotfiles/scripts/bmenu | 4 ++-- dotfiles/sway.conf | 2 +- dotfiles/waybar/style.css | 4 ++-- dotfiles/wofi/style.css | 4 ++-- dotfiles/zathura.conf | 2 +- 14 files changed, 62 insertions(+), 39 deletions(-) diff --git a/config.yaml b/config.yaml index 1a7e9d9..2d3dd05 100644 --- a/config.yaml +++ b/config.yaml @@ -16,7 +16,8 @@ variables: font: mono: FiraCode Nerd Font interface: Inter -profiles: #{{{ + +profiles: dark: # {{{ variables: gtk_theme: materia-lelgenio-dark @@ -25,7 +26,6 @@ profiles: #{{{ cursor_theme: capitaine-cursors color: type: dark - accent: '#D9534F' bg: '#202020' bg_light: '#404040' bg_dark: '#191919' @@ -51,7 +51,6 @@ profiles: #{{{ cursor_theme: capitaine-cursors color: type: light - accent: '#D9534F' bg: '#EAEAEA' bg_light: '#A0A0A0' bg_dark: '#999999' @@ -66,6 +65,15 @@ profiles: #{{{ magenta: '#C397D8' cyan: '#00A0A5' white: '#FFFFFF' +# }}} +# Accents {{{ + accent_red: {variables: {accent_color: "#D9534F"}} + accent_green: {variables: {accent_color: "#159828"}} + accent_blue: {variables: {accent_color: "#3465A3"}} + accent_pink: {variables: {accent_color: "#E91E63"}} + accent_teal: {variables: {accent_color: "#16A085"}} + accent_magenta: {variables: {accent_color: "#9C27B0"}} + # }}} colemak: #{{{ variables: @@ -101,8 +109,9 @@ profiles: #{{{ include: - "{{@@ key_layout @@}}" - "{{@@ color_type @@}}" + - "accent_{{@@ accent_color_name @@}}" #}}} -#}}} + config: # {{{ backup: false banner: false @@ -123,6 +132,7 @@ dynvariables: echo colemak || echo qwerty fi color_type: test -n "$_COLOR_TYPE" && echo "$_COLOR_TYPE" || echo dark + accent_color_name: test -n "$_ACCENT_COLOR" && echo "$_ACCENT_COLOR" || echo red blender_version: blender --version | head -n1 | sed -E 's|^Blender (.*)\..*|\1|g' # }}} dotfiles: # {{{ @@ -249,7 +259,7 @@ actions: #{{{ notify: notify-send "Updating dotfiles" "{{@@ _dotfile_abs_dst.lstrip(env['HOME']) @@}}" makoreload: makoctl reload lesskey: lesskey - reload_sway: swaymsg reload + reload_sway: pidof swaymsg || swaymsg reload reload_fish: pkill -SIGHUP fish vimplug: > nvim diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml index 53c7bac..a647192 100644 --- a/dotfiles/alacritty.yml +++ b/dotfiles/alacritty.yml @@ -191,7 +191,7 @@ colors: # the cursor color will be the inverse of the cell color. cursor: text: '#000000' - cursor: '{{@@ color.accent @@}}' + cursor: '{{@@ accent_color @@}}' # Selection colors # diff --git a/dotfiles/blenderTheme.xml b/dotfiles/blenderTheme.xml index 09b5e97..f57161b 100644 --- a/dotfiles/blenderTheme.xml +++ b/dotfiles/blenderTheme.xml @@ -34,7 +34,7 @@ /dev/null & + +# Materia GTK Theme src_path="$HOME/.cache/materia-theme" -theme_name="materia-${USER}{{@@ '-dark' if color.type == 'dark' @@}}" +theme_name="{{@@ gtk_theme @@}}" dst_path="${HOME}/.themes" test -d "$src_path" || @@ -18,11 +30,11 @@ cd "$src_path" # View = Main part of file browser # Surface = background of context menu colors="\ -SEL_BG={{@@ color.accent .lstrip('#') @@}}\n\ +SEL_BG={{@@ accent_color .lstrip('#') @@}}\n\ FG={{@@ color.txt .lstrip('#') @@}}\n\ -BG={{@@ color.bg_dark .lstrip('#') @@}}\n\ +BG={{@@ color.bg .lstrip('#') @@}}\n\ HDR_FG={{@@ color.txt .lstrip('#') @@}}\n\ -HDR_BG={{@@ color.bg_dark .lstrip('#') @@}}\n\ +HDR_BG={{@@ color.bg .lstrip('#') @@}}\n\ MATERIA_VIEW={{@@ color.bg .lstrip('#') @@}}\n\ MATERIA_SURFACE={{@@ color.bg .lstrip('#') @@}}" @@ -41,8 +53,8 @@ mkdir -p "${dst_path}/${theme_name}" ./change_color.sh \ -t "${dst_path}" \ -o "${theme_name}" \ - "$color_file" &> /dev/null + "$color_file" echo -e "$colors" > "$color_file" notify-send "Finished generating theme" -} & +} &> /dev/null & diff --git a/dotfiles/scripts/bmenu b/dotfiles/scripts/bmenu index 5077430..5c7d63c 100755 --- a/dotfiles/scripts/bmenu +++ b/dotfiles/scripts/bmenu @@ -22,7 +22,7 @@ end set -l fn "{{@@ font.mono @@}} 12" set -l tb "{{@@ color.bg @@}}" -set -l tf "{{@@ color.accent @@}}" +set -l tf "{{@@ accent_color @@}}" set -l fb "{{@@ color.bg @@}}" set -l ff "{{@@ color.txt @@}}" @@ -31,7 +31,7 @@ set -l nb "{{@@ color.bg @@}}" set -l nf "{{@@ color.txt @@}}" set -l hb "{{@@ color.bg_light @@}}" -set -l hf "{{@@ color.accent @@}}" +set -l hf "{{@@ accent_color @@}}" #{%@@ if False @@%}# # Hacks to allow runnning even if not templated diff --git a/dotfiles/sway.conf b/dotfiles/sway.conf index a449860..06b443c 100644 --- a/dotfiles/sway.conf +++ b/dotfiles/sway.conf @@ -239,7 +239,7 @@ bindsym $mod+escape mode Passthrough # }}} # Visual: {{{ # - set $accent {{@@ color.accent @@}} + set $accent {{@@ accent_color @@}} set $fg_color {{@@ color.txt @@}} set $bg_color {{@@ color.bg_dark @@}} set $alert #000000 diff --git a/dotfiles/waybar/style.css b/dotfiles/waybar/style.css index fa8bf6c..69091ff 100644 --- a/dotfiles/waybar/style.css +++ b/dotfiles/waybar/style.css @@ -52,7 +52,7 @@ window#waybar.empty { {%@@ else @@%} border-bottom: {%@@ endif @@%} - 3px solid {{@@ color.accent @@}}; + 3px solid {{@@ accent_color @@}}; /* border-bottom: 3px solid transparent; */ } @@ -63,7 +63,7 @@ window#waybar.empty { } #mode{ - color: {{@@ color.accent @@}}; + color: {{@@ accent_color @@}}; } #custom-mpd, diff --git a/dotfiles/wofi/style.css b/dotfiles/wofi/style.css index 2367576..9bcfc3b 100644 --- a/dotfiles/wofi/style.css +++ b/dotfiles/wofi/style.css @@ -6,11 +6,11 @@ #entry:selected { border: none; padding: none; - background: {{@@ color.accent @@}}; + background: {{@@ accent_color @@}}; } window { - background-color: {{@@ color.accent @@}}; + background-color: {{@@ accent_color @@}}; } #input { diff --git a/dotfiles/zathura.conf b/dotfiles/zathura.conf index 528d1fe..13932bf 100644 --- a/dotfiles/zathura.conf +++ b/dotfiles/zathura.conf @@ -33,7 +33,7 @@ set statusbar-fg "{{@@ color.txt @@}}" set completion-bg "{{@@ color.bg_light @@}}" set completion-fg "{{@@ color.txt @@}}" -set completion-highlight-bg "{{@@ color.accent @@}}" +set completion-highlight-bg "{{@@ accent_color @@}}" set completion-highlight-fg "{{@@ color.txt @@}}" # vim: commentstring=#\ %s