From 035b972b4881a63c1c98f101fd336c87e8a44f8e Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 24 Apr 2025 15:43:15 +0200 Subject: [PATCH] Added steambox update script --- config/hypr/hyprland.conf | 10 +- update_arch.sh | 4 + update_arch_steambox.sh | 418 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 427 insertions(+), 5 deletions(-) create mode 100755 update_arch_steambox.sh diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 7163b6e..fb72511 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -1,7 +1,7 @@ ################ ### MONITORS ### ################ -monitor=,2560x1440,auto,1 +monitor=,2560x1440@59.9,auto,1 ################### ### MY PROGRAMS ### @@ -19,10 +19,10 @@ exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = waybar -exec-once = hypridle -exec-once = /usr/local/bin/pypr --debug /tmp/pypr.log +# exec-once = hypridle +# exec-once = /usr/local/bin/pypr --debug /tmp/pypr.log exec-once = systemctl --user start sunshine -exec-once = input-remapper-control --command autoload +# exec-once = input-remapper-control --command autoload exec-once = org.remmina.Remmina -i exec-once = [workspace 1] $terminal @@ -177,7 +177,7 @@ bind = , PRINT, exec, hyprshot -m region # Set monitor resolution bind = $mainMod, R, exec, hyprctl keyword monitor ",1920x1200,auto,1" -bind = $mainMod CTRL, R, exec, hyprctl keyword monitor ",2560x1440,auto,1" +bind = $mainMod CTRL, R, exec, hyprctl keyword monitor ",2560x1440@59.9,auto,1" # Special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, scratchpad diff --git a/update_arch.sh b/update_arch.sh index 3c1bc38..8d4cdd9 100755 --- a/update_arch.sh +++ b/update_arch.sh @@ -368,6 +368,10 @@ unzip -o NerdFontsSymbolsOnly.zip rm NerdFontsSymbolsOnly.zip fc-cache -fv +# Install other fonts +printf -- '\033[33m Installing other fonts\n\033[37m' +sudo pacman --noconfirm --needed -S noto-fonts poppler-data + # Install Brave Browser printf -- '\033[33m Installing Brave Browser\n\033[37m' yay --noconfirm -S --needed --aur brave-bin diff --git a/update_arch_steambox.sh b/update_arch_steambox.sh new file mode 100755 index 0000000..870e698 --- /dev/null +++ b/update_arch_steambox.sh @@ -0,0 +1,418 @@ +#!/bin/bash +set -e + +echo -e ' \e[H\e[2J + \e[0;34m. + \e[0;34m/ \ + \e[0;34m/ \ \e[1;37m # \e[1;34m| * + \e[0;34m/^. \ \e[1;37m a##e #%" a#"e 6##% \e[1;34m| | |-^-. | | \ / + \e[0;34m/ .-. \ \e[1;37m.oOo# # # # # \e[1;34m| | | | | | X + \e[0;34m/ ( ) _\ \e[1;37m%OoO# # %#e" # # \e[1;34m| | | | ^._.| / \ \e[0;37mTM + \e[1;34m/ _.~ ~._^\ + \e[1;34m/.^ ^.\ \e[0;37mTM + + + \e[1;32mCMtec STEAMBOX install/Update script\e[0;37m +' +# Create backup/snapshot +if pacman -Qs timeshift >/dev/null; then + CONFIG_FILE="/etc/timeshift/timeshift.json" + if [ -f "$CONFIG_FILE" ]; then + BTRFS_MODE=$(jq '.btrfs_mode' "$CONFIG_FILE") + if [ "$BTRFS_MODE" == '"true"' ]; then + printf -- '\033[33m Creating backup/snapshot\n\033[37m' + sudo timeshift --create --comments "Update script" + fi + fi +fi + +# Read currently operating kernel version +KERNEL=$(uname -r) + +# Update all pacman packages +printf -- '\033[33m Updating pacman packages\n\033[37m' +sudo pacman -Suyy --noconfirm +# Update all AUR packages +printf -- '\033[33m Updating AUR packages\n\033[37m' +if pacman -Qs yay >/dev/null; then + yay --noconfirm --aur +else + sudo pacman -S --needed --noconfirm git base-devel + if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi + cd ~ + git clone https://aur.archlinux.org/yay-bin.git + cd yay-bin + makepkg --noconfirm -si + cd ~ + if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi +fi +# Update all Flatpak packages +printf -- '\033[33m Updating Flatpak packages\n\033[37m' +if pacman -Qs flatpak >/dev/null; then + flatpak update -y +else + sudo pacman --noconfirm --needed -S flatpak + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install -y flathub com.github.tchx84.Flatseal +fi + +# Install initial system packages +printf -- '\033[33m Installing initial system packages\n\033[37m' +sudo pacman --noconfirm --needed -S base-devel cmake gawk wget gettext unzip curl + +# Setup locals +printf -- '\033[33m Setup locals\n\033[37m' +sudo localectl set-locale LANG=en_US.UTF-8 + +# Install git +printf -- '\033[33m Installing git\n\033[37m' +sudo pacman --noconfirm --needed -S git +ln -sf ~/code_server/gitconfig ~/.gitconfig + +# # Install hyprland +# printf -- '\033[33m Installing hyprland\n\033[37m' +# sudo pacman --noconfirm --needed -S usbutils plymouth dracut dunst hypridle hyprland hyprlock xdg-desktop-portal-hyprland polkit-gnome xorg-xhost gnome-keyring qt5ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance +# +# yay --noconfirm -S --needed --aur adwaita-qt5-git +# yay --noconfirm -S --needed --aur adwaita-qt6-git +# yay --noconfirm -S --needed --aur wlogout +# yay --noconfirm -S --needed --aur hyprshot +# +# mkdir -p ~/.local/bin +# mkdir -p ~/.config/hypr +# mkdir -p ~/.config/gtk-3.0 +# mkdir -p ~/.config/qt5ct +# mkdir -p ~/.config/qt6ct +# mkdir -p ~/.config/dunst +# +# ln -sf ~/code_server/wrappedhl ~/.local/bin/wrappedhl +# ln -sf ~/code_server/config/hypr/hyprland.conf ~/.config/hypr/hyprland.conf +# ln -sf ~/code_server/config/hypr/hypridle.conf ~/.config/hypr/hypridle.conf +# ln -sf ~/code_server/config/gtk-3.0/settings.ini ~/.config/gtk-3.0/settings.ini +# ln -sf ~/code_server/config/qt5ct/qt5ct.conf ~/.config/qt5ct/qt5ct.conf +# ln -sf ~/code_server/config/qt6ct/qt6ct.conf ~/.config/qt6ct/qt6ct.conf +# ln -sf ~/code_server/config/dunst/dunstrc ~/.config/dunst/dunstrc +# +# # Install waybar +# printf -- '\033[33m Installing waybar\n\033[37m' +# sudo pacman --noconfirm --needed -S waybar +# mkdir -p ~/.config/waybar +# ln -sf ~/code_server/config/waybar/config ~/.config/waybar/config +# ln -sf ~/code_server/config/waybar/style.css ~/.config/waybar/style.css +# +# # Install Audio +# printf -- '\033[33m Installing Audio\n\033[37m' +# sudo pacman --noconfirm --needed -S pipewire pipewire-pulse pavucontrol helvum +# mkdir -p ~/.config/pipewire +# ln -sf ~/code_server/config/pipewire/pipewire.conf ~/.config/pipewire/pipewire.conf +# +# # #Install input-remapper +# # printf -- '\033[33m Installing input-remapper\n\033[37m' +# # yay --noconfirm -S --needed --aur input-remapper-git +# # sudo systemctl enable --now input-remapper +# +# # Install networkmanager +# printf -- '\033[33m Installing networkmanager\n\033[37m' +# sudo pacman --noconfirm --needed -S network-manager-applet +# yay --noconfirm -S --needed --aur networkmanager-dmenu-git +# mkdir -p ~/.config/networkmanager-dmenu +# ln -sf ~/code_server/config/networkmanager-dmenu/config.ini ~/.config/networkmanager-dmenu/config.ini +# +# # Install autologin +# printf -- '\033[33m Installing autologin\n\033[37m' +# yay --noconfirm -S --needed --aur pam_autologin +# sudo /bin/cp -rf ~/code_server/login /etc/pam.d/login +# sudo /bin/cp -rf ~/code_server/getty@.service /usr/lib/systemd/system/getty@.service +# sudo touch /etc/security/autologin.conf + +# Install btop +printf -- '\033[33m Installing btop\n\033[37m' +sudo pacman --noconfirm --needed -S btop + +# Install ranger +printf -- '\033[33m Installing ranger\n\033[37m' +sudo pacman --noconfirm --needed -S ranger + +# Install kitty +printf -- '\033[33m Installing kitty\n\033[37m' +sudo pacman --noconfirm --needed -S kitty +mkdir -p ~/.config/kitty +ln -sf ~/code_server/config/kitty/kitty.conf ~/.config/kitty/kitty.conf + +# Install tmux +printf -- '\033[33m Installing tmux\n\033[37m' +sudo pacman --noconfirm --needed -S tmux +ln -sf ~/code_server/tmux.conf ~/.tmux.conf + +# Install python +printf -- '\033[33m Installing python\n\033[37m' +sudo pacman --noconfirm --needed -S python python-pip python-pipx python-pipenv python-pynvim + +# Install fzf +printf -- '\033[33m Installing fzf\n\033[37m' +rm -rf ~/.fzf +git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf +~/.fzf/install --all +source ~/.fzf.bash + +# Install fzfmenu +printf -- '\033[33m Installing fzfmenu\n\033[37m' +mkdir -p ~/.local/bin +ln -sf ~/code_server/fzfmenu.sh ~/.local/bin/fzfmenu + +# Install VirtualHere server +curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh + +# Install VirtualHere client +printf -- '\033[33m Installing VirtualHere client\n\033[37m' +cd ~ +wget https://www.virtualhere.com/sites/default/files/usbclient/scripts/virtualhereclient.service +wget https://www.virtualhere.com/sites/default/files/usbclient/vhclientx86_64 +wget https://www.virtualhere.com/sites/default/files/usbclient/vhuit64 +chmod +x ./vhclientx86_64 +chmod +x ./vhuit64 +sudo mv ./vhclientx86_64 /usr/sbin +sudo mv ./vhuit64 /usr/sbin +echo "$USER ALL=(ALL:ALL) NOPASSWD: /usr/sbin/vhclientx86_64" | sudo tee /etc/sudoers.d/$USER+vhclientx86_64 +echo "$USER ALL=(ALL:ALL) NOPASSWD: /usr/sbin/vhuit64" | sudo tee /etc/sudoers.d/$USER+vhuit64 +sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service +# sudo systemctl daemon-reload +# sudo systemctl enable virtualhereclient.service +# sudo systemctl start virtualhereclient.service + +# Install teensy udev rules (only for non docker system) +if [ ! -f /.dockerenv ]; then + printf -- '\033[33m Installing teensy udev rules\n\033[37m' + sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules + sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo udevadm control --reload-rules + sudo udevadm trigger +fi + +# Install neovim +printf -- '\033[33m Installing neovim\n\033[37m' +sudo pacman --noconfirm --needed -S neovim +mkdir -p ~/.config/nvim +ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua +ln -sf ~/code_server/clang-format ~/.clang-format +ln -sf ~/code_server/luacheckrc ~/.luacheckrc +mkdir -p ~/.local/bin +ln -sf ~/code_server/pico-load.sh ~/.local/bin/pico-load + +# Install fd +printf -- '\033[33m Installing fd\n\033[37m' +sudo pacman --noconfirm --needed -S fd + +# Install lazygit +printf -- '\033[33m Installing lazygit\n\033[37m' +cd ~ +LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') +curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" +tar xf lazygit.tar.gz lazygit +sudo install lazygit /usr/local/bin +rm ~/lazygit && rm ~/lazygit.tar.gz +mkdir -p ~/.config/lazygit +ln -sf ~/code_server/config/lazygit/config.yml ~/.config/lazygit/config.yml + +# Install gdu +printf -- '\033[33m Installing gdu\n\033[37m' +sudo pacman --noconfirm --needed -S gdu + +# Install ruby +printf -- '\033[33m Installing ruby\n\033[37m' +sudo pacman --noconfirm --needed -S ruby + +# Install bottom +printf -- '\033[33m Installing bottom\n\033[37m' +sudo pacman --noconfirm --needed -S bottom + +# Install go +printf -- '\033[33m Installing go\n\033[37m' +sudo pacman --noconfirm --needed -S go + +# Install php +printf -- '\033[33m Installing php\n\033[37m' +sudo pacman --noconfirm --needed -S php + +# Install luarocks +printf -- '\033[33m Installing luarocks\n\033[37m' +sudo pacman --noconfirm --needed -S luarocks + +# Install composer +printf -- '\033[33m Installing composer\n\033[37m' +sudo pacman --noconfirm --needed -S composer + +# Install java +printf -- '\033[33m Installing java\n\033[37m' +sudo pacman --noconfirm --needed -S jdk-openjdk + +# Install julia +printf -- '\033[33m Installing julia\n\033[37m' +sudo pacman --noconfirm --needed -S julia + +# Install node +printf -- '\033[33m Installing node\n\033[37m' +sudo pacman --noconfirm --needed -S nodejs npm + +# Install ble.sh +printf -- '\033[33m Installing ble.sh\n\033[37m' +if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi +cd ~ +git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git +make -C ble.sh install +if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi +ln -sf ~/code_server/blerc ~/.blerc + +# Install platformio +printf -- '\033[33m Installing platformio\n\033[37m' +sudo pacman --noconfirm --needed -S platformio-core + +# Install neovim for node +printf -- '\033[33m Installing neovim for node\n\033[37m' +sudo npm install -g neovim + +# Install rust +printf -- '\033[33m Installing Rust\n\033[37m' +sudo pacman --noconfirm --needed -S rustup +rustup update stable +rustup default stable + +# Install rust embedded stuff +printf -- '\033[33m Installing Rust embedded stuff\n\033[37m' +cd ~ +rustup target add thumbv6m-none-eabi +cargo install elf2uf2-rs --locked +cargo install probe-run +cargo install flip-link + +# Install tree sitter cli +printf -- '\033[33m Installing tree sitter cli\n\033[37m' +cd ~ +cargo install tree-sitter-cli + +# Install ripgrep +printf -- '\033[33m Installing ripgrep\n\033[37m' +cargo install ripgrep + +# Install eza +printf -- '\033[33m Installing eza\n\033[37m' +cargo install eza + +# Install zoxide +printf -- '\033[33m Installing zoxide\n\033[37m' +cargo install zoxide --locked + +# Install starship +printf -- '\033[33m Installing starship\n\033[37m' +cargo install starship --locked +ln -sf ~/code_server/config/starship.toml ~/.config/starship.toml + +# Install Discord (Equibop) +printf -- '\033[33m Installing Discord (Equibop)\n\033[37m' +flatpak install -y flathub io.github.equicord.equibop + +# # Install XAir +# printf -- '\033[33m Installing XAir\n\033[37m' +# flatpak install -y flathub com.behringer.XAirEdit +# +# # Install Krita +# printf -- '\033[33m Installing Krita\n\033[37m' +# flatpak install -y flathub org.kde.krita +# +# # Install KiCad +# printf -- '\033[33m Installing KiCad\n\033[37m' +# sudo pacman --noconfirm --needed -S kicad +# +# # Install FreeCad +# printf -- '\033[33m Installing FreeCad\n\033[37m' +# sudo pacman --noconfirm --needed -S freecad +# +# # Install Prusaslicer +# printf -- '\033[33m Installing Prusaslicer\n\033[37m' +# flatpak install -y flathub com.prusa3d.PrusaSlicer +# +# # Install Moonlight +# printf -- '\033[33m Installing Moonlight\n\033[37m' +# flatpak install -y flathub com.moonlight_stream.Moonlight +# +# # Install DrawIo +# printf -- '\033[33m Installing DrawIo\n\033[37m' +# flatpak install -y flathub com.jgraph.drawio.desktop +# +# # Install Gimp +# printf -- '\033[33m Installing Gimp\n\033[37m' +# flatpak install -y flathub org.gimp.GIMP +# +# # Install VSCode +# printf -- '\033[33m Installing VSCode\n\033[37m' +# sudo pacman --noconfirm --needed -S code +# +# # Install remmina +# printf -- '\033[33m Installing remmina\n\033[37m' +# flatpak install -y flathub org.remmina.Remmina + +# Install feh +printf -- '\033[33m Installing feh\n\033[37m' +sudo pacman --noconfirm --needed -S feh + +# Install NerdFonts +printf -- '\033[33m Installing NerdFonts\n\033[37m' +mkdir -p /home/$USER/.local/share/fonts +cd /home/$USER/.local/share/fonts +wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip +unzip -o CodeNewRoman.zip +rm CodeNewRoman.zip +wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip +unzip -o NerdFontsSymbolsOnly.zip +rm NerdFontsSymbolsOnly.zip +fc-cache -fv + +# Install other fonts +printf -- '\033[33m Installing other fonts\n\033[37m' +sudo pacman --noconfirm --needed -S noto-fonts poppler-data + +# Install Brave Browser +printf -- '\033[33m Installing Brave Browser\n\033[37m' +yay --noconfirm -S --needed --aur brave-bin + +# # Install Virtualbox +# printf -- '\033[33m Installing Virtualbox\n\033[37m' +# sudo pacman --noconfirm --needed -S virtualbox virtualbox-guest-iso +# yay --noconfirm -S --needed --aur virtualbox-ext-oracle +# sudo usermod -a -G vboxusers "$USER" + +# Install timeshift +printf -- '\033[33m Installing Timeshift\n\033[37m' +sudo pacman --noconfirm --needed -S timeshift + +# Install sunshine +printf -- '\033[33m Installing Sunshine\n\033[37m' +sudo pacman --noconfirm --needed -S intel-media-driver +yay --noconfirm --needed -S sunshine +echo 'KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"' | sudo tee /etc/udev/rules.d/60-sunshine.rules +mkdir -p ~/.config/systemd/user +cp -f ~/code_server/config/systemd/user/sunshine.service ~/.config/systemd/user/sunshine.service +# if [ "$KERNEL" == "$(uname -r)" ]; then +sudo udevadm control --reload-rules +sudo udevadm trigger +# sudo modprobe uinput +sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine)) +sudo systemctl daemon-reload +systemctl --user start sunshine +# fi + +# Symlink update script +printf -- '\033[33m Symlinking update wrapper\n\033[37m' +mkdir -p ~/.local/bin +ln -sf ~/code_server/update_wrapper.sh ~/.local/bin/update + +# Symlink bashrc +printf -- '\033[33m Symlinking bashrc config\n\033[37m' +ln -sf ~/code_server/bashrc ~/.bashrc + +if [ "$KERNEL" == "$(uname -r)" ]; then + printf -- '\033[32m \n\n***** Update complete! *****\n\n\033[37m' +else + printf -- '\033[32m \n\n***** Update complete! KERNEL UPDATE !!! Please reboot. *****\n\n\033[37m' +fi