desktop: Add flavours program to set colors

Switching from my custom, brittle, styling implementation `styler` to
the wonder `flavours` program which does exactly the same only with more
clarity, faster and - I would presume - more stable.
This commit is contained in:
Marty Oehme 2023-03-07 11:05:15 +01:00
parent 2c0d41f4af
commit b800d8f1eb
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
6 changed files with 147 additions and 8 deletions

View file

@ -68,6 +68,7 @@ fasd Command-line productivity booster, offers quick access to files and directo
fd Simple, fast and user-friendly alternative to find R fd Simple, fast and user-friendly alternative to find R
ffmpegthumbnailer Lightweight video thumbnailer that can be used by file managers R ffmpegthumbnailer Lightweight video thumbnailer that can be used by file managers R
firefox Standalone web browser from mozilla.org R firefox Standalone web browser from mozilla.org R
flavours A simple and easy cli to build and use base16 schemes A
fonts-cjk Linux 下的免费商用字体包 A fonts-cjk Linux 下的免费商用字体包 A
freerdp Free implementation of the Remote Desktop Protocol (RDP) R freerdp Free implementation of the Remote Desktop Protocol (RDP) R
fwupd Simple daemon to allow session software to update firmware R fwupd Simple daemon to allow session software to update firmware R

1 Name Description Source Target
68 fd Simple, fast and user-friendly alternative to find R
69 ffmpegthumbnailer Lightweight video thumbnailer that can be used by file managers R
70 firefox Standalone web browser from mozilla.org R
71 flavours A simple and easy cli to build and use base16 schemes A
72 fonts-cjk Linux 下的免费商用字体包 A
73 freerdp Free implementation of the Remote Desktop Protocol (RDP) R
74 fwupd Simple daemon to allow session software to update firmware R

View file

@ -0,0 +1,84 @@
# Configuration for flavours
# https://github.com/Misterio77/flavours
#
# This file should contain a [[items]] section for each application you want themed
# You can also set a shell (outside items) on which to run hooks
# Check flavours repository for more information and examples
# Explanation and default values for keys:
# # Through which shell command hooks will run. The command will be replaced in '{}'
shell = "bash -c '{}'"
#
# [[items]]
# # File to inject to, supports tilde and env var expansion. required
# file = "~/.config/example"
# # Template to use. required
# template = "example"
#
# # Subtemplate to use
# subtemplate = "default"
# # If not rewriting, on which line (usually a comment) to start replacing
# start = "# Start flavours"
# # If not rewriting, on which line (usually a comment) to stop replacing
# end = "# End flavours"
# # Should we rewrite the entire file, instead of using the above delimiters?
# rewrite = false
# # Command to execute after injecting (goes through shell)
# hook = ""
# # Whether this hook should be executed when flavours is ran with lightweight flag
# light = true
[[items]]
template = "waybar"
file = "~/.local/state/waybar/colorscheme.css"
rewrite = true
light = false
hook = "killall -SIGUSR2 waybar"
[[items]]
# Uses custom nvim template to work together with
# RRethy base16 neovim plugin
template = "nvim"
file = "~/.local/state/nvim/colorscheme.lua"
rewrite = true
[[items]]
# For newer wezterm versions (missing cursor= field)
# make use of my custom wezterm template
template = "wezterm"
file = "~/.local/state/wezterm/colors.toml"
rewrite = true
[[items]]
template = "zathura"
file = "~/.local/state/zathura/zathurarc"
rewrite = true
[[items]]
template = "qutebrowser"
subtemplate = "minimal"
file = "~/.local/state/qutebrowser/colorscheme.py"
rewrite = true
light = false
hook = "pgrep -x qutebrowser && qutebrowser :config-source"
# CSS Webpage styling in qutebrowser
[[item]]
file = "~/.config/qutebrowser/stylesheets/stylesheet.css"
template = "styles"
subtemplate = "css-variables"
rewrite = false
start = "/* Start flavours */"
end = "/* End flavours */"
[[items]]
# MAKO DOES NOT SUPPORT INCLUDES YET
template = "mako"
file = "~/.config/mako/config"
light = false
rewrite = false
start = "# Start flavours"
end = "# End flavours"
hook = "killall mako"

