Commit before push.

This commit is contained in:
cyteen 2024-07-09 00:01:18 +01:00
parent 9d31152ede
commit 389842ff13
10 changed files with 667 additions and 46 deletions

238
020_kmonad-conf_print.sh Normal file
View File

@ -0,0 +1,238 @@
# create a template for the dell d830
# split into header, deflayer, defcfg and defsrc to allow reuse.
conf_print_dell_d830_template_header() {
cat <<EOF
#| --------------------------------------------------------------------------
KMonad: ISO Dell D830 Template
This file contains UK and 'defsrc' configurations for a Dell D830
with an ISO keyboard. Copy out the 'defsrc' layer to start your own
keyboard configuration. Copy out the 'deflayer' template to easily start
a new layer with matching 'transparent' buttons.
-------------------------------------------------------------------------- |#
EOF
}
# conf_print_dell_d830_template_header | tee ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_header_generic() {
cat <<EOF
#| --------------------------------------------------------------------------
KMonad: ISO Dell D830 Template
This file contains UK and 'defsrc' configurations for a Dell D830
with an ISO keyboard. Copy out the 'defsrc' layer to start your own
keyboard configuration. Copy out the 'deflayer' template to easily start
a new layer with matching 'transparent' buttons.
EOF
}
# conf_print_dell_d830_template_header_generic | tee ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_empty_generic() {
cat <<EOF
(deflayer empty
_ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _
)
-------------------------------------------------------------------------- |#
EOF
}
# conf_print_dell_d830_template_deflayer_empty_generic | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_empty() {
cat <<EOF
(deflayer empty
_ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_empty | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defcfg_generic() {
cat <<EOF
(defcfg
;; ** For Linux **
;;input (device-file "/dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd")
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "KMonad seniply-iso-wide")
cmp-seq cmp
;; ** For Windows **
;; input (low-level-hook)
;; output (send-event-sink)
;; ** For MacOS **
;; input (iokit-name "my-keyboard-product-string")
;; output (kext)
fallthrough true
)
EOF
}
# conf_print_dell_d830_template_defcfg_generic | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defcfg() {
cat <<EOF
(defcfg
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "Kmonad kbd")
"/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/setxkbmap -option caps:swapescape,compose:ralt")
cmp-seq 'ralt' ;; Set the compose key to 'RightAlt'
comp-seq-delay '5' ;; 5ms delay between each compose-key sequence press
fallthrough 'true' ;; Set to true to emit unhandled events
allow-cmd 'false' ;; Set to false to disable command execution in KMonad
)
EOF
}
# conf_print_dell_d830_template_defcfg | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defsrc() {
cat <<EOF
(defsrc
vold volu mute gui kprt nlck pause ins home pgup
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del end pgdn
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \# ret
lsft z x c v b n m , . / rsft
lctl fn lmet lalt spc ralt rctl up
left down rght
)
EOF
}
# conf_print_dell_d830_template_defsrc | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defalias_extend() {
cat <<EOF
(defalias
ext (layer-toggle extend) ;; Bind 'ext' to the Extend Layer
)
EOF
}
# conf_print_dell_d830_template_defalias_extend | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defalias() {
cat <<EOF
(defalias
cpy C-c
pst C-v
cut C-x
udo C-z
all C-a
fnd C-f
bk Back
fw Forward
)
EOF
}
# conf_print_dell_d830_template_defalias | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
# Using this as tje first layer after the defsrc preserves querty as the default
conf_print_dell_d830_template_deflayer_querty() {
cat <<EOF
(deflayer querty
vold volu mute gui kprt nlck pause ins home pgup
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del end pgdn
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \# ret
lsft z x c v b n m , . / rsft
lctl fn lmet lalt spc ralt rctl up
left down rght
)
EOF
}
# conf_print_dell_d830_template_deflayer_querty | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_colemak_dh() {
cat <<EOF
(deflayer colemak-dh
_ _ _ _ _ _ _ _ _ _
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g m n e i o ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl _ lmet lalt spc ralt rmet _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_colemak_dh | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_colemak_dhk() {
cat <<EOF
(deflayer colemak-dhk
_ _ _ _ _ _ _ _ _ _
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g k n e i o ' \\ ret
lsft z x c d v 102d m h , . / rsft
lctl _ lmet lalt spc ralt rmet _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_colemak_dhk | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_extend() {
cat <<EOF
(deflayer extend
_ _ _ _ _ _ _ _ _ _
_ play rewind previoussong nextsong ejectcd refresh brdn brup www mail prog1 prog2
_ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _
_ esc @bk @fnd @fw ins pgup home up end menu prnt slck
_ lalt lmet lsft lctl ralt pgdn lft down rght del caps _ _
_ @udo @cut @cpy tab @pst _ pgdn bks lsft lctl comp _
_ _ _ _ ret _ _ _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_extend | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
cat <<EOF
(deflayer empty
_ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _
)
EOF

193
020_kmonad.sh Normal file
View File

@ -0,0 +1,193 @@
#!/usr/bin/env bash
set -x
# https://www.zephyrproject.org/zephyr-rtos-on-esp32/
# https://zmk.dev/docs/development/setup/
source ./020_kmonad-conf_print.sh
DEST=${1:-/etc/skel}
GITHUB_USER=kmonad
PROJECT=kmonad
API_URL=https://api.github.com/repos/${USER}/${PROJECT}/releases/latest
# RELEASE=$(curl -s ${API_URL} | grep tarball_url | cut -d '"' -f 4 | awk -F "/" {'print $8'})
RELEASE=$(lastversion ${GITHUB_USER}/${PROJECT})
SDK_URL=https://github.com/${USER}/${PROJECT}/releases/download/${RELEASE}
RSS_FEED="https://github.com/${USER}/${PROJECT}/releases.atom"
# xdg-open ${RSS_FEED}
echo ${RSS_FEED}
# make a containing directory
BUILD_HOME="/var/tmp/${PROJECT}-${RELEASE}"
mkdir -p "${BUILD_HOME}"
echo "git clone --depth 1 https://github.com/${GITHUB_USER}/${PROJECT} /var/tmp/${PROJECT}-${RELEASE}"
git clone --depth 1 https://github.com/${GITHUB_USER}/${PROJECT} "${BUILD_HOME}"
cd "${BUILD_HOME}" || exit
cat <<FOE | tee ${BUILD_HOME}/description-pak
Customize and extend the functionalities of a keyboard.
FOE
cat <<EOF | tee ${BUILD_HOME}/checkinstall_it.sh
echo "ENTERING CHECKINSTALL"
BASE_URL='https://raw.githubusercontent.com/'
BASE_USER=${GITHUB_USER}
BASE_REPO=${PROJECT}
LICENSE_URL="\${BASE_URL}/\${BASE_USER}/\${BASE_REPO}"/master/LICENSE
# wget -c \${LICENSE_URL}
# VERSION=\$(date +%Y-%m-%d_)git
VERSION=${RELEASE}
RELEASE="1"
LICENSE=bsd
# make a new temporary directory for this use
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
mkdir -p \${BASE_TMP_DIR}
# do your work
sudo checkinstall -y --fstrans \
--exclude=/home/${USER}/.sudo_as_admin_successful \
--pkgname=\${BASE_REPO} \
--pkgversion=\${VERSION}\
--pkgrelease="\${RELEASE}" \
--pkgarch=\${ARCH} \
--pkggroup=development \
--pkglicense=\$LICENSE \
--pkgsource=${LATEST_URL} \
--maintainer=cyteen@ring-zero.co.uk \
--requires= \
-D \
bash ./install_it.sh
EOF
cat <<-EOF | tee ${BUILD_HOME}/install_it.sh
# Copy files to their production locations.
cp -v ${BUILD_HOME}/kmonad /usr/local/bin/kmonad
mkdir -p /usr/share/kmonad
cp -v -a keymap /usr/share/kmonad/
cp -v -a startup /usr/share/kmonad/
cp -v README.md /usr/share/kmonad/
cp -v changelog.md /usr/share/kmonad/
EOF
# Create config directory and copy files there.
sudo -u ${USER} bash -c "mkdir -p "${DEST}"/.config/kmonad"
# bash -c "mkdir -p "${DEST}"/.config/kmonad"
# Create the template files
conf_print_dell_d830_template_header_generic | tee ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_empty_generic | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defcfg_generic | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defsrc | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
## Add some keymaps to the ${HOME}/.config/kmonad directory, miryoku, seniply, colemak-dh-extend-iso
# assign variable for use in sed
DEFCFG=$(conf_print_dell_d830_template_defcfg)
DEFSRC=$(conf_print_dell_d830_template_defsrc)
# Generate the miryoku kmonad config
MIRYOKU_BUILD_HOME="/var/tmp/miryoku-kmonad-git"
echo "MIRYOKU_BUILD_HOME ${MIRYOKU_BUILD_HOME}"
mkdir -p "${MIRYOKU_BUILD_HOME}"
git clone --depth 1 https://github.com/manna-harbour/miryoku_kmonad ${MIRYOKU_BUILD_HOME}
pushd ${MIRYOKU_BUILD_HOME}/src
make
make \
MIRYOKU_ALPHAS=QWERTY \
MIRYOKU_EXTRA=COLEMAKDH \
MIRYOKU_TAP=QWERTY \
MIRYOKU_NAV=INVERTEDT \
MIRYOKU_CLIPBOARD=WIN \
MIRYOKU_LAYERS=FLIP \
MIRYOKU_MAPPING=LITE \
MIRYOKU_KMONAD_OS=LINUX
popd
# Apply local defcfg and defsrc
DEST_FILE="${DEST}/.config/kmonad/miryoku.kbd"
echo "DEST_FILE ${DEST_FILE}"
cp "${MIRYOKU_BUILD_HOME}/src/build/miryoku_kmonad.kbd" ${DEST_FILE}
# sed -E -e '/^(defcfg/,/^)/ { s/(.*)/\1'"$DEFCFG"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
# sed -E -e '/^(defsrc/,/^)/ { s/(.*)/\1'"$DEFSRC"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
# Gnerate the semply config: https://stevep99.github.io/seniply/
# SEMPLY_BUILD_HOME=/var/tmp/semply-kmonad-git
# mkdir -p "${BUILD_HOME}"
# git clone --depth 1 https://github.com/semplify/semply_kmonad ${SEMPLY_BUILD_HOME}
DEST_FILE="${DEST}/.config/kmonad/colemak-dh-seniply-split.kbd"
echo "DEST_FILE ${DEST_FILE}"
echo ${DEST_FILE}
wget -c -O "${DEST_FILE}" https://raw.githubusercontent.com/stevep99/seniply/master/downloads/kmonad/colemak-dh-seniply-split.kbd
# sed -E -e '/^(defcfg/,/^)/ { s/(.*)/\1'"$DEFCFG"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
# sed -E -e '/^(defsrc/,/^)/ { s/(.*)/\1'"$DEFSRC"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
DEST_FILE="${DEST}/.config/kmonad/colemak-dh-seniply-wide.kbd"
echo ${DEST_FILE}
echo "DEST_FILE ${DEST_FILE}"
wget -c -O "${DEST_FILE}" https://raw.githubusercontent.com/stevep99/seniply/master/downloads/kmonad/colemak-dh-seniply-wide.kbd
DEST_FILE="colemak-dh-seniply-wide.kbd"
# sed -E -e '/^(defcfg/,/^)/ { s/(.*)/\1'"$DEFCFG"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
# sed -E -e '/^(defsrc/,/^)/ { s/(.*)/\1'"$DEFSRC"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
# create a config for the official colemak mod dh
# See: https://raw.githubusercontent.com/ColemakMods/mod-dh/master/kmonad/colemak-dh-extend-iso.kbd
KMONAD_HOME="${DEST}/.config/kmonad"
DEST_FILE="${DEST}/.config/kmonad/colemak-dh-extend-iso.kbd"
echo "DEST_FILE ${DEST_FILE}"
FILE="${DEST}/.config/kmonad/colemak-dh-extend-iso.kbd"
echo "DEST ${DEST}"
# wget -c -O ${DEST_FILE} https://raw.githubusercontent.com/ColemakMods/mod-dh/master/kmonad/colemak-dh-extend-iso.kbd
# sed -E -e '/^(defcfg/,/^)/ { s/(.*)/\1'"$DEFCFG"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
# sed -E -e '/^(defsrc/,/^)/ { s/(.*)/\1'"$DEFSRC"'/ }' ${DEST_FILE} >/tmp/temp && mv /tmp/temp ${DEST_FILE}
conf_print_dell_d830_template_header | tee ${DEST_FILE}
conf_print_dell_d830_template_defcfg | tee -a ${DEST_FILE}
conf_print_dell_d830_template_defsrc | tee -a ${DEST_FILE}
conf_print_dell_d830_template_defalias_extend | tee -a ${DEST_FILE}
conf_print_dell_d830_template_defalias | tee -a ${DEST_FILE}
conf_print_dell_d830_template_deflayer_querty | tee -a ${DEST_FILE}
conf_print_dell_d830_template_deflayer_colemak_dh | tee -a ${DEST_FILE}
conf_print_dell_d830_template_deflayer_colemak_dhk | tee -a ${DEST_FILE}
conf_print_dell_d830_template_deflayer_extend | tee -a ${DEST_FILE}
conf_print_dell_d830_template_deflayer_empty | tee -a ${DEST_FILE}
# set the default keymap
DEFAULT_KEYMAP="colemak-dh-seniply-split.kbd"
DEFAULT_KEYMAP="colemak-dh-seniply-wide.kbd"
DEFAULT_KEYMAP="miryoku.kbd"
DEFAULT_KEYMAP="colemak-dh-extend-iso.kbd"
sudo ln -sf ${DEST}/.config/kmonad/${DEFAULT_KEYMAP} ${DEST}/.config/kmonad/config.kbd
# copy templates to the home config dir.
sudo -u ${USER} cp -a keymap ${DEST}/.config/kmonad/
# This loads the user keymap on zsh start
cat <<-EOF | tee ${HOME}/.zshrc.d/008_kmonad.zsh
if [[ -f "${HOME}/.config/config.kbd" ]]; then
/usr/local/bin/kmonad "${HOME}/.config/kmonad/config.kbd"
fi
EOF
# Build the Docker image with alpine/haskell which will contain the binary.
# if [ ! docker info ] >/dev/null 2>&1; then
# echo "This script uses docker, and it isn't running - please start docker and try again!"
# exit 1
# else
# docker build -t kmonad-builder .
# # Spin up an ephemeral Docker container from the built image, to just copy the
# # built binary to the host's current directory bind-mounted inside the
# # container at /host/.
# docker run --rm -it -v ${PWD}:/host/ kmonad-builder bash -c "cp -vp /root/.local/bin/kmonad /host/"
#
# # Clean up build image, since it is no longer needed.
# # docker rmi kmonad-builder
# fi
bash ${BUILD_HOME}/checkinstall_it.sh

View File

@ -1,10 +1,10 @@
#!/usr/bin/env bash
# sudo apt install -y kodi
#
# 18.04 bionic buster
# 17.10 artful stretch
PROJECT="team-xbmc"
PROJECT_URL="https://launchpad.net/~"${PROJECT}"/+archive/ubuntu/ppa"
PROJECT_PAGE="$(curl -sS "${PROJECT_URL}")"
@ -18,17 +18,17 @@ KEY_ID="$(echo "${PROJECT_PAGE}" | xmllint --html --xpath "${KEY_ID_XPATH}" - 2>
# Download the key
KEY_SERVER="keyserver.ubuntu.com"
KEY_DIR="/etc/apt/keyrings"
KEY_DIR="/etc/apt/trusted.gpg.d/
SIGNED_BY="${KEY_DIR}/${PROJECT}.gpg"
sudo gpg --homedir /tmp --no-default-keyring --keyring "${SIGNED_BY}" --keyserver "${KEY_SERVER}" --recv-keys "${KEY_ID}
RELEASE=bionic
RELEASE="mantic"
sudo echo "deb [signed-by=${SIGNED_BY}] http://ppa.launchpad.net/${PROJECT}/ppa/ubuntu ${RELEASE} main" > /etc/apt/sources.list-available/kodi-ppa.list
sudo echo "deb-src [signed-by=${SIGNED_BY}] http://ppa.launchpad.net/${PROJECT}/ppa/ubuntu ${RELEASE} main" >> /etc/apt/sources.list-available/kodi-ppa.list
sudo echo "deb [signed-by=${SIGNED_BY}] http://ppa.launchpad.net/${PROJECT}/ppa/ubuntu ${RELEASE} main" >/etc/apt/sources.list-available${PROJECT}.list
sudo echo "deb-src [signed-by=${SIGNED_BY}] http://ppa.launchpad.net/${PROJECT}/ppa/ubuntu ${RELEASE} main" >>/etc/apt/sources.list-available/${PROJECT}.list
sudo ln -sf /etc/apt/sources.list-available/kodi-ppa.list /etc/apt/sources.list.d/kodi-ppa.list
sudo ln -sf /etc/apt/sources.list-available/${PROJECT}.list /etc/apt/sources.list.d/${PROJECT}.list
sudo apt update
@ -44,7 +44,6 @@ sudo apt update
#uranus
#maverick tv
packages=" \
ca-certificates \
kodi=2:18.* \
@ -65,7 +64,7 @@ packages=" \
kodi-repository-kodi \
vdr \
vdr-plugin-vnsiserver \
tzdata"
tzdata"
packages_missing=" \
kodi-game-libretro \
@ -79,9 +78,9 @@ packages_missing=" \
kodi-pvr-stalker \
kodi-pvr-teleboy \
kodi-pvr-vbox \
kodi-pvr-zattoo"
kodi-pvr-zattoo"
sudo apt update && \
sudo apt install -y --no-install-recommends $packages
sudo apt update &&
sudo apt install -y --no-install-recommends $packages
sudo apt install -y --no-install-recommends $packages_missing
sudo apt install -y --no-install-recommends
sudo apt install -y --no-install-recommends

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
DEST=${1:-/etc/skel}
LAZY_DEST=${DEST}/.config/nvim/lua/plugins
# PlatformIO wrapper for neovim written iua.
conf_print_platformio() {
cat <<EOF
return {
"anurag3301/nvim-platformio.lua",
dependencies = {
{ "akinsho/nvim-toggleterm.lua" },
{ "nvim-telescope/telescope.nvim" },
{ "nvim-lua/plenary.nvim" },
},
}
EOF
}
conf_print_platformio | tee ${LAZY_DEST}/platformio.lua

View File

@ -1,5 +1,8 @@
#!/usr/bin/env bash
PIPEWIRE_HOME=/etc/pipewire
WIREPLUMBER_HOME=/usr/share/wireplumber
# https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home
#
# with-alsa: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-ALSA
@ -30,9 +33,11 @@ sudo apt-get install qpwgraph vlc-plugin-pipewire
# Copy conffiles to /etc
sudo cp -vRa /usr/share/pipewire /etc/
sudo cp -vRa /usr/share/wireplumber /etc/
sudo mkdir -p /etc/pipewire/pipewire.conf.d
sudo mkdir -p /etc/wireplumber/wireplumber.conf.d
sudo mkdir -p ${PIPEWIRE_HOME}/pipewire.conf.d
# Wireplumber now expects configuration files in /usr/share and no more lua.
# sudo cp -vRa /usr/share/wireplumber /etc/
# sudo mkdir -p ${WIREPLUMER_HOME}/wireplumber.conf.d
# WirePlumber has profile auto-switching enabled by default. It can
# automatically switch between HSP/HFP and A2DP profiles whenever an
@ -44,10 +49,10 @@ conf_print_wireplumber_bt_autoswitch() {
}
EOF
}
# conf_print_wireplumber_bt_autoswitch | sudo tee /etc/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf
# conf_print_wireplumber_bt_autoswitch | sudo tee ${WIREPLUMBER_HOME}/wireplumber.conf.d/11-bluetooth-policy.conf
# conf_print_wireplumber_bt_autoswitch | sudo tee ~/.config/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf
sudo touch /etc/pipewire/media-session.d/with-alsa
sudo touch ${PIPEWIRE_HOME}/media-session.d/with-alsa
sudo cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-x86_64-linux-gnu.conf /etc/ld.so.conf.d/
@ -161,7 +166,8 @@ conf_print_alsa_conf_suspend-timeout() {
}
EOF
}
conf_print_alsa_conf_suspend-timeout | sudo tee /etc/wireplumber/main.lua.d/60-alsa_suspend-timeout.conf
# no more lua for wireplumber
# conf_print_alsa_conf_suspend-timeout | sudo tee ${WIREPLUMBER_HOME}/main.lua.d/60-alsa_suspend-timeout.conf
# improved crackling in fullscreen
conf_print_pipewire_quantum() {
@ -172,7 +178,7 @@ conf_print_pipewire_quantum() {
default.clock.max-quantum = "768"
EOF
}
conf_print_pipewire_quantum | sudo tee /etc/pipewire/pipewire.conf.d/clock_quantum.conf
conf_print_pipewire_quantum | sudo tee ${PIPEWIRE_HOME}/pipewire.conf.d/clock_quantum.conf
# default.clock.allowed-rates = [ 44100 48000 96000 192000 ]
conf_print_pipewire_quantum() {
@ -187,7 +193,7 @@ conf_print_pipewire_quantum() {
settings.check-rate = false
EOF
}
conf_print_pipewire_quantum | sudo tee /etc/pipewire/pipewire.conf.d/clock_quantum.conf
conf_print_pipewire_quantum | sudo tee ${PIPEWIRE_HOME}/pipewire.conf.d/clock_quantum.conf
conf_print_pipewire_alsa-api() {
cat <<-EOF
@ -196,7 +202,7 @@ conf_print_pipewire_alsa-api() {
api.alsa.period-size = 256
EOF
}
conf_print_pipewire_alsa-api | sudo tee /etc/pipewire/pipewire.conf.d/alsa-api.conf
conf_print_pipewire_alsa-api | sudo tee ${PIPEWIRE_HOME}/pipewire.conf.d/alsa-api.conf
conf_print_pipewire_clock-rate() {
cat <<-EOF
@ -205,14 +211,14 @@ conf_print_pipewire_clock-rate() {
}
EOF
}
conf_print_pipewire_clock-rate | sudo tee /etc/pipewire/pipewire.conf.d/alsa-dmix.conf
conf_print_pipewire_clock-rate | sudo tee ${PIPEWIRE_HOME}/pipewire.conf.d/alsa-dmix.conf
conf_print_pipewire_alsa-dmix() {
cat <<EOF
EOF
}
conf_print_pipewire_alsa-dmix | sudo tee /etc/pipewire/pipewire.conf.d/alsa-dmix.conf
conf_print_pipewire_alsa-dmix | sudo tee ${PIPEWIRE_HOME}/pipewire.conf.d/alsa-dmix.conf
## with-jack: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK:
# sudo apt -y install libspa-0.2-jack
@ -225,7 +231,7 @@ conf_print_pipewire_alsa-dmix | sudo tee /etc/pipewire/pipewire.conf.d/alsa-dmix
# ldconfig
# /usr/share/pipewire/client-rt.conf /etc/pipewire/client-rt.conf.d/
mkdir -p /etc/pipewire/client-rt.conf.d/
mkdir -p ${PIPEWIRE_HOME}/client-rt.conf.d/
# Real-time Client config file for PipeWire version "1.0.3" #
#
@ -250,7 +256,7 @@ conf_print_client-rt_context_property() {
}
EOF
}
conf_print_client-rt_context_property | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_context_property.conf >/dev/null
conf_print_client-rt_context_property | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_context_property.conf >/dev/null
conf_print_client-rt_context_spa-libs() {
cat <<-EOF
@ -266,7 +272,7 @@ conf_print_client-rt_context_spa-libs() {
}
EOF
}
conf_print_client-rt_context_spa-libs | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_context_spa-libs.conf >/dev/null
conf_print_client-rt_context_spa-libs | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_context_spa-libs.conf >/dev/null
conf_print_client-rt_context_modules() {
cat <<-EOF
@ -316,7 +322,7 @@ conf_print_client-rt_context_modules() {
]
EOF
}
conf_print_client-rt_context_modules | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_context_modules.conf >/dev/null
conf_print_client-rt_context_modules | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_context_modules.conf >/dev/null
conf_print_client-rt_filter_properties() {
cat <<-EOF
@ -325,7 +331,7 @@ conf_print_client-rt_filter_properties() {
}
EOF
}
conf_print_client-rt_filter_properties | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_filter_properties.conf >/dev/null
conf_print_client-rt_filter_properties | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_filter_properties.conf >/dev/null
conf_print_client-rt_stream_properties() {
cat <<-EOF
@ -346,7 +352,7 @@ conf_print_client-rt_stream_properties() {
}
EOF
}
conf_print_client-rt_stream_properties | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_stream_properties.conf >/dev/null
conf_print_client-rt_stream_properties | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_stream_properties.conf >/dev/null
conf_print_client-rt_stream_rules() {
cat <<-EOF
@ -367,7 +373,7 @@ conf_print_client-rt_stream_rules() {
]
EOF
}
conf_print_client-rt_stream_rules | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_stream_rules.conf >/dev/null
conf_print_client-rt_stream_rules | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_stream_rules.conf >/dev/null
conf_print_client-rt_alsa_properties() {
cat <<-EOF
@ -386,7 +392,7 @@ conf_print_client-rt_alsa_properties() {
}
EOF
}
conf_print_client-rt_alsa_properties | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_alsa_properties.conf >/dev/null
conf_print_client-rt_alsa_properties | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_alsa_properties.conf >/dev/null
conf_print_client-rt_alsa_rules() {
cat <<-EOF
@ -402,4 +408,4 @@ conf_print_client-rt_alsa_rules() {
]
EOF
}
conf_print_client-rt_alsa_rules | sudo tee /etc/pipewire/client-rt.conf.d/client-rt_alsa_rules.conf >/dev/null
conf_print_client-rt_alsa_rules | sudo tee ${PIPEWIRE_HOME}/client-rt.conf.d/client-rt_alsa_rules.conf >/dev/null

View File

@ -0,0 +1,73 @@
#!/usr/bin/env bash
cd /var/tmp
USER=ckampfe
PROJECT=russ
PRERELEASE=false
RELEASE=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name')
# VERSION=$(echo "${RELEASE}" | cut -c 2- | cut -f1 -d"-")
VERSION=$(date +%Y-%m-%d_)git
DOWNLOAD_DIR=/tmp
RSS_FEED="https://github.com/${USER}/${PROJECT}/releases.atom"
#xdg-open ${RSS_FEED}
echo ${RSS_FEED}
# make a containing directory
mkdir -p /var/tmp/${PROJECT}-"${RELEASE}"
cd /var/tmp/${PROJECT}-"${RELEASE}" || exit
cat <<EOF | tee ./description-pak
Russ is a TUI RSS/Atom reader with vim-like controls and a local-first, offline-first focus.
EOF
cat <<EOF | tee ./checkinstall_it.sh
echo "ENTERING CHECKINSTALL"
BASE_URL='https://api.github.com/repos'
BASE_USER=''ckampfe
BASE_REPO='russ'
LICENSE_PAGE_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/license
RELEASES_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/releases
# CONTENT=$(curl -s ${RELEASES_URL}/latest)
# LATEST_URL=$(echo "${CONTENT}" | jq --raw-output '.assets[] | select(.browser_download_url | test("Linux-x86_64")) | .browser_download_url')
echo "LATEST_URL: " "${LATEST_URL}"
# RELEASE=$(echo "${CONTENT}" | jq --raw-output '.tag_name')
# LICENSE_URL=$(curl "${LICENSE_PAGE_URL}" | jq --raw-output '.download_url')
# wget -c ${LICENSE_URL}
# VERSION=$(date +%Y-%m-%d_)git
VERSION="1.0"
RELEASE="git"
REQUIRES="libxcb-shape0-dev,libxcb-xfixes0-dev"
# make a new temporary directory for this use
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
mkdir -p \${BASE_TMP_DIR}
# do your work
checkinstall -y --fstrans \
--pkgname=russ \
--pkgversion=\${VERSION}\
--pkgrelease=\${RELEASE} \
--pkgarch=amd64 \
--pkggroup=admin \
--pkglicense=LICENSE \
--pkgsource=\${LATEST_URL} \
--maintainer=cyteen@ring-zero.co.uk \
--requires=\${REQUIRES} \
-D \
bash ./install.sh
EOF
cat <<EOF | tee ./install.sh
cargo install russ --git https://github.com/ckampfe/russ
EOF
bash ./checkinstall_it.sh

View File

@ -13,16 +13,30 @@
# $ help
#
# You can backup the existing firmware:
# $ dump_image /Your/File/Path/flash.bin 0 0x40000`
# $ dump_image /Your/File/Path/flash.bin 0 0x40000
# $ dump_image /tmp/zephyr-shell_flash.bin 0 0x40000
#
# Erase the flash using
# Erase the flash using
# $ nrf5 mass_erase
# Verify and program your device by using (use the .bin not .hex file)
# $ program /your/path/to/the/firmware.bin verify
# $ program /your/path/to/the/firmware.bin
#
# $ program /home/default/zephyrproject/zephyr/build/zephyr/zephyr.bin verify
# $ program /home/default/zephyrproject/zephyr/build/zephyr/zephyr.bin
#
# $ program /tmp/zephyr-shell_flash.bin verify
# $ program /tmp/zephyr-shell_flash.bin
#
# $ openocd \
# -f ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/${MACHINE}-pokysdk-linux/usr/share/openocd/scripts/interface/stlink.cfg \
# -f ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/${MACHINE}-pokysdk-linux/usr/share/openocd/scripts/target/nrf51.cfg
# -c init \
# -c "reset halt" \
# -c "nrf51 mass_erase" \
# -c "program build/zephyr/zephyr.hex verify reset" \
# -c exit
DEST=${1:-${HOME}}
@ -38,20 +52,31 @@ SDK_FILENAME=zephyr-sdk-${RELEASE#v}_linux-${MACHINE}_minimal.tar.xz # 41.8 M
SDK_URL=https://github.com/${USER}/${PROJECT}/releases/download/${RELEASE}/
# fetch the sdk
wget ${SDK_URL}/${SDK_FILENAME}
wget -O - ${SDK_URL}/sha256.sum | shasum --check --ignore-missing
# wget ${SDK_URL}/${SDK_FILENAME}
# wget -O - ${SDK_URL}/sha256.sum | shasum --check --ignore-missing
SDK_DEST=${DEST}/zephyr-sdk-${RELEASE#v}
PROJECT_DEST=${DEST}/zephyrproject}
#
PROJECT_DEST=${DEST}/zephyrproject
# https://docs.zephyrproject.org/latest/develop/env_vars.html#env-vars-important
ZEPHYR_ENV_FILE="${HOME}/.zshrc.d/001_zephyr.zsh"
cat <<-EOF | tee ${ZEPHYR_ENV_FILE}
# zephyr specific
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR="${SDK_DEST}"
EOF
# use the sdk setup script to add the target toolchains and the host tools.
pushd ${ZEPHYR_SDK_INSTALL_DIR}
west update
# bash ./setup.sh -t x86_64-zephyr-elf
bash ./setup.sh -t arm-zephyr-eabi
bash ./setup.sh -t xtensa-espressif_esp32_zephyr-elf
bash ./setup.sh -t xtensa-espressif_esp32s3_zephyr-elf
bash ./setup.sh -h
popd
@ -86,8 +111,9 @@ echo "*** Installing west with pip3 ***"
# ensure a conda env exists for zephyr python requirements
# https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download?lang=en#infotabs
# https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/nrf-command-line-tools_10.24.2_amd64.deb
# py -3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main
if [[ ! -d ${HOME}/.conda/envs/zephyr ]];
conda init -n zephyr python west pynrfjprog
conda init -n zephyr python west pynrfjprog dtsh # pyocd pylink
fi
conda activate zephyr
@ -97,6 +123,18 @@ COMPLETION_FILE="/usr/share/zsh/site-functions/_west"
COMPLETION_FILE="${HOME}/.zshrc.d/001_west-completion.zsh"
west completion zsh > ${COMPLETION_FILE}
# Create west configuation file.
cat <<EOF | tee ${HOME}/.westconfig
[zephyr]
# base-prefer = configfile
[build]
# pristine = auto
#board = nrf52840dk/nrf52840
#dir-fmt = build/{board}
#guess-dir = runners
EOF
# 'west' is the tool that manages the entire life-cycle of a Zephyr-based project.
echo "*** Getting zephyr source code ***"
git clone https://github.com/${USER}/zephyr

View File

@ -138,6 +138,7 @@ cat >"${ALIAS_FILE}" <<-'EOF'
#alias mpv='mpv --ao=alsa --force-window -af "crossfeed=strength=0.2:range=0.5:slope=0.5:level_in=0.9:level_out=1:block_size=1024"'
alias mpv='mpv --ao=pipewire --pipewire-buffer=47 --force-window'
alias tsmpv='torsocks mpv'
alias ytmpv='torsocks mpv --ytdl-format=18'
alias wtmpv='webtorrent --mpv --blocklist https://dbl.oisd.nl/ --upload-limit 20'
alias yt-dlp='yt-dlp --downloader=aria2c'
alias ytfzf='ytfzf --ytdl-pref=18'

View File

@ -4,11 +4,11 @@
DEST=${1:-/etc/skel}
LAZY_DEST=${DEST}/.config/nvim/lua/plugins
conf-print() {
cat <<-EOF
EOF
}
# conf-print() {
# cat <<-EOF
#
# EOF
# }
# conf_print > ${DEST}
# nvim-dap Debug Adapter Protocol client
@ -36,7 +36,7 @@ conf_print_nvim-dap() {
EOF
}
conf_print_nvim-dap >"${LAZY_DEST}/nvim-dap.lua"
conf_print_nvim-dap >"${LAZY_DEST}/nvim-dap-python.lua"
# https://github.com/folke/lazy.nvim

54
gitea_renderers.md Normal file
View File

@ -0,0 +1,54 @@
#
[Official docs page for external renderers](https://docs.gitea.com/next/administration/external-renderers)
## [kicanvas](https://kicanvas.org/)
[Adding kicanvas to gitea](https://www.reddit.com/r/KiCad/comments/1d2ngvh/comment/l65fuij/)
First I set the renderer for KiCad files as a powershell echo of "kicanvas here".
I do this so Gitea creates an extra element with the class "file-view markup kicad".
The echo text can be anything, it get's deleted before the page loads anyway.
Added in app.ini:
```app.ini
[markup.kicad]
ENABLED = true
FILE_EXTENSIONS = .kicad_sch,.kicad_pcb
RENDER_COMMAND = powershell echo "kicanvas here"
Then I edited the "footer.tmpl" to look for an element with the "file-view markup
kicad" class. If it finds that class it edits the innerHTML of it to remove the
"kicanvas here" text and appends a "kicanvas-embed" child element.
```
footer.tmpl:
```tmpl
<script>
function lS(src) {
return new Promise(function (resolve, reject) {
let s = document.createElement("script");
s.src = src;
s.addEventListener("load", () => {
resolve();
});
document.body.appendChild(s);
});
}
if (document.getElementsByClassName("file-view markup kicad").length) {
Promise.all([
lS("/assets/kicanvas.js"),
]).then(function () {
let s = document.createElement("kicanvas-embed");
s.src = location.pathname.replace("/src/","/raw/");
s.controls = "full";
s.theme = "kicad";
s.controlslist = "nooverlay";
document.body.getElementsByClassName("file-view markup kicad")[0].innerHTML = "";
document.body.getElementsByClassName("file-view markup kicad")[0].appendChild(s);
});
}
</script>
```