From 8d1c7541062fca40c257f4a5d9f9d57c2d3d7e53 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 15 Jul 2024 12:10:06 +0200 Subject: [PATCH] Package essential software --- scripts/Arch/OS/install.fish | 37 ++++++++++++++++- scripts/Arch/Software/git/main.fish | 19 +++++++++ scripts/Arch/Software/openssh/main.fish | 23 +++++++++++ scripts/Arch/Software/vim/main.fish | 20 +++++++++ scripts/Common/Scripts/config.fish | 4 ++ scripts/Common/Software/git/main.fish | 55 +++++++++++++++++++++++++ scripts/Common/Software/vim/main.fish | 21 ++++++++++ 7 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 scripts/Arch/Software/git/main.fish create mode 100644 scripts/Arch/Software/openssh/main.fish create mode 100644 scripts/Arch/Software/vim/main.fish create mode 100644 scripts/Common/Software/git/main.fish create mode 100644 scripts/Common/Software/vim/main.fish diff --git a/scripts/Arch/OS/install.fish b/scripts/Arch/OS/install.fish index 47c9c8c2..640185cd 100644 --- a/scripts/Arch/OS/install.fish +++ b/scripts/Arch/OS/install.fish @@ -3,14 +3,49 @@ begin set -l dir (status dirname) function initialize -V dir + source "$dir/../Scripts/software.fish" source "$dir/../Software/base-devel/main.fish" source "$dir/../Software/pacman/main.fish" source "$dir/../Software/yay/main.fish" + yayinst powershell-bin end if not type -q installSoftware function installSoftware -V dir - "$dir/../Collections/personal.sh"; + source "$dir/../../Common/Scripts/config.fish" + source "$dir/../Scripts/software.fish" + + if collectionActive essentials + yayinst \ + mkinitcpio-firmware \ + neofetch \ + bash-completion \ + wget \ + oh-my-posh-bin \ + screen \ + tmux \ + htop \ + lsof \ + zsh \ + fish \ + pkgfile \ + sl \ + rar + + sudo pkgfile --update + source "$dir/../Software/openssh/main.fish" + source "$dir/../Software/vim/main.fish" + source "$dir/../Software/git/main.fish" + end + + if collectionActive common + yayinst \ + tldr \ + btop \ + nvtop \ + numbat-bin \ + terminal-parrot + end end end diff --git a/scripts/Arch/Software/git/main.fish b/scripts/Arch/Software/git/main.fish new file mode 100644 index 00000000..aab077bf --- /dev/null +++ b/scripts/Arch/Software/git/main.fish @@ -0,0 +1,19 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + + function installSW -V dir + yayinst \ + git \ + git-lfs \ + gitflow-avh \ + gitflow-bashcompletion-avh \ + gitflow-fishcompletion-avh \ + gitflow-zshcompletion-avh + + fish "$dir/../../../Common/Software/git/main.fish" configure + end + + runInstaller $argv +end diff --git a/scripts/Arch/Software/openssh/main.fish b/scripts/Arch/Software/openssh/main.fish new file mode 100644 index 00000000..6b78f0d0 --- /dev/null +++ b/scripts/Arch/Software/openssh/main.fish @@ -0,0 +1,23 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + + function installSW + yayinst \ + openssh \ + libfido2 + end + + function configureSW + systemctl --global enable --now ssh-agent + + begin + printf %s\n \ + "#!/bin/bash" \ + 'export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"' + end | sudo tee "/etc/profile.d/openssh.sh" > /dev/null + end + + runInstaller $argv +end diff --git a/scripts/Arch/Software/vim/main.fish b/scripts/Arch/Software/vim/main.fish new file mode 100644 index 00000000..b9c6e542 --- /dev/null +++ b/scripts/Arch/Software/vim/main.fish @@ -0,0 +1,20 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + source "$dir/../../../Common/Software/vim/main.fish" + + function installSW + yayinst ( + # Necessary for accessing clipboard in terminal: https://wiki.archlinux.org/title/Vim + ) gvim \ + vi-vim-symlink ( + # Add clipboard support for wayland: https://www.reddit.com/r/Fedora/comments/ax9p9t/comment/jjb4p7b/ + ) vim-wayland-clipboard-git \ + wl-clipboard + + configureSW + end + + runInstaller $argv +end diff --git a/scripts/Common/Scripts/config.fish b/scripts/Common/Scripts/config.fish index a0d37f3f..8ffdcae6 100644 --- a/scripts/Common/Scripts/config.fish +++ b/scripts/Common/Scripts/config.fish @@ -3,3 +3,7 @@ function getConfig -S -a property source "$(status dirname)/eval-module.fish" evalModule "$CONFIG_MODULE" "$property" $argv[2..] end + +function collectionActive -S -a name + [ "$(getConfig "valhalla.software.$name" --json)" = "true" ] +end diff --git a/scripts/Common/Software/git/main.fish b/scripts/Common/Software/git/main.fish new file mode 100644 index 00000000..dd26a452 --- /dev/null +++ b/scripts/Common/Software/git/main.fish @@ -0,0 +1,55 @@ +#!/bin/env fish +begin + source "$(status dirname)/../../Scripts/software.fish" + + function configureSW -S + git config --global init.defaultBranch "main" + git config --global user.name "Manuel Thalmann" + git config --global user.email "m@nuth.ch" + + begin # Git Flow + set -l dir (mktemp -d) + + pushd "$dir" > /dev/null + git init + git commit --allow-empty -m "Initial commit" > /dev/null + git branch master || true &> /dev/null + git branch main || true &> /dev/null + git branch dev || true &> /dev/null + yes "" | git flow init &> /dev/null + git flow config set --global master main > /dev/null + git flow config set --global develop dev > /dev/null + popd > /dev/null + + rm -rf "$dir" + end + + git config --global alias.ahfange init + git config --global alias.tuedezue add + git config --global alias.beschuldig blame + git config --global alias.zieh pull + git config --global alias.druck push + git config --global alias.machnah clone + git config --global alias.hol fetch + git config --global alias.zwiigab branch + git config --global alias.buechiih commit + git config --global alias.eich rebase + git config --global alias.erd rebase + git config --global alias.gahufwiifelde rebase + git config --global alias.vergliich diff + git config --global alias.tuezemme merge + git config --global alias.versorg stash + git config --global alias.markier tag + git config --global alias.pflueckoepfel cherry-pick + git config --global alias.pflueckhimbeeri cherry-pick + git config --global alias.buechuus checkout + git config --global alias.quaetsch 'merge --squash' + git config --global alias.pfudle 'push --force' + git config --global alias.beschuldigung blame + git config --global alias.zwiigli branch + git config --global alias.tagebuech log + git config --global alias.versteck stash + git config --global alias.zuestand status + git config --global alias.markierig tag + end +end diff --git a/scripts/Common/Software/vim/main.fish b/scripts/Common/Software/vim/main.fish new file mode 100644 index 00000000..8b803fee --- /dev/null +++ b/scripts/Common/Software/vim/main.fish @@ -0,0 +1,21 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + + function installSW + configureSW + end + + function configureSW + set -l configFile /etc/vimrc + set -l indicator "set clipboard" + + if not grep "\b$indicator\b" "$configFile" > /dev/null + # As described in https://wiki.archlinux.org/title/Vim#Clipboard + echo "$indicator+=unnamed,unnamedplus" | sudo tee "$configFile" > /dev/null; + end + end + + runInstaller $argv +end