#!/bin/sh
# The following script is designed to put all SWMO color customizations in a single file
# Uncomment the lines for the colors you want to change and set the hex color code
# This script can be ran more than once and will always overwrite previous changes
# <-----Sway----->
# Status Bar color (excluding workspace buttons)
# BACKGROUND="background #RRGGBBaa"
# Status Bar text color
# STATUSLINE="statusline #RRGGBBaa"
# Status Bar and text colors on the focused monitor
# FOCUSED_BG="focused_background #RRGGBBaa"
# FOCUSED_SL="focused_statusline #RRGGBBaa"
# Border, background, and text colors of the focused workspace button
# FOCUSED_WS="focused_workspace #RRGGBBaa #RRGGBBaa #RRGGBBaa"
# Multiple monitors only. Border, background, and text colors of the workspace button when visible but not focused
# ACTIVE_WS="active_workspace #RRGGBBaa #RRGGBBaa #RRGGBBaa"
# Border, background, and text colors of any workspace button that is not focused.
# INACTIVE_WS="inactive_workspace #RRGGBBaa #RRGGBBaa #RRGGBBaa"
# Border, background, and text colors of a workspace button with an urgency hint
# URGENT_WS="urgent_workspace #RRGGBBaa #RRGGBBaa #RRGGBBaa"
# Border, background, and text colors of relevant workspace buttons when multiple workspaces are displayed on a single screen
# BINDING_MODE="binding_mode #RRGGBBaa #RRGGBBaa #RRGGBBaa"
# Font syntax '<fontname> <size>'
# Note the single quotes inside the double quotes
# FONT="'Mono 14'"
# Window Border Color
# BORDER_CLR="#RRGGBBaa"
sed -i -e "/colors {/,/}/{/colors {/!{/}/!d}}" ~/.config/sxmo/sway
sed -i "/colors {/a \\
$BACKGROUND \\
$STATUSLINE \\
$FOCUSED_BG \\
$FOCUSED_SL \\
$FOCUSED_WS \\
$ACTIVE_WS \\
$INACTIVE_WS \\
$URGENT_WS \\
$BINDING_MODE \\
$FONT" ~/.config/sxmo/sway
if [ -n "$BORDER_CLR" ]; then
sed -i -e "/client.focused/d" -e "/default_border/iclient.focused #4c7899 $BORDER_CLR #ffffff" ~/.config/sxmo/sway
fi
# <-----bemenu----->
# BG: Bar Color
# FG: Text Color
# Menu Title (Top left of menu)
# TITLE_BG="--tb #RRGGBBaa"
# TITLE_FG="--tf #RRGGBBaa"
# Search/Filter Bar (Right of title)
# FILTER_BG="--fb #RRGGBBaa"
# FILTER_FG="--ff #RRGGBBaa"
# Non-selected Bars
# NSEL_BG="--nb #RRGGBBaa"
# NSEL_FG="--nf #RRGGBBaa"
# Selected Bar
# HILGT_BG="--hb #RRGGBBaa"
# HILGT_FG="--hf #RRGGBBaa"
# Scrollbar (FG: the bar itself; BG: left side of the menu)
# SCROLL_BG="--scb #RRGGBBaa"
# SCROLL_FG="--scf #RRGGBBaa"
sed -i -e "/BEMENU_OPTS/d" -e "/sxmo documentation/a\\BEMENU_OPTS=\"--fn 'Mono 14' --scrollbar autohide -s -n -w -c -l8 -M 40 -W 20 $TITLE_BG $TITLE_FG $FILTER_BG $FILTER_FG $NSEL_BG $NSEL_FG $HILGT_BG $HILGT_FG $SCROLL_BG $SCROLL_FG\" \\" ~/.config/sxmo/profile
# <-----wvkbd----->
# This will compile a new version of wvkbd under the name 'wvkbd-custom' and sets it as your default keyboard in ~/.config/sxmo/profile
# Note that with this set, if there are updates to the sxmo-wvkbd package, you will not see them without commenting out or deleting the line in profile
# Define color variables in AARRGGBB
# ALL COLORS MUST BE DEFINED -- Default colors are currently set
LETKEYBG="FF0F0F0F" # Color of the lines between keys on the inner portion of the keyboard (primarily text and spacebar)
LETKEYFG="FF2D2D2D" # Color of inner portion keys
LETKEYHI="FF646464" # Color of inner portion keys when pressed
LETKEYSW="4964FF64" # Color of inner portion swipe keys (not seen without exterbal swipe program)
LETKEYTX="FFFFFFFF" # Text color
SYMKEYBG="FF0F0F0F" # Color of the lines between the keys on the outer portion of the keyboard (ctrl, shift, enter, etc)
SYMKEYFG="FF202020" # Color of outer portion keys
SYMKEYHI="FF646464" # Color of outer portion keys when pressed
SYMKEYSW="4964FF64" # Color of outer portion swipe keys
SYMKEYTX="FFFFFFFF" # Text color
# install required packages
doas apk add git make pango-dev libxkbcommon-dev waylandpp-dev gcc libc-dev
git clone https://github.com/jjsullivan5196/wvkbd ~/.config/wvkbd
cp ~/.config/wvkbd/config.def.h ~/.config/wvkbd/config.h
cp ~/.config/wvkbd/keymap.mobintl.h ~/.config/wvkbd/keymap.custom.h
cp ~/.config/wvkbd/layout.mobintl.h ~/.config/wvkbd/layout.custom.h
sed -i -e "s/mobintl/custom/g" ~/.config/wvkbd/config.mk
sed -i -e "/scheme = {/,/;/{/scheme = {/!{/;/!d}}" ~/.config/wvkbd/config.h
sed -i "/scheme = {/a \\
/* colors */ \\
.bg = {.color = 0x$LETKEYBG}, \\
.fg = {.color = 0x$LETKEYFG}, \\
.high = {.color = 0x$LETKEYHI}, \\
.swipe = {.color = 0x$LETKEYSW}, \\
.text = {.color = 0x$LETKEYTX}, " ~/.config/wvkbd/config.h
sed -i -e "/scheme1 = {/,/;/{/scheme1 = {/!{/;/!d}}" ~/.config/wvkbd/config.h
sed -i "/scheme1 = {/a \\
/* colors */ \\
.bg = {.color = 0x$SYMKEYBG}, \\
.fg = {.color = 0x$SYMKEYFG}, \\
.high = {.color = 0x$SYMKEYHI}, \\
.swipe = {.color = 0x$SYMKEYSW}, \\
.text = {.color = 0x$SYMKEYTX}, " ~/.config/wvkbd/config.h
sed -i -e "/KEYBOARD/d" -e "/sxmo documentation/a\\export KEYBOARD=\"/usr/bin/wvkbd-custom\" \\" ~/.config/sxmo/profile
doas make -C ~/.config/wvkbd clean install PREFIX=/usr