From 9004d40d3470e37d9d1fed84d981b6c3a29ccaa0 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 13 Jan 2024 22:45:21 +0000 Subject: update --- home/xyz/.local/bin/upd | 81 ------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 home/xyz/.local/bin/upd (limited to 'home/xyz/.local') diff --git a/home/xyz/.local/bin/upd b/home/xyz/.local/bin/upd deleted file mode 100755 index e3953e8d..00000000 --- a/home/xyz/.local/bin/upd +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -all () { - fast - clean - refl - qb -} - -clean () { - paru -aSc --noconfirm -} - -# basic daily stuff -fast () { - pac - misc -} - -misc () { - "$EDITOR" +PlugClean! +PlugUpdate +qa -} - -pac () { - pacpacs="$(sudo pacman --noconfirm -Syu | tee /dev/tty | grep -m1 '^Packages' | cut -d' ' -f3-)" - # Update rust toolchains before paru so paru can compile things in newest rust if needed. - rustup update - aurpacs="$(paru --color never --noconfirm -aSu | tee /dev/tty | grep -m1 '^Aur' | cut -d' ' -f3-)" - # part steal from aur comment - # sometimes "ERROR: Failure while downloading": https://github.com/neovim/neovim/issues/15709 - # echo 1, printf 1 and yes 1 all works? not sure why - # aur neovim-nightly-bin has some issue on 12/26/2021? switch to community repo neovim temporary - #rm -rf ~/.cache/paru/clone/neovim-nightly-bin/ && echo 1 | PARU_PAGER=cat paru --rebuild --redownload neovim-nightly-bin - pacman -Qqme > "$XDG_CONFIG_HOME/myconf/pacman_Qqme" - pacman -Qqne > "$XDG_CONFIG_HOME/myconf/pacman_Qqne" - systemctl list-unit-files --state=enabled > "$XDG_CONFIG_HOME/myconf/sye" - systemctl --user list-unit-files --state=enabled > "$XDG_CONFIG_HOME/myconf/syue" - # pacdiff default use pacman database, so no need `sudo -E` for find, but will be a little bit slower - log="$log -updated pacman packages: $pacpacs -updated aur packages: $aurpacs -pacdiff: $(pacdiff -o | tr '\n' ' ') -checkrebuild: $(checkrebuild) -$(if echo "$pacpacs" | grep -q 'linux-[0-9]'; then echo 'kernel upgraded, need reboot'; fi) -" -} - -qb () { - sudo systemctl stop qbittorrent-nox@xyz.service - find "$XDG_DATA_HOME/qBittorrent/nova3/engines" -maxdepth 1 -type f ! -name 'jackett*' -a ! -name '__init__.py' -delete - curlqb "$XDG_DATA_HOME/qBittorrent/nova3/engines" - sudo systemctl start qbittorrent-nox@xyz.service -} - -refl () { - # why not use http: - # https://www.reddit.com/r/archlinux/comments/kx149z/should_i_use_http_mirrors/ - # https://www.reddit.com/r/archlinux/comments/ej4k4d/is_it_safe_to_use_not_secured_http_pacman_mirrors/ - # rsync may need to change XferCommand in /etc/pacman.conf - # https://www.reddit.com/r/archlinux/comments/mynw6e/rsync_mirrors_with_pacman/ - # need --delay so no super out of sync mirrors - sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3 -} - -if [ $# -eq 0 ]; then - fast -else - while getopts acfmpqr opt; do - case $opt in - a)all;; - c)clean;; - f)fast;; - m)misc;; - p)pac;; - q)qb;; - r)refl;; - \?)exit 1;; - esac - done -fi -[ "$log" ] && printf '%s' "$log" | tee "$XDG_DOCUMENTS_DIR/logs/upd.log" -- cgit v1.2.3-70-g09d2