From 3be98e5ef5247042fd219dded572910305b1a5a4 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 9 Mar 2024 14:16:43 +0100 Subject: big restructure of `mode` scripts --- .local/share/mode/switch.d/chromium | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 .local/share/mode/switch.d/chromium (limited to '.local/share/mode/switch.d/chromium') diff --git a/.local/share/mode/switch.d/chromium b/.local/share/mode/switch.d/chromium new file mode 100755 index 0000000..5f4f342 --- /dev/null +++ b/.local/share/mode/switch.d/chromium @@ -0,0 +1,47 @@ +#!/bin/sh +. "$XDG_DATA_HOME/mode/lib/functions.sh" + +PREFIX="$XDG_CACHE_HOME/mode/chromium" + +mkdir -p "$PREFIX" +rm -f "$PREFIX/Cached Theme.pak" + +convert -size 100x100 "xc:$bg" "$PREFIX/bg.png" +bg_alt=$(mix_rgb $color7 $bg 0.20) +fg_alt=$(mix_rgb $color15 $fg 0.60) +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 > "$PREFIX/manifest.json" +{ + "description": "colorscheme generated by mode", + "manifest_version": 2, + "name": "mode theme", + "theme": { + "images": { "theme_frame": "bg.png" }, + "colors": { + "frame": $bg, + "button_background": $fg, + "ntp_background": $bg, + "ntp_text": $bg, + "toolbar": $bg_alt, + "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 + -- cgit v1.2.3