diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-08-28 14:02:05 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-08-28 14:02:05 +0200 |
commit | cdc4d81fb72881911204e731126869968d82f31a (patch) | |
tree | c98f463e09c2b6b0da11d21ecdc61d9fa0bee99a /.local/share/bin/mode | |
parent | 2300570c19a79d4949eac3173785cf56ec5425a1 (diff) |
dynamic theme for fcitx5
Diffstat (limited to '.local/share/bin/mode')
-rwxr-xr-x | .local/share/bin/mode | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/.local/share/bin/mode b/.local/share/bin/mode index 166aa7f..2d16819 100755 --- a/.local/share/bin/mode +++ b/.local/share/bin/mode @@ -70,6 +70,37 @@ switch_gtk() { fi } +switch_fcitx5() { + accent="$(get_color color9)" + read -r -d '' conf << EOF +[InputPanel] +NormalColor=$(get_color foreground) +HighlightCandidateColor=$(get_color background) +HighlightColor=$(get_color color13) +HighlightBackgroundColor=$(get_color background) + +[InputPanel/Background] +Color=$(get_color background) +BorderColor=${accent} + +[InputPanel/Highlight] +Color=${accent} + +[Menu/Background] +Color=$(get_color background) + +[Menu] +NormalColor=$(get_color foreground) + +[Menu/Highlight] +Color=${accent} + +[Menu/Separator] +Color=$(get_color color7) +EOF + echo "$conf" | cat ~/.local/share/fcitx5/themes/loek/base.conf - > ~/.local/share/fcitx5/themes/loek/theme.conf +} + reload_terms() { read -r -d '' escape_msgs << EOF \033]11;$(get_color background)\007 @@ -109,6 +140,10 @@ reload_polybar() { polybar-msg cmd restart &> /dev/null } +reload_fcitx5() { + fcitx5 -rd &> /dev/null & disown +} + switch_cfgs() { echo "switching to $1 mode..." @@ -116,6 +151,7 @@ switch_cfgs() { switch_dunst $1 switch_zathura $1 switch_gtk $1 + switch_fcitx5 $1 mkdir -p ~/.local/share/mode echo $1 > ~/.local/share/mode/active @@ -131,6 +167,7 @@ reload_apps() { reload_polybar reload_dunst reload_terms + reload_fcitx5 } reload_apps |