From c9690dc110477cdf0f28183040d6ea4905a9c4b9 Mon Sep 17 00:00:00 2001 From: Nikita Hasert Date: Sat, 12 Apr 2025 08:55:20 +0200 Subject: [PATCH] README: Add explanations on scripts --- README.md | 24 ++++++++++++++++++++++++ scripts/enable_jp_locale | 2 +- scripts/install_lein | 25 +++++++++++++++++++++++-- scripts/install_neovim | 25 +++++++++++++++++++++++-- scripts/install_podman-compose | 4 ++-- scripts/install_xclip | 2 +- 6 files changed, 74 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c494875..aee00b9 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,27 @@ To run all scripts, simply execute ./install_all ``` +## Scripts + +### enable_jp_locale + +Enables the japanese locale on the steamdeck. Useful for learners of japanese that have to interact with e.g. zip archives with japanese characters in file names +```bash +LANG=ja_JP 7zz x +``` + +### install_lein + +Installs [Leiningen](https://leiningen.org/) for clojure development. I suggest combining this with installing java via [SDKMAN](https://sdkman.io/). + +### install_neovim + +Installs [neovim](https://neovim.io/) in `${HOME}/bin/nvim`. By default the nightly version is chosen. You may want to install this via `distrobox` in a dedicated development container. + +### install_podman-compose + +Installs `aardvark-dns` and `podman-compose` for support of docker-compose files. + +### install_xclip + +Installs xclip, which is useful for copying and pasting in and out of [neovim](https://neovim.io/), [mpv](https://mpv.io/) with stuff like [mpvacious](https://github.com/Ajatt-Tools/mpvacious) etc. \ No newline at end of file diff --git a/scripts/enable_jp_locale b/scripts/enable_jp_locale index f150a47..8948a7f 100755 --- a/scripts/enable_jp_locale +++ b/scripts/enable_jp_locale @@ -1,6 +1,6 @@ #!/bin/bash -enable_jp_locale() { +function enable_jp_locale { echo "Enabling ja_JP locale..." sudo sed -i "s%#ja_JP.UTF-8 UTF-8%ja_JP.UTF-8 UTF-8%" /etc/locale.gen && locale-gen } diff --git a/scripts/install_lein b/scripts/install_lein index fde43f7..9d455cb 100755 --- a/scripts/install_lein +++ b/scripts/install_lein @@ -1,8 +1,29 @@ #!/bin/bash -install_lein() { - echo "Installing lein..." +function yes_or_no { + while true; do + read -p "$* [y/n]: " yn + case $yn in + [Yy]*) return 0 ;; + [Nn]*) return 1 ;; + esac + done +} + +function install_lein { lein="${HOME}/bin/lein" + + if [ -e ${lein} ]; then + lein -v + yes_or_no "lein is already installed, do you want to overwrite the existing installation?" + fi + + if [ $? -ne 0 ]; then + echo "Aborting install of lein." + return 0 + fi + + echo "Installing lein..." curl httpis://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -o "$lein" chmod u+x "$lein" } diff --git a/scripts/install_neovim b/scripts/install_neovim index c1e1e78..5d2f3bc 100755 --- a/scripts/install_neovim +++ b/scripts/install_neovim @@ -1,9 +1,30 @@ #!/bin/bash -install_neovim() { +function yes_or_no { + while true; do + read -p "$* [y/n]: " yn + case $yn in + [Yy]*) return 0 ;; + [Nn]*) return 1 ;; + esac + done +} + +function install_neovim { + nvim="${HOME}/bin/nvim" + + if [ -e ${nvim} ]; then + nvim -v + yes_or_no "nvim is already installed, do you want to overwrite the existing installation?" + fi + + if [ $? -ne 0 ]; then + echo "Aborting install of neovim." + return 0 + fi + version=${1:-nightly} echo "Installing nvim ${version}..." - nvim="${HOME}/bin/nvim" nvimurl="https://github.com/neovim/neovim/releases/download/${version}/nvim-linux-x86_64.appimage" mkdir -p "$(dirname "$nvim")" curl -fL "$nvimurl" -o "$nvim" -z "$nvim" diff --git a/scripts/install_podman-compose b/scripts/install_podman-compose index db0e683..0db69ce 100755 --- a/scripts/install_podman-compose +++ b/scripts/install_podman-compose @@ -1,10 +1,10 @@ #!/bin/bash -install_pip() { +function install_podman_compose { echo "Installing aardvark-dns and podman-compose..." sudo pacman -S aardvark-dns podman-compose } sudo steamos-readonly disable -install_pip +install_podman_compose sudo steamos-readonly enable diff --git a/scripts/install_xclip b/scripts/install_xclip index 214ce97..843e6b1 100755 --- a/scripts/install_xclip +++ b/scripts/install_xclip @@ -1,6 +1,6 @@ #!/bin/bash -install_xclip() { +function install_xclip { echo "Installing xclip..." sudo pacman -S xclip }