diff --git a/exmaples/thm/scripts/reload-mako b/exmaples/thm/scripts/reload-mako new file mode 100755 index 0000000..342500a --- /dev/null +++ b/exmaples/thm/scripts/reload-mako @@ -0,0 +1,2 @@ +#!/bin/sh +makoctl reload diff --git a/exmaples/thm/templates/alacritty-colors.yml.template b/exmaples/thm/templates/alacritty-colors.yml.template new file mode 100644 index 0000000..78a4140 --- /dev/null +++ b/exmaples/thm/templates/alacritty-colors.yml.template @@ -0,0 +1,32 @@ +colors: + primary: + background: '#{bg_color}' + foreground: '#{fg_color}' + + cursor: + text: '#{bg_color}' + cursor: '#{fg_color}' + + selection: + text: '#{bg_color}' + background: '#{fg_color}' + + normal: + black: '#{color0}' + red: '#{color1}' + green: '#{color2}' + yellow: '#{color3}' + blue: '#{color4}' + magenta: '#{color5}' + cyan: '#{color6}' + white: '#{color7}' + + bright: + black: '#{color8}' + red: '#{color9}' + green: '#{color10}' + yellow: '#{color11}' + blue: '#{color12}' + magenta: '#{color13}' + cyan: '#{color14}' + white: '#{color15}' diff --git a/exmaples/thm/templates/colors.css.template b/exmaples/thm/templates/colors.css.template new file mode 100644 index 0000000..67972c4 --- /dev/null +++ b/exmaples/thm/templates/colors.css.template @@ -0,0 +1,43 @@ +:root { + /* HEX */ + --bg-color: #{bg_color}; + --fg-color: #{fg_color}; + + --color0: #{color0}; + --color1: #{color1}; + --color2: #{color2}; + --color3: #{color3}; + --color4: #{color4}; + --color5: #{color5}; + --color6: #{color6}; + --color7: #{color7}; + --color8: #{color8}; + --color9: #{color9}; + --color10: #{color10}; + --color11: #{color11}; + --color12: #{color12}; + --color13: #{color13}; + --color14: #{color14}; + --color15: #{color15}; + + /* RGB */ + --bg-color-rgb: rgb({bg_color.rgb}); + --fg-color-rgb: rgb({fg_color.rgb}); + + --color0-rgb: rgb({color0.rgb}); + --color1-rgb: rgb({color1.rgb}); + --color2-rgb: rgb({color2.rgb}); + --color3-rgb: rgb({color3.rgb}); + --color4-rgb: rgb({color4.rgb}); + --color5-rgb: rgb({color5.rgb}); + --color6-rgb: rgb({color6.rgb}); + --color7-rgb: rgb({color7.rgb}); + --color8-rgb: rgb({color8.rgb}); + --color9-rgb: rgb({color9.rgb}); + --color10-rgb: rgb({color10.rgb}); + --color11-rgb: rgb({color11.rgb}); + --color12-rgb: rgb({color12.rgb}); + --color13-rgb: rgb({color13.rgb}); + --color14-rgb: rgb({color14.rgb}); + --color15-rgb: rgb({color15.rgb}); +} diff --git a/exmaples/thm/templates/colors.sh.template b/exmaples/thm/templates/colors.sh.template index b14cca8..97c5537 100644 --- a/exmaples/thm/templates/colors.sh.template +++ b/exmaples/thm/templates/colors.sh.template @@ -1,5 +1,6 @@ #!/bin/sh +# Hex bg_color='{bg_color}' fg_color='{fg_color}' @@ -20,3 +21,25 @@ color12='{color12}' color13='{color13}' color14='{color14}' color15='{color15}' + +# RGB +bg_color_rgb='{bg_color.rgb}' +fg_color_rgb='{fg_color.rgb}' + +color0_rgb='{color0.rgb}' +color1_rgb='{color1.rgb}' +color2_rgb='{color2.rgb}' +color3_rgb='{color3.rgb}' +color4_rgb='{color4.rgb}' +color5_rgb='{color5.rgb}' +color6_rgb='{color6.rgb}' +color7_rgb='{color7.rgb}' + +color8_rgb='{color8.rgb}' +color9_rgb='{color9.rgb}' +color10_rgb='{color10.rgb}' +color11_rgb='{color11.rgb}' +color12_rgb='{color12.rgb}' +color13_rgb='{color13.rgb}' +color14_rgb='{color14.rgb}' +color15_rgb='{color15.rgb}' diff --git a/exmaples/thm/templates/colors.template b/exmaples/thm/templates/colors.template new file mode 100644 index 0000000..eac445e --- /dev/null +++ b/exmaples/thm/templates/colors.template @@ -0,0 +1,20 @@ +# Puts the hex and rgb values of the same color on the same line in order + +{bg_color} {bg_color.rgb} +{fg_color} {fg_color.rgb} +{color0} {color0.rgb} +{color1} {color1.rgb} +{color2} {color2.rgb} +{color3} {color3.rgb} +{color4} {color4.rgb} +{color5} {color5.rgb} +{color6} {color6.rgb} +{color7} {color7.rgb} +{color8} {color8.rgb} +{color9} {color9.rgb} +{color10} {color10.rgb} +{color11} {color11.rgb} +{color12} {color12.rgb} +{color13} {color13.rgb} +{color14} {color14.rgb} +{color1} {color1.rgb} diff --git a/exmaples/thm/templates/dark/sway-appearance.template b/exmaples/thm/templates/dark/sway-appearance.template new file mode 100644 index 0000000..9927c0b --- /dev/null +++ b/exmaples/thm/templates/dark/sway-appearance.template @@ -0,0 +1,38 @@ +# class border background text indicator child_border +client.focused #{color5} #{color13} #{fg_color} #{color5} #{color5} +client.focused_inactive #{color4} #{color12} #{fg_color} #{color4} #{color4} +client.unfocused #{color8} #{color8} #{fg_color} #{color8} #{color8} +client.urgent #{color1} #{color9} #{fg_color} #{color1} #{color1} + +default_border normal 2 +default_floating_border normal 2 +titlebar_border_thickness 2 + +font pango:monospace 10 + +hide_edge_borders both + +title_align center + +set { + $bg_color {bg_color} + $fg_color {fg_color} + + $color0 {color0} + $color1 {color1} + $color2 {color2} + $color3 {color3} + $color4 {color4} + $color5 {color5} + $color6 {color6} + $color7 {color7} + $color8 {color8} + $color9 {color9} + + $color10 {color10} + $color11 {color11} + $color12 {color12} + $color13 {color13} + $color14 {color14} + $color15 {color15} +} diff --git a/exmaples/thm/templates/foot.ini.template b/exmaples/thm/templates/foot.ini.template new file mode 100644 index 0000000..479d1c5 --- /dev/null +++ b/exmaples/thm/templates/foot.ini.template @@ -0,0 +1,43 @@ +font=monospace:size=10 +dpi-aware=yes +pad=8x8 +initial-window-size-chars=120x36 + +[scrollback] +lines=2000 +indicator-position=none + +[cursor] +style=bar +color={bg_color} {fg_color} + +[colors] +background={bg_color} +foreground={fg_color} +regular0={color0} +regular1={color1} +regular2={color2} +regular3={color3} +regular4={color4} +regular5={color5} +regular6={color6} +regular7={color7} +bright0={color8} +bright1={color9} +bright2={color10} +bright3={color11} +bright4={color12} +bright5={color13} +bright6={color14} +bright7={color15} +# selection-foreground= +# selection-background= + +[csd] +preferred=client +size=32 +color=ff{fg_color} +button-width=32 +button-minimize-color={color4} +button-maximize-color={color2} +button-close-color={color1} diff --git a/exmaples/thm/templates/gtk.css.template b/exmaples/thm/templates/gtk.css.template new file mode 100644 index 0000000..b21f672 --- /dev/null +++ b/exmaples/thm/templates/gtk.css.template @@ -0,0 +1,41 @@ +/* HEX */ +@define-color bg-color #{bg_color}; +@define-color fg-color #{fg_color}; + +@define-color color0 #{color0}; +@define-color color1 #{color1}; +@define-color color2 #{color2}; +@define-color color3 #{color3}; +@define-color color4 #{color4}; +@define-color color5 #{color5}; +@define-color color6 #{color6}; +@define-color color7 #{color7}; +@define-color color8 #{color8}; +@define-color color9 #{color9}; +@define-color color10 #{color10}; +@define-color color11 #{color11}; +@define-color color12 #{color12}; +@define-color color13 #{color13}; +@define-color color14 #{color14}; +@define-color color15 #{color15}; + +/* RGB */ +@define-color bg-color-rgb rgb ({bg_color.rgb}); +@define-color fg-color-rgb rgb ({fg_color.rgb}); + +@define-color color0-rgb rgb ({color0.rgb}); +@define-color color1-rgb rgb ({color1.rgb}); +@define-color color2-rgb rgb ({color2.rgb}); +@define-color color3-rgb rgb ({color3.rgb}); +@define-color color4-rgb rgb ({color4.rgb}); +@define-color color5-rgb rgb ({color5.rgb}); +@define-color color6-rgb rgb ({color6.rgb}); +@define-color color7-rgb rgb ({color7.rgb}); +@define-color color8-rgb rgb ({color8.rgb}); +@define-color color9-rgb rgb ({color9.rgb}); +@define-color color10-rgb rgb ({color10.rgb}); +@define-color color11-rgb rgb ({color11.rgb}); +@define-color color12-rgb rgb ({color12.rgb}); +@define-color color13-rgb rgb ({color13.rgb}); +@define-color color14-rgb rgb ({color14.rgb}); +@define-color color15-rgb rgb ({color15.rgb}); diff --git a/exmaples/thm/templates/sway-colors.template b/exmaples/thm/templates/light/sway-appearance.template similarity index 81% rename from exmaples/thm/templates/sway-colors.template rename to exmaples/thm/templates/light/sway-appearance.template index aa5a772..e523732 100644 --- a/exmaples/thm/templates/sway-colors.template +++ b/exmaples/thm/templates/light/sway-appearance.template @@ -4,7 +4,16 @@ client.focused_inactive #{color4} #{color12} #{bg_color} #{color4} #{color4} client.unfocused #{color8} #{color8} #{bg_color} #{color8} #{color8} client.urgent #{color1} #{color9} #{bg_color} #{color1} #{color1} -# set variables +default_border normal 2 +default_floating_border normal 2 +titlebar_border_thickness 2 + +font pango:monospace 10 + +hide_edge_borders both + +title_align center + set { $bg_color {bg_color} $fg_color {fg_color} diff --git a/exmaples/thm/templates/mako.template b/exmaples/thm/templates/mako.template new file mode 100644 index 0000000..a3aa9c4 --- /dev/null +++ b/exmaples/thm/templates/mako.template @@ -0,0 +1,47 @@ +# Global Config +max-visible=2 +sort=-time +output=DP-1 +layer=top +anchor=top-right + +# All Notifcations +font=monospace 10 +background-color=#{bg_color} +text-color=#{fg_color} +width=400 +height=200 +margin=8,8 +padding=8,8 +border-size=4 +border-color=#{fg_color} +max-icon-size=48 +actions=1 +format=%a\n%s\n%b +default-timeout=8000 +group-by=app-name + +# Low Urgency Notifcations +[urgency=low] +border-color=#{color8} +default-timeout=4000 + +# Normal Ugency Notifcations +[urgency=normal] +border-color=#{fg_color} +default-timeout=8000 + +# High Urgency Notifcations +[urgency=high] +border-color=#{color1} +default-timeout=0 + +[grouped] +format=%a\n%s\n%b + +# Hidden Notification +[hidden] +width=0 +height=0 +border-size=0 +format= diff --git a/exmaples/thm/templates/swaylock.template b/exmaples/thm/templates/swaylock.template new file mode 100644 index 0000000..d93d5c3 --- /dev/null +++ b/exmaples/thm/templates/swaylock.template @@ -0,0 +1,32 @@ +# Functionality +ignore-empty-password +daemonize + +# Appearance +disable-caps-lock-text +indicator-caps-lock +color={color8} +bs-hl-color={color1} +caps-lock-bs-hl-color={color1} +caps-lock-key-hl-color={color3} +font=monospace +indicator-radius=64 +indicator-thickness=16 +inside-color={color2} +inside-clear-color={color5} +inside-caps-lock-color={color3} +inside-ver-color={color4} +inside-wrong-color={color1} +key-hl-color={color2} +line-uses-inside +ring-color={color10} +ring-clear-color={color13} +ring-caps-lock-color={color11} +ring-ver-color={color12} +ring-wrong-color={color9} +separator-color={color7}00 +text-color={color15} +text-clear-color={color15} +text-caps-lock-color={color15} +text-ver-color={color15} +text-wrong-color={color15} diff --git a/exmaples/thm/themes/dark.theme b/exmaples/thm/themes/dark.theme new file mode 100644 index 0000000..43f8077 --- /dev/null +++ b/exmaples/thm/themes/dark.theme @@ -0,0 +1,23 @@ +#!/bin/sh + +theme_type="dark" + +bg_color="1f1f1f" +fg_color="efefef" + +color0="1f1f1f" +color1="e67b7b" +color2="80ba63" +color3="f5a868" +color4="849ce6" +color5="b37fe3" +color6="6ebdc4" +color7="b0b0b0" +color8="3f3f3f" +color9="ed9a9a" +color10="a3d989" +color11="f7c297" +color12="a6baf5" +color13="d1adf2" +color14="bedcde" +color15="efefef" diff --git a/exmaples/thm/themes/default-dark.theme b/exmaples/thm/themes/default-dark.theme index c8f848f..418ead4 100644 --- a/exmaples/thm/themes/default-dark.theme +++ b/exmaples/thm/themes/default-dark.theme @@ -1,5 +1,7 @@ #!/bin/sh +theme_type="dark" + bg_color="000000" fg_color="ffffff" diff --git a/exmaples/thm/themes/default-light.theme b/exmaples/thm/themes/default-light.theme index 7ff18d4..07a9062 100644 --- a/exmaples/thm/themes/default-light.theme +++ b/exmaples/thm/themes/default-light.theme @@ -1,5 +1,7 @@ #!/bin/sh +theme_type="light" + bg_color="ffffff" fg_color="000000" diff --git a/exmaples/thm/themes/grayscale-light.theme b/exmaples/thm/themes/grayscale-light.theme index 1660cb1..0a4c02c 100644 --- a/exmaples/thm/themes/grayscale-light.theme +++ b/exmaples/thm/themes/grayscale-light.theme @@ -1,4 +1,7 @@ #!/bin/sh + +theme_type="light" + bg_color="efefef" fg_color="1f1f1f" diff --git a/exmaples/thm/themes/light.theme b/exmaples/thm/themes/light.theme index 59d0ea0..11a71f6 100644 --- a/exmaples/thm/themes/light.theme +++ b/exmaples/thm/themes/light.theme @@ -1,5 +1,7 @@ #!/bin/sh +theme_type="light" + bg_color="efefef" fg_color="1f1f1f" diff --git a/scritps/thm b/scritps/thm index fc7e70c..e5aab11 100755 --- a/scritps/thm +++ b/scritps/thm @@ -113,6 +113,58 @@ do " "$t" > "${dest_dir}/${file_name}" done +# This allows for different configuration for different color schemes. +# Configuration for one theme may not work very well for another theme. To use +# this set theme_type in the theme file to any string and place theme specific +# configuration in `${XDG_CONFIG_HOME:-$HOME/.config}/thm/templates/$theme_type`. +# If not specified, only templates in the base template directory will be generated. +# This will overwrite previously generated template files. +[ "$theme_type" ] && [ -d "${conf_dir}/templates/$theme_type" ] && \ + for t in "${conf_dir}/templates/$theme_type/"*".template" + do + file_name=${t##*/} + file_name=${file_name%.template} + + sed " + s/{bg_color}/$bg_color/g + s/{fg_color}/$fg_color/g + s/{color0}/$color0/g + s/{color1}/$color1/g + s/{color2}/$color2/g + s/{color3}/$color3/g + s/{color4}/$color4/g + s/{color5}/$color5/g + s/{color6}/$color6/g + s/{color7}/$color7/g + s/{color8}/$color8/g + s/{color9}/$color9/g + s/{color10}/$color10/g + s/{color11}/$color11/g + s/{color12}/$color12/g + s/{color13}/$color13/g + s/{color14}/$color14/g + s/{color15}/$color15/g + s/{bg_color.rgb}/$bg_color_rgb/g + s/{fg_color.rgb}/$fg_color_rgb/g + s/{color0.rgb}/$color0_rgb/g + s/{color1.rgb}/$color1_rgb/g + s/{color2.rgb}/$color2_rgb/g + s/{color3.rgb}/$color3_rgb/g + s/{color4.rgb}/$color4_rgb/g + s/{color5.rgb}/$color5_rgb/g + s/{color6.rgb}/$color6_rgb/g + s/{color7.rgb}/$color7_rgb/g + s/{color8.rgb}/$color8_rgb/g + s/{color9.rgb}/$color9_rgb/g + s/{color10.rgb}/$color10_rgb/g + s/{color11.rgb}/$color11_rgb/g + s/{color12.rgb}/$color12_rgb/g + s/{color13.rgb}/$color13_rgb/g + s/{color14.rgb}/$color14_rgb/g + s/{color15.rgb}/$color15_rgb/g + " "$t" > "${dest_dir}/${file_name}" + done + # Run extra user scripts [ -d "$conf_dir/scripts" ] || exit 0 for i in "$conf_dir/scripts/"*