From c1a2059a1acf9f8396a9a9f0b60f9b2998a1f808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Mendelski?= Date: Sat, 30 Sep 2023 17:01:33 +0200 Subject: [PATCH] rename init tot sysinit --- .gitignore | 1 - {_init => _sysinit}/cloudvm/init.sh | 0 .../Create New File.workflow/Contents/Info.plist | 0 .../Contents/QuickLook/Thumbnail.png | Bin .../Contents/document.wflow | 0 {_init => _sysinit}/macos/config.sh | 8 ++++++-- {_init => _sysinit}/macos/init.sh | 0 .../com.googlecode.iterm2.plist-backup | 0 {_init => _sysinit}/macos/iterm2-backup/tmux.json | 0 .../macos/iterm2-backup/tokyo-night-day.itermcolors | 0 .../macos/iterm2-backup/tokyo-night.itermcolors | 0 .../macos/iterm2/com.googlecode.iterm2.plist | 0 {_init => _sysinit}/macos/iterm2/profile-tmux.json | 0 .../macos/iterm2/tmux-keybindings.itermkeymap | 0 {_init => _sysinit}/macos/packages.sh | 2 +- {_init => _sysinit}/macos/scripts/sublime | 0 {_init => _sysinit}/macos/scripts/vscode | 0 {_init => _sysinit}/macos/vscode/settings.json | 0 {_init => _sysinit}/ubuntu-server/config.sh | 0 {_init => _sysinit}/ubuntu-server/init.sh | 0 {_init => _sysinit}/ubuntu-server/packages.sh | 0 {_init => _sysinit}/ubuntu/config.sh | 0 {_init => _sysinit}/ubuntu/init.sh | 0 {_init => _sysinit}/ubuntu/nautilus/Code | 0 {_init => _sysinit}/ubuntu/nautilus/Smaller Image | 0 {_init => _sysinit}/ubuntu/nautilus/Sublime | 0 {_init => _sysinit}/ubuntu/packages.sh | 0 {_init => _sysinit}/ubuntu/packages/docker.sh | 0 {_init => _sysinit}/ubuntu/packages/media.sh | 0 {_init => _sysinit}/ubuntu/packages/net.sh | 0 {_init => _sysinit}/ubuntu/packages/system-gui.sh | 0 {_init => _sysinit}/ubuntu/packages/system.sh | 0 {_init => _sysinit}/ubuntu/packages/theme.sh | 0 {_init => _sysinit}/ubuntu/templates/Bash Script.sh | 0 .../ubuntu/templates/Executable Bash Script.sh | 0 {_init => _sysinit}/ubuntu/templates/Text File.txt | 0 check.sh | 2 +- readme.md | 4 ++-- init.sh => sysinit.sh | 6 +++--- 39 files changed, 13 insertions(+), 10 deletions(-) rename {_init => _sysinit}/cloudvm/init.sh (100%) rename {_init => _sysinit}/macos/automator/Create New File.workflow/Contents/Info.plist (100%) rename {_init => _sysinit}/macos/automator/Create New File.workflow/Contents/QuickLook/Thumbnail.png (100%) rename {_init => _sysinit}/macos/automator/Create New File.workflow/Contents/document.wflow (100%) rename {_init => _sysinit}/macos/config.sh (99%) rename {_init => _sysinit}/macos/init.sh (100%) rename {_init => _sysinit}/macos/iterm2-backup/com.googlecode.iterm2.plist-backup (100%) rename {_init => _sysinit}/macos/iterm2-backup/tmux.json (100%) rename {_init => _sysinit}/macos/iterm2-backup/tokyo-night-day.itermcolors (100%) rename {_init => _sysinit}/macos/iterm2-backup/tokyo-night.itermcolors (100%) rename {_init => _sysinit}/macos/iterm2/com.googlecode.iterm2.plist (100%) rename {_init => _sysinit}/macos/iterm2/profile-tmux.json (100%) rename {_init => _sysinit}/macos/iterm2/tmux-keybindings.itermkeymap (100%) rename {_init => _sysinit}/macos/packages.sh (99%) rename {_init => _sysinit}/macos/scripts/sublime (100%) rename {_init => _sysinit}/macos/scripts/vscode (100%) rename {_init => _sysinit}/macos/vscode/settings.json (100%) rename {_init => _sysinit}/ubuntu-server/config.sh (100%) rename {_init => _sysinit}/ubuntu-server/init.sh (100%) rename {_init => _sysinit}/ubuntu-server/packages.sh (100%) rename {_init => _sysinit}/ubuntu/config.sh (100%) rename {_init => _sysinit}/ubuntu/init.sh (100%) rename {_init => _sysinit}/ubuntu/nautilus/Code (100%) rename {_init => _sysinit}/ubuntu/nautilus/Smaller Image (100%) rename {_init => _sysinit}/ubuntu/nautilus/Sublime (100%) rename {_init => _sysinit}/ubuntu/packages.sh (100%) rename {_init => _sysinit}/ubuntu/packages/docker.sh (100%) rename {_init => _sysinit}/ubuntu/packages/media.sh (100%) rename {_init => _sysinit}/ubuntu/packages/net.sh (100%) rename {_init => _sysinit}/ubuntu/packages/system-gui.sh (100%) rename {_init => _sysinit}/ubuntu/packages/system.sh (100%) rename {_init => _sysinit}/ubuntu/packages/theme.sh (100%) rename {_init => _sysinit}/ubuntu/templates/Bash Script.sh (100%) rename {_init => _sysinit}/ubuntu/templates/Executable Bash Script.sh (100%) rename {_init => _sysinit}/ubuntu/templates/Text File.txt (100%) rename init.sh => sysinit.sh (87%) diff --git a/.gitignore b/.gitignore index 3191428..4128bd1 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ zsh/.zsh/deps zsh/.zsh/ohmyzsh tmux/.tmux/tmp tmux/.tmux/deps -_init/ubuntu/conky/tmp !.gitkeep .DS_Store .netrwhist diff --git a/_init/cloudvm/init.sh b/_sysinit/cloudvm/init.sh similarity index 100% rename from _init/cloudvm/init.sh rename to _sysinit/cloudvm/init.sh diff --git a/_init/macos/automator/Create New File.workflow/Contents/Info.plist b/_sysinit/macos/automator/Create New File.workflow/Contents/Info.plist similarity index 100% rename from _init/macos/automator/Create New File.workflow/Contents/Info.plist rename to _sysinit/macos/automator/Create New File.workflow/Contents/Info.plist diff --git a/_init/macos/automator/Create New File.workflow/Contents/QuickLook/Thumbnail.png b/_sysinit/macos/automator/Create New File.workflow/Contents/QuickLook/Thumbnail.png similarity index 100% rename from _init/macos/automator/Create New File.workflow/Contents/QuickLook/Thumbnail.png rename to _sysinit/macos/automator/Create New File.workflow/Contents/QuickLook/Thumbnail.png diff --git a/_init/macos/automator/Create New File.workflow/Contents/document.wflow b/_sysinit/macos/automator/Create New File.workflow/Contents/document.wflow similarity index 100% rename from _init/macos/automator/Create New File.workflow/Contents/document.wflow rename to _sysinit/macos/automator/Create New File.workflow/Contents/document.wflow diff --git a/_init/macos/config.sh b/_sysinit/macos/config.sh similarity index 99% rename from _init/macos/config.sh rename to _sysinit/macos/config.sh index a392589..785e644 100755 --- a/_init/macos/config.sh +++ b/_sysinit/macos/config.sh @@ -9,7 +9,11 @@ osascript -e 'tell application "System Preferences" to quit' sudo -v # Keep-alive: update existing `sudo` time stamp until `.macos` has finished -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & +while true; do + sudo -n true + sleep 60 + kill -0 "$$" || exit +done 2>/dev/null & ############################################################################### # General UI/UX # @@ -270,7 +274,7 @@ for app in \ "Safari" \ "SystemUIServer" \ "iCal"; do - killall "${app}" &> /dev/null + killall "${app}" &>/dev/null done ############################################################################### diff --git a/_init/macos/init.sh b/_sysinit/macos/init.sh similarity index 100% rename from _init/macos/init.sh rename to _sysinit/macos/init.sh diff --git a/_init/macos/iterm2-backup/com.googlecode.iterm2.plist-backup b/_sysinit/macos/iterm2-backup/com.googlecode.iterm2.plist-backup similarity index 100% rename from _init/macos/iterm2-backup/com.googlecode.iterm2.plist-backup rename to _sysinit/macos/iterm2-backup/com.googlecode.iterm2.plist-backup diff --git a/_init/macos/iterm2-backup/tmux.json b/_sysinit/macos/iterm2-backup/tmux.json similarity index 100% rename from _init/macos/iterm2-backup/tmux.json rename to _sysinit/macos/iterm2-backup/tmux.json diff --git a/_init/macos/iterm2-backup/tokyo-night-day.itermcolors b/_sysinit/macos/iterm2-backup/tokyo-night-day.itermcolors similarity index 100% rename from _init/macos/iterm2-backup/tokyo-night-day.itermcolors rename to _sysinit/macos/iterm2-backup/tokyo-night-day.itermcolors diff --git a/_init/macos/iterm2-backup/tokyo-night.itermcolors b/_sysinit/macos/iterm2-backup/tokyo-night.itermcolors similarity index 100% rename from _init/macos/iterm2-backup/tokyo-night.itermcolors rename to _sysinit/macos/iterm2-backup/tokyo-night.itermcolors diff --git a/_init/macos/iterm2/com.googlecode.iterm2.plist b/_sysinit/macos/iterm2/com.googlecode.iterm2.plist similarity index 100% rename from _init/macos/iterm2/com.googlecode.iterm2.plist rename to _sysinit/macos/iterm2/com.googlecode.iterm2.plist diff --git a/_init/macos/iterm2/profile-tmux.json b/_sysinit/macos/iterm2/profile-tmux.json similarity index 100% rename from _init/macos/iterm2/profile-tmux.json rename to _sysinit/macos/iterm2/profile-tmux.json diff --git a/_init/macos/iterm2/tmux-keybindings.itermkeymap b/_sysinit/macos/iterm2/tmux-keybindings.itermkeymap similarity index 100% rename from _init/macos/iterm2/tmux-keybindings.itermkeymap rename to _sysinit/macos/iterm2/tmux-keybindings.itermkeymap diff --git a/_init/macos/packages.sh b/_sysinit/macos/packages.sh similarity index 99% rename from _init/macos/packages.sh rename to _sysinit/macos/packages.sh index c129f9b..09d5d6d 100755 --- a/_init/macos/packages.sh +++ b/_sysinit/macos/packages.sh @@ -250,7 +250,7 @@ echo " - Finder > Right Click Toolbar > Customize > ..." echo "" echo "iTerm2" echo "- Read settings from file: Preferences > General > Preferences" -echo " Read from file .dotfiles/_init/macos/iterm2" +echo " Read from file .dotfiles/_sysinit/macos/iterm2" echo "" echo "Other" echo "- Fix keyboard shortcuts" diff --git a/_init/macos/scripts/sublime b/_sysinit/macos/scripts/sublime similarity index 100% rename from _init/macos/scripts/sublime rename to _sysinit/macos/scripts/sublime diff --git a/_init/macos/scripts/vscode b/_sysinit/macos/scripts/vscode similarity index 100% rename from _init/macos/scripts/vscode rename to _sysinit/macos/scripts/vscode diff --git a/_init/macos/vscode/settings.json b/_sysinit/macos/vscode/settings.json similarity index 100% rename from _init/macos/vscode/settings.json rename to _sysinit/macos/vscode/settings.json diff --git a/_init/ubuntu-server/config.sh b/_sysinit/ubuntu-server/config.sh similarity index 100% rename from _init/ubuntu-server/config.sh rename to _sysinit/ubuntu-server/config.sh diff --git a/_init/ubuntu-server/init.sh b/_sysinit/ubuntu-server/init.sh similarity index 100% rename from _init/ubuntu-server/init.sh rename to _sysinit/ubuntu-server/init.sh diff --git a/_init/ubuntu-server/packages.sh b/_sysinit/ubuntu-server/packages.sh similarity index 100% rename from _init/ubuntu-server/packages.sh rename to _sysinit/ubuntu-server/packages.sh diff --git a/_init/ubuntu/config.sh b/_sysinit/ubuntu/config.sh similarity index 100% rename from _init/ubuntu/config.sh rename to _sysinit/ubuntu/config.sh diff --git a/_init/ubuntu/init.sh b/_sysinit/ubuntu/init.sh similarity index 100% rename from _init/ubuntu/init.sh rename to _sysinit/ubuntu/init.sh diff --git a/_init/ubuntu/nautilus/Code b/_sysinit/ubuntu/nautilus/Code similarity index 100% rename from _init/ubuntu/nautilus/Code rename to _sysinit/ubuntu/nautilus/Code diff --git a/_init/ubuntu/nautilus/Smaller Image b/_sysinit/ubuntu/nautilus/Smaller Image similarity index 100% rename from _init/ubuntu/nautilus/Smaller Image rename to _sysinit/ubuntu/nautilus/Smaller Image diff --git a/_init/ubuntu/nautilus/Sublime b/_sysinit/ubuntu/nautilus/Sublime similarity index 100% rename from _init/ubuntu/nautilus/Sublime rename to _sysinit/ubuntu/nautilus/Sublime diff --git a/_init/ubuntu/packages.sh b/_sysinit/ubuntu/packages.sh similarity index 100% rename from _init/ubuntu/packages.sh rename to _sysinit/ubuntu/packages.sh diff --git a/_init/ubuntu/packages/docker.sh b/_sysinit/ubuntu/packages/docker.sh similarity index 100% rename from _init/ubuntu/packages/docker.sh rename to _sysinit/ubuntu/packages/docker.sh diff --git a/_init/ubuntu/packages/media.sh b/_sysinit/ubuntu/packages/media.sh similarity index 100% rename from _init/ubuntu/packages/media.sh rename to _sysinit/ubuntu/packages/media.sh diff --git a/_init/ubuntu/packages/net.sh b/_sysinit/ubuntu/packages/net.sh similarity index 100% rename from _init/ubuntu/packages/net.sh rename to _sysinit/ubuntu/packages/net.sh diff --git a/_init/ubuntu/packages/system-gui.sh b/_sysinit/ubuntu/packages/system-gui.sh similarity index 100% rename from _init/ubuntu/packages/system-gui.sh rename to _sysinit/ubuntu/packages/system-gui.sh diff --git a/_init/ubuntu/packages/system.sh b/_sysinit/ubuntu/packages/system.sh similarity index 100% rename from _init/ubuntu/packages/system.sh rename to _sysinit/ubuntu/packages/system.sh diff --git a/_init/ubuntu/packages/theme.sh b/_sysinit/ubuntu/packages/theme.sh similarity index 100% rename from _init/ubuntu/packages/theme.sh rename to _sysinit/ubuntu/packages/theme.sh diff --git a/_init/ubuntu/templates/Bash Script.sh b/_sysinit/ubuntu/templates/Bash Script.sh similarity index 100% rename from _init/ubuntu/templates/Bash Script.sh rename to _sysinit/ubuntu/templates/Bash Script.sh diff --git a/_init/ubuntu/templates/Executable Bash Script.sh b/_sysinit/ubuntu/templates/Executable Bash Script.sh similarity index 100% rename from _init/ubuntu/templates/Executable Bash Script.sh rename to _sysinit/ubuntu/templates/Executable Bash Script.sh diff --git a/_init/ubuntu/templates/Text File.txt b/_sysinit/ubuntu/templates/Text File.txt similarity index 100% rename from _init/ubuntu/templates/Text File.txt rename to _sysinit/ubuntu/templates/Text File.txt diff --git a/check.sh b/check.sh index 36a2487..390fe49 100755 --- a/check.sh +++ b/check.sh @@ -18,7 +18,7 @@ checkBashScripts() { -not -path "*/plugins/*" \ -not -path "*/tmp/*" \ -not -path "*/.luarocks/*" \ - -not -path "./_init/*/templates/*")" + -not -path "./_sysinit/*/templates/*")" echo -e "\n>>> Running ShellCheck for bash" shellcheck $files echo -e "<<< ShellCheck passed\n" diff --git a/readme.md b/readme.md index 66f9286..d2e595e 100644 --- a/readme.md +++ b/readme.md @@ -30,6 +30,6 @@ Initialization script installs packages and applies OS configuration. Run: ``` -./init.sh SYSTEM_NAME +./sysinit.sh SYSTEM_NAME ``` -SYSTEM_NAME can be one of: ubuntu, ubuntu-server, macos. See [_init](./_init) for details. +SYSTEM_NAME can be one of: ubuntu, ubuntu-server, macos. See [_sysinit](./_sysinit) for details. diff --git a/init.sh b/sysinit.sh similarity index 87% rename from init.sh rename to sysinit.sh index 5a38dca..a4bdeb6 100755 --- a/init.sh +++ b/sysinit.sh @@ -8,7 +8,7 @@ if [ "$(bash --version | grep -o -E '[0-9]+' | head -n 1)" -lt 4 ]; then fi # Constant values -declare -r INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && echo "$PWD")/_init" +declare -r INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && echo "$PWD")/_sysinit" # Make sure we're in the init directory cd "$INIT_DIR" @@ -17,12 +17,12 @@ init() { local system="$1" if [ -z "$system" ] || [ ! -d "$INIT_DIR/$system" ]; then echo "Expected system as a parameter." - echo " Example: init.sh ubuntu-server" + echo " Example: sysinit.sh ubuntu-server" echo " Available system inits: $(ls "$INIT_DIR" | tr '\n' ' ')" exit 1 fi cd "$INIT_DIR/$system" - echo "Initializing $system" + echo "Initializing system: $system" bash "./init.sh" && echo -e "\n\nSUCCESS: System initalized successfuly" || echo -e "\n\nFAILURE: Initalizion failure"