From 7cd5b8f14e671e0da8e5efd4acf99790cdac146c Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Tue, 17 Mar 2020 19:24:08 +0200 Subject: [PATCH] Update arch init script Remove global yarn packages --- .bash_profile | 2 +- .clang-tidy | 7 -- .config/git/config | 35 +-------- .config/qutebrowser/config.py | 2 +- .config/yarn/global/package.json | 17 ---- .config/youtube-dl/config | 2 +- .local/arch/init.sh | 128 +++++++++++++++++-------------- .local/arch/packages.aur.txt | 34 ++++---- .local/arch/packages.repo.txt | 105 ++++++++++++++++++------- .stylelintrc.json | 1 - .yarnrc | 2 +- README.md | 1 - 12 files changed, 171 insertions(+), 165 deletions(-) delete mode 100644 .config/yarn/global/package.json diff --git a/.bash_profile b/.bash_profile index d389be4..694e5b5 100644 --- a/.bash_profile +++ b/.bash_profile @@ -51,7 +51,7 @@ export GOPATH="$HOME/.local/go" # Set the paths used by ruby {{{ export GEM_HOME="$HOME/.local/ruby" export GEM_SPEC_CACHE="$GEM_HOME/specs" -export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/2.6.0" +export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/2.7.0" export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME/bundle" export BUNDLE_USER_CACHE="$XDG_CACHE_HOME/bundle" export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME/bundle" diff --git a/.clang-tidy b/.clang-tidy index 4e843d4..a7454ea 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -149,7 +149,6 @@ Checks: > readability-deleted-default, readability-implicit-bool-conversion, readability-inconsistent-declaration-parameter-name, - readability-magic-numbers, readability-misleading-indentation, readability-misplaced-array-index, readability-named-parameter, @@ -214,12 +213,6 @@ CheckOptions: value: true - key: readability-inconsistent-declaration-parameter-name.Strict value: true - - key: readability-magic-numbers.IgnoredIntegerValues - value: "1;10" - - key: readability-magic-numbers.IgnoredFloatingPointValues - value: "1.0" - - key: readability-magic-numbers.IgnorePowersOf2IntegerValues - value: true - key: readability-simplify-boolean-expr.ChainedConditionalReturn value: true - key: readability-simplify-boolean-expr.ChainedConditionalAssignment diff --git a/.config/git/config b/.config/git/config index 2a98c63..f8aeb21 100644 --- a/.config/git/config +++ b/.config/git/config @@ -80,44 +80,11 @@ conflicts = diff --name-only --diff-filter=U root = rev-parse --show-toplevel shallow = clone --single-branch --depth=1 - lab = !git clone git@gitlab.com:"$1" "${@:2}" "#" - aur = !git clone aur@aur.archlinux.org:"$1" "${@:2}" "#" repush = !git commit --amend -a --no-edit && git push --force - fork-sync = "\ + fork-sync = "! \ git fetch --verbose upstream && git checkout --progress master && \ git reset --hard upstream/master && git push --verbose --force" force-pull = "!git fetch -a && git reset --hard ${2:-origin}/${1:-master}" - create-lab = "!f() { \ - if [ -z \"$GITLAB_TOKEN\" ]; then \ - if [ -f \"$HOME/.local/tokens/gitlab\" ]; then \ - GITHUB_TOKEN=\"$(< \"$HOME/.local/tokens/gitlab\" )\"; \ - else \ - printf \"%s%s%s\\n\" \"export GITLAB_TOKEN\" \ - \"or save it in \\$HOME/.local/tokens/gitlab\" \ - \"to use this command\" >&2; \ - fi; \ - fi; \ - curl -H \"Content-Type: application/json\" \ - -H \"Private-Token: $GITLAB_TOKEN\" \ - -sSX POST https://gitlab.com/api/v4/projects \ - -d \"{\\\"name\\\": \\\"${1:?}\\\"}\"; printf '\n';}; f" - rename = "!f() { \ - if [ -z \"$GITHUB_TOKEN\" ]; then \ - if [ -f \"$HOME/.local/tokens/github\" ]; then \ - GITHUB_TOKEN=\"$(< \"$HOME/.local/tokens/github\" )\"; \ - else \ - printf \"%s%s%s\\n\" \"export GITHUB_TOKEN\" \ - \"or save it in \\$HOME/.local/tokens/github\" \ - \"to use this command\" >&2; \ - fi; \ - fi; \ - user=\"${2:-$(git config --get user.name)}\"; \ - old=\"${3:-$(basename \"$(git rev-parse --show-toplevel)\")}\"; \ - curl -H \"Content-Type: application/json\" \ - -H \"Authorization: Token $GITHUB_TOKEN\" \ - -sSX PATCH \"https://api.github.com/repos/$user/$old\" \ - -d \"{\\\"name\\\": \\\"${1:?}\\\"}\"; \ - git remote set-url \"${4:-origin}\" \"https://github.com/$user/$1\";}; f" [url "git@github.com:"] insteadOf = https://github.com/ diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index f5b7c75..b6a9c84 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -36,7 +36,7 @@ c.editor.command = [ ] # Default monospace fonts. -c.fonts.monospace = ','.join(( +c.fonts.web.family.fixed = ','.join(( 'Hack', 'Fira Code', 'Code New Roman', diff --git a/.config/yarn/global/package.json b/.config/yarn/global/package.json deleted file mode 100644 index fa91285..0000000 --- a/.config/yarn/global/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "license": "MIT-0", - "private": true, - "dependencies": { - "american-british-english-translator": "^0.1.2", - "eslint": "^6.7.0", - "grunt-cli": "^1.3.2", - "gulp-cli": "^2.2.0", - "htmlhint": "^0.11.0", - "neovim": "^4.5.0", - "pug-cli": "^1.0.0-alpha6", - "pug-lint": "^2.5.0", - "stylelint": "^12.0.0", - "stylelint-scss": "^3.13.0", - "svgo": "^1.3.0" - } -} diff --git a/.config/youtube-dl/config b/.config/youtube-dl/config index 145615c..d5547b0 100644 --- a/.config/youtube-dl/config +++ b/.config/youtube-dl/config @@ -17,6 +17,6 @@ --output "%(title)s.%(ext)s" # Specify a custom user agent. ---user-agent "Mozilla/5.0 (Linux x86_64) youtube-dl/2020.01.15" +--user-agent "Mozilla/5.0 (Linux x86_64) youtube-dl/2020.03.08" # vim:ft=conf: diff --git a/.local/arch/init.sh b/.local/arch/init.sh index bb9d237..26c209d 100755 --- a/.local/arch/init.sh +++ b/.local/arch/init.sh @@ -5,25 +5,38 @@ sudo cp /etc/pacman.conf{,.bak} sudo sed -i /etc/pacman.conf \ -e 's/^#\(Color\)/\1\nILoveCandy/' \ -e '/\[multilib\]/,/Include/s/^#//' \ - -e '$ a [quarry]\nServer = https://pkgbuild.com/~anatolik/quarry/x86_64/' + -e '$ a [quarry]\nServer = https://pkgbuild.com/~anatolik/quarry/x86_64/' \ + -e '$ a [chaotic-aur]\nServer = https://repo.kitsuna.net/x86_64/' \ + -e '$ a Server = http://lonewolf-builder.duckdns.org/chaotic-aur/x86_64/' \ + -e '$ a Server = http://chaotic.bangl.de/chaotic-aur/x86_64/' # }}} # Update system and install basic packages {{{ sudo pacman-key --init sudo pacman-key --populate archlinux -sudo pacman -Syyu -sudo pacman -S base-devel git aria2 reflector go --noconfirm -git clone https://aur.archlinux.org/yay.git /tmp/yay -(cd /tmp/yay && makepkg -sic --noconfirm) -git clone https://github.com/alfunx/dotfiles.sh \ - --single-branch --branch=sparse-edit /tmp/dotfiles.sh -(cd /tmp/dotfiles.sh && sudo make install) +sudo pacman-key --recv-keys 0x3056513887B78AEB +sudo pacman -Syyu --noconfirm +sudo pacman -S git aria2 reflector yay --noconfirm # }}} # Clone dotfiles {{{ -mkdir -p ~/Documents/Code/GitHub +(cd /tmp; yay -G dotfiles.sh-git) +pushd /tmp/dotfiles.sh-git >/dev/null +patch -n PKGBUILD <<'EOF' +12,13c12,14 +< source=("${pkgname%-git}::git+$url") +< md5sums=("SKIP") +--- +> source=("${pkgname%-git}::git+$url" "sparse-edit.patch::$url/pull/10.diff") +> md5sums=("SKIP" "6ecafcc0206a730aa40cc751435922ef") +> prepare() (git -C "$srcdir/${pkgname%-git}" apply "$srcdir/sparse-edit.patch") +EOF +makepkg -sic +popd >/dev/null +rm -r /tmp/dotfiles.sh-git dotfiles clone https://github.com/ObserverOfTime/home.files \ - ~/Documents/Code/GitHub/home.files && dotfiles checkout -f + "${XDG_CONFIG_HOME:=$HOME/.config}/dotfiles" +dotfiles checkout --force # }}} # Rank pacman mirrors {{{ @@ -50,7 +63,7 @@ unset REF_OPTS # }}} # Use aria2 for makepkg & set packager {{{ -NAME="$(awk -F'[:,]' -vu="$USER" '$1 == u {print $5}' /etc/passwd)" +NAME="$(getent passwd "$USER" | awk -F'[:,]' '{print $5}')" PACKAGER="${NAME:-ObserverOfTime} " ARIA='::/usr/bin/aria2c --conf-path=/etc/aria2.conf -o %o %u' WGET="$(wget -V | awk 'NR == 1 {print $2"/"$3}')" @@ -70,25 +83,23 @@ unset NAME PACKAGER ARIA WGET # }}} # Install packages via yay {{{ -# shellcheck disable=SC2046,SC2086 -_yay() (yay -S --$1 --needed ${*:2} $(<~/.local/arch/packages.$1.txt)) -_yay repo --noconfirm && _yay aur -unset -f _yay -# }}} - -# Install node packages {{{ -yarn global install +# shellcheck disable=SC2046 +yay -S --repo --needed --noconfirm \ + $(<~/.local/arch/packages.repo.txt) +# shellcheck disable=SC2046 +yay -S --aur --needed \ + $(<~/.local/arch/packages.aur.txt) # }}} # Download binaries from github {{{ -ghdl() (curl -L https://git.io/"$1" -o ~/.local/bin/"$2"; chmod +x "$_") -ghdl vhMor aria2magnet -ghdl fjlNS lnk-parse -unset -f ghdl +mkdir -p ~/.local/bin +curl -LSs https://git.io/vhMor -o ~/.local/bin/aria2magnet +curl -LSs https://git.io/fjlNS -o ~/.local/bin/lnk-parse +chmod +x ~/.local/bin/{aria2magnet,lnk-parse} # }}} # Install bash completions {{{ -DIRECTORY="$XDG_DATA_HOME/bash/completions" +DIRECTORY="${XDG_DATA_HOME:=.local/share}/bash/completions" declare -A ALIASES=( [adb]=android [emulator]=android @@ -101,23 +112,22 @@ declare -A ALIASES=( [bundler]=bundle ) mkdir -p "$DIRECTORY" -raw() (printf 'https://raw.githubusercontent.com/%s' "$1/$2/master/$3") aria2c -d "$DIRECTORY" -i - <> "$DIRECTORY/ffmpeg" @@ -132,31 +142,17 @@ pandoc --bash-completion > "$DIRECTORY/pandoc" poetry completions bash > "$DIRECTORY/poetry" ln -fvs "$(gem contents travis | grep 'travis.sh$')" "$DIRECTORY/travis" ln -fvs /usr/share/fzf/completion.bash "$DIRECTORY/fzf" -unset -f DIRECTORY ALIASES raw -# }}} - -# Install from github reporisotories {{{ -clone() { hub clone --depth=1 "$@" "/tmp/${1##*/}"; } - -clone eli-schwartz/dotfiles.sh -(cd /tmp/dotfiles.sh && sudo make) - -clone rkitover/vimpager -(cd /tmp/vimpager && sudo make PREFIX=/usr/local docs install) - -clone ObserverOfTime/sddm-patema -sudo -E /tmp/sddm-patema/install.sh - -# clone ObserverOfTime/PKGBUILDS -# TODO: wait for Jguer/yay#694 +unset DIRECTORY ALIASES # }}} # Configure grub {{{ THEME=/boot/grub/themes/Lain SWAP="$(swapon --show=NAME --noheadings)" SWAP="${SWAP+ resume=$SWAP}" -clone ObserverOfTime/grub2-theme-lain -sudo cp -r /tmp/grub2-theme-lain/Lain "$THEME" +git clone https://git.disroot.org/chronobserver/grub2-theme-lain \ + /tmp/grub2-theme-lain --depth=1 +rm -rf /tmp/grub2-theme-lain/{.git*,README.md} +sudo cp -r /tmp/grub2-theme-lain "$THEME" sudo cp /etc/default/grub{,.bak} sudo tee /etc/default/grub >/dev/null </dev/null </dev/null <<'EOF' [Trigger] Operation = Upgrade Type = File @@ -220,10 +225,17 @@ Target = usr/bin/firefox-developer-edition Description = Setting GTK_USE_PORTAL=1 for Firefox... When = PostTransaction Exec = /bin/sed -i /usr/bin/firefox-developer-edition \ - -e 's/exec/GTK_USE_PORTAL=1 &/;s/"\$@"/-allow-downgrade &/' + -e 's/exec/GTK_USE_PORTAL=1 &/;s/"$@"/-allow-downgrade &/' EOF # }}} +# Set user dirs {{{ +xdg-user-dirs-update --set \ + TEMPLATES "$HOME/.local/templates" +xdg-user-dirs-update --set \ + PUBLICSHARE "$HOME/.local/public" +# }}} + # Set tty font {{{ sudo tee /etc/vconsole.conf >/dev/null <<'EOF' KEYMAP=us @@ -232,7 +244,7 @@ FONT_MAP=8859-2 EOF sudo sed -i /etc/mkinitcpio.conf \ -re 's/(^HOOKS="[^"]*)"/\1 consolefont"/' -sudo mkinitcpio -p linux +sudo mkinitcpio -p linux-zen # }}} # vim:fdm=marker:fdl=0: diff --git a/.local/arch/packages.aur.txt b/.local/arch/packages.aur.txt index 6833961..7beba88 100644 --- a/.local/arch/packages.aur.txt +++ b/.local/arch/packages.aur.txt @@ -1,36 +1,38 @@ -bear -betterdiscordctl-git +android-apktool cfr -clion -clion-jre -clion-lldb -discord-canary +compiledb discord-ptb drawio-desktop-bin exe-thumbnailer google-java-format -intellij-idea-ultimate-edition -intellij-idea-ultimate-edition-jre +gulp-cli +htmlhint +hyperfine-bin iridium-deb kde-thumbnailer-apk korla-icon-theme +lab-bin luacheck mcomix-gtk3-git mkv-extractor-qt +mpv-bash-completion-git +nodejs-neovim +nodejs-pug +nvimpager-git opustags pandoc-bin -phpstorm +protontricks-git +pug-lint pycharm-professional -rar +sha3sum shellcheck-static -snapd +stylelint +svgo syncplay-git -tor-browser +trackma-git ttf-ms-fonts -typora +ttf-twemoji-color vale-bin -waifu2x-converter-cpp +waifu2x-ncnn-vulkan-git webp-pixbuf-loader winetricks-git -yarn-completion-git -yay diff --git a/.local/arch/packages.repo.txt b/.local/arch/packages.repo.txt index 06740e9..4093b6c 100644 --- a/.local/arch/packages.repo.txt +++ b/.local/arch/packages.repo.txt @@ -1,78 +1,118 @@ -adobe-source-code-pro-fonts aegisub +alsa-firmware alsa-plugins alsa-utils ant -aria2 -asar +ark autopep8 base-devel +bash +bash-completion +bc +bluedevil +breeze +breeze-gtk +breeze-icons cabextract -checkbashisms +calligra +ccache clang cmake ctags desmume -discord -docx2txt +dnscrypt-proxy +docker dolphin dolphin-plugins dos2unix -dotnet-sdk -efibootmgr +doxygen eog eog-plugins +eslint +extra-cmake-modules fd -ffmpeg ffmpegthumbs filezilla firefox-developer-edition -flatpak +fontconfig fontforge fzf +gamemode +gawk gdb gimp git git-lfs glances +gnupg go goldendict gradle +grunt-cli +gst-plugins-bad +gst-plugins-base +gst-plugins-good +gst-plugins-ugly +gtk2 +gtk3 +gwenview htop hub +hunspell-el +hunspell-en_GB +hunspell-en_US iftop imagemagick -inkscape +intellij-idea-ultimate-edition +jdk-openjdk jdk8-openjdk +jemalloc jq +kcalc kcolorchooser -kde-servicemenu-rootactions +kde-gtk-config kdegraphics-thumbnailers +kdeplasma-addons +kdialog keepassxc +kid3 +kile +kimageformats kio-extras kio-gdrive kipi-plugins kleopatra kmix +konsole +kotlin krita -lib32-mesa -lib32-vulkan-intel -libreoffice-fresh +kwin-lowlatency +lib32-alsa-plugins +lib32-ffmpeg +lib32-mesa-aco-git +lib32-vulkan-icd-loader +linux-firmware +linux-zen +linux-zen-headers lldb llvm +lsof +lua52 +lutris maven -mesa +meld +mesa-aco-git mkvtoolnix-cli mkvtoolnix-gui mpv -neofetch neovim network-manager-applet networkmanager-openvpn networkmanager-pptp +newsboat +node-gyp nodejs ntfs-3g -odt2txt okteta okular optipng @@ -80,9 +120,12 @@ otf-fantasque-sans-mono otf-fira-code p7zip pacman-contrib -perl-test-perltidy +parallel +pdfjs +perl-tidy +plantuml +plasma-desktop ppsspp -pygmentize python-isort python-netifaces python-pip @@ -95,31 +138,39 @@ qemu qutebrowser r rclone +reflector ripgrep rstcheck +rsync ruby ruby-jekyll ruby-travis -screenfetch sddm-kcm shfmt -smplayer +spectacle +sshfs steam -tor -ttf-hack -ttf-inconsolata +syncplay +texlive-langgreek +texlive-latexextra thunderbird +tor-browser +ttf-hack unzip valgrind vifm -vim vint virt-manager -wget whois wine words +xclip +xdg-user-dirs +xf86-video-amdgpu +xf86-video-intel +xorg-server yarn +yay youtube-dl zathura zathura-pdf-mupdf diff --git a/.stylelintrc.json b/.stylelintrc.json index d9273b7..c5f06c3 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -3,7 +3,6 @@ "plugins": ["stylelint-scss"], "rules": { "at-rule-name-case": "lower", - "at-rule-name-space-after": "never", "at-rule-semicolon-newline-after": "always", "at-rule-semicolon-space-before": "never", "block-closing-brace-empty-line-before": "never", diff --git a/.yarnrc b/.yarnrc index 6de2253..57a3de6 100644 --- a/.yarnrc +++ b/.yarnrc @@ -10,6 +10,6 @@ init-author-url "https://observeroftime.github.io" init-license MIT init-version "0.1.0" prefix "~/.local" -user-agent "yarn/1.21.1 node/v13.5.0 linux x64" +user-agent "yarn/1.22.4 node/v13.11.0 linux x64" username ObserverOfTime version-git-sign true diff --git a/README.md b/README.md index cc382a8..caab798 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,6 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) ## [Yarn](https://yarnpkg.com/lang/en/) -* [.config/yarn/global/package.json](.config/yarn/global/package.json): package list * [.yarnrc](.yarnrc): configuration file ## [Yay](https://github.com/Jguer/yay)