Implement bash-style comment for dependencies list

This commit is contained in:
clsty 2024-02-03 13:05:22 +08:00
parent df8a0a2bfc
commit aea096ce8d
7 changed files with 52 additions and 2357 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,12 @@
########## Input method ##########
env = GTK_IM_MODULE, fcitx
# See https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
env = GTK_IM_MODULE, wayland
env = QT_IM_MODULE, fcitx
env = XMODIFIERS, @im=fcitx
env = SDL_IM_MODULE, fcitx
env = GLFW_IM_MODULE, ibus
env = INPUT_METHOD, fcitx
############# Themes #############
env = QT_QPA_PLATFORM, wayland

4
.gitignore vendored
View file

@ -1,8 +1,6 @@
.config/ags/style.css
.config/ags/scripts/templates/gradience/preset.json
.config/ags/scss/_musicmaterial.scss
.config/ags/style.css
.config/ags/scss/_material.scss
.config/hypr/colors.conf
#.config/hypr/colors.conf
/cache
.config/ags/style.css

View file

@ -9,8 +9,11 @@ source ./scriptdata/functions
source ./scriptdata/installers
pkglistfile=$(mktemp)
pkglistfile_orig=./scriptdata/dependencies.txt
cat $pkglistfile_orig | sed "s_\ _\n_g" > $pkglistfile
pkglistfile_orig=./scriptdata/dependencies.conf
pkglistfile_orig_s=./cache/dependencies_stripped.conf
remove_bashcomments_emptylines $pkglistfile_orig $pkglistfile_orig_s
cat $pkglistfile_orig_s | sed "s_\ _\n_g" > $pkglistfile
echo "The non-existent pkgs in $pkglistfile_orig are listed as follows."
# Borrowed from https://bbs.archlinux.org/viewtopic.php?pid=1490795#p1490795

View file

@ -6,6 +6,7 @@ source ./scriptdata/installers
#####################################################################################
if ! command -v pacman >/dev/null 2>&1;then printf "\e[31m[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...\e[0m\n";exit 1;fi
prevent_sudo_or_root
startask (){
printf "\e[34m[$0]: Hi there!\n"
printf 'This script 1. only works for ArchLinux and Arch-based distros.\n'
@ -39,7 +40,8 @@ set -e
printf "\e[36m[$0]: 1. Get packages and add user to video/input groups\n\e[97m"
# Each line as an element of the array $pkglist
readarray -t pkglist < ./scriptdata/dependencies.txt
remove_bashcomments_emptylines ./scriptdata/dependencies.conf ./cache/dependencies_stripped.conf
readarray -t pkglist < ./cache/dependencies_stripped.conf
# NOTE: wayland-idle-inhibitor-git is for providing `wayland-idle-inhibitor.py' used by the `Keep system awake' button in `.config/ags/widgets/sideright/quicktoggles.js'.
if ! command -v yay >/dev/null 2>&1;then
@ -111,10 +113,10 @@ do
fi
done
target="$HOME/.config/hypr/colors.conf"
test -f $target || { \
echo -e "\e[34m[$0]: File \"$target\" not found.\e[0m" && \
v cp "$HOME/.config/hypr/colors_default.conf" $target ; }
# target="$HOME/.config/hypr/colors.conf"
# test -f $target || { \
# echo -e "\e[34m[$0]: File \"$target\" not found.\e[0m" && \
# v cp "$HOME/.config/hypr/colors_default.conf" $target ; }
# some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync,
# since the files here come from different places, not only about one program.

View file

@ -1,9 +1,32 @@
### This file support bash-style comments, and blank lines.
### PKGs on same line will be send to `yay` together, unless `-f` is specified.
### Basic
coreutils cliphist curl fuzzel rsync wget ripgrep gojq npm meson typescript gjs sassc
### Python
# Add `python-setuptools-scm` and `python-wheel` explicitly to fix #197
python-build python-material-color-utilities python-pillow python-poetry python-pywal python-setuptools-scm python-wheel
### Basic graphic env
hyprland-git xorg-xrandr
# xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-hyprland-git
### Player and Audio
pavucontrol wireplumber libdbusmenu-gtk3 plasma-browser-integration playerctl swww
### GTK
webp-pixbuf-loader gtk-layer-shell gtk3 gtksourceview3 gobject-introspection upower yad ydotool
### Gnome
polkit-gnome gnome-keyring gnome-control-center blueberry networkmanager brightnessctl wlsunset gnome-bluetooth-3.0
### Widgets
wayland-idle-inhibitor-git swayidle swaylock-effects-git wlogout wl-clipboard hyprpicker-git grim tesseract slurp
### Fonts and Themes
adw-gtk3-git gradience-git fontconfig lexend-fonts-git ttf-jetbrains-mono-nerd ttf-material-symbols-variable-git ttf-space-mono-nerd fish foot starship
swappy wf-recorder
### Screenshot and Recoder
swappy wf-recorder

View file

@ -63,3 +63,12 @@ function showfun() {
type -a $1
printf "\e[97m"
}
function remove_bashcomments_emptylines(){
mkdir -p $(dirname $2)
cat $1 | sed -e '/^[[:blank:]]*#/d;s/#.*//' -e '/^[[:space:]]*$/d' > $2
}
function prevent_sudo_or_root(){
case $(whoami) in
root)echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;;
esac
}