From cc76cf25ba2b606e7c1fab0caccd1e924dc96d4e Mon Sep 17 00:00:00 2001 From: Kevin Munoz Date: Sun, 13 Oct 2024 10:19:50 -0500 Subject: [PATCH] initial commit --- .gitignore | 2 + condor-hooks/.SRCINFO | 28 +++ condor-hooks/90-mkinitcpio-install.hook | 19 ++ condor-hooks/PKGBUILD | 40 ++++ condor-hooks/condor-hooks-runner | 74 ++++++ condor-hooks/condor-hooks-runner.hook | 10 + condor-hooks/condor-hooks.install | 7 + condor-hooks/filesystem.hook | 10 + condor-hooks/lsb-release.hook | 10 + condor-libs/.SRCINFO | 28 +++ condor-libs/PKGBUILD | 28 +++ condor-libs/condor.shlib | 7 + condor-libs/install-software | 16 ++ condor-libs/is-snapshot-boot | 8 + condor-libs/launch-terminal | 96 ++++++++ condor-libs/org.condor.libs.pkexec.policy | 33 +++ condor-libs/pkexec-gui | 20 ++ condor-zsh-config/.SRCINFO | 22 ++ condor-zsh-config/PKGBUILD | 27 +++ condor-zsh-config/zshrc | 260 ++++++++++++++++++++++ grub-condor/.SRCINFO | 18 ++ grub-condor/PKGBUILD | 14 ++ 22 files changed, 777 insertions(+) create mode 100644 .gitignore create mode 100644 condor-hooks/.SRCINFO create mode 100644 condor-hooks/90-mkinitcpio-install.hook create mode 100644 condor-hooks/PKGBUILD create mode 100755 condor-hooks/condor-hooks-runner create mode 100644 condor-hooks/condor-hooks-runner.hook create mode 100755 condor-hooks/condor-hooks.install create mode 100644 condor-hooks/filesystem.hook create mode 100644 condor-hooks/lsb-release.hook create mode 100644 condor-libs/.SRCINFO create mode 100644 condor-libs/PKGBUILD create mode 100644 condor-libs/condor.shlib create mode 100755 condor-libs/install-software create mode 100755 condor-libs/is-snapshot-boot create mode 100755 condor-libs/launch-terminal create mode 100644 condor-libs/org.condor.libs.pkexec.policy create mode 100644 condor-libs/pkexec-gui create mode 100644 condor-zsh-config/.SRCINFO create mode 100644 condor-zsh-config/PKGBUILD create mode 100644 condor-zsh-config/zshrc create mode 100644 grub-condor/.SRCINFO create mode 100644 grub-condor/PKGBUILD diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b83a254 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.tar.zst +*.sig diff --git a/condor-hooks/.SRCINFO b/condor-hooks/.SRCINFO new file mode 100644 index 0000000..3131c19 --- /dev/null +++ b/condor-hooks/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = condor-hooks + pkgdesc = Additions and enhancements for Condor Linux + pkgver = 1.0.0 + pkgrel = 1 + install = condor-hooks.install + arch = any + license = GPL + depends = pacman + depends = pacman-contrib + depends = chaotic-mirrorlist + depends = nss-mdns + depends = kernel-modules-hook + depends = grub + depends = update-grub + depends = awk + depends = garuda-libs + source = filesystem.hook + source = condor-hooks-runner + source = condor-hooks-runner.hook + source = lsb-release.hook + source = 90-mkinitcpio-install.hook + sha256sums = f2ce7fc0ea9d9fddd2f7065ce722d3e2330a6a5bfcec6f75d840ea65e5a8b4ec + sha256sums = d3c359b3d74ce78922318edfd5600a38c2e81d9aa7861bcf2e7ac32e14db0e62 + sha256sums = 1626f3c2e656336a67662d73c2be1a6843da368c9311440247543f8db4b90215 + sha256sums = 398c03a1f94dd37080e254dc388ae8582a2264ebcd996537ea03962ab438c75d + sha256sums = 5a995d9cb87c2463b9bd8f2ff5dbdee44e88dca98289840e32c5c476bc50b3a8 + +pkgname = condor-hooks diff --git a/condor-hooks/90-mkinitcpio-install.hook b/condor-hooks/90-mkinitcpio-install.hook new file mode 100644 index 0000000..9f0d179 --- /dev/null +++ b/condor-hooks/90-mkinitcpio-install.hook @@ -0,0 +1,19 @@ +[Trigger] +Type = Path +Operation = Install +Operation = Upgrade +Target = usr/lib/modules/*/vmlinuz +Target = usr/lib/initcpio/* + +[Trigger] +Operation = Install +Operation = Remove +Operation = Upgrade +Type = Package +Target = *-dkms* + +[Action] +Description = Updating linux initcpios... +When = PostTransaction +Exec = /usr/share/libalpm/scripts/condor-hooks-runner kernel +NeedsTargets diff --git a/condor-hooks/PKGBUILD b/condor-hooks/PKGBUILD new file mode 100644 index 0000000..ccca946 --- /dev/null +++ b/condor-hooks/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: dr460nf1r3 +# Contributor: Librewish + +pkgname=condor-hooks +pkgdesc="Additions and enhancements for Condor Linux" +pkgver=1.0.0 +pkgrel=1 +arch=('any') +license=('GPL') +depends=('pacman' 'pacman-contrib' 'condor-mirrorlist' 'nss-mdns' 'grub' 'awk' 'condor-libs') +install=$pkgname.install +source=( + filesystem.hook + condor-hooks-runner + condor-hooks-runner.hook + lsb-release.hook + 90-mkinitcpio-install.hook +) +sha256sums=('f2ce7fc0ea9d9fddd2f7065ce722d3e2330a6a5bfcec6f75d840ea65e5a8b4ec' + 'd3c359b3d74ce78922318edfd5600a38c2e81d9aa7861bcf2e7ac32e14db0e62' + '1626f3c2e656336a67662d73c2be1a6843da368c9311440247543f8db4b90215' + '398c03a1f94dd37080e254dc388ae8582a2264ebcd996537ea03962ab438c75d' + '5a995d9cb87c2463b9bd8f2ff5dbdee44e88dca98289840e32c5c476bc50b3a8') + +package() { + cd "$srcdir" || exit + + install -d "$pkgdir"/usr/share/libalpm/hooks + install -Dm644 condor-hooks-runner.hook "$pkgdir"/usr/share/libalpm/hooks/condor-hooks-runner.hook + install -Dm644 lsb-release.hook "$pkgdir"/usr/share/libalpm/hooks/20-lsb-release.hook + install -Dm644 filesystem.hook "$pkgdir"/usr/share/libalpm/hooks/20-os-release.hook + + install -d "$pkgdir"/etc/pacman.d/hooks + install -Dm644 90-mkinitcpio-install.hook "$pkgdir"/etc/pacman.d/hooks/90-mkinitcpio-install.hook + + install -d "$pkgdir"/usr/share/libalpm/scripts + install -Dm755 condor-hooks-runner "$pkgdir"/usr/share/libalpm/scripts/condor-hooks-runner + + install -d "$pkgdir"/var/lib/condor +} diff --git a/condor-hooks/condor-hooks-runner b/condor-hooks/condor-hooks-runner new file mode 100755 index 0000000..22006e6 --- /dev/null +++ b/condor-hooks/condor-hooks-runner @@ -0,0 +1,74 @@ +#!/bin/bash + +source /usr/lib/condor/condor.shlib + +Filesystem() { + local file=/usr/lib/os-release + sed -i $file \ + -e 's,NAME=.*,NAME=\"Condor Linux\",' \ + -e 's,PRETTY_NAME=.*,PRETTY_NAME=\"Condor Linux\",' \ + -e 's,ID=.*,ID=condor,' \ + -e 's,ID_LIKE=.*,ID_LIKE=arch,' \ + -e 's,BUILD_ID=.*,BUILD_ID=rolling,' \ + -e 's,HOME_URL=.*,HOME_URL=\"https://gitlab.com/condor-linux/\",' \ + -e 's,DOCUMENTATION_URL=.*,DOCUMENTATION_URL=\"https://gitlab.com/condor-linux/\",' \ + -e 's,SUPPORT_URL=.*,SUPPORT_URL=\"https://gitlab.com/condor-linux/\",' \ + -e 's,BUG_REPORT_URL=.*,BUG_REPORT_URL=\"https://gitlab.com/condor-linux/\",' \ + -e 's,LOGO=.*,LOGO=condorlinux,' + + if [ -z "$(grep "^ID_LIKE=" $file)" ] && [ -n "$(grep "^ID=" $file)" ]; then + # add missing ID_LIKE= + sed -i $file -e '/^ID=/a \ID_LIKE=arch' + fi + + sed -i 's|Arch|Condor|g' /etc/issue /usr/share/factory/etc/issue +} + +Lsb_release() { + local file=/etc/lsb-release + + if [ -z "$(grep "^DISTRIB_CODENAME=" $file)" ]; then + # add missing DISTRIB_CODENAME= + echo "DISTRIB_CODENAME=rolling" >>$file + fi + sed -i $file \ + -e 's,DISTRIB_ID=.*,DISTRIB_ID=Condor,' \ + -e 's,DISTRIB_RELEASE=.*,DISTRIB_RELEASE=Soaring,' \ + -e 's,DISTRIB_CODENAME=.*,DISTRIB_CODENAME="Uchiha",' \ + -e 's,DISTRIB_DESCRIPTION=.*,DISTRIB_DESCRIPTION=\"Condor Linux Uchiha\",' +} + + + +Mkinitcpio-Install() { + if [ ! -e /usr/share/libalpm/hooks/90-dracut-install.hook ]; then + # Delegate this to the official script + # Also run the right once since Arch Linux upstream merged install/remove into one + if [ -x /usr/share/libalpm/scripts/mkinitcpio-install ]; then + /usr/share/libalpm/scripts/mkinitcpio-install + elif [ -x /usr/share/libalpm/scripts/mkinitcpio ]; then + /usr/share/libalpm/scripts/mkinitcpio install + else + # We should let the user know + echo -e "\n\033[1;34m\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nThe kernel update failed to determine how to update initramfs.\nYou will need to update manually using mkinitcpio or dracut yourself or your system WILL NOT BE BOOTABLE.\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nWaiting 10 seconds.\n\033[0m" + garudalib_add_update_notice "The kernel update failed to determine how to update initramfs.\nYou will need to update manually using mkinitcpio or dracut yourself or your system WILL NOT BE BOOTABLE." + sleep 10 + fi + fi +} + +Main() { + local hookname="$1" + + case "$hookname" in + filesystem) Filesystem ;; + lsb-release) Lsb_release ;; + kernel) Mkinitcpio-Install ;; + "") + Filesystem + Lsb_release + ;; + esac +} + +Main "$@" diff --git a/condor-hooks/condor-hooks-runner.hook b/condor-hooks/condor-hooks-runner.hook new file mode 100644 index 0000000..b34e6a5 --- /dev/null +++ b/condor-hooks/condor-hooks-runner.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Package +Target = condor-hooks + +[Action] +Description = Updating Condor specific hooks... +When = PostTransaction +Exec = /usr/share/libalpm/scripts/condor-hooks-runner diff --git a/condor-hooks/condor-hooks.install b/condor-hooks/condor-hooks.install new file mode 100755 index 0000000..afce55b --- /dev/null +++ b/condor-hooks/condor-hooks.install @@ -0,0 +1,7 @@ +post_install() { + systemctl enable linux-modules-cleanup +} + +post_upgrade() { + systemctl is-enabled linux-modules-cleanup >/dev/null || systemctl enable linux-modules-cleanup +} diff --git a/condor-hooks/filesystem.hook b/condor-hooks/filesystem.hook new file mode 100644 index 0000000..02fecee --- /dev/null +++ b/condor-hooks/filesystem.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Package +Target = filesystem + +[Action] +Description = Adding Condor specific configurations... +When = PostTransaction +Exec = /usr/share/libalpm/scripts/condor-hooks-runner filesystem diff --git a/condor-hooks/lsb-release.hook b/condor-hooks/lsb-release.hook new file mode 100644 index 0000000..a29c2dd --- /dev/null +++ b/condor-hooks/lsb-release.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Package +Target = lsb-release + +[Action] +Description = Add Condor specific configuration... +When = PostTransaction +Exec = /usr/share/libalpm/scripts/condor-hooks-runner lsb-release diff --git a/condor-libs/.SRCINFO b/condor-libs/.SRCINFO new file mode 100644 index 0000000..505f413 --- /dev/null +++ b/condor-libs/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = condor-libs + pkgdesc = Libraries commonly used by Condor Linux software + pkgver = 1.0.0 + pkgrel = 2 + arch = any + license = GPL + depends = libnotify + depends = expect + optdepends = alacritty + optdepends = lxterminal + optdepends = kitty + optdepends = gnome-terminal + optdepends = xfce4-terminal + optdepends = xterm + source = launch-terminal + source = condor.shlib + source = is-snapshot-boot + source = install-software + source = org.condor.libs.pkexec.policy + source = pkexec-gui + sha512sums = ad4efa466ae51e8f18e454951d2e502d471fd6b0acc25d900c979a4c15fa0922485664487aed92ac5b7f0c163a3a3c0c5271c0a67e4cd07fc96cbfe49a0bf443 + sha512sums = 2ecf0287f8b9daeea88654bac490c13d7efe99f591a79d5cac62b5cafca1da4a71b2837e88a86a320787a16d07ad00e644f607e516e730b45d2fb06f79190008 + sha512sums = 2ba2701c933b37fd708efe9cd8a2dc9e17d33f6c7ecafcdd3ffd4292b5d88cde10595e15af1560b8c03bd3e1b94e13a69d23d72899ec75b500856c71bd23c446 + sha512sums = 67f448632946e0ed7edc1a587647beedb550b2063b1867bf6a4aa721d365c233fcbb4c543ef6f6289c7fe840e8eb20080f5ae9d2124cc9d60d0bf6d6abcc99ae + sha512sums = b1b58810a4cb0f7f0479e34d98de2528a35ff576cc48dddcd60d5d0c8d449d6cfb34fe93095933a38d78ae82581c14a7cb0a65b55ce1c261a8e0d052bbe0a8f0 + sha512sums = 4b658e0c7710a82bd164bd8ee064a76e1922d63153590f89bbc2f6326da6e31cf24949d8be07045a73dcde8b6583109aa9e1d74eb661d6173ed2c55e3802bd61 + +pkgname = condor-libs diff --git a/condor-libs/PKGBUILD b/condor-libs/PKGBUILD new file mode 100644 index 0000000..65ca86c --- /dev/null +++ b/condor-libs/PKGBUILD @@ -0,0 +1,28 @@ +# Maintainer: TNE + +pkgname=condor-libs +pkgdesc="Libraries commonly used by Condor Linux software" +pkgver=1.0.0 +pkgrel=2 +arch=('any') +license=('GPL') +depends=('libnotify' 'expect') +optdepends=('alacritty' 'lxterminal' 'kitty' 'gnome-terminal' 'xfce4-terminal' 'xterm') +source=("launch-terminal" "condor.shlib" "is-snapshot-boot" "install-software" "org.condor.libs.pkexec.policy" "pkexec-gui") +sha512sums=('ad4efa466ae51e8f18e454951d2e502d471fd6b0acc25d900c979a4c15fa0922485664487aed92ac5b7f0c163a3a3c0c5271c0a67e4cd07fc96cbfe49a0bf443' + '2ecf0287f8b9daeea88654bac490c13d7efe99f591a79d5cac62b5cafca1da4a71b2837e88a86a320787a16d07ad00e644f607e516e730b45d2fb06f79190008' + '2ba2701c933b37fd708efe9cd8a2dc9e17d33f6c7ecafcdd3ffd4292b5d88cde10595e15af1560b8c03bd3e1b94e13a69d23d72899ec75b500856c71bd23c446' + '67f448632946e0ed7edc1a587647beedb550b2063b1867bf6a4aa721d365c233fcbb4c543ef6f6289c7fe840e8eb20080f5ae9d2124cc9d60d0bf6d6abcc99ae' + 'b1b58810a4cb0f7f0479e34d98de2528a35ff576cc48dddcd60d5d0c8d449d6cfb34fe93095933a38d78ae82581c14a7cb0a65b55ce1c261a8e0d052bbe0a8f0' + '4b658e0c7710a82bd164bd8ee064a76e1922d63153590f89bbc2f6326da6e31cf24949d8be07045a73dcde8b6583109aa9e1d74eb661d6173ed2c55e3802bd61') + +package() { + install -Dm755 launch-terminal "$pkgdir"/usr/lib/condor/launch-terminal + install -Dm755 install-software "$pkgdir"/usr/lib/conodor/install-software + install -Dm755 is-snapshot-boot "$pkgdir"/usr/lib/condor/is-snapshot-boot + install -Dm755 pkexec-gui "$pkgdir"/usr/lib/condor/pkexec-gui + install -Dm644 condor.shlib "$pkgdir"/usr/lib/garuda/condor.shlib + install -d "$pkgdir"/var/lib/condor/tmp + + install -Dm0644 org.condor.libs.pkexec.policy "$pkgdir/usr/share/polkit-1/actions/org.condor.libs.pkexec.policy" +} diff --git a/condor-libs/condor.shlib b/condor-libs/condor.shlib new file mode 100644 index 0000000..97a6761 --- /dev/null +++ b/condor-libs/condor.shlib @@ -0,0 +1,7 @@ +#!/bin/bash + +# Adds a notice that will be shown at the end of garuda-update +condorlib_add_update_notice() { + mkdir -p /var/lib/condor/tmp + echo "$(date +%F) ${1// / }" >>/var/lib/condor/tmp/update_notices +} diff --git a/condor-libs/install-software b/condor-libs/install-software new file mode 100755 index 0000000..c93b24e --- /dev/null +++ b/condor-libs/install-software @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +CONDORLIB_GUI="${CONDORLIB_GUI:-true}" +if [ -z "$DISPLAY" ]; then + CONDORLIB_GUI=false +fi + +# Elevate +if [[ $EUID -ne 0 ]] && [ "$CONDORLIB_GUI" == "true" ]; then + exec pkexec /usr/lib/condor/install-software "$@" + exit 1 +fi + +sudo pacman -S --noconfirm "$@" diff --git a/condor-libs/is-snapshot-boot b/condor-libs/is-snapshot-boot new file mode 100755 index 0000000..0366f62 --- /dev/null +++ b/condor-libs/is-snapshot-boot @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +# Returns 0 on confirmed snapper snapshot boot, returns a non zero value otherwise + +if grep -qE 'subvol=@/.snapshots/[0-9]+/snapshot' /proc/cmdline; then + exit 0 +fi +exit 1 diff --git a/condor-libs/launch-terminal b/condor-libs/launch-terminal new file mode 100755 index 0000000..4618ace --- /dev/null +++ b/condor-libs/launch-terminal @@ -0,0 +1,96 @@ +#!/usr/bin/bash +set -e + +LAUNCH_TERMINAL_SHELL=bash + +usage() { + echo "Usage: ${0##*/} [cmd]" + echo ' -s [shell] Change shell to [shell]' + echo ' -h This help' + exit 1 +} + +opts='s:h' + +while getopts "${opts}" arg; do + case "${arg}" in + s) LAUNCH_TERMINAL_SHELL="$OPTARG" ;; + h | ?) usage 0 ;; + *) + echo "invalid argument '${arg}'" + usage 1 + ;; + esac +done + +shift $(($OPTIND - 1)) + +initfile="$(mktemp)" +codefile="$initfile" +echo "#!/usr/bin/env bash" >"$initfile" +if [ "$LAUNCH_TERMINAL_SHELL" != "bash" ]; then + codefile="$(mktemp)" + echo "$LAUNCH_TERMINAL_SHELL $codefile" >>"$initfile" +fi +echo "$1" >>"$codefile" +chmod +x "$initfile" +cmd="\"$initfile\"" + +terminal="" +declare -A terminals=(["alacritty"]="alacritty -e $cmd || LIBGL_ALWAYS_SOFTWARE=1 alacritty -e $cmd" ["kitty"]="kitty -e $cmd" ["kgx"]="kgx -- $cmd" ["gnome-terminal"]="gnome-terminal --wait -- $cmd" ["xfce4-terminal"]="xfce4-terminal --disable-server --command '$cmd'" ["qterminal"]="qterminal -e $cmd" ["lxterminal"]="lxterminal -e $cmd" ["mate-terminal"]="mate-terminal --disable-factory -e $cmd" ["xterm"]="xterm -e $cmd" ["foot"]="foot -T launch-terminal -e $cmd") +declare -a term_order=("alacritty" "kitty" "kgx" "gnome-terminal" "mate-terminal" "xfce4-terminal" "qterminal" "lxterminal" "xterm" "foot") + +case "$XDG_CURRENT_DESKTOP" in +KDE) + terminal=kitty + ;; +GNOME) + if command -v "kgx" &>/dev/null; then + terminal=kgx + else + terminal=gnome-terminal + fi + ;; +XFCE) + terminal=xfce4-terminal + ;; +LXQt) + terminal=qterminal + ;; +MATE) + terminal=mate-terminal + ;; +esac + +if [ -z "$terminal" ] || ! command -v "$terminal" &>/dev/null; then + for i in ${term_order[@]}; do + if command -v "$i" &>/dev/null; then + terminal="$i" + break + fi + done +fi + +if [ -z "$terminal" ]; then + notify-send -t 15000 --app-name=Garuda\ Linux "No terminal installed" "No supported terminal emulator is installed. Please install a terminal emulator like Alacritty." + exit 1 +fi + +# Special kgx, thanks gnome +if [ "$terminal" == "kgx" ]; then + sed -i '2i sleep 0.1' $initfile + echo 'kill -SIGINT $PPID' >>$initfile +fi + +eval "${terminals[${terminal}]}" || { + exitcode=$? +} + +rm "$initfile" +if [ "$codefile" != "$initfile" ]; then + rm "$codefile" +fi + +if [ ! -z "$exitcode" ] && [ "$exitcode" != 130 ]; then + exit 2 +fi diff --git a/condor-libs/org.condor.libs.pkexec.policy b/condor-libs/org.condor.libs.pkexec.policy new file mode 100644 index 0000000..d4e05a3 --- /dev/null +++ b/condor-libs/org.condor.libs.pkexec.policy @@ -0,0 +1,33 @@ + + + + + Condor Linux + https://gitlab.com/condor-linux + + + Install software with pacman + Authentication is required to install software. + condorlinux + + no + no + auth_admin + + /usr/lib/condor/install-software + true + + + Run GUI program as root + Authentication is required to run a GUI program as root. + + no + no + auth_admin + + /usr/lib/condor/pkexec-gui + true + + + diff --git a/condor-libs/pkexec-gui b/condor-libs/pkexec-gui new file mode 100644 index 0000000..4e97136 --- /dev/null +++ b/condor-libs/pkexec-gui @@ -0,0 +1,20 @@ +#!/bin/bash + +# Elevate +if [[ $EUID -ne 0 ]]; then + exec pkexec /usr/lib/condor/pkexec-gui "$@" + exit 1 +fi + +# Launch dbus session if not already running +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then + eval $(dbus-launch --sh-syntax --exit-with-session) +fi + +# Restore some variables from parent process +while IFS= read -rd '' var; do export "$var"; done < <(grep --null-data -ae "^\(XDG_CURRENT_DESKTOP\|WAYLAND_DISPLAY\|XDG_RUNTIME_DIR\|XDG_SESSION_TYPE\|XCURSOR_SIZE\|LC_.*\|LANG\|LANGUAGE\|QT_WAYLAND_FORCE_DPI\|QT_QPA_PLATFORMTHEME\|QT_STYLE_OVERRIDE\|\)=.*\$" /proc/$PPID/environ) +if [[ -v WAYLAND_DISPLAY ]]; then + export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" +fi +export XDG_RUNTIME_DIR="/run/user/0" +exec "$@" diff --git a/condor-zsh-config/.SRCINFO b/condor-zsh-config/.SRCINFO new file mode 100644 index 0000000..f3ca8ab --- /dev/null +++ b/condor-zsh-config/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = condor-zsh-config + pkgdesc = Zsh configuration for Condor Linux + pkgver = 1.0.0 + pkgrel = 1 + arch = any + license = GPL + makedepends = git + depends = find-the-command-git + depends = fzf + depends = mcfly + depends = ugrep + depends = zsh + depends = zsh-autosuggestions + depends = zsh-completions + depends = zsh-history-substring-search + depends = zsh-syntax-highlighting + conflicts = grml-zsh-config + conflicts = manjaro-zsh-config + source = zshrc + sha256sums = c0fa3e027fe752b55052909c2bf929094c1dc81854521abe5f69104a0370cd8e + +pkgname = condor-zsh-config diff --git a/condor-zsh-config/PKGBUILD b/condor-zsh-config/PKGBUILD new file mode 100644 index 0000000..d2ce7cc --- /dev/null +++ b/condor-zsh-config/PKGBUILD @@ -0,0 +1,27 @@ +# Garuda-Team +# Contributor: Librewish + +pkgname=condor-zsh-config +pkgver=1.0.0 +pkgrel=1 +pkgdesc="Zsh configuration for Condor Linux" +arch=(any) +# url="https://gitlab.com/garuda-linux/themes-and-settings/settings/$pkgname" +license=('GPL') +conflicts=('grml-zsh-config' 'manjaro-zsh-config') +depends=('find-the-command-git' + 'fzf' + 'mcfly' + 'ugrep' + 'zsh' + 'zsh-autosuggestions' + 'zsh-completions' + 'zsh-history-substring-search' + 'zsh-syntax-highlighting') +makedepends=('git') +source=('zshrc') +sha256sums=('c0fa3e027fe752b55052909c2bf929094c1dc81854521abe5f69104a0370cd8e') + +package() { + install -D -m644 zshrc "$pkgdir/etc/skel/.zshrc" +} diff --git a/condor-zsh-config/zshrc b/condor-zsh-config/zshrc new file mode 100644 index 0000000..020b3b6 --- /dev/null +++ b/condor-zsh-config/zshrc @@ -0,0 +1,260 @@ +## Path section +# Set $PATH if ~/.local/bin exist +if [ -d "$HOME/.local/bin" ]; then + export PATH=$HOME/.local/bin:$PATH +fi + +eval "$(starship init zsh)" +function set_win_title(){ + echo -ne "\033]0; $USER@$HOST:${PWD/$HOME/~} \007" +} +precmd_functions+=(set_win_title) + + +## Plugins section: Enable fish style features +# Use syntax highlighting +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +# Use autosuggestion +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + +# Use history substring search +source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh + +# Use fzf +source /usr/share/fzf/key-bindings.zsh +source /usr/share/fzf/completion.zsh + +# Arch Linux command-not-found support, you must have package pkgfile installed +# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook +[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh + +# Advanced command-not-found hook +[[ -e /usr/share/doc/find-the-command/ftc.zsh ]] && source /usr/share/doc/find-the-command/ftc.zsh + + +## Options section +setopt correct # Auto correct mistakes +setopt extendedglob # Extended globbing. Allows using regular expressions with * +setopt nocaseglob # Case insensitive globbing +setopt rcexpandparam # Array expension with parameters +setopt nocheckjobs # Don't warn about running processes when exiting +setopt numericglobsort # Sort filenames numerically when it makes sense +setopt nobeep # No beep +setopt appendhistory # Immediately append history instead of overwriting +setopt histignorealldups # If a new command is a duplicate, remove the older one +setopt autocd # if only directory path is entered, cd there. +setopt auto_pushd +setopt pushd_ignore_dups +setopt pushdminus + +# Completion. +autoload -Uz compinit +compinit +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion +zstyle ':completion:*' rehash true # automatically find new executables in path +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc) +zstyle ':completion:*' completer _expand _complete _ignored _approximate +zstyle ':completion:*' menu select +zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' +zstyle ':completion:*:descriptions' format '%U%F{cyan}%d%f%u' + +# Speed up completions +zstyle ':completion:*' accept-exact '*(N)' +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.cache/zcache + +# automatically load bash completion functions +autoload -U +X bashcompinit && bashcompinit + +HISTFILE=~/.zhistory +HISTSIZE=50000 +SAVEHIST=10000 + + +## Keys +# Use emacs key bindings +bindkey -e + +# [PageUp] - Up a line of history +if [[ -n "${terminfo[kpp]}" ]]; then + bindkey -M emacs "${terminfo[kpp]}" up-line-or-history + bindkey -M viins "${terminfo[kpp]}" up-line-or-history + bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history +fi +# [PageDown] - Down a line of history +if [[ -n "${terminfo[knp]}" ]]; then + bindkey -M emacs "${terminfo[knp]}" down-line-or-history + bindkey -M viins "${terminfo[knp]}" down-line-or-history + bindkey -M vicmd "${terminfo[knp]}" down-line-or-history +fi + +# Start typing + [Up-Arrow] - fuzzy find history forward +if [[ -n "${terminfo[kcuu1]}" ]]; then + autoload -U up-line-or-beginning-search + zle -N up-line-or-beginning-search + + bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search + bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search + bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search +fi +# Start typing + [Down-Arrow] - fuzzy find history backward +if [[ -n "${terminfo[kcud1]}" ]]; then + autoload -U down-line-or-beginning-search + zle -N down-line-or-beginning-search + + bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search + bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search + bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search +fi + +# [Home] - Go to beginning of line +if [[ -n "${terminfo[khome]}" ]]; then + bindkey -M emacs "${terminfo[khome]}" beginning-of-line + bindkey -M viins "${terminfo[khome]}" beginning-of-line + bindkey -M vicmd "${terminfo[khome]}" beginning-of-line +fi +# [End] - Go to end of line +if [[ -n "${terminfo[kend]}" ]]; then + bindkey -M emacs "${terminfo[kend]}" end-of-line + bindkey -M viins "${terminfo[kend]}" end-of-line + bindkey -M vicmd "${terminfo[kend]}" end-of-line +fi + +# [Shift-Tab] - move through the completion menu backwards +if [[ -n "${terminfo[kcbt]}" ]]; then + bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete + bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete + bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete +fi + +# [Backspace] - delete backward +bindkey -M emacs '^?' backward-delete-char +bindkey -M viins '^?' backward-delete-char +bindkey -M vicmd '^?' backward-delete-char +# [Delete] - delete forward +if [[ -n "${terminfo[kdch1]}" ]]; then + bindkey -M emacs "${terminfo[kdch1]}" delete-char + bindkey -M viins "${terminfo[kdch1]}" delete-char + bindkey -M vicmd "${terminfo[kdch1]}" delete-char +else + bindkey -M emacs "^[[3~" delete-char + bindkey -M viins "^[[3~" delete-char + bindkey -M vicmd "^[[3~" delete-char + + bindkey -M emacs "^[3;5~" delete-char + bindkey -M viins "^[3;5~" delete-char + bindkey -M vicmd "^[3;5~" delete-char +fi + +typeset -g -A key +if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then + autoload -Uz add-zle-hook-widget + function zle_application_mode_start { echoti smkx } + function zle_application_mode_stop { echoti rmkx } + add-zle-hook-widget -Uz zle-line-init zle_application_mode_start + add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop +fi + +# Control Left - go back a word +key[Control-Left]="${terminfo[kLFT5]}" +if [[ -n "${key[Control-Left]}" ]]; then + bindkey -M emacs "${key[Control-Left]}" backward-word + bindkey -M viins "${key[Control-Left]}" backward-word + bindkey -M vicmd "${key[Control-Left]}" backward-word +fi + +# Control Left - go forward a word +key[Control-Right]="${terminfo[kRIT5]}" +if [[ -n "${key[Control-Right]}" ]]; then + bindkey -M emacs "${key[Control-Right]}" forward-word + bindkey -M viins "${key[Control-Right]}" forward-word + bindkey -M vicmd "${key[Control-Right]}" forward-word +fi + +# Alt Left - go back a word +key[Alt-Left]="${terminfo[kLFT3]}" +if [[ -n "${key[Alt-Left]}" ]]; then + bindkey -M emacs "${key[Alt-Left]}" backward-word + bindkey -M viins "${key[Alt-Left]}" backward-word + bindkey -M vicmd "${key[Alt-Left]}" backward-word +fi + +# Control Right - go forward a word +key[Alt-Right]="${terminfo[kRIT3]}" +if [[ -n "${key[Alt-Right]}" ]]; then + bindkey -M emacs "${key[Alt-Right]}" forward-word + bindkey -M viins "${key[Alt-Right]}" forward-word + bindkey -M vicmd "${key[Alt-Right]}" forward-word +fi + +## Useful aliases + +# Replace ls with exa +alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing +alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs +alias ll='exa -l --color=always --group-directories-first --icons' # long format +alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing +alias l.='exa -ald --color=always --group-directories-first --icons .*' # show only dotfiles + +# Replace some more things with better alternatives +alias cat='bat --style header --style snip --style changes --style header' +[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru' + +# Common use +alias grubup="sudo update-grub" +alias fixpacman="sudo rm /var/lib/pacman/db.lck" +alias tarnow='tar -acf ' +alias untar='tar -zxvf ' +alias wget='wget -c ' +alias rmpkg="sudo pacman -Rdd" +alias psmem='ps auxf | sort -nr -k 4' +alias psmem10='ps auxf | sort -nr -k 4 | head -10' +alias upd='/usr/bin/garuda-update' +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' +alias ......='cd ../../../../..' +alias dir='dir --color=auto' +alias vdir='vdir --color=auto' +alias grep='ugrep --color=auto' +alias fgrep='ugrep -F --color=auto' +alias egrep='ugrep -E --color=auto' +alias hw='hwinfo --short' # Hardware Info +alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB (expac must be installed) +alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages +alias ip='ip -color' + +# Get fastest mirrors +alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist" +alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist" +alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist" +alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist" + +# Help people new to Arch +alias apt='man pacman' +alias apt-get='man pacman' +alias please='sudo' +alias tb='nc termbin.com 9999' +alias helpme='cht.sh --shell' +alias pacdiff='sudo -H DIFFPROG=meld pacdiff' + +# Cleanup orphaned packages +alias cleanup='sudo pacman -Rns $(pacman -Qtdq)' + +# Get the error messages from journalctl +alias jctl="journalctl -p 3 -xb" + +# Recent installed packages +alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl" + +# Load Mcfly +export MCFLY_FUZZY=true +export MCFLY_RESULTS=20 +export MCFLY_INTERFACE_VIEW=BOTTOM +export MCFLY_RESULTS_SORT=LAST_RUN +eval "$(mcfly init zsh)" + +## Run neofetch +neofetch diff --git a/grub-condor/.SRCINFO b/grub-condor/.SRCINFO new file mode 100644 index 0000000..c1f7968 --- /dev/null +++ b/grub-condor/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = grub-garuda + pkgdesc = Meta-package for using GRUB on Garuda Linux + pkgver = 2.06 + pkgrel = 2 + url = https://www.gnu.org/software/grub/ + arch = any + license = GPL3 + makedepends = git + depends = grub + depends = update-grub + depends = os-prober-btrfs + depends = efibootmgr + depends = memtest86+ + provides = grub-garuda + conflicts = grub-garuda + conflicts = grub-customizer + +pkgname = grub-garuda diff --git a/grub-condor/PKGBUILD b/grub-condor/PKGBUILD new file mode 100644 index 0000000..552a1e7 --- /dev/null +++ b/grub-condor/PKGBUILD @@ -0,0 +1,14 @@ +# Maintainer: dr460nf1r3 +# Contributor: Librewish + +pkgname='grub-condor' +pkgdesc='Meta-package for using GRUB on Condor Linux' +pkgver=2.00 +pkgrel=1 +url='https://www.gnu.org/software/grub/' +arch=('any') +license=('GPL3') +conflicts=('grub-garuda' 'grub-customizer') +provides=('grub-garuda') +makedepends=('git') +depends=('grub' 'update-grub' 'os-prober-btrfs' 'efibootmgr' 'memtest86+')