Compare commits

...

2 Commits

Author SHA1 Message Date
cf66847051 wip 2025-04-01 00:00:37 +00:00
e9f27213c1 migrate to gomplate 2025-03-31 23:50:11 +00:00
12 changed files with 41 additions and 82 deletions

View File

@ -1,24 +0,0 @@
#!/bin/sh
export BEMENU_OPTS="\
--ignorecase \
--width-factor 0.5 \
--fn \"$THEME_FONT_MONO $THEME_SIZE_FONT_LARGE_PT\" \
--list 500 \
--border 2 \
--scrollbar autohide \
--border-radius 4 \
--bdr #$THEME_COLOR_FG_ACCENT$THEME_OPACITY_MID_HEX \
--scf #$THEME_COLOR_FG_ACCENT$THEME_OPACITY_MID_HEX \
--scb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--nb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--ab #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--hb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--fb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--tb #$THEME_COLOR_BG$THEME_OPACITY_HIGH_HEX \
--nf #$THEME_COLOR_FG \
--af #$THEME_COLOR_FG \
--cf #$THEME_COLOR_FG \
--hf #$THEME_COLOR_FG_ACCENT \
--tf #$THEME_COLOR_FG_ACCENT \
--ff #$THEME_COLOR_FG_ACCENT \
"

View File

@ -0,0 +1,24 @@
#!/bin/sh
export BEMENU_OPTS="\
--ignorecase \
--width-factor 0.5 \
--fn \"{{ .theme.font.name_mono }} {{ math.Add .theme.font.size_base_pt .theme.font.size_step_pt }}\" \
--list 500 \
--border 2 \
--scrollbar autohide \
--border-radius 4 \
--bdr #{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} \
--scf #{{ .theme.color.fg_accent }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} \
--scb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--nb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--ab #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--hb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--fb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--tb #{{ .theme.color.bg }}{{ math.Mul .theme.opacity.high 255 | conv.ToInt64 | printf "%02X" }} \
--nf #{{ .theme.color.fg }} \
--af #{{ .theme.color.fg }} \
--cf #{{ .theme.color.fg }} \
--hf #{{ .theme.color.fg_accent }} \
--tf #{{ .theme.color.fg_accent }} \
--ff #{{ .theme.color.fg_accent }} \
"

View File

@ -2,7 +2,6 @@
export PATH=$PATH:~/.local/bin
{{ jq "1 config/theme.json\n" }}
source ~/.config/bemenu/config.sh
for fpath in ~/.config/*/env.sh; do
. "$fpath"
done

View File

@ -11,7 +11,7 @@ for mode in ['normal','insert','hint','passthrough','command','prompt','yesno','
# styles
config.set('colors.webpage.preferred_color_scheme','dark')
config.set('colors.webpage.darkmode.enabled', True)
config.set('colors.webpage.bg','#'+os.environ['THEME_COLOR_BG'])
config.set('colors.webpage.bg','#'+os.environ['QB_THEME_COLOR_BG'])
config.set('fonts.default_family','Roboto')
# engines
config.set('url.searchengines', {

View File

@ -0,0 +1,3 @@
#!/bin/sh
export QB_THEME_COLOR_BG={{ .theme.color.bg }}

View File

@ -15,7 +15,7 @@ set $bwd apostrophe
default_border pixel 1
smart_borders on
title_align center
font pango:{{ .theme.font.name_regular }} {{ math.Mul .theme.font.size_base_pt .theme.font.size_smaller_em }}
font pango:{{ .theme.font.name_regular }} {{ math.Sub .theme.font.size_base_pt .theme.font.size_step_pt }}
output * bg #{{ .theme.color.bg }} solid_color
client.focused #{{ .theme.color.bg_accent_light }} #{{ .theme.color.bg_accent_light }} #{{ .theme.color.fg }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}
client.focused_tab_title #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.bg_accent_light }}{{ math.Mul .theme.opacity.med 255 | conv.ToInt64 | printf "%02X" }} #{{ .theme.color.fg_dark }} #{{ .theme.color.fg_accent }} #{{ .theme.color.bg_accent_light }}

View File

@ -16,7 +16,6 @@
"name_regular": "Roboto",
"name_mono": "Roboto Mono",
"size_base_pt": 12,
"size_smaller_em": 0.875,
"size_larger_em": 1.1125
"size_step_pt": 1.5
}
}

View File

@ -12,7 +12,7 @@ umask 002
####### file structure #########
USER_DIRS=(
##### xdg #####
~/.config
~/.config # bkp=weak
~/.local/bin # bkp=weak
~/.local/share # bkp=weak
~/.local/state
@ -41,43 +41,18 @@ cp -rf bin/* ~/.local/bin
################################
########### config #############
source config/theme.sh
VARS=$(printenv | \
grep -E '^(THEME_.\w+)|(USER)=' | \
sed -e 's/[= ].*//g' | sed -e 's/^/\$/' | tr '\n' ' '
)
cp_subst() {
mkdir -p "$(dirname "$2")"
envsubst "$VARS" < "$1" > "$2"
}
gomplate --input-dir config \
--output-map "$HOME/.config/{{ .in | strings.ReplaceAll \".tmpl\" \"\" }}" \
--exclude-processing "!*.tmpl" \
--plugin jq=/bin/jq \
-c theme=config/theme.json
# xdg
cp -rf config/i3blocks ~/.config
cp -rf config/git ~/.config
cp -rf config/vim ~/.config
cp -rf config/xkb ~/.config
cp -rf config/swayidle ~/.config
# non-xdg
cp -rf config/bash ~/.config
ln -sf ~/.config/bash/bashrc ~/.bashrc
# templated
cp_subst config/sway/config.tmpl ~/.config/sway/config
cp_subst config/foot/foot.ini.tmpl ~/.config/foot/foot.ini
cp_subst config/mako/config.tmpl ~/.config/mako/config
cp_subst config/qutebrowser/config.py.tmpl ~/.config/qutebrowser/config.py
# dynamic
cp -rf config/profile.part ~/.profile
# shellcheck disable=SC2129
echo -e "\n# GENERATED" >> ~/.profile
sed '/^#/d' config/theme.sh >> ~/.profile
sed '/^#/d' config/bemenu/config.sh >> ~/.profile
ln -sf ~/.config/profile ~/.profile
################################
############# data ############
cp_subst data/qutebrowser/start.html.tmpl ~/.local/share/qutebrowser/start.html
cp -rf data/* ~/.local/share
###############################
swaymsg reload || true

View File

@ -1,17 +0,0 @@
#!/bin/bash
set -e
# packages
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update && sudo apt upgrade -y
sudo apt install gnupg docker-ce
# keys
curl https://yrz.am/gpg | gpg --import
# files
mkdir -p ~/app
touch ~/app/docker-compose.yaml