From f8d380472d95099e67c37f72d2d8c7590546a536 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Thu, 3 Jul 2025 21:51:49 -0400 Subject: Add inital script for setting up Devuan --- distro/devuan.sh | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 distro/devuan.sh diff --git a/distro/devuan.sh b/distro/devuan.sh new file mode 100644 index 0000000..eb5a951 --- /dev/null +++ b/distro/devuan.sh @@ -0,0 +1,200 @@ +#!/bin/sh +# distro/devuan.sh +echo "This script is designed to be run twice, once as root ( e.g. 'su -' )" +echo "Then again as your normal user without sudo, it will call sudo as needed" +if [ "$(id -u)" -eq 0 ] ; then + if ! grep -q 'EDITOR=' ~/.bashrc ; then + echo "EDITOR=vi" >> ~/.bashrc + fi + echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo_enable + printf "Enter username to add to sudo group (enter to skip): " + read -r _un + if ! [ -z "$_un" ] ; then + gpasswd -a "$_un" sudo + else + echo skipping... + fi + touch /etc/.sudo_configured + echo "now run as a regular user" + exit 0 +else + if ! [ -r /etc/.sudo_configured ] ; then + echo "Run as root first, then as a regular user" + exit 1 + fi +fi +set -ex + +codedir="$HOME/scm/pub" +nvimdir="${codedir}/neovim-nvim" +_nvim_msg=0 +okshdir="${codedir}/ibara-oksh" + +dwmdir="${codedir}/x/dwm" +dwmStdir="${codedir}/x/st" +dwmDmenudir="${codedir}/x/dmenu" +dwmSesdir="${codedir}/x/session" + +BRAVE="${BRAVE:-yes}" +NVIM="${NVIM:-yes}" +OKSH="${OKSH:-yes}" +PACKAGES="${PACKAGES:-yes}" +FONTS="${FONTS:-yes}" +DWM="${DWM:-no}" + +if [ "$PACKAGES" = yes ] ; then +# Get rid of the CDROM source, lol +sudo sed -i '/cdrom:/d' /etc/apt/sources.list + +sudo apt update + +sudo apt install -y git curl \ + tmux \ + htop \ + neofetch \ + oathtool \ + pavucontrol \ + scdaemon \ + vim \ + evemu-tools \ + evtest \ + libarchive-tools \ + evolution \ + gimp \ + git-lfs \ + ncdu \ + nload \ + pv \ + pwgen \ + ripgrep \ + wireguard-tools \ + zstd \ + dunst \ + xclip \ + restic \ + tree \ + + +fi + +if [ "$NVIM" = yes ] ; then + sudo apt build-dep -y neovim + + if ! [ -d "$nvimdir" ] ; then + git clone https://github.com/neovim/neovim "$nvimdir" + fi + cd "$nvimdir" + git fetch --tags + git checkout v0.11.2 + rm -rf build || echo "" + make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/.local" -j"$(nproc)" + make install + cd - + + _paq_dir="${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim + if ! [ -d "$_paq_dir" ] ; then + git clone --depth=1 https://github.com/savq/paq-nvim.git "$_paq_dir" + _nvim_msg=1 + fi +fi + +if [ "$OKSH" = yes ] ; then + if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" + fi + cd "$okshdir" + git checkout oksh-7.6 + ./configure + make + sudo make install + cd - + + if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' + fi + + if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile + fi + + set +x + if ! grep ^$(id -un) /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi + fi + set -x + + +fi + +if [ "$BRAVE" = yes ] ; then +sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + +sudo curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ + https://brave-browser-apt-release.s3.brave.com/brave-browser.sources + +sudo apt update + +sudo apt install -y brave-browser + +fi + +if [ "$FONTS" = yes ] ; then + if ! [ -d ~/.fonts ]; then + git clone https://git.riedstra.dev/mitch/fonts ~/.fonts + fi + sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf || echo "" +fi + +if [ "$DWM" = yes ] ; then + sudo apt -y install compton + sudo apt -y build-dep dwm st + + if ! [ -d "$dwmdir" ] ; then + git clone https://git.riedstra.dev/x/dwm "$dwmdir" + fi + cd "$dwmdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmStdir" ] ; then + git clone https://git.riedstra.dev/x/st "$dwmStdir" + fi + cd "$dwmStdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmDmenudir" ] ; then + git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" + fi + cd "$dwmDmenudir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmSesdir" ] ; then + git clone https://git.riedstra.dev/x/session "$dwmSesdir" + fi + cd "$dwmSesdir" + sudo make install + cd - + + if ! [ -f ~/.xinitrc ] ; then +cat > ~/.xinitrc < Date: Fri, 4 Jul 2025 10:36:53 -0400 Subject: Add a note about rusticl --- distro/devuan.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/distro/devuan.sh b/distro/devuan.sh index eb5a951..8e32dbb 100644 --- a/distro/devuan.sh +++ b/distro/devuan.sh @@ -41,6 +41,9 @@ OKSH="${OKSH:-yes}" PACKAGES="${PACKAGES:-yes}" FONTS="${FONTS:-yes}" DWM="${DWM:-no}" +RUSTICL="${RUSTICL:-yes}" + + if [ "$PACKAGES" = yes ] ; then # Get rid of the CDROM source, lol @@ -73,8 +76,19 @@ sudo apt install -y git curl \ xclip \ restic \ tree \ + feh \ + +fi +if [ "$RUSTICL" = "yes" ] ; then + sudo apt install -y \ + mesa-opencl-icd + printf "\033[1;32m" + echo "Note, for GPU accelerated darktable with RustiCL you may need to:" + echo "export RUSTICL_ENABLE=radeonsi; darktable -d opencl" + echo "or similar, for intel change radeonsi to 'iris'" + printf "\033[0m" fi if [ "$NVIM" = yes ] ; then @@ -84,7 +98,7 @@ if [ "$NVIM" = yes ] ; then git clone https://github.com/neovim/neovim "$nvimdir" fi cd "$nvimdir" - git fetch --tags + git fetch --force --tags git checkout v0.11.2 rm -rf build || echo "" make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/.local" -j"$(nproc)" -- cgit v1.2.3 From 993693ea161a37ef55ed9683387c21e8adda4d24 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Fri, 4 Jul 2025 10:37:56 -0400 Subject: Auto allow thunderbolt --- distro/devuan.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/distro/devuan.sh b/distro/devuan.sh index 8e32dbb..8348ecf 100644 --- a/distro/devuan.sh +++ b/distro/devuan.sh @@ -42,6 +42,7 @@ PACKAGES="${PACKAGES:-yes}" FONTS="${FONTS:-yes}" DWM="${DWM:-no}" RUSTICL="${RUSTICL:-yes}" +THUNDERBOLT="${THUNDERBOLT:-yes}" @@ -80,6 +81,13 @@ sudo apt install -y git curl \ fi +if [ "$THUNDERBOLT" = "yes" ] ; then +cat > /etc/udev/rules.d/99-removable.rules < Date: Sun, 20 Jul 2025 12:51:44 -0400 Subject: add a few misc programs to devuan --- distro/devuan.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/distro/devuan.sh b/distro/devuan.sh index 8348ecf..9824f20 100644 --- a/distro/devuan.sh +++ b/distro/devuan.sh @@ -78,6 +78,11 @@ sudo apt install -y git curl \ restic \ tree \ feh \ + sipcalc \ + bluez-alsa-utils \ + bluez-firmware \ + pulseaudio-module-bluetooth \ + fi -- cgit v1.2.3 From cda49c518529c089b7392a2f11312092ea5849df Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Fri, 4 Jul 2025 20:58:35 -0400 Subject: Update arch script and pull oksh compiling into its own script --- compile/oksh.sh | 31 +++++++++++++++++++++++++++++++ distro/arch.sh | 16 +++++----------- 2 files changed, 36 insertions(+), 11 deletions(-) create mode 100755 compile/oksh.sh diff --git a/compile/oksh.sh b/compile/oksh.sh new file mode 100755 index 0000000..1a44c0f --- /dev/null +++ b/compile/oksh.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -ex +codedir="$HOME/scm/pub" +okshdir="${codedir}/ibara-oksh" +if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" +fi +cd "$okshdir" +git checkout oksh-7.6 +./configure +make +sudo make install +cd - + +if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' +fi + +if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile +fi + +set +x +if ! grep ^$(id -un) /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi +fi +set -x diff --git a/distro/arch.sh b/distro/arch.sh index 55e0a31..72971ef 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -5,12 +5,12 @@ if [ "$(id -u)" -ne 0 ] ; then exit 1; fi +# Todo add in sipcalc, it's in the AUR now... + pkgs=" alsa-utils ansible arandr -avr-gcc -avr-libc base base-devel bind @@ -23,7 +23,6 @@ chromium cmake colordiff ctags -docker dosfstools dunst ed @@ -41,14 +40,11 @@ gdisk gimp git git-lfs -gpa hdparm htop inkscape iotop iperf3 -jdk11-openjdk -jdk8-openjdk kdenlive libconfig # dmenu-pinentry libfido2 @@ -70,7 +66,6 @@ multipath-tools # kpartx ncdu ncmpc ncspot -neofetch neovim net-tools networkmanager @@ -101,17 +96,14 @@ qemu qt5ct # https://wiki.archlinux.org/title/qt#Appearance rclone redshift -rlwrap # used for clj rsync scrot seahorse shellcheck shellcheck -sipcalc smartmontools speedtest-cli swig # ykman -the_silver_searcher tmux usbutils v4l2loopback-dkms @@ -123,7 +115,9 @@ whois wireguard-tools wireless_tools wl-clipboard -wlroots +wlroots0.17 +wlroots0.18 +wlroots0.19 xclip xdotool xfce4 -- cgit v1.2.3 From 80bff39581ee9bbda6b8d60553c548339ebd570f Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 20 Jul 2025 12:57:08 -0400 Subject: Switch to just warning about /etc/systemd/logind.conf. Remove old bootbackup. Add OpenCL for Intel --- distro/arch.sh | 55 ++++++++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/distro/arch.sh b/distro/arch.sh index 72971ef..ef896a3 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -137,28 +137,11 @@ zstd #shellcheck disable=SC2046 pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') -fn="/etc/systemd/logind.conf" -bak="$fn.$(date +%s)" -cp "$fn" "$bak" -ed "$fn" </dev/null ; then - rm "$bak" -fi +grep -q '^KillUserProcesses=yes' /etc/systemd/logind.conf || \ + echo "You may want to set KillUserProcesses=yes in /etc/systemd/logind.conf" +grep -q '^HandleLidSwitch=ignore' /etc/systemd/logind.conf || \ + echo "You may want to set HandleLidSwitch=ignore in /etc/systemd/logind.conf" cat > /etc/udev/rules.d/99-removable.rules < /etc/pacman.d/hooks/95-bootbackup.hook < /etc/modprobe.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf < Date: Wed, 20 Aug 2025 19:01:42 -0400 Subject: Add a note on rocm-opencl --- distro/arch.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distro/arch.sh b/distro/arch.sh index ef896a3..528ccca 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -164,6 +164,9 @@ case $(lspci | grep VGA) in pacman -S --needed intel-compute-runtime ;; *AMD*) + # OpenCL Drivers + echo "Note ROCM isn't supported by all AMD GPUs" + pacman -S --needed rocm-opencl-runtime ;; *Nvidia*) ;; -- cgit v1.2.3 From 21cbbd2d61b4020817c31cc61ea665301866e0c8 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Thu, 4 Sep 2025 17:09:58 -0400 Subject: Update arch install and setup scripts. Add paq clone to the install script --- distro/arch-install.sh | 77 +++++++++++++++++++ distro/arch.sh | 203 +++++++++++++++++++++++++++++++++++++++++++++---- install.sh | 6 ++ 3 files changed, 271 insertions(+), 15 deletions(-) create mode 100755 distro/arch-install.sh diff --git a/distro/arch-install.sh b/distro/arch-install.sh new file mode 100755 index 0000000..6cfb095 --- /dev/null +++ b/distro/arch-install.sh @@ -0,0 +1,77 @@ +#!/bin/sh +set -ex + +do_edit() { +printf "Edit \"$1\" ? : " +read -r resp +case $resp in + Y|y) arch-chroot "${_install_path}" nvim "$1" ;; + *) ;; +esac +} + +do_chroot() { + arch-chroot "$_install_path" "$@" +} + +_install_path="${INSTALL_PATH:-/mnt}" +_tz="${TZ:-America/New_York}" +_hostname="${INSTALL_HOSTNAME:-arch}" +PACSTRAP="${PACSTRAP:-1}" + +set +x +if ! awk '{print $2}' /proc/mounts | grep -q '^'"$_install_path"'$' ; then + echo "Cannot install to \"$_install_path\" because it is not a mountpoint" + echo "if you've mounted somewhere other than /mnt use:" + echo " env INSTALL_PATH= ./arch-install.sh" + echo where '' is the mount point in question + exit 1 +fi +set -x + +if [ $PACSTRAP -eq 1 ] ; then +pacstrap -K "$_install_path" \ + arch-install-scripts \ + base \ + base-devel \ + cryptsetup \ + dosfstools \ + e2fsprogs \ + efibootmgr \ + git \ + gptfdisk \ + grub \ + linux \ + linux-firmware \ + linux-firmware-marvell \ + lvm2 \ + networkmanager \ + nvim \ + sof-firmware \ + tmux \ + xfsprogs \ + +fi + + +genfstab -U "$_install_path" >> "${_install_path}/etc/fstab" + +do_edit /etc/fstab + +do_edit /etc/locale.gen + +do_chroot locale-gen + +do_chroot ln -sf "/usr/share/zoneinfo/$_tz" /etc/localtime + +do_edit /etc/mkinitcpio.conf + +do_chroot mkinitcpio -p linux + +do_edit /etc/default/grub + +do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi + +do_chroot grub-mkconfig -o /boot/grub/grub.cfg + +do_chroot passwd diff --git a/distro/arch.sh b/distro/arch.sh index 528ccca..72b5db4 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -1,11 +1,33 @@ #!/bin/sh set -e -if [ "$(id -u)" -ne 0 ] ; then - echo "Run as root" +if [ "$(id -u)" -eq 0 ] ; then + echo "Run as normal user w/ sudo access" exit 1; fi -# Todo add in sipcalc, it's in the AUR now... +codedir="$HOME/scm" +okshdir="${codedir}/pub/ibara-oksh" +rivercfgdir="${codedir}/wl/rivercfg" +yaydir="${codedir}/pub/yay" + +GRAPHICS="${GRAPHICS:-yes}" +THUNDERBOLT="${THUNDERBOLT:-yes}" +PACKAGES="${PACKAGES:-yes}" +FONTS="${FONTS:-yes}" +YAY="${YAY:-yes}" +BRAVE="${BRAVE:-yes}" +OKSH="${OKSH:-yes}" +RIVER="${RIVER:-yes}" +V4L2LOOPBACK="${V4L2LOOPBACK:-yes}" +LOGIND="${LOGIND:-yes}" +DWM="${DWM:-no}" +DPW="${DPW:-yes}" + +dpwdir="${codedir}/me/dpw" +dwmdir="${codedir}/x/dwm" +dwmStdir="${codedir}/x/st" +dwmDmenudir="${codedir}/x/dmenu" +dwmSesdir="${codedir}/x/session" pkgs=" alsa-utils @@ -31,6 +53,7 @@ ethtool evince evolution exfat-utils +fastfetch feh firefox fuse @@ -46,16 +69,12 @@ inkscape iotop iperf3 kdenlive +less libconfig # dmenu-pinentry libfido2 libvirt # If you want libxcb libxkbcommon -lightdm -lightdm-gtk-greeter -linux -linux-firmware -linux-zen lvm2 lxappearance man-pages @@ -96,11 +115,12 @@ qemu qt5ct # https://wiki.archlinux.org/title/qt#Appearance rclone redshift +ripgrep rsync scrot +sddm seahorse shellcheck -shellcheck smartmontools speedtest-cli swig # ykman @@ -134,30 +154,178 @@ zathura-ps zstd " +if [ "$PACKAGES" = "yes" ] ; then #shellcheck disable=SC2046 -pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') +sudo pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') +fi +if [ "$LOGIND" = "yes" ] ; then +fn="/etc/systemd/logind.conf" +bak="$fn.$(date +%s)" +sudo cp "$fn" "$bak" +sudo sed -i -E -e 's/^.*KillUserProcesses=.*$/KillUserProcesses=yes/g' "$fn" +sudo sed -i -E -e 's/^.*HandleLidSwitch=.*$/HandleLidSwitch=ignore/g' "$fn" +if sudo diff -q "$fn" "$bak" >/dev/null ; then + sudo rm "$bak" +fi +fi grep -q '^KillUserProcesses=yes' /etc/systemd/logind.conf || \ echo "You may want to set KillUserProcesses=yes in /etc/systemd/logind.conf" grep -q '^HandleLidSwitch=ignore' /etc/systemd/logind.conf || \ echo "You may want to set HandleLidSwitch=ignore in /etc/systemd/logind.conf" -cat > /etc/udev/rules.d/99-removable.rules < /etc/udev/rules.d/99-removable.rules < /etc/modprobe.d/v4l2loopback.conf < /etc/modprobe.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf <> /etc/shells' + fi + + if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile + fi + + set +x + if ! grep "^$(id -un)" /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi + fi + set -x + + +fi + +if [ "$FONTS" = yes ] ; then + if ! [ -d ~/.fonts ]; then + git clone https://git.riedstra.dev/mitch/fonts ~/.fonts + fi +fi + +if [ "$RIVER" = yes ] ; then + if ! [ -d "$rivercfgdir" ] ; then + git clone https://git.riedstra.dev/wl/rivercfg "$rivercfgdir" + fi + cd "$rivercfgdir" + sudo pacman -S river foot swaylock waybar wlr-randr bemenu bemenu-wayland swaybg grim slurp + ./link.sh + cd - + + wlcustomdir="$rivercfgdir"/../wlcustom + if ! [ -d "$wlcustomdir" ] ; then + git clone https://git.riedstra.dev/wl/wlcustom "$wlcustomdir" + fi + cd "$wlcustomdir" + sudo make install + cd - +fi + +if [ "$DPW" = yes ] ; then + if ! [ -d "$dpwdir" ] ; then + git clone https://git.riedstra.dev/mitch/dpw "$dpwdir" + fi + cd "$dpwdir" + make PREFIX="$HOME" install + cd - +fi + +if [ "$YAY" = yes ] ; then + if ! [ -d "$yaydir" ] ; then + git clone https://aur.archlinux.org/yay.git "$yaydir" + fi + cd "$yaydir" + yay --version || makepkg -si + cd - +fi + +if [ "$BRAVE" = yes ] ;then +if [ "$YAY" == yes ] ; then + yay -Sy brave-bin +else + echo "You need to install yay ( env YAY=yes ./distro/arch.sh or so )" + echo "In order to install brave via this script" +fi +fi + + +if [ "$DWM" = yes ] ; then + sudo pacman -S picom + + if ! [ -d "$dwmdir" ] ; then + git clone https://git.riedstra.dev/x/dwm "$dwmdir" + fi + cd "$dwmdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmStdir" ] ; then + git clone https://git.riedstra.dev/x/st "$dwmStdir" + fi + cd "$dwmStdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmDmenudir" ] ; then + git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" + fi + cd "$dwmDmenudir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmSesdir" ] ; then + git clone https://git.riedstra.dev/x/session "$dwmSesdir" + fi + cd "$dwmSesdir" + sudo make install + cd - + + if ! [ -f ~/.xinitrc ] ; then +cat > ~/.xinitrc < Date: Mon, 13 Oct 2025 23:55:24 -0400 Subject: Fixes for OpenSSH 10.1 --- kshrc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/kshrc b/kshrc index 429664a..d6a5207 100644 --- a/kshrc +++ b/kshrc @@ -325,9 +325,9 @@ checkSSHAgentForward() { && [ -z "$TMUX" ] ; then echo "SSH_AUTH_SOCK=\"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK" \ - > "$HOME"/.ssh/agent + > "$HOME"/.ssh/agent_conf elif [ -n "$TMUX" ]; then - . "$HOME"/.ssh/agent + . "$HOME"/.ssh/agent_conf fi } @@ -337,7 +337,14 @@ checkSSHAgent() { pkill -9 ssh-agent fi - ssh_agent_conf="$HOME/.ssh/agent" + # So OpenSSH 10.1 steps on my configuration, rather than passing in + # -T which doesn't exist on older SSH, simply move my configuration + # out of the way. + if [ -f "$HOME/.ssh/agent" ] ; then + rm "$HOME/.ssh/agent" + fi + + ssh_agent_conf="$HOME/.ssh/agent_conf" if [ -e "$ssh_agent_conf" ] ; then #shellcheck disable=SC1090 . "$ssh_agent_conf" -- cgit v1.2.3 From 6faf64c17a9fe1c5f5ab0f313c1d36c867097ad7 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 22 Nov 2025 12:25:53 -0500 Subject: Add my neovim 0.12 configuration --- dotfiles/nvim/nvim0.12.lua | 145 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 dotfiles/nvim/nvim0.12.lua diff --git a/dotfiles/nvim/nvim0.12.lua b/dotfiles/nvim/nvim0.12.lua new file mode 100644 index 0000000..b8346a1 --- /dev/null +++ b/dotfiles/nvim/nvim0.12.lua @@ -0,0 +1,145 @@ +-- Configuration for nvim 0.12+ +-- Not replacing my main configuration yet as this isn't released or +-- in any distribution package managers at the moment + +-- Themes +vim.pack.add({'https://github.com/shaunsingh/nord.nvim'}) +vim.pack.add({'https://github.com/ellisonleao/gruvbox.nvim'}) + +vim.pack.add({'https://github.com/nvim-treesitter/nvim-treesitter'}) + +-- Required for telescope +vim.pack.add({'https://github.com/nvim-lua/plenary.nvim'}) +vim.pack.add({'https://github.com/nvim-telescope/telescope.nvim'}) + +local hooks = function(ev) + local name, kind = ev.data.spec.name, ev.data.kind + + if name == 'nvim-treesitter' then + vim.system(":TSUpdate") + end +end + +vim.api.nvim_create_autocmd('PackChanged', {callback = hooks}) + +require'nvim-treesitter.configs'.setup { + hightlight = { + enable = true, + } +} + +-------------------------------------------------------------------------------- +-- telescope +-------------------------------------------------------------------------------- +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', 'sb', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer]' }) + +vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +local builtin = require('telescope.builtin') +vim.keymap.set('n', '', builtin.find_files, {}) +vim.keymap.set('n', '', builtin.git_files, {}) +vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end) +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- Nord theme config +-------------------------------------------------------------------------------- +-- vim.g.nord_contrast = true +-- vim.g.nord_borders = false +vim.g.nord_disable_background = true +vim.g.nord_italic = false +-- vim.g.nord_uniform_diff_background = true +vim.g.nord_bold = false + +-- Load the colorscheme +require('nord').set() +-------------------------------------------------------------------------------- + + +-- "Basic" nvim config: + +vim.opt.nu = true +vim.opt.rnu = true + +vim.keymap.set("n", "l", function() vim.cmd('set list!') end) +vim.opt.listchars = 'tab:▸ ,eol:¬,trail:•' +-- vim.opt.listchars = 'tab:| ,eol:$,trail:.' + +-- tw == textwidth +vim.opt.tw = 80 +vim.opt.colorcolumn = "80" + +vim.opt.ic = true +vim.opt.hls = true + +vim.opt.scrolloff = 8 + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.smartindent = true +vim.opt.expandtab = false +vim.opt.wrap = false + +-- I know how to setup my editor, I don't need your changes to my vim +-- configuration. +vim.opt.modeline = false + +-- Use \-s to pop open a spelling menu. use ]s to search forwards and [s to go +-- +-- backwards. +-- Apparently this also doesn't work if spell checking isn't enabled +-- at the time you enable it. +vim.opt.spell = true +vim.keymap.set("n", "ss", "ea") +vim.opt.spell = false + + +-- Always show status line +vim.opt.laststatus = 2 + +-- Automatically keep window sizes equal and do it automatically +vim.cmd("set ea") +vim.cmd("autocmd VimResized * wincmd =") + + +vim.diagnostic.config({ + virtual_text = true, + signs = true, + underline = true, + -- update_in_insert = false, + severity_sort = true, +}) + + +-- For LSP, :help lsp-defaults can be useful to get the keybindings down + +-- clangd language server config... +-- 'bear' can be useful for generating compile_commands.json with clangd +vim.lsp.config['clangd'] = { + cmd = {'clangd'}, + filetypes = { 'c', 'cpp' }, + root_markers = {'compile_commands.json' }, +} +vim.lsp.enable('clangd') + + +vim.lsp.config['gopls'] = { + cmd = {'gopls'}, + filetypes = { 'go' }, + root_markers = {'go.mod' }, +} +vim.lsp.enable('gopls') -- cgit v1.2.3