Skip to content

Instantly share code, notes, and snippets.

@webflo-dev
Last active June 15, 2022 13:23
Show Gist options
  • Save webflo-dev/4e6a70a0853e0cf38111522b14550bea to your computer and use it in GitHub Desktop.
Save webflo-dev/4e6a70a0853e0cf38111522b14550bea to your computer and use it in GitHub Desktop.
backup gnome archlinux
#!/usr/bin/env bash
date=$(date +"%Y-%m-%d")
source_dir=/home/$USER/
backup_dir=${source_dir}backup_${date}/
mkdir -p ${backup_dir}
dconf dump / > gnome_dconf.conf
tar -zcvf ${backup_dir}gnome_extensions.tar.gz ${source_dir}.local/share/gnome-shell/extensions/
tar -zcvf ${backup_dir}gnome_themes.tar.gz ${source_dir}.themes/
tar \
-zcvf ${backup_dir}home_dot_config.tar.gz \
--exclude='/home/florent/.config/Code' \
--exclude='/home/florent/.config/discord' \
--exclude='/home/florent/.config/microsoft-edge' \
${source_dir}.config/
tar -zcvf ${backup_dir}home_dot_local.tar.gz ${source_dir}.local/
tar -zcvf ${backup_dir}home_dot_password_store.tar.gz ${source_dir}.password-store/
tar -zcvf ${backup_dir}home_dot_ssh.tar.gz ${source_dir}.ssh/
tar -zcvf ${backup_dir}home_dotfiles.tar.gz \
${source_dir}.zshrc ${source_dir}.zsh_history ${source_dir}.zsh/ \
${source_dir}.dotfiles/ ${source_dir}.dotfiles-git/ \
${source_dir}.gitconfig ${source_dir}.gitconfig-github ${source_dir}.gitconfig-pro \
${source_dir}.gpg-keys/ \
${source_dir}.npmrc
tar -zcvf ${backup_dir}home_${USER}.tar.gz ${source_dir}bin/ ${source_dir}Pictures/ ${source_dir}Downloads/ ${source_dir}docker-compose.yml ${source_dir}docker/ ${source_dir}.mcfly/
comm -12 <(grep -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log | sort | uniq) <(pacman -Qeqn | sort) > ${backup_dir}pkg_from_distro.txt
comm -12 <(grep -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log | sort | uniq) <(pacman -Qeqm | sort) > ${backup_dir}pkg_from_aur.txt
cat ${backup_dir}pkg_from_distro.txt | grep -v '^lib' | grep -v '^xf86-' | grep -v '^vulkan-' | grep -v '^mesa' > ${backup_dir}pkg.txt
cat ${backup_dir}pkg_from_aur.txt | grep -v '^lib' | grep -v '^xf86-' | grep -v '^vulkan-' | grep -v '^mesa' >> ${backup_dir}pkg.txt
barrier
bat
direnv
discord
docker
downgrade
fd
git-delta
gnome-connections
gnome-keyring
guake
hdx-realtime-media-engine
httpie
icaclient
microsoft-edge-stable-bin
mkcert
neofetch
pass
rclone
spotify
terminator
ttf-fira-code
vim
visual-studio-code-bin
wmctrl
xdotool
yay
z
zsh
#!/usr/bin/env bash
# docker
sudo systemctl start docker.service
sudo systemctl enable docker.service
sudo usermod -aG docker $USER
newgrp docker
# docker compose
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
acpi
acpid
alacritty
autoconf
automake
awesome
base
bat
binutils
bison
brightnessctl
bspwm
btop
conky
discord
dmenu
docker
dunst
efibootmgr
exa
fakeroot
feh
file
file-roller
findutils
firefox
flex
fzf
gawk
gcc
gettext
git
git-delta
gnome-keyring
gnome-themes-extra
grep
groff
gst-plugin-pipewire
gtk4
gzip
htop
i3-gaps
i3blocks
i3lock
i3status
intel-media-driver
intel-ucode
iwd
libpulse
libtool
libva-intel-driver
light
linux
linux-firmware
lxappearance-gtk3
m4
make
man-db
mpc
mpd
mpv
nano
nano-syntax-highlighting
neofetch
networkmanager
noto-fonts
obs-studio
openssh
pacman
patch
pipewire
pipewire-alsa
pipewire-jack
pipewire-pulse
pkgconf
playerctl
polkit-gnome
polybar
pulsemixer
qtile
ranger
rofi
seahorse
sed
smartmontools
sudo
sxhkd
texinfo
thunar
thunar-archive-plugin
thunar-volman
tldr
ttf-dejavu
ttf-fantasque-sans-mono
ttf-liberation
ttf-roboto
unzip
vim
vulkan-intel
wget
which
wireless_tools
wireplumber
wpa_supplicant
xdg-desktop-portal-wlr
xdg-utils
xdotool
xf86-video-intel
xorg-server
xorg-xdpyinfo
xorg-xinit
xorg-xwininfo
xss-lock
xterm
z
zsh
#!/usr/bin/env bash
pacman -Qqe | grep -v "$(pacman -Qqm)" > pacman.lst
#!/usr/bin/env bash
backup_dir=$1
target_dir=/home/$USER/
dconf load / < ${backup_dir}gnome_dconf.conf
tar --extract --file ${backup_dir}gnome_extensions.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}gnome_themes.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}home_dot_config.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}home_dot_local.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}home_dot_password_store.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}home_dot_ssh.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}home_dotfiles.tar.gz -C ${target_dir} --strip-components=2
tar --extract --file ${backup_dir}home_${USER}.tar.gz -C ${target_dir} --strip-components=2
pacman -Syyu
pacman -S - < ${backup_dir}pkg.txt
# or
# pacman -S --needed $(cat pkglist)
#!/usr/bin/env bash
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
#!/usr/bin/env bash
# install Volta
curl https://get.volta.sh | bash
# install Node
volta install node
#!/usr/bin/env bash
curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM}/plugins/zsh-completions
git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM}/plugins/fzf-tab
git clone https://github.com/urbainvaes/fzf-marks.git ${ZSH_CUSTOM}/plugins/fzf-marks
git clone https://github.com/denysdovhan/spaceship-prompt.git "${ZSH_CUSTOM}/themes/spaceship-prompt"
ln -s "$zdir/themes/spaceship-prompt/spaceship.zsh-theme" "${ZSH_CUSTOM}/themes/spaceship.zsh-theme"
# git clone https://github.com/paoloantinori/hhighlighter $ZSH_CUSTOM/plugins/h
# mv $ZSH_CUSTOM/plugins/h/h.sh $ZSH_CUSTOM/plugins/h/h.plugin.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment