From 389842ff1341409c05335a7b2b6ea51fff343e7d Mon Sep 17 00:00:00 2001 From: cyteen Date: Tue, 9 Jul 2024 00:01:18 +0100 Subject: [PATCH] Commit before push. --- 020_kmonad-conf_print.sh | 238 +++++++++++++++++++++++++++++++ 020_kmonad.sh | 193 +++++++++++++++++++++++++ 020_kodi_ppa.sh | 23 ++- 020_neovim-lazyvim_plugins.sh | 19 +++ 020_pipewire.sh-WIP | 46 +++--- 020_russ-rss_checkinstall.sh-WIP | 73 ++++++++++ 020_zephyr.sh | 54 +++++-- 020_zsh_aliases.d.sh | 1 + conf-print_nvim-lazy-snippets.sh | 12 +- gitea_renderers.md | 54 +++++++ 10 files changed, 667 insertions(+), 46 deletions(-) create mode 100644 020_kmonad-conf_print.sh create mode 100644 020_kmonad.sh create mode 100644 020_neovim-lazyvim_plugins.sh create mode 100644 020_russ-rss_checkinstall.sh-WIP create mode 100644 gitea_renderers.md diff --git a/020_kmonad-conf_print.sh b/020_kmonad-conf_print.sh new file mode 100644 index 0000000..68ceb85 --- /dev/null +++ b/020_kmonad-conf_print.sh @@ -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 </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 diff --git a/020_kodi_ppa.sh b/020_kodi_ppa.sh index 5f534c2..9f69cbc 100755 --- a/020_kodi_ppa.sh +++ b/020_kodi_ppa.sh @@ -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 diff --git a/020_neovim-lazyvim_plugins.sh b/020_neovim-lazyvim_plugins.sh new file mode 100644 index 0000000..243b223 --- /dev/null +++ b/020_neovim-lazyvim_plugins.sh @@ -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 </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 diff --git a/020_russ-rss_checkinstall.sh-WIP b/020_russ-rss_checkinstall.sh-WIP new file mode 100644 index 0000000..0084dba --- /dev/null +++ b/020_russ-rss_checkinstall.sh-WIP @@ -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 < ${COMPLETION_FILE} +# Create west configuation file. +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' diff --git a/conf-print_nvim-lazy-snippets.sh b/conf-print_nvim-lazy-snippets.sh index d208425..64a1b7d 100644 --- a/conf-print_nvim-lazy-snippets.sh +++ b/conf-print_nvim-lazy-snippets.sh @@ -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 diff --git a/gitea_renderers.md b/gitea_renderers.md new file mode 100644 index 0000000..3f7a777 --- /dev/null +++ b/gitea_renderers.md @@ -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 + +```