This repository was archived by the owner on Feb 24, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
138 lines (112 loc) · 3.61 KB
/
setup.sh
File metadata and controls
138 lines (112 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
clear
# --------------------------
# Setup for Fedora Sway Spin
# Author: hasnatsafdar
# --------------------------
set -e
REPO="https://github.com/hasnatsafdar/Dotfiles"
DOTFILES_DIR="$(pwd)"
# Colors
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
info() {
echo -e "${CYAN}[INFO]${NC} $1"
}
ask() {
read -rp "[?] $1 (y/n): " answer
case ${answer:0:1} in
y|Y ) return 0;;
* ) return 1;;
esac
}
# Required packages
PACKAGES=(
kitty rofi waybar zsh zoxide tmux bat fastfetch htop pyfiglet lolcat firefox \
fzf eza zstd flatpak snapd cargo rust-analyzer docker \
unzip wget rsync git figlet curl
)
# Optional COPR and custom installs
yazi_install() {
sudo dnf copr enable lihaohong/yazi -y && sudo dnf install yazi -y
}
lazygit_install() {
sudo dnf copr enable atim/lazygit -y && sudo dnf install lazygit -y
}
lazydocker_install() {
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
}
nerd_font_install() {
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts || exit
curl -LO https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip
unzip -o JetBrainsMono.zip -d JetBrainsMono
fc-cache -fv
cd - || exit
}
starship_install() {
curl -sS https://starship.rs/install.sh | sh -s -- -y
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
}
zinit_install() {
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
}
tmux_setup() {
git clone --single-branch https://github.com/gpakosz/.tmux.git ~/.config/oh-my-tmux
ln -sf ~/.config/oh-my-tmux/.tmux.conf ~/.config/tmux/tmux.conf
cp ~/.config/oh-my-tmux/.tmux.conf.local ~/.config/tmux/tmux.conf.local
}
zoxide_setup() {
echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc
}
install_packages() {
info "Installing base packages..."
sudo dnf install -y "${PACKAGES[@]}"
}
copy_dotfiles() {
DOTFILES=(kitty rofi sway tmux nvim zsh waybar)
for folder in "${DOTFILES[@]}"; do
SRC="$DOTFILES_DIR/$folder"
DEST="$HOME/.config/$folder"
if [ -d "$SRC" ]; then
info "Copying $folder → $DEST"
mkdir -p "$DEST"
cp -r "$SRC"/* "$DEST"/
fi
done
# ZSHRC
[ -f "$DOTFILES_DIR/.zshrc" ] && cp "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc"
}
setup_wallpaper() {
WALL_SRC="$DOTFILES_DIR/wallpapers"
WALL_DEST="$HOME/.config/wallpapers"
TARGET_WALL="wallhaven-5g22q5_3840x2160.png"
if [ -f "$WALL_SRC/$TARGET_WALL" ]; then
mkdir -p "$WALL_DEST"
cp "$WALL_SRC/$TARGET_WALL" "$WALL_DEST/"
grep -qxF "exec swaybg -i $WALL_DEST/$TARGET_WALL -m fill" ~/.config/sway/config || \
echo "exec swaybg -i $WALL_DEST/$TARGET_WALL -m fill" >> ~/.config/sway/config
info "Wallpaper '$TARGET_WALL' set using swaybg"
else
info "Wallpaper not found: $TARGET_WALL"
fi
}
main() {
echo -e "${GREEN}Hasnat’s Fedora Sway Dotfiles Installer${NC}"
ask "Update system first?" && sudo dnf update -y
install_packages
ask "Install Zinit?" && zinit_install
ask "Install Starship?" && starship_install
ask "Install and setup Zoxide?" && zoxide_setup
ask "Install Oh My Tmux setup?" && tmux_setup
ask "Install LazyGit?" && lazygit_install
ask "Install LazyDocker?" && lazydocker_install
ask "Install Yazi file manager?" && yazi_install
ask "Install JetBrainsMono Nerd Font?" && nerd_font_install
ask "Copy dotfiles from repo to ~/.config?" && copy_dotfiles
ask "Set wallpaper via swaybg?" && setup_wallpaper
info "Setup complete! You may want to reboot or start using your system now."
info "Make ZSH default shell: chsh -s $(which zsh)"
}
main "$@"