diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
| commit | e43eb1177872f52e949fb5f0f93396ed94b0d093 (patch) | |
| tree | 78b73af6a989fa2996d71b112e161b70d35081ef /home/dot_local/share/mode/switch.d | |
| parent | 2f14a896e4b897bd747c24d7ad8e9e7bb3237d03 (diff) | |
move to chezmoi
Diffstat (limited to 'home/dot_local/share/mode/switch.d')
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_anki | 120 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_chromium | 48 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_discord | 34 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_dunst | 24 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_fcitx5 | 67 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_gtk | 11 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_i3 | 14 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_kitty | 27 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_mode | 10 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_polybar | 16 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_vim | 59 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_wall | 2 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_xrdb | 22 | ||||
| -rw-r--r-- | home/dot_local/share/mode/switch.d/executable_zathura | 27 |
14 files changed, 481 insertions, 0 deletions
diff --git a/home/dot_local/share/mode/switch.d/executable_anki b/home/dot_local/share/mode/switch.d/executable_anki new file mode 100644 index 0000000..7572b00 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_anki @@ -0,0 +1,120 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +# this generates theme files compatible with Anki-redesign: +# <https://ankiweb.net/shared/info/308574457> +# <https://github.com/shirajuki/anki-redesign> +ANKI_REDESIGN="$XDG_DATA_HOME/Anki2/addons21/308574457" + +# ensure folders exist +mkdir -p "$ANKI_REDESIGN/user_files/themes" + +# ensure theme is set to mode +CONFIG="$ANKI_REDESIGN/config.json" +[ -e "$CONFIG" ] && jq '.theme = "mode"' "$CONFIG" | sponge "$CONFIG" + +name() { + key="$1" + value="$2" + key_json="$(printf '%s' "$key" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_')" + key_css="--$(printf '%s' "$key" | tr '[:upper:]' '[:lower:]' | tr -c '[:alnum:]' '-')" + echo "\"$key_json\": [ \"\", \"\", \"$value\", \"$value\", \"$key_css\" ]" +} + +unused="#ff00ff" +surface_0=$(mix_rgb $bg '#000000' 0.7) +surface_1=$(mix_rgb $color0 $bg 0.40) +surface_2=$(mix_rgb $color0 $bg 0.60) + +cat << EOF > "$ANKI_REDESIGN/user_files/themes/mode.json" +{ + "colors": { + $(name accent-card "$color4"), + $(name accent-danger "$color1"), + $(name accent-note "$color2"), + $(name border "$bg"), + $(name border-focus "#3b82f6"), + $(name border-strong "#020202"), + $(name border-subtle "$bg"), + $(name buried-fg "#777733"), + $(name button-bg "$surface_1"), + $(name button-disabled "$bg"), + $(name button-focus-bg "#0093d0"), + $(name button-gradient-end "$surface_2"), + $(name button-gradient-start "$surface_2"), + $(name button-hover-border "$accent"), + $(name button-primary-bg "$accent"), + $(name button-primary-disabled "#4484ed"), + $(name button-primary-gradient-end "$accent"), + $(name button-primary-gradient-start "$accent"), + $(name canvas "$bg"), + $(name canvas-code "$surface_0"), + $(name canvas-elevated "$bg"), + $(name canvas-inset "$surface_1"), + $(name canvas-overlay "$bg"), + $(name current-deck "$unused"), + $(name disabled "#777"), + $(name faint-border "#29292b"), + $(name fg "$fg"), + $(name fg-disabled "#737373"), + $(name fg-faint "$color0"), + $(name fg-link "#bfdbfe"), + $(name fg-subtle "#858585"), + $(name flag1-bg "#aa5555"), + $(name flag1-fg "#ff7b7b"), + $(name flag2-bg "#ac653a"), + $(name flag2-fg "#f5aa41"), + $(name flag3-bg "#559238"), + $(name flag3-fg "#86ce5d"), + $(name flag4-bg "#506aa3"), + $(name flag4-fg "#6f9dff"), + $(name flag5-bg "#975d8f"), + $(name flag5-fg "#f097e4"), + $(name flag6-bg "#399185"), + $(name flag6-fg "#5ccfca"), + $(name flag7-bg "#624b77"), + $(name flag7-fg "#9f63d3"), + $(name flag-1 "$color9"), + $(name flag-2 "$color11"), + $(name flag-3 "$color10"), + $(name flag-4 "$color12"), + $(name flag-5 "$color13"), + $(name flag-6 "$color14"), + $(name flag-7 "$color5"), + $(name focus-shadow "#0093d0"), + $(name frame-bg "$surface_1"), + $(name highlight-bg "$accent"), + $(name highlight-fg "$accent_text"), + $(name learn-count "#ff935b"), + $(name link "#77ccff"), + $(name marked-bg "#77c"), + $(name medium-border "#444"), + $(name new-count "#77ccff"), + $(name review-count "#5ccc00"), + $(name scrollbar-bg "$surface_1"), + $(name scrollbar-bg-active "$surface_2"), + $(name scrollbar-bg-hover "$surface_2"), + $(name selected-bg "rgba(147, 197, 253, 0.5)"), + $(name selected-fg "$fg"), + $(name shadow "#141414"), + $(name shadow-focus "#6366f1"), + $(name shadow-inset "#202020"), + $(name shadow-subtle "#363636"), + $(name slightly-grey-text "#ccc"), + $(name state-buried "#92400e"), + $(name state-learn "$color1"), + $(name state-marked "#a855f7"), + $(name state-new "$color4"), + $(name state-review "$color2"), + $(name state-suspended "#fef9c3"), + $(name suspended-bg "#aaaa33"), + $(name suspended-fg "#ffffb2"), + $(name text-fg "$fg"), + $(name tooltip-bg "$surface_1"), + $(name window-bg "$bg"), + $(name zero-count "#444") + }, + "version": { "major": -1, "minor": -1 } +} +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_chromium b/home/dot_local/share/mode/switch.d/executable_chromium new file mode 100644 index 0000000..0ea2caa --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_chromium @@ -0,0 +1,48 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CACHE_HOME/mode/chromium" + +rm -f 'Cached Theme.pak' + +magick -size 100x100 "xc:$bg" 'bg.png' +bg_alt=$(mix_rgb $bg $color0 0.65) +fg_alt=$(mix_rgb $fg $color15 0.35) + +bg="$(hex_to_rgb_array "$bg")" +fg="$(hex_to_rgb_array "$fg")" +bg_alt="$(hex_to_rgb_array "$bg_alt")" +fg_alt="$(hex_to_rgb_array "$fg_alt")" + +cat << EOF > 'manifest.json' +{ + "description": "colorscheme generated by mode", + "manifest_version": 2, + "name": "mode theme", + "theme": { + "images": { "theme_frame": "bg.png" }, + "colors": { + "frame": $bg_alt, + "button_background": $fg, + "ntp_background": $bg, + "ntp_text": $bg_alt, + "toolbar": $bg, + "toolbar_button_icon": $fg, + "tab_background_text": $fg_alt, + "tab_background_text_inactive": $fg_alt, + "tab_background_text_incognito": $fg_alt, + "tab_background_text_incognito_inactive": $fg_alt, + "bookmark_text": $fg, + "tab_text": $fg + }, + "tints": { + "buttons": [ -1, -1, -1 ], + "frame_inactive": [ -1, -1, -1 ], + "frame_incognito": [ -1, -1, -1 ], + "frame_incognito_inactive": [ -1, -1, -1 ] + } + }, + "version": "2" +} +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_discord b/home/dot_local/share/mode/switch.d/executable_discord new file mode 100644 index 0000000..dd7e5e3 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_discord @@ -0,0 +1,34 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/BetterDiscord/themes" +cat << EOF > 'mode.theme.css' +/** + * @name mode + * @author mode + * @version 0 +*/ + +/* AUTOMATICALLY GENERATED, DO NOT EDIT */ + +.theme-dark, .theme-light { + --background-primary: $bg; + --background-secondary: $bg; + --background-secondary-alt: $bg; + --text-primary: $fg; + --text-secondary: $color15; + --accent: $color4; + --accent-alt: $color12; + --error: $color1; + --error-alt: $color9; +} + +.theme-dark { + --background-tertiary: $(mix_rgb $bg '#000000' 0.7); +} + +.theme-light { + --background-tertiary: $bg; +} +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_dunst b/home/dot_local/share/mode/switch.d/executable_dunst new file mode 100644 index 0000000..d7d9a2b --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_dunst @@ -0,0 +1,24 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/dunst" +cat 'base' - << EOF > 'dunstrc' +frame_color = "$accent" + +[urgency_low] +background = "$bg" +foreground = "$fg" +timeout = 10 + +[urgency_normal] +background = "$bg" +foreground = "$fg" +timeout = 10 + +[urgency_critical] +background = "$color1" +foreground = "$bg" +frame_color = "$color1" +timeout = 0 +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_fcitx5 b/home/dot_local/share/mode/switch.d/executable_fcitx5 new file mode 100644 index 0000000..2cc6ccb --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_fcitx5 @@ -0,0 +1,67 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_DATA_HOME/fcitx5/themes/mode" +rounding=6 +size=$(( 2 * $rounding + 4 )) +margin_h=6 +margin_v=4 + +bg='#000000' +fg='#ffffff' +accent='#404040' +accent_text=$fg +sel_bg=$(mix_rgb $color12 $bg 0.4) +sel_fg=$fg + +magick \ + -size ${size}x${size} xc:transparent \ + -fill xc:"$accent" \ + -draw "roundrectangle 0,0 $(( $size - 1 )),$(( $size - 1 )) $rounding,$rounding" \ + highlight.png + +cat base.conf - << EOF > theme.conf +[InputPanel] +NormalColor=$fg +HighlightCandidateColor=$accent_text +HighlightColor=$sel_fg +HighlightBackgroundColor=$sel_bg + +[InputPanel/Background] +Color=$bg + +[InputPanel/Highlight] +Image=highlight.png + +[InputPanel/Highlight/Margin] +Left=$rounding +Right=$rounding +Top=$rounding +Bottom=$rounding + +[InputPanel/ContentMargin] +Left=$(( 2 + $rounding - $margin_h )) +Right=$(( 2 + $rounding - $margin_h )) +Top=$(( 2 + $rounding - $margin_v )) +Bottom=$(( 2 + $rounding - $margin_v )) + +[InputPanel/TextMargin] +Left=$margin_h +Right=$margin_h +Top=$margin_v +Bottom=$margin_v + +[Menu] +NormalColor=$fg + +[Menu/Background] +Color=$bg + +[Menu/Highlight] +Color=$accent + +[Menu/Separator] +Color=$color7 + +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_gtk b/home/dot_local/share/mode/switch.d/executable_gtk new file mode 100644 index 0000000..95d3e53 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_gtk @@ -0,0 +1,11 @@ +#!/bin/sh +GTK_3_SETTINGS_INI="$XDG_CONFIG_HOME/gtk-3.0/settings.ini" +if [ "$mode" = "light" ]; then + sed -e 's/-Dark/-Light/' -e 's/-dark/-light/' -i "$GTK_3_SETTINGS_INI" + sed "s/gtk-application-prefer-dark-theme.*/gtk-application-prefer-dark-theme=false/" -i "$GTK_3_SETTINGS_INI" +else + sed -e 's/-Dark/-Light/' -e 's/-dark/-light/' -i "$GTK_3_SETTINGS_INI" + sed "s/gtk-application-prefer-dark-theme.*/gtk-application-prefer-dark-theme=true/" -i "$GTK_3_SETTINGS_INI" +fi +grep gtk-theme-name "$GTK_3_SETTINGS_INI" | cut -f2 -d= | xargs xfconf-query -c xsettings -p /Net/ThemeName -s + diff --git a/home/dot_local/share/mode/switch.d/executable_i3 b/home/dot_local/share/mode/switch.d/executable_i3 new file mode 100644 index 0000000..713869e --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_i3 @@ -0,0 +1,14 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +indicator="$color0" +mkcd "$XDG_CONFIG_HOME/i3" +cat << EOF > 'color.conf' +client.focused $fg $bg $fg $indicator $bg +client.focused_inactive $bg $bg $fg $indicator $bg +client.unfocused $bg $bg $fg $indicator $bg +client.urgent $bg $bg $fg $indicator $bg +client.placeholder $bg $bg $fg $indicator $bg +client.background $bg +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_kitty b/home/dot_local/share/mode/switch.d/executable_kitty new file mode 100644 index 0000000..eeb81d0 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_kitty @@ -0,0 +1,27 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/kitty" + +cat << EOF > 'color.conf' +background $bg +foreground $fg + +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 +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_mode b/home/dot_local/share/mode/switch.d/executable_mode new file mode 100644 index 0000000..8866486 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_mode @@ -0,0 +1,10 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CACHE_HOME/mode/state" + +echo "$mode" > mode +rm theme +ln -sf "$theme" theme +echo "#!/bin/sh$vars" > vars + diff --git a/home/dot_local/share/mode/switch.d/executable_polybar b/home/dot_local/share/mode/switch.d/executable_polybar new file mode 100644 index 0000000..7087735 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_polybar @@ -0,0 +1,16 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/polybar" +cat << EOF > 'colors.ini' +[color] +bg = \${xrdb:background:$bg} +fg = \${xrdb:foreground:$fg} +fg-alt = \${xrdb:background:$bg} +fg-half = \${xrdb:color8:$color8} + +alpha = #00000000 + +; vim:ft=dosini +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_vim b/home/dot_local/share/mode/switch.d/executable_vim new file mode 100644 index 0000000..2220b1a --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_vim @@ -0,0 +1,59 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/nvim/mode" + +# lightline +cat << EOF > 'lightline.vim' +let s:bg = [ '$bg', 'NONE' ] +let s:fg = [ '$fg', 'NONE' ] +let s:mode = [ '$color0', 'NONE' ] +let s:faint = [ '$color8', 'NONE' ] +let s:none = [ 'NONE', 'NONE' ] +let s:test = [ '#ff00ff', 'NONE' ] + +let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}} +let s:p.normal.left = [ [ s:fg, s:mode ], [ s:faint, s:bg ] ] +let s:p.normal.right = [ [ s:faint, s:bg ] ] +let s:p.normal.middle = [ [ s:bg, s:bg ] ] +let s:p.normal.error = [ [ s:test, s:test ] ] +let s:p.normal.warning = [ [ s:test, s:test ] ] +let s:p.inactive.left = copy(s:p.normal.left) +let s:p.inactive.right = copy(s:p.normal.right) +let s:p.inactive.middle = copy(s:p.normal.middle) +let s:p.insert.left = copy(s:p.normal.left) +let s:p.replace.left = copy(s:p.insert.left) +let s:p.visual.left = copy(s:p.insert.left) +let s:p.tabline.left = copy(s:p.normal.right) +let s:p.tabline.tabsel = [ [ s:fg, s:mode ] ] +let s:p.tabline.middle = copy(s:p.normal.right) +let s:p.tabline.right = copy(s:p.normal.right) + +let g:lightline#colorscheme#auto#palette = lightline#colorscheme#flatten(s:p) +EOF + +# terminal colors +cat << EOF > 'termcolors.vim' +let g:terminal_color_0 = '$color0' +let g:terminal_color_1 = '$color1' +let g:terminal_color_2 = '$color2' +let g:terminal_color_3 = '$color3' +let g:terminal_color_4 = '$color4' +let g:terminal_color_5 = '$color5' +let g:terminal_color_6 = '$color6' +let g:terminal_color_7 = '$color7' +let g:terminal_color_8 = '$color8' +let g:terminal_color_9 = '$color9' +let g:terminal_color_10 = '$color10' +let g:terminal_color_11 = '$color11' +let g:terminal_color_12 = '$color12' +let g:terminal_color_13 = '$color13' +let g:terminal_color_14 = '$color14' +let g:terminal_color_15 = '$color15' +EOF + +# color scheme +cat << EOF > 'colorscheme.vim' +colorscheme $vim_theme_name +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_wall b/home/dot_local/share/mode/switch.d/executable_wall new file mode 100644 index 0000000..c5ced92 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_wall @@ -0,0 +1,2 @@ +#!/bin/sh +bgcol "$bg" diff --git a/home/dot_local/share/mode/switch.d/executable_xrdb b/home/dot_local/share/mode/switch.d/executable_xrdb new file mode 100644 index 0000000..591a530 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_xrdb @@ -0,0 +1,22 @@ +#!/bin/sh +cat << EOF | xrdb -override +*.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 +*.foreground: $fg +*.background: $bg +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_zathura b/home/dot_local/share/mode/switch.d/executable_zathura new file mode 100644 index 0000000..8d7e311 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_zathura @@ -0,0 +1,27 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/zathura" +cat << EOF > 'colors' +set completion-bg "$bg" +set completion-fg "$fg" +set completion-highlight-bg "$accent" +set completion-highlight-fg "$accent_text" +set default-bg "$bg" +set default-fg "$fg" +set highlight-active-color "$(echo "$accent" | pastel set alpha 0.5 | pastel format rgb)" +set highlight-color "$(echo "$accent_text" | pastel set alpha 0.5 | pastel format rgb)" +set inputbar-bg "$bg" +set inputbar-fg "$fg" +set notification-bg "$bg" +set notification-error-bg "$color9" +set notification-error-fg "$bg" +set notification-fg "$fg" +set notification-warning-bg "$color9" +set notification-warning-fg "$bg" +set recolor-darkcolor "$fg" +set recolor-lightcolor "$bg" +set statusbar-bg "$bg" +set statusbar-fg "$fg" +EOF + |