Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Use the following `curl`, `wget`, or `git` command:
</details>

<details>
<summary>git (>=2.35.0 recommended)</summary>
<summary>git >= 2.35.0</summary>

<pre>
<code class="language-bash">git clone --depth=1 https://github.com/irichu/dotfiles.git && cd dotfiles && ./install.sh</code>
Expand Down
6 changes: 0 additions & 6 deletions assets/scripts/completions/generate-zsh-completions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
ZSH_COMPLETIONS_DIR="${ZSH_COMPLETIONS_DIR:-${CONFIG_HOME}/zsh/completions}"
mkdir -p "$ZSH_COMPLETIONS_DIR"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "${SCRIPT_DIR}" || exit 1

cmd_exists() {
command -v "$1" &>/dev/null
}
Expand Down Expand Up @@ -74,5 +70,3 @@ fi
if cmd_exists zsh; then
zsh -c 'autoload -Uz compinit && compinit' >/dev/null 2>&1
fi

cd - || exit 1
64 changes: 64 additions & 0 deletions assets/scripts/desktop/autoinstall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
autoinstall:
version: 1
identity:
hostname: ubuntu-desktop
realname: "User"
username: user
password: "$6$EXAMPLE$ABCDEFGHIJKLMNOPQRSTUVWXzyxwvutsrqponmlkjihgfedcba1234567890abcdEFGH" # REPLACE with a real SHA-512 hash, e.g. from: openssl passwd -6 'your-password' (do NOT commit real passwords)
locale: "en_US.UTF-8"
#locale: "ja_JP.UTF-8"
keyboard:
layout: us
variant: ""
toggle: null
source:
id: ubuntu-desktop-minimal # ubuntu-server-minimal
#interactive-sections:
# - network
#network:
# # network configuration (e.g., interfaces, wifi, etc.)
# version: 2
# ethernets:
# enp0s31f6:
# dhcp6: true
#proxy: http://172.16.90.1:3128
apt:
mirror-selection:
primary:
- uri: "http://jp.archive.ubuntu.com/ubuntu"
#- uri: "http://archive.ubuntu.com/ubuntu"
fallback: abort
storage:
layout:
name: lvm
sizing-policy: all
#password: LUKS_PASSPHRASE
timezone: Asia/Tokyo
ubuntu-pro:
# Enable Ubuntu-Pro using a contract token
# Note that the example below is an invalid contract token.
#token: "your-ubuntu-pro-contract-token"
ssh:
install-server: true
authorized-keys:
# replace with the contents of the public key(s) as generated by
# ssh-keygen or similar tools
- "<your-public-key>"
allow-pw: false
codecs:
install: false
packages:
- build-essential
- curl
- git
- unzip
- tar
early-commands:
- /bin/true
late-commands:
- curtin in-target -- bash -c 'echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-user'
- curtin in-target -- chmod 440 /etc/sudoers.d/99-user
- curtin in-target -- sudo -H -u user bash -c 'cd "$HOME" && curl -sL https://raw.githubusercontent.com/irichu/dotfiles/main/install.sh | bash && DEBUG=true ~/.local/bin/dots install --apt'
error-commands:
- tar -czf /installer-logs.tar.gz /var/log/installer/
- journalctl -b > /installer-journal.log
1 change: 1 addition & 0 deletions assets/scripts/desktop/set-dconf-custom-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dconf write /org/gnome/shell/favorite-apps "@as [\
'vlc.desktop',\
'code.desktop',\
'code-insiders.desktop',\
'ghostty_ghostty.desktop',\
'alacritty_alacritty.desktop',\
'obsidian.desktop',\
'Waydroid.desktop',\
Expand Down
68 changes: 65 additions & 3 deletions assets/scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ export LC_ALL=C
ARCH="$(uname -m)"
readonly ARCH

AUTO_YES=false
POSITIONAL=()

while [[ $# -gt 0 ]]; do
case "$1" in
-y|--yes)
AUTO_YES=true
shift
;;
*)
POSITIONAL+=("$1")
shift
;;
esac
done

set -- "${POSITIONAL[@]}"

#GITHUB_ACTIONS=1
#readonly GITHUB_ACTIONS

Expand Down Expand Up @@ -325,6 +343,12 @@ echo_each_command_usage() {
((i++))
done

info ''
info -ny -cg 'Generate zsh completion: '
info -cc 'dots completion'
info -ny -cg 'Generate package completions: '
info -cc 'dots completions'

info ''
info -ny -cg 'Test on Docker: '
info -cc 'dots docker test {ubuntu|ubuntu-22.04|arch|fedora}'
Expand Down Expand Up @@ -502,6 +526,36 @@ remove_zcompdump() {
return 0
}

confirm() {
local prompt="${1:-Are you sure?}"
local reply

if "$AUTO_YES"; then
echo "$prompt [Y/n]: yes (auto)"
return 0
fi

if [[ ! -t 0 ]]; then
return 0
fi

while true; do
read -r -p "$prompt [Y/n]: " reply
case "$reply" in
[Yy]|"" )
return 0
;;
[Nn] )
return 1
;;
* )
echo "Please answer y or n."
;;
esac
done
}


###################################################
# shells
###################################################
Expand Down Expand Up @@ -2539,11 +2593,19 @@ i | install)
remove_zcompdump
;;
--ubuntu-desktop)
info "Start installation with apt and snap"
check_command apt
check_command snap

info "Start installation with apt and snap"
echo "This process will download and install many packages (~15 minutes)."
echo "Please ensure you have a stable internet connection."
echo

if confirm "Proceed?"; then
info "Starting installation for Ubuntu Desktop..."
else
exit 1
fi

install_apt_package
install_snap_package
setup_zsh
Expand All @@ -2557,7 +2619,7 @@ i | install)
remove_zcompdump
setup_desktop
echo_completion_message
info "End installation with apt and snap"
info "End installation for Ubuntu Desktop..."
;;
#--------------------------------------------------
# individual installation
Expand Down