improved chaining of programs in bash scripts

This commit is contained in:
aminnairi
2025-11-11 13:44:23 +01:00
parent fc9b2f1dcf
commit c8cea20981
9 changed files with 101 additions and 94 deletions
+10 -10
View File
@@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed git \ ensure_package_is_installed git &&
&& ensure_package_is_installed github-cli \ ensure_package_is_installed github-cli &&
&& ensure_git_configuration_set "user.name" \ ensure_git_configuration_set "user.name" &&
&& ensure_git_configuration_set "user.email" \ ensure_git_configuration_set "user.email" &&
&& ensure_git_configuration_set "init.defaultbranch" \ ensure_git_configuration_set "init.defaultbranch" &&
&& ensure_root_git_configuration_set "user.name" \ ensure_root_git_configuration_set "user.name" &&
&& ensure_root_git_configuration_set "user.email" \ ensure_root_git_configuration_set "user.email" &&
&& ensure_root_git_configuration_set "init.defaultbranch" \ ensure_root_git_configuration_set "init.defaultbranch" &&
&& ensure_ssh_key_installed \ ensure_ssh_key_installed &&
&& ensure_github_cli_authenticated ensure_github_cli_authenticated
+39 -38
View File
@@ -1,40 +1,41 @@
#!/bin/bash #!/bin/bash
ensure_system_is_updated \ ensure_system_is_updated &&
&& ensure_package_is_installed sudo \ ensure_package_is_installed sudo &&
&& ensure_git_configuration_set "user.name" \ ensure_git_configuration_set "user.name" &&
&& ensure_git_configuration_set "user.email" \ ensure_git_configuration_set "user.email" &&
&& ensure_git_configuration_set "init.defaultbranch" \ ensure_git_configuration_set "init.defaultbranch" &&
&& ensure_ssh_key_installed \ ensure_ssh_key_installed &&
&& ensure_package_is_installed linux \ ensure_package_is_installed linux &&
&& ensure_package_is_installed linux-headers \ ensure_package_is_installed linux-headers &&
&& ensure_package_is_installed linux-firmware \ ensure_package_is_installed linux-firmware &&
&& ensure_package_is_installed grub \ ensure_package_is_installed grub &&
&& ensure_package_is_installed efibootmgr \ ensure_package_is_installed efibootmgr &&
&& ensure_package_is_installed mesa \ ensure_package_is_installed mesa &&
&& ensure_package_is_installed syncthing \ ensure_package_is_installed syncthing &&
&& ensure_package_is_installed man \ ensure_package_is_installed man &&
&& ensure_package_is_installed bpytop \ ensure_package_is_installed bpytop &&
&& ensure_package_is_installed bind \ ensure_package_is_installed bind &&
&& ensure_package_is_installed which \ ensure_package_is_installed which &&
&& ensure_package_is_installed fd \ ensure_package_is_installed fd &&
&& ensure_package_is_installed python \ ensure_package_is_installed python &&
&& ensure_package_is_installed ruby \ ensure_package_is_installed ruby &&
&& ensure_package_is_installed php \ ensure_package_is_installed php &&
&& ensure_package_is_installed composer \ ensure_package_is_installed composer &&
&& ensure_package_is_installed luarocks \ ensure_package_is_installed luarocks &&
&& ensure_package_is_installed wget \ ensure_package_is_installed wget &&
&& ensure_package_is_installed unzip \ ensure_package_is_installed unzip &&
&& ensure_package_is_installed zip \ ensure_package_is_installed zip &&
&& ensure_package_is_installed rsync \ ensure_package_is_installed rsync &&
&& ensure_package_is_installed tokei \ ensure_package_is_installed tokei &&
&& ensure_package_is_installed texlive-bin \ ensure_package_is_installed texlive-bin &&
&& ensure_package_is_installed neovim \ ensure_package_is_installed neovim &&
&& ensure_package_is_installed chromium \ ensure_package_is_installed chromium &&
&& ensure_package_is_installed firefox \ ensure_package_is_installed firefox &&
&& ensure_package_is_installed cheat \ ensure_package_is_installed cheat &&
&& ensure_package_is_installed posting \ ensure_package_is_installed posting &&
&& ensure_package_is_installed thefuck \ ensure_package_is_installed thefuck &&
&& ensure_package_is_installed dust \ ensure_package_is_installed dust &&
&& ensure_graphics_packages_installed \ ensure_package_is_installed wttr &&
&& ensure_mkinitcpio_configured_for linux ensure_graphics_packages_installed &&
ensure_mkinitcpio_configured_for linux
+6 -5
View File
@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed docker \ ensure_package_is_installed docker &&
&& ensure_package_is_installed docker-compose \ ensure_package_is_installed docker-compose &&
&& ensure_package_is_installed lazydocker \ ensure_package_is_installed lazydocker &&
&& ensure_group_is_installed docker \ ensure_group_is_installed docker &&
&& ensure_service_active docker ensure_service_active docker
+16 -15
View File
@@ -1,17 +1,18 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed fish \ ensure_package_is_installed fish &&
&& ensure_package_is_installed eza \ ensure_package_is_installed eza &&
&& ensure_package_is_installed bat \ ensure_package_is_installed bat &&
&& ensure_package_is_installed fastfetch \ ensure_package_is_installed fastfetch &&
&& ensure_package_is_installed openvpn \ ensure_package_is_installed openvpn &&
&& ensure_package_is_installed fzf \ ensure_package_is_installed fzf &&
&& synchronize_user_folder ./sources/fish ~/.config \ synchronize_user_folder ./sources/fish ~/.config &&
&& synchronize_user_folder ./sources/omf ~/.config \ synchronize_user_folder ./sources/omf ~/.config &&
&& synchronize_root_folder ./sources/fish /root/.config \ synchronize_root_folder ./sources/fish /root/.config &&
&& synchronize_root_folder ./sources/omf /root/.config \ synchronize_root_folder ./sources/omf /root/.config &&
&& ensure_git_folder_installed_for_user oh-my-fish/oh-my-fish ~/.local/share/omf \ ensure_git_folder_installed_for_user oh-my-fish/oh-my-fish ~/.local/share/omf &&
&& ensure_git_folder_installed_for_user oh-my-fish/theme-agnoster ~/.local/share/omf/themes/agnoster \ ensure_git_folder_installed_for_user oh-my-fish/theme-agnoster ~/.local/share/omf/themes/agnoster &&
&& ensure_git_folder_installed_for_root oh-my-fish/oh-my-fish /root/.local/share/omf \ ensure_git_folder_installed_for_root oh-my-fish/oh-my-fish /root/.local/share/omf &&
&& ensure_git_folder_installed_for_root oh-my-fish/theme-agnoster /root/.local/share/omf/themes/agnoster \ ensure_git_folder_installed_for_root oh-my-fish/theme-agnoster /root/.local/share/omf/themes/agnoster &&
&& ensure_shell_installed fish ensure_shell_installed fish
+8 -7
View File
@@ -1,9 +1,10 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed ttf-jetbrains-mono-nerd \ ensure_package_is_installed ttf-jetbrains-mono-nerd &&
&& ensure_package_is_installed noto-fonts \ ensure_package_is_installed noto-fonts &&
&& ensure_package_is_installed noto-fonts-emoji \ ensure_package_is_installed noto-fonts-emoji &&
&& ensure_package_is_installed noto-fonts-cjk \ ensure_package_is_installed noto-fonts-cjk &&
&& ensure_package_is_installed noto-fonts-ar \ ensure_package_is_installed noto-fonts-ar &&
&& synchronize_user_folder ./sources/fontconfig ~/.config \ synchronize_user_folder ./sources/fontconfig ~/.config &&
&& synchronize_root_folder ./sources/fontconfig /root/.config synchronize_root_folder ./sources/fontconfig /root/.config
+6 -5
View File
@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
ensure_package_group_is_installed gnome \ ensure_package_group_is_installed gnome &&
&& ensure_package_group_is_installed gnome-extra \ ensure_package_group_is_installed gnome-extra &&
&& ensure_package_is_installed python-psutil \ ensure_package_is_installed python-psutil &&
&& ensure_service_active gdm \ ensure_service_active gdm &&
&& ensure_gnome_setting_set "org.gnome.desktop.input-sources" "xkb-options" "['compose:ralt']" ensure_gnome_setting_set "org.gnome.desktop.input-sources" "xkb-options" "['compose:ralt']"
+6 -5
View File
@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed kitty \ ensure_package_is_installed kitty &&
&& ensure_package_is_installed viu \ ensure_package_is_installed viu &&
&& ensure_package_is_installed ueberzugpp \ ensure_package_is_installed ueberzugpp &&
&& synchronize_user_folder ./sources/kitty ~/.config \ synchronize_user_folder ./sources/kitty ~/.config &&
&& synchronize_root_folder ./sources/kitty /root/.config synchronize_root_folder ./sources/kitty /root/.config
+6 -5
View File
@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed tmux \ ensure_package_is_installed tmux &&
&& ensure_git_folder_installed_for_user tmux-plugins/tpm ~/.tmux/plugins/tpm \ ensure_git_folder_installed_for_user tmux-plugins/tpm ~/.tmux/plugins/tpm &&
&& ensure_git_folder_installed_for_root tmux-plugins/tpm /root/.tmux/plugins/tpm \ ensure_git_folder_installed_for_root tmux-plugins/tpm /root/.tmux/plugins/tpm &&
&& synchronize_user_folder ./sources/tmux/.tmux.conf ~/.config \ synchronize_user_folder ./sources/tmux/.tmux.conf ~/.config &&
&& synchronize_root_folder ./sources/tmux/.tmux.conf /root/.config synchronize_root_folder ./sources/tmux/.tmux.conf /root/.config
+4 -4
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ensure_package_is_installed syncthing \ ensure_package_is_installed syncthing &&
&& ensure_user_folder_present ~/.config/systemd/user \ ensure_user_folder_present ~/.config/systemd/user &&
&& synchronize_user_folder ./sources/syncthing/syncthing.service ~/.config/systemd/user \ synchronize_user_folder ./sources/syncthing/syncthing.service ~/.config/systemd/user &&
&& ensure_user_service_active syncthing ensure_user_service_active syncthing