dotfiles/setup.sh

297 lines
7.3 KiB
Bash
Raw Normal View History

2020-11-04 16:26:25 +01:00
#!/usr/bin/env bash
# You must have sudo before running this script
2020-11-08 21:40:21 +01:00
su - -c "apt install sudo"
su - -c "usermod -a -G sudo ${USER}"
2020-11-04 16:26:25 +01:00
# Set up various variables
WORKDIR="$(pwd)"
GREETDSWAYCONFIG="/etc/greetd/sway-config"
GREETDCONFIG="/etc/greetd/config.toml"
GREETDENVS="/etc/greetd/environments"
SWAYRUN="/usr/local/bin/sway-run.sh"
WAYLAND_ENABLE="/usr/local/bin/wayland_enablement.sh"
2021-02-14 11:44:38 +01:00
GTK_THEME=Adwaita:dark
2020-11-04 16:26:25 +01:00
2020-12-27 15:34:22 +01:00
# Add my own repo
wget -O - 'https://repo.mic.ke/PUBLIC.KEY' | sudo apt-key add -
wget -O - 'https://repo.mic.ke/debian/debian-micke-unstable.list' | sudo tee /etc/apt/sources.list.d/debian-micke-unstable.list
2020-12-22 18:50:18 +01:00
# Add linux-libre repo
wget -O - 'https://jxself.org/gpg.asc' | sudo apt-key add -
2020-12-22 20:59:19 +01:00
echo 'deb https://mirror.linux.pizza/linux-libre/freesh/ freesh main
2020-12-22 18:50:18 +01:00
' | sudo tee /etc/apt/sources.list.d/linux-libre.list
2020-12-22 20:59:19 +01:00
# Add repo for tlpui
2020-12-22 18:50:18 +01:00
wget -O - 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1cc3d16e460a94ee17fe581cea8cacc073c3db2a' | sudo apt-key add -
2020-12-22 13:34:34 +01:00
echo 'deb http://ppa.launchpad.net/linuxuprising/apps/ubuntu focal main
deb-src http://ppa.launchpad.net/linuxuprising/apps/ubuntu focal main
2020-12-22 18:50:18 +01:00
' | sudo tee /etc/apt/sources.list.d/linuxuprising-apps.list
2020-12-22 20:59:19 +01:00
# Add system76 repo
wget -O - 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x5d1f3a80254f6afba254fed5acd442d1c8b7748b' | sudo apt-key add -
echo 'deb http://ppa.launchpad.net/system76-dev/stable/ubuntu focal main
deb-src http://ppa.launchpad.net/system76-dev/stable/ubuntu focal main
' | sudo tee /etc/apt/sources.list.d/system76-dev.list
2020-12-22 18:50:18 +01:00
# Update repos
2020-12-22 13:34:34 +01:00
sudo apt update
2020-12-22 18:50:18 +01:00
2020-11-04 16:26:25 +01:00
# Install software from repo
sudo apt install \
2020-12-16 23:24:32 +01:00
acpi \
acpi-support \
2020-12-20 22:28:42 +01:00
adwaita-qt \
2020-12-15 11:37:13 +01:00
build-essential \
cargo \
cheese \
cmake \
curl \
2020-12-15 11:54:25 +01:00
elinks \
2020-12-16 23:24:32 +01:00
file-roller \
2020-12-15 11:37:13 +01:00
firefox-esr \
2020-12-22 21:00:25 +01:00
firmware-manager \
2020-12-22 18:37:40 +01:00
fish \
2020-12-15 11:37:13 +01:00
geany \
geany-plugins \
git \
2020-12-20 22:28:42 +01:00
gnome-themes-extra \
2020-12-22 20:59:19 +01:00
grub-coreboot \
2020-12-15 11:37:13 +01:00
jq \
libcairo-dev \
libdbus-1-dev \
2020-11-18 17:14:35 +01:00
libgtkmm-3.0-dev \
2020-12-15 11:37:13 +01:00
libncursesw5-dev \
libpam-dev \
libpam0g-dev \
2021-02-14 11:44:38 +01:00
libpipewire-0.3-dev \
2020-12-15 11:37:13 +01:00
libpulse-dev \
libssl-dev \
2021-02-14 11:44:38 +01:00
libsystemd-dev \
2020-12-15 11:37:13 +01:00
libwayland-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxkbcommon-dev \
light \
2020-12-22 18:50:18 +01:00
linux-libre \
2020-12-20 22:28:42 +01:00
lxappearance \
2020-12-15 11:37:13 +01:00
meson \
mpv \
neomutt \
neovim \
nextcloud-desktop \
ninja-build \
pandoc \
pass \
pavucontrol \
2020-12-16 23:24:32 +01:00
pcmanfm \
2021-02-14 11:45:22 +01:00
pipewire \
2020-12-15 11:37:13 +01:00
poppler-utils \
python3-pip \
python3-tldextract \
2020-12-20 22:28:42 +01:00
qt5ct \
2020-12-15 11:37:13 +01:00
qutebrowser \
ripgrep \
rsync \
2020-12-22 21:17:29 +01:00
seahorse \
2020-12-15 11:37:13 +01:00
scdoc \
sway \
swayidle \
2020-12-27 15:34:22 +01:00
swayswitch \
2020-12-22 20:59:19 +01:00
system76-firmware-daemon \
system76-power \
2020-12-22 13:34:34 +01:00
tlp \
tlpui \
2020-12-20 22:28:42 +01:00
ukui-polkit \
2020-12-15 11:37:13 +01:00
unzip \
wayland-protocols \
wl-clipboard \
2020-12-16 18:28:25 +01:00
wlr-randr \
zsh
2020-11-04 23:33:50 +01:00
# Fix nm-tray icon
nm=$(grep QT_QPA_PLATFORMTHEME /etc/security/pam_env.conf)
if [[ "x${nm}" == "x" ]]; then
2020-12-15 11:37:13 +01:00
echo 'QT_QPA_PLATFORMTHEME DEFAULT=qt5ct' | sudo tee -a /etc/security/pam_env.conf
2020-11-04 23:33:50 +01:00
fi
2020-11-04 16:26:25 +01:00
# Install software from sources
mkdir -p ~/sources
cd ~/sources
# Greetd
git clone https://git.sr.ht/~kennylevinsen/greetd
cd greetd
# Compile greetd and agreety.
cargo build --release
# Put things into place
sudo cp target/release/{greetd,agreety} /usr/local/bin/
sudo cp greetd.service /etc/systemd/system/greetd.service
sudo mkdir -p /etc/greetd
# Create the greeter user
sudo useradd -M -G video greeter
sudo chown -R greeter:greeter /etc/greetd/
#wlgreet
cd ~/sources
git clone https://git.sr.ht/~kennylevinsen/wlgreet
cd wlgreet
cargo build --release
sudo cp target/release/wlgreet /usr/local/bin/
echo 'exec "wlgreet --command sway; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m "What do you want to do?" \
-b "Poweroff" "systemctl poweroff" \
-b "Reboot" "systemctl reboot"
include /etc/sway/config.d/*
' | sudo tee ${GREETDSWAYCONFIG}
echo '[terminal]
vt = 1
[default_session]
command = "sway --config /etc/greetd/sway-config"
user = "greeter"
' | sudo tee ${GREETDCONFIG}
echo 'sway
bash
' | sudo tee ${GREETDENVS}
echo '#!/bin/sh
# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway
source /usr/local/bin/wayland_enablement.sh
systemd-cat --identifier=sway sway $@
' | sudo tee ${SWAYRUN}
2020-11-08 18:05:37 +01:00
echo '#!/bin/sh
2020-11-04 16:26:25 +01:00
export MOZ_ENABLE_WAYLAND=1
export CLUTTER_BACKEND=wayland
export QT_QPA_PLATFORM=wayland-egl
export ECORE_EVAS_ENGINE=wayland-egl
export ELM_ENGINE=wayland_egl
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export NO_AT_BRIDGE=1' | sudo tee ${WAYLAND_ENABLE}
sudo chmod +x ${SWAYRUN} ${WAYLAND_ENABLE}
# enable greetd
2020-11-04 18:52:15 +01:00
sudo systemctl enable greetd
2020-11-04 16:26:25 +01:00
2020-11-05 21:32:00 +01:00
# Swaylock-effects
2020-11-05 21:23:08 +01:00
cd ~/sources
git clone https://github.com/mortie/swaylock-effects.git
cd swaylock-effects
meson build
ninja -C build
sudo ninja -C build install
2020-11-18 17:14:35 +01:00
# Grid menu
git clone https://github.com/nwg-piotr/nwg-launchers.git
cd nwg-launchers
meson builddir -Dbuildtype=release
ninja -C builddir
sudo ninja -C builddir install
#sudo ninja -C builddir uninstall
2020-11-16 22:17:26 +01:00
# Autotiling
sudo -H pip install autotiling
2020-12-15 11:37:13 +01:00
# j4-dmenu-desktop
cd ~/sources
git clone https://github.com/enkore/j4-dmenu-desktop.git
cd j4-dmenu-desktop
cmake .
make
sudo make install
2020-11-04 16:26:25 +01:00
#ncspot
cd ~/sources
git clone https://github.com/hrkfdn/ncspot.git
cd ncspot
cargo build --release
sudo cp target/release/ncspot /usr/local/bin/
2021-02-14 11:44:38 +01:00
# xdg-desktop-portal-wlr
cd ~/sources
git clone https://github.com/emersion/xdg-desktop-portal-wlr
cd xdg-desktop-portal-wlr
meson build
ninja -C build
sudo ninja -C build install
# Vdirsyncer
cd ~/sources
git clone https://github.com/pimutils/vdirsyncer
cd vdirsyncer
python3 -m pip install --user --upgrade setuptools wheel
python3 setup.py sdist bdist_wheel
sudo python3 setup.py install
# dotfiles
cd ${WORKDIR}
rsync -a dotfiles/ ~/
2020-11-18 09:54:42 +01:00
# Card/Cal
sudo pip3 install khal khard
2020-11-18 09:54:42 +01:00
vdirsyncer discover contacts
vdirsyncer discover calendar
vdirsyncer sync
# Firefox pass host app
curl -sSL github.com/passff/passff-host/releases/latest/download/install_host_app.sh | bash -s -- firefox
2020-11-08 10:53:08 +01:00
# Background
2020-11-18 09:54:42 +01:00
sudo mkdir -p /usr/local/share/backgrounds
sudo wget https://www.publicdomainpictures.net/pictures/230000/velka/night-landscape-15010066769pV.jpg -O /usr/local/share/backgrounds/night-landscape.jpg
2020-11-08 10:53:08 +01:00
2020-11-08 17:18:18 +01:00
# VictoMono font
cd /tmp
mkdir fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/VictorMono.zip
unzip VictorMono.zip
2020-11-08 18:05:37 +01:00
sudo cp *tf /usr/local/share/fonts
2020-11-08 17:18:18 +01:00
cd ..
rm -rf fonts
2021-02-14 11:44:38 +01:00
# Set up GTK_THEME
grep GTK_THEME /etc/environment
if [[$? != 0]];
echo "GTK_THEME=${GTK_THEME}" | sudo tee -a /etc/environment
fi
2020-12-16 23:24:32 +01:00
#lsd
wget https://github.com/Peltoche/lsd/releases/download/0.19.0/lsd-musl_0.19.0_amd64.deb
sudo dpkg -i lsd-musl_0.19.0_amd64.deb
2020-12-15 11:51:10 +01:00
# Appimage
wget https://github.com/TheAssassin/AppImageLauncher/releases/download/v2.2.0/appimagelauncher_2.2.0-travis995.0f91801.bionic_amd64.deb
sudo dpkg -i appimagelauncher_2.2.0-travis995.0f91801.bionic_amd64.deb
sudo apt -f install
2020-12-16 18:28:25 +01:00
# oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
omz theme use agnoster
2020-11-07 11:05:38 +01:00
2020-12-22 18:53:26 +01:00
# Fish and oh my fish
curl -L https://get.oh-my.fish | fish
omf install agnoster
2020-11-18 09:54:42 +01:00
echo "Make sure you have you gpg-key imported and trusted"
2020-11-04 17:14:33 +01:00
echo "Follow this instruction if gnome-keyring gives you trouble: https://wiki.archlinux.org/index.php/GNOME/Keyring#Using_the_keyring_outside_GNOME"
echo "Rebooting in 5 seconds"
sleep 5s
2020-11-04 16:26:25 +01:00
sudo reboot