View file

@ -0,0 +1,29 @@
-- base16-nvim (https://github.com/wincent/base16-nvim)
-- by Greg Hurrell (https://github.com/wincent)
-- based on
-- base16-vim (https://github.com/chriskempson/base16-vim)
-- by Chris Kempson (https://github.com/chriskempson)
-- using nvim-base16 neovim plugin
-- by RRethy (https://github.com/RRethy/nvim-base16)
-- {{scheme-name}} scheme by {{scheme-author}}
require('base16-colorscheme').setup({
base00 = '#{{base00-hex}}',
base01 = '#{{base01-hex}}',
base02 = '#{{base02-hex}}',
base03 = '#{{base03-hex}}',
base04 = '#{{base04-hex}}',
base05 = '#{{base05-hex}}',
base06 = '#{{base06-hex}}',
base07 = '#{{base07-hex}}',
base08 = '#{{base08-hex}}',
base09 = '#{{base09-hex}}',
base0A = '#{{base0A-hex}}',
base0B = '#{{base0B-hex}}',
base0C = '#{{base0C-hex}}',
base0D = '#{{base0D-hex}}',
base0E = '#{{base0E-hex}}',
base0F = '#{{base0F-hex}}'
})
-- vim: filetype=lua

View file

@ -0,0 +1,32 @@
# Base16 {{scheme-name}} - wezterm color config
# Scheme by {{scheme-author}}
[colors]
foreground = "#{{base05-hex}}"
background = "#{{base00-hex}}"
cursor_bg = "#{{base05-hex}}"
cursor_border = "#{{base05-hex}}"
selection_bg = "#{{base05-hex}}"
selection_fg = "#{{base00-hex}}"
ansi = [
"#{{base00-hex}}",
"#{{base08-hex}}",
"#{{base0B-hex}}",
"#{{base0A-hex}}",
"#{{base0D-hex}}",
"#{{base0E-hex}}",
"#{{base0C-hex}}",
"#{{base05-hex}}"
]
brights = [
"#{{base03-hex}}",
"#{{base08-hex}}",
"#{{base0B-hex}}",
"#{{base0A-hex}}",
"#{{base0D-hex}}",
"#{{base0E-hex}}",
"#{{base0C-hex}}",
"#{{base07-hex}}"
]

View file

@ -1,25 +1,18 @@
sort=-time sort=-time
layer=overlay layer=overlay
background-color=#2e3440
width=300 width=300
height=110 height=110
border-size=2 border-size=2
border-color=#88c0d0
border-radius=15 border-radius=15
max-icon-size=64 max-icon-size=64
default-timeout=5000 default-timeout=5000
ignore-timeout=1 ignore-timeout=1
font=monospace 14 font=monospace 14
[urgency=low]
border-color=#cccccc
[urgency=normal]
border-color=#d08770
[urgency=critical] [urgency=critical]
#on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga #on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga
border-color=#bf616a
default-timeout=0 default-timeout=0
[mode=do-not-disturb] [mode=do-not-disturb]

View file

@ -71,7 +71,7 @@ riverctl map normal $mod+Shift T spawn "bemenu-translate"
# Desktop theming # Desktop theming
# shellcheck disable=SC2016 # shellcheck disable=SC2016
riverctl map normal $mod+Shift S spawn 'styler set $(styler list themes | bemenu)' riverctl map normal $mod+Shift S spawn 'flavours list -l | bemenu | xargs flavours apply'
# Password dropdown frontend # Password dropdown frontend
riverctl map normal $mod+Shift P spawn "pass-pick" riverctl map normal $mod+Shift P spawn "pass-pick"