Add reflector configuration

Improve dirname on scripts
This commit is contained in:
2024-09-13 11:42:27 +02:00
parent d4539b6c2b
commit f8780fa846
8 changed files with 58 additions and 13 deletions

3
TODO
View File

@@ -2,7 +2,8 @@ install steam, wine and lib32 multilib #
basename opti ## basename opti ##
configure yazi # configure yazi #
nvim bufferline colors # nvim bufferline colors #
configure for work ### configure firefox hardening
configure trim (fstrim and luks)
## Hyprland ## Hyprland
wofi wofi
foot foot

View File

@@ -8,7 +8,7 @@ PACSTRAP_EXTRA_ARGS="-c"
### Switch to the script directory ### Switch to the script directory
cd "$(dirname "$0")" cd "$(dirname "$0")"
DIRNAME="$(pwd)" DIRNAME="$(pwd)"
source scripts/functions.sh source scripts/functions
### Format disk ### Format disk
sgdisk --clear \ sgdisk --clear \
@@ -20,6 +20,8 @@ partprobe "$DISK"
### Create Luks partition ### Create Luks partition
printf "%s\n" "root" | cryptsetup --batch-mode --verify-passphrase luksFormat /dev/disk/by-partlabel/SYS printf "%s\n" "root" | cryptsetup --batch-mode --verify-passphrase luksFormat /dev/disk/by-partlabel/SYS
printf "%s\n" "root" | cryptsetup open /dev/disk/by-partlabel/SYS rootfs printf "%s\n" "root" | cryptsetup open /dev/disk/by-partlabel/SYS rootfs
cryptsetup config /dev/disk/by-partlabel/SYS --label sys
cryptsetup --allow-discards --persistent refresh rootfs
### Create filesystem ### Create filesystem
mkfs.fat -F32 -n efi /dev/disk/by-partlabel/EFI mkfs.fat -F32 -n efi /dev/disk/by-partlabel/EFI

View File

@@ -102,6 +102,7 @@ client.background $bg
exec_always --no-startup-id /usr/local/share/dotfiles/scripts/wallpapers.sh exec_always --no-startup-id /usr/local/share/dotfiles/scripts/wallpapers.sh
exec_always --no-startup-id "killall picom ; picom" exec_always --no-startup-id "killall picom ; picom"
exec_always --no-startup-id "killall dunst ; dunst" exec_always --no-startup-id "killall dunst ; dunst"
exec_always --no-startup-id "killall nextcloud ; nextcloud"
################# #################
# Apps shortcut # # Apps shortcut #

View File

@@ -0,0 +1,33 @@
# Reflector configuration file for the systemd service.
#
# Empty lines and lines beginning with "#" are ignored. All other lines should
# contain valid reflector command-line arguments. The lines are parsed with
# Python's shlex modules so standard shell syntax should work. All arguments are
# collected into a single argument list.
#
# See "reflector --help" for details.
# Recommended Options
# Set the output path where the mirrorlist will be saved (--save).
--save /etc/pacman.d/mirrorlist
# Select the transfer protocol (--protocol).
--protocol https
# Select the country (--country).
# Consult the list of available countries with "reflector --list-countries" and
# select the countries nearest to you or the ones that you trust. For example:
# --country France,Germany
# Use only the most recently synchronized mirrors (--latest).
--latest 5
# Sort the mirrors by synchronization time (--sort).
--sort age
--fastest 6
--score 6
--download-timeout 1

View File

@@ -1,8 +1,7 @@
#!/bin/bash #!/bin/bash
_BASENAME=$(basename "$0") cd -- "$(dirname -- "$0")" || exit
_DIRNAME="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)" _DIRNAME="$(pwd)"
cd "$_DIRNAME" || _exit 1
_URL=$(grep -Ev "^#" ./bookmarks | rofi -dmenu -i -p Bookmarks) _URL=$(grep -Ev "^#" ./bookmarks | rofi -dmenu -i -p Bookmarks)

View File

