Added reflector, fzf and renamed the pack file. hooks + udev

master
Toerd@iArch 6 years ago
parent 0d96213094
commit e35a11a1e3

@ -21,7 +21,7 @@ done
device=${device:="480"} device=${device:="480"}
repo=${repo:="https://toerd@bitbucket.org/toerd/dotfiles"} repo=${repo:="https://toerd@bitbucket.org/toerd/dotfiles"}
prog=${prog:="$scriptdir/pack.list"} prog=${prog:="$scriptdir/pack.csv"}
aurhelper=${aurhelper:="yay"} aurhelper=${aurhelper:="yay"}
@ -99,10 +99,10 @@ install_aur_helper() {
installation_loop() { installation_loop() {
echo "Entered installationloop\n\n" >> $logfile echo "Entered installationloop\n\n" >> $logfile
([ -f "$prog" ] && cp "$prog" /tmp/pack.list) || curl -Ls "$prog" > /tmp/pack.list ([ -f "$prog" ] && cp "$prog" /tmp/pack.csv) || curl -Ls "$prog" > /tmp/pack.csv
ps=$(grep -e ",P," /tmp/pack.list | wc -l) ps=$(grep -e ",P," /tmp/pack.csv | wc -l)
as=$(grep -e ",A," /tmp/pack.list | wc -l) as=$(grep -e ",A," /tmp/pack.csv | wc -l)
ms=$(grep -e ",M," /tmp/pack.list | wc -l) ms=$(grep -e ",M," /tmp/pack.csv | wc -l)
aur_already_installed=$(pacman -Qqm) aur_already_installed=$(pacman -Qqm)
#IFS separator #IFS separator
while IFS=, read -r platform prefix program info; do while IFS=, read -r platform prefix program info; do
@ -116,7 +116,7 @@ installation_loop() {
A) install_aur "$program" "$info" ;; A) install_aur "$program" "$info" ;;
M) install_manual "$program" "$info" ;; M) install_manual "$program" "$info" ;;
esac esac
done < /tmp/pack.list done < /tmp/pack.csv
} }
enable_service() { enable_service() {
@ -152,12 +152,45 @@ ready_steady_go() {
dialog --title "WE ARE DONE" --msgbox "The installation is complete\n\n#fingerscrossed everything worked :D" 0 0 ; dialog --title "WE ARE DONE" --msgbox "The installation is complete\n\n#fingerscrossed everything worked :D" 0 0 ;
} }
uncom() {
sed -i '/'"$1"'/s/^#//g' $2
}
com() {
sed -i '/'"$1"'/s/^/#/g' $2
}
add_after() {
# Example:
# add_after "Color" 'tt="ILoveCandy"' "$HOME/test/pacman.conf"
# add_after "Color" 'tt="ILoveCandy"' "$HOME/test/pacman.conf"
sed -i '/'"$1"'/a '"$2"'' $3
}
add_udev_rules() {
cp "$scriptdir/udev/*" /etc/udev/rules.d/
}
add_pacman_hooks() {
mkdir -p /etc/pacman.d/hooks
cp "$scriptdir/pacman/hooks/*" /etc/pacman.d/hooks/
}
set_pacman_config() {
pconf="/etc/pacman.conf"
uncom "Color" $pconf
uncom "TotalDownload" $pconf
uncom "VerbosePkgLists" $pconf
add_after "VerbosePkgLists" "ILoveCandy" $pconf
}
set_system_stuff() { set_system_stuff() {
# locale gen # locale gen
sudo localectl --no-convert set-x11-keymap us ,altgr-intl localectl --no-convert set-x11-keymap us ,altgr-intl
setxkbmap us -variant altgr-intl setxkbmap us -variant altgr-intl
set_pacman_conf
add_udev_rules
} }
# ACTUAL ROUTINE # ACTUAL ROUTINE
init init
@ -172,6 +205,5 @@ download_dotfiles
set_permissions "%wheel ALL=(ALL) ALL\\n%wheel ALL=(ALL) NOPASSWD: /usr/bin/shutdown,/usr/bin/reboot,/usr/bin/systemctl suspend,/usr/bin/wifi-menu,/usr/bin/mount,/usr/bin/umount,/usr/bin/pacman -Syu,/usr/bin/pacman -Syyu,/usr/bin/packer -Syu,/usr/bin/packer -Syyu,/usr/bin/systemctl restart NetworkManager,/usr/bin/rc-service NetworkManager restart,/usr/bin/pacman -Syyu --noconfirm,/usr/bin/loadkeys,/usr/bin/yay" set_permissions "%wheel ALL=(ALL) ALL\\n%wheel ALL=(ALL) NOPASSWD: /usr/bin/shutdown,/usr/bin/reboot,/usr/bin/systemctl suspend,/usr/bin/wifi-menu,/usr/bin/mount,/usr/bin/umount,/usr/bin/pacman -Syu,/usr/bin/pacman -Syyu,/usr/bin/packer -Syu,/usr/bin/packer -Syyu,/usr/bin/systemctl restart NetworkManager,/usr/bin/rc-service NetworkManager restart,/usr/bin/pacman -Syyu --noconfirm,/usr/bin/loadkeys,/usr/bin/yay"
no_beep no_beep
set_system_stuff set_system_stuff
sed -i "s/#Color^/Color/g" /etc/pacman.conf
ready_steady_go ready_steady_go
clear clear

@ -16,6 +16,8 @@ L,P,acpid,A daemon for delivering ACPI power management events with netlink supp
A,P,pulseaudio,A featureful general-purpose sound server A,P,pulseaudio,A featureful general-purpose sound server
A,P,openssh,ssh A,P,openssh,ssh
# Package management
A,P,reflector,sort mirrorlist
# Fonts # Fonts
A,A,nerd-fonts-hack,Systemfont A,A,nerd-fonts-hack,Systemfont
@ -70,6 +72,7 @@ A,P,pass,Stores retrieves generates and synchronizes passwords securely
A,P,zip,Compressor/archiver for creating and modifying zipfiles A,P,zip,Compressor/archiver for creating and modifying zipfiles
A,P,p7zip,Command-line file archiver with high compression ratio A,P,p7zip,Command-line file archiver with high compression ratio
A,P,ripgrep,A search tool that combines the usability of ag with the raw speed of grep A,P,ripgrep,A search tool that combines the usability of ag with the raw speed of grep
A,P,fzf,fuzzy bash completion
# Tools # Tools
A,P,flameshot,snipping tool for screenshots and stuff A,P,flameshot,snipping tool for screenshots and stuff
1 # First column: A = All, L = Laptop, D = Desktop
16 A,P,openssh,ssh
17 # Fonts # Package management
18 A,A,nerd-fonts-hack,Systemfont A,P,reflector,sort mirrorlist
19 # Fonts
20 A,A,nerd-fonts-hack,Systemfont
21 A,P,ttf-hack,Systemfont fallback
22 A,A,ttf-font-awesome-4,Glyphs fallback
23 A,A,ttf-unifont,more font support
72
73
74
75
76
77
78

@ -0,0 +1,11 @@
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = pacman-mirrorlist
[Action]
Description = Updating mirrorlist with reflector...
When = PostTransaction
Depends = reflector
Exec = sudo reflector --verbose --latest 40 --number 10 --sort rate --protocol https --save /etc/pacman.d/mirrorlist
Loading…
Cancel
Save