@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
source ./scripts/variables
_template() { _template() {
source ./scripts/variables
sed -i "s|{{foreground}}|$foreground|" "$1" sed -i "s|{{foreground}}|$foreground|" "$1"
sed -i "s|{{foreground_light}}|$foreground_light|" "$1" sed -i "s|{{foreground_light}}|$foreground_light|" "$1"
sed -i "s|{{foreground_lighter}}|$foreground_lighter|" "$1" sed -i "s|{{foreground_lighter}}|$foreground_lighter|" "$1"
@@ -29,8 +30,6 @@ _template() {
} }
_kernel_colors() { _kernel_colors() {
source ./scripts/variables
printf "\e[32m==> Generating for kernel arg\e[0m\n"
transform_colors () transform_colors ()
{ {
printf "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" \ printf "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" \

View File

@@ -1,8 +1,6 @@
#!/bin/bash #!/bin/bash
_BASENAME=$(basename "$0") cd -- "$(dirname -- "$0")" || exit
_DIRNAME="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)"
cd "$_DIRNAME" || _exit 1
## if not $1 ## if not $1
if [[ -z $1 ]] if [[ -z $1 ]]

View File

@@ -9,13 +9,16 @@ source ./scripts/functions
### Global variables ### Global variables
_DIRNAME="$(pwd)" _DIRNAME="$(pwd)"
_PACKAGES=(arc-gtk-theme chromium code curl discord dmenu dunst egl-wayland feh flameshot flatpak firefox htop hyprland i3lock i3-wm imagemagick lxappearance mpv nwg-look otf-comicshanns-nerd pavucontrol pipewire pipewire-jack pipewire-pulse polybar neofetch numlockx papirus-icon-theme picom plocate polybar remmina ttf-dejavu-nerd wget wireguard-tools xdg-desktop-portal xorg xorg-xinit) _PACKAGES=(arc-gtk-theme chromium code curl discord dmenu dunst egl-wayland feh flameshot flatpak firefox htop hyprland i3lock i3-wm imagemagick kitty lxappearance mpv neofetch numlockx nwg-look otf-comicshanns-nerd papirus-icon-theme pavucontrol picom pipewire pipewire-jack pipewire-pulse rofi plocate polybar reflector remmina ttf-dejavu-nerd wget wireguard-tools xdg-desktop-portal xorg xorg-xinit)
### Configure pacman and install needeed packages ### Configure pacman and install needeed packages
_info "Configuring and updateing packages" _info "Configuring and updateing packages"
_msg "Configuring pacman" _msg "Configuring pacman"
sed -i "s|^#Color.*|Color|" /etc/pacman.conf sed -i "s|^#Color.*|Color|" /etc/pacman.conf
sed -i "s|^#ParallelDownloads.*|ParallelDownloads = 10|" /etc/pacman.conf sed -i "s|^#ParallelDownloads.*|ParallelDownloads = 10|" /etc/pacman.conf
_msg "Configuring reflector"
ln -sf "$_DIRNAME/links/reflector/reflector.conf" /etc/xdg/reflector/reflector.conf
ln -sf "/usr/lib/systemd/system/reflector.timer" "/etc/systemd/system/timers.target.wants/reflector.timer"
_msg "Updating packages" _msg "Updating packages"
pacman -Syu --noconfirm pacman -Syu --noconfirm
_msg "Installing needeed packages" _msg "Installing needeed packages"
@@ -77,6 +80,8 @@ mkdir -p ~/.local/share/applications
ln -sf "$_DIRNAME/links/applications/teams.desktop" ~/.local/share/applications/teams.desktop ln -sf "$_DIRNAME/links/applications/teams.desktop" ~/.local/share/applications/teams.desktop
sed -i "s|^Exec=.*|Exec=code-oss --no-sandbox|" /usr/share/applications/code-oss.desktop sed -i "s|^Exec=.*|Exec=code-oss --no-sandbox|" /usr/share/applications/code-oss.desktop
sed -i "s|^Icon=.*|Icon=vscode|" /usr/share/applications/code-oss.desktop sed -i "s|^Icon=.*|Icon=vscode|" /usr/share/applications/code-oss.desktop
sed -i 's|Exec=/usr/bin/chromium %U|Exec=/usr/bin/chromium --no-sandbox %U|' /usr/share/applications/chromium.desktop
sed -i 's|Exec=/usr/bin/chromium --incognito|Exec=/usr/bin/chromium --no-sandbox --incognito|' /usr/share/applications/chromium.desktop
_msg "links kitty" _msg "links kitty"
mkdir -p ~/.config/kitty mkdir -p ~/.config/kitty
ln -sf "$_DIRNAME/links/kitty/kitty.conf" ~/.config/kitty/kitty.conf ln -sf "$_DIRNAME/links/kitty/kitty.conf" ~/.config/kitty/kitty.conf
@@ -94,14 +99,21 @@ then
fi fi
if [[ $_LOCATION == "home" ]] if [[ $_LOCATION == "home" ]]
then then
_info "Configuring for work" _info "Configuring for home"
sed -i "s|^include /etc/i3.*|include /etc/i3/home|" ./links/i3wm/config sed -i "s|^include /etc/i3.*|include /etc/i3/home|" ./links/i3wm/config
sed -i "s|^include-file = /etc/polybar/work.ini|include-file = /etc/polybar/home.ini|" ./links/polybar/config.ini sed -i "s|^include-file = /etc/polybar/work.ini|include-file = /etc/polybar/home.ini|" ./links/polybar/config.ini
fi fi
### Add no sandbox
_info "Add --no-sandbox if needed"
### nvidia vs amd ### nvidia vs amd
### Print kernel cmdline ### Print kernel cmdline
_info "Dont forget to update /etc/hernel/cmdline (require mkinitcpio -P after)"
printf "cryptdevice=UUID=%s:rootfs root=UUID=%s rootflags=subvol=@ rw initrd=\\intel-ucode.img initrd=\\initramfs-linux.img loglevel=3 %s intel_iommu=on iommu=pt nvidia_drm.fbdev=1 nvidia_drm.modeset=1\n" \
"$(blkid --match-token LABEL=sys -s UUID -o value)" \
"$(blkid --match-token LABEL=root -s UUID -o value)" \
"$(_kernel_colors)"
### Wait for user ### Wait for user
_info "Update sucessfull" _info "Update sucessfull"