chore(just): cleanup and standardize just recipes (#765)

* fix(just): correctly generate tmpfile config with sudo heredoc

* fix(just): correct vfio-pci.ids to vfio_pci.ids in echo

* chore(just): cleanup heredoc for just syntax highlighting in vscode

* feat(just): turn sunshine recipes into 1 recipe

* feat(just): add service toggle to sunshine

* feat(just): turn watchdog recipes into configure-watchdog

* feat(just): turn hide-grub and unhide-grub into 1 recipe

also add option to "fix double ostree entries"

* feat(just): turn virtualization and vfio recipes into 1 recipe

* feat(just): split virtualization recipes into its own file

* feat(just): move install application recipes to its own file

* feat(just): move setup-sunshine to its own file

* feat(just): move waydroid recipes to its own file

* feat(just): move audio recipes into its own file

* fix(just): move distrobox-check-fedora to bazzite-apps just file

* feat(just): standardize verbs for applications

* feat(just): move fixes to its own repository

* feat(just): add alias for yafti (until we change the command in yafti)

* fix(just): apply correct playback props for virtual channels when on deck image

a valve update added virtual sink and filter chain which messes up default outputs for the old config

* chore(just): add more recommended programs for routing audio

* chore: Update to use Sunshine from copr

* chore: Hide toggle-autologin

* chore(just): merge setup and remove recipes for audio

* feat(just): add recipe to restart pipewire

* chore(just): Combine waydroid recipes

* fix(yafti): make yafti use the new recipes for sunshine and grub

* feat(just): add looking-glass selinux option to setup-virtualization

* feat(just): add alias for wayland toggle
This is mainly so both _toggle_wayland and _toggle-wayland will be correct, as this is the only recipe with underscore instead of dash

* chore(just): remove aliases to old "patch" verb for fixes

* feat(just): combine install decky and get alt handheld recipes to setup-decky

* feat(yafti): update yafti config to use new changes

* chore: update readme to reflect new ujust recipes

* fix(yafti): update desktop yafti config to use new ujust recipes

* chore(just): add echo to restart-pipewire

* feat(just): implement ujust configure-powerprofile for kde

* feat: add support for sending power-saver dbus signal on gnome

* fix(just): activate the default power profile after selecting it as default

* feat(just): add message with highlight to ask people to use Balanced profile for testing/debugging

* fix: only try to remove the autostart file if the file exists

---------

Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
This commit is contained in:
HikariKnight 2024-03-01 07:31:59 +01:00 committed by GitHub
parent 4b6565baa9
commit 42607df576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 793 additions and 580 deletions

View File

@ -517,6 +517,12 @@ RUN /tmp/image-info.sh && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/discover_overlay.desktop && \
cp "/usr/share/ublue-os/firstboot/yafti.yml" "/etc/yafti.yml" && \
echo "import \"/usr/share/ublue-os/just/80-bazzite.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/81-bazzite-fixes.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-apps.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-sunshine.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-waydroid.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/83-bazzite-audio.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/84-bazzite-virt.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/85-bazzite-image.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/90-bazzite-de.just\"" >> /usr/share/ublue-os/justfile && \
pip install --prefix=/usr yafti && \

View File

@ -60,7 +60,7 @@ Bazzite dibentuk dari [ublue-os/main](https://github.com/ublue-os/main) and [ubl
- Driver [GCAdapter_OC](https://github.com/hannesmann/gcadapter-oc-kmod) untuk men-overclocking Kontroller Nintendo Gamecube sampai dengan 1000hz polling.
- Dukungan untuk keyboard [Wooting](https://wooting.io/).
- Dukungan untuk kartu grafis Southern Islands <sub><sup>(HD 7000)</sup></sub> and Sea Islands <sub><sup>(HD 8000)</sup></sub> dengan driver `amdgpu`.
- Memperbaiki masalah untuk [game yang menggunakan engine Source 1 <sub><sup>(Contoh: TF2)</sup></sub>](https://github.com/ValveSoftware/Source-1-Games/issues/5043) yang membuat game-nya crash saat dijalankan `ujust patch-source1-tcmalloc`
- Memperbaiki masalah untuk [game yang menggunakan engine Source 1 <sub><sup>(Contoh: TF2)</sup></sub>](https://github.com/ValveSoftware/Source-1-Games/issues/5043) yang membuat game-nya crash saat dijalankan `ujust fix-source1-tcmalloc`
- [XwaylandVideoBridge](https://invent.kde.org/system/xwaylandvideobridge) untuk Discord screensharing di Wayland.
- [Webapp Manager](https://github.com/linuxmint/webapp-manager) tersedia untuk membuat aplikasi dari situs web dengan berbagai macam peramban, termasuk Firefox.

View File

@ -72,7 +72,7 @@ Bazzite es creado con [ublue-os/main](https://github.com/ublue-os/main) y [ublue
- Driver [GCAdapter_OC](https://github.com/hannesmann/gcadapter-oc-kmod) para aumentar la frecuencia del reloj (overclocking) del adaptador para el mando de videojuegos del Gamecube de Nintendo para obtener una taza de sondeo (polling rate) de 1000hz.
- Soporte fuera de la caja para los teclados hechos por [Wooting](https://wooting.io/).
- Soporte incorporado de las GPU de las familias <sub><sup>(HD 7000)</sup></sub> y Sea Islands <sub><sup>(HD 8000)</sup></sub> de AMD bajo el driver `amdgpu`.
- Un parche esta disponible [para un bug en juegos de 32 bits que usen el motor Source 1](https://github.com/ValveSoftware/Source-1-Games/issues/5043)<sub><sup>[(Por ejemplo: TF2)](https://github.com/ValveSoftware/Source-1-Games/issues/5043)</sup></sub> que provoca que el juego se congele al ser iniciado, para aplicar el parche, ejecuta el siguiente comando en una terminal: `ujust patch-source1-tcmalloc`
- Un parche esta disponible [para un bug en juegos de 32 bits que usen el motor Source 1](https://github.com/ValveSoftware/Source-1-Games/issues/5043)<sub><sup>[(Por ejemplo: TF2)](https://github.com/ValveSoftware/Source-1-Games/issues/5043)</sup></sub> que provoca que el juego se congele al ser iniciado, para aplicar el parche, ejecuta el siguiente comando en una terminal: `ujust fix-source1-tcmalloc`
- [XwaylandVideoBridge](https://invent.kde.org/system/xwaylandvideobridge) esta disponible para hacer posible compartir tu pantalla con Discord usando Wayland.
- [Webapp Manager](https://github.com/linuxmint/webapp-manager) esta disponible para crear aplicaciones de sitios web con una variedad de navegadores web, incluyendo Firefox.
@ -156,10 +156,10 @@ rpm-ostree rebase ostree-unverified-registry:ghcr.io/ublue-os/bazzite-deck:stabl
Si estas usando esta imagen en otras computadoras Handheld que no son la Steam Deck, puedes controlar el TDP usando el plugin de Decky Loader llamado SimpleDeckyTDP.
- Primero, instala Decky Loader ejecutando el siguiente comando en una terminal: `ujust get-decky`
- Despues, instala SimpleDeckyTDP ejecutando el siguiente comando en una terminal: `ujust get-simpledeckytdp`
- Primero, instala Decky Loader ejecutando el siguiente comando en una terminal: `ujust setup-decky`
- Despues, instala SimpleDeckyTDP ejecutando el siguiente comando en una terminal: `ujust setup-decky simpledeckytdp`
Si estas usando una computadora Handheld que tiene soporte por parte de [hhd](https://github.com/hhd-dev/hhd) <sub><sup>(Como la Lenovo Legion Go o la ASUS ROG Ally)</sup></sub>, tambien puedes obtener un plugin que integra esta funcionalidad en Game Mode, solo ejecuta el siguiente comando en una terminal: `ujust get-hhd-decky`
Si estas usando una computadora Handheld que tiene soporte por parte de [hhd](https://github.com/hhd-dev/hhd) <sub><sup>(Como la Lenovo Legion Go o la ASUS ROG Ally)</sup></sub>, tambien puedes obtener un plugin que integra esta funcionalidad en Game Mode, solo ejecuta el siguiente comando en una terminal: `ujust setup-decky hhd-decky`
**Igualmente, asegurate de tambien leer la [documentación de HHD (en inglés)](https://github.com/hhd-dev/hhd#after-install), algunas computadoras Handheld requieren ciertos ajustes o tweaks especificos para funcionar correctamente.**

View File

@ -69,7 +69,7 @@ Bazzite is built from [ublue-os/main](https://github.com/ublue-os/main) and [ubl
- [GCAdapter_OC](https://github.com/hannesmann/gcadapter-oc-kmod) driver for overclocking Nintendo's Gamecube Controller Adapter to 1000hz polling.
- Out of the box support for [Wooting](https://wooting.io/) keyboards.
- Built in support for Southern Islands <sub><sup>(HD 7000)</sup></sub> and Sea Islands <sub><sup>(HD 8000)</sup></sub> AMD GPUs under the `amdgpu` driver.
- A fix is available for [a 32-bit Source 1 engine game bug <sub><sup>(IE: TF2)</sup></sub>](https://github.com/ValveSoftware/Source-1-Games/issues/5043) that makes the game crash on launch - `ujust patch-source1-tcmalloc`
- A fix is available for [a 32-bit Source 1 engine game bug <sub><sup>(IE: TF2)</sup></sub>](https://github.com/ValveSoftware/Source-1-Games/issues/5043) that makes the game crash on launch - `ujust fix-source1-tcmalloc`
- [XwaylandVideoBridge](https://invent.kde.org/system/xwaylandvideobridge) is available for Discord screensharing on Wayland.
- [Webapp Manager](https://github.com/linuxmint/webapp-manager) is available for creating applications from websites for a variety of browsers, including Firefox.
@ -147,10 +147,10 @@ rpm-ostree rebase ostree-unverified-registry:ghcr.io/ublue-os/bazzite-deck:stabl
#### Alternative Handhelds
If you're using this image on a handheld other than the Steam Deck, you can get TDP control via the SimpleDeckyTDP Decky Loader Plugin.
- First install Decky Loader with: `ujust get-decky`
- Then install SimpleDeckyTDP with: `ujust get-simpledeckytdp`
- First install Decky Loader with: `ujust setup-decky`
- Then install SimpleDeckyTDP with: `ujust setup-decky simpledeckytdp`
If you're using a handheld supported by [hhd](https://github.com/hhd-dev/hhd) <sub><sup>(Such as the Lenovo Legion Go and the ASUS Ally)</sup></sub>, you can also get the plugin to integrate an option menu for it into game mode with: `ujust get-hhd-decky`
If you're using a handheld supported by [hhd](https://github.com/hhd-dev/hhd) <sub><sup>(Such as the Lenovo Legion Go and the ASUS Ally)</sup></sub>, you can also get the plugin to integrate an option menu for it into game mode with: `ujust setup-decky hhd-decky`
**Be sure to also read the [hhd documentation](https://github.com/hhd-dev/hhd#after-install), some handhelds require specific setting changes/tweaks to function properly.**

View File

@ -31,7 +31,7 @@ screens:
description: A plugin loader for the Steam Deck
default: false
packages:
- Retrieve Decky: sudo -A ujust get-decky
- Retrieve Decky: sudo -A ujust setup-decky install
EmuDeck:
description: |
A utility for installing and configuring emulators on the Steam Deck
@ -42,14 +42,14 @@ screens:
description: A self-hosted game stream host for Moonlight
default: false
packages:
- Install Sunshine: ujust install-sunshine
- Autostart Sunshine: ujust autostart-sunshine
- Install Sunshine: ujust setup-sunshine install
- Autostart Sunshine: ujust setup-sunshine autostart
Hide GRUB Menu:
description: |
NOTE: Press the escape key before boot to show the menu
default: true
packages:
- Hide GRUB: sudo -A ujust hide-grub
- Hide GRUB: sudo -A ujust configure-grub hide
Install Game Mode Startup Video:
description: Adds a Bazzite themed startup video for Steam's game mode.
default: true
@ -79,7 +79,7 @@ screens:
description: A configurator for Wooting keyboards
default: false
packages:
- Retrieve Wootility: ujust get-wootility
- Retrieve Wootility: ujust install-wootility
OpenTabletDriver:
description: Open source, cross-platform, user-mode tablet driver
default: false
@ -99,7 +99,7 @@ screens:
description: Installs SteamCMD
default: true
packages:
- Install SteamCMD: ujust get-steamcmd
- Install SteamCMD: ujust install-steamcmd
Use EXT4 for SD Cards:
description: Disable BTRFS support for SD cards for direct compatibility with SD cards formatted on stock SteamOS (Not recommended).
default: false

View File

@ -1,37 +1,58 @@
# vim: set ft=make :
# Install Decky Loader (https://github.com/SteamDeckHomebrew/decky-loader)
get-decky:
#!/usr/bin/bash
export HOME=$(getent passwd ${SUDO_USER:-$USER} | cut -d: -f6)
curl -L https://github.com/SteamDeckHomebrew/decky-installer/releases/latest/download/install_release.sh | sh
sudo chcon -R -t bin_t $HOME/homebrew/services/PluginLoader
# Install SimpleDeckyTDP, a simple TDP plugin for alternative PC handhelds
get-simpledeckytdp:
#!/usr/bin/bash
# Install and configure Decky Loader (https://github.com/SteamDeckHomebrew/decky-loader) and plugins for alternative handhelds
setup-decky ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
DECKY_STATE="${b}${red}Not Installed${n}"
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/SimpleDeckyTDP
curl -L $(curl -s https://api.github.com/repos/aarron-lee/SimpleDeckyTDP/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/SimpleDeckyTDP.tar.gz
sudo tar -xzf /tmp/SimpleDeckyTDP.tar.gz -C $HOME/homebrew/plugins
rm /tmp/SimpleDeckyTDP.tar.gz
sudo sed -i 's/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=0/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=1/g' /etc/default/steam-hardware-control
echo 'Installed. Please reboot to apply needed changes.'
else
echo 'Please install Decky Loader by running ujust get-decky first.'
DECKY_STATE="${b}${green}Installed${n}"
fi
# Install HHD Decky Plugin for controlling input on the Lenovo Legion Go and ASUS Ally
get-hhd-decky:
#!/usr/bin/bash
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/hhd-decky
curl -L $(curl -s https://api.github.com/repos/hhd-dev/hhd-decky/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/hhd-decky.tar.gz
sudo tar -xzf /tmp/hhd-decky.tar.gz -C $HOME/homebrew/plugins
rm /tmp/hhd-decky.tar.gz
echo 'Installed.'
else
echo 'Please install Decky Loader by running ujust get-decky first.'
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-watchdog <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'install' to select Install Decky"
echo " Use 'simpledeckytdp' to select Get SimpleDeckyTDP"
echo " Use 'hhd-decky' to select Get HHD-decky"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Setup Decky Loader${normal}"
echo "This lets you setup decky and install some decky plugins for alternative handhelds"
echo "Tip: CTRL+Click on the plugin name to visit the project page for more info"
echo "Decky Loader is $DECKY_STATE"
OPTION=$(
Choose \
"Install Decky" \
"Get $(Urllink "https://github.com/aarron-lee/SimpleDeckyTDP" SimpleDeckyTDP)${n}" \
"Get $(Urllink "https://github.com/hhd-dev/hhd-decky" HHD-Decky)${n}"
)
fi
if [[ "${OPTION,,}" =~ install ]]; then
export HOME=$(getent passwd ${SUDO_USER:-$USER} | cut -d: -f6)
curl -L https://github.com/SteamDeckHomebrew/decky-installer/releases/latest/download/install_release.sh | sh
sudo chcon -R -t bin_t $HOME/homebrew/services/PluginLoader
elif [[ "${OPTION,,}" =~ simpledeckytdp ]]; then
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/SimpleDeckyTDP
curl -L $(curl -s https://api.github.com/repos/aarron-lee/SimpleDeckyTDP/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/SimpleDeckyTDP.tar.gz
sudo tar -xzf /tmp/SimpleDeckyTDP.tar.gz -C $HOME/homebrew/plugins
rm /tmp/SimpleDeckyTDP.tar.gz
sudo sed -i 's/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=0/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=1/g' /etc/default/steam-hardware-control
echo 'Installed. Please reboot to apply needed changes.'
else
echo 'Please install Decky Loader by running "ujust setup-decky install" first.'
fi
elif [[ "${OPTION,,}" =~ hhd-decky ]]; then
if [[ -d $HOME/homebrew/plugins ]]; then
sudo rm -rf $HOME/homebrew/plugins/hhd-decky
curl -L $(curl -s https://api.github.com/repos/hhd-dev/hhd-decky/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -o /tmp/hhd-decky.tar.gz
sudo tar -xzf /tmp/hhd-decky.tar.gz -C $HOME/homebrew/plugins
rm /tmp/hhd-decky.tar.gz
echo 'Installed.'
else
echo 'Please install Decky Loader by running "ujust setup-decky install" first.'
fi
fi
# Install ROG Ally Theme for CSS Loader (https://github.com/semakusut/SBP-ROG-Ally)
@ -139,6 +160,8 @@ restore-input-remapper:
cp /usr/share/applications/input-remapper-gtk.desktop ~/.local/share/applications/input-remapper-gtk.desktop && \
sed -i '/NoDisplay=true/d' ~/.local/share/applications/input-remapper-gtk.desktop
alias _toggle-wayland := _toggle_wayland
_toggle_wayland:
#!/usr/bin/bash
source /etc/default/desktop-wayland

View File

@ -0,0 +1,26 @@
#!/usr/bin/bash
# This script sends the Power Profile Daemon dbus call to set tuneD to power-saver mode
# This is useful only for battery powered devices where you want to start in power-saver mode by default
POWERSAVE=1
if [ -z "$1" ]; then
if [ "$1" == 0 ]; then
POWERSAVE=0
fi
fi
# Check what DE we are on
if command -v /usr/bin/mutter > /dev/null; then
# If we are on Gnome send the dbus signal with gdbus
if [ $POWERSAVE == 0 ]; then
gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'balanced'>"
else
gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'power-saver'>"
fi
else
# Assume we are on KDE and send the dbus signal with qdbus
if [ $POWERSAVE == 0 ]; then
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/PowerProfile setProfile balanced
else
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/PowerProfile setProfile power-saver
fi
fi

View File

@ -36,8 +36,8 @@ screens:
description: A self-hosted game stream host for Moonlight
default: false
packages:
- Install Sunshine: ujust install-sunshine
- Autostart Sunshine: ujust autostart-sunshine
- Install Sunshine: ujust setup-sunshine install
- Autostart Sunshine: ujust setup-sunshine autostart
OpenRazer:
description: Enables additional capabilities for Razer Hardware
default: false
@ -62,7 +62,7 @@ screens:
description: A configurator for Wooting keyboards
default: false
packages:
- Retrieve Wootility: ujust get-wootility
- Retrieve Wootility: ujust install-wootility
Resilio Sync:
description: A file synchronization utility powered by BitTorrent
default: false

View File

@ -1,11 +1,5 @@
# vim: set ft=make :
# Fix the default Steam config to improve download speeds
fix-steam-download-speed:
mkdir -p $HOME/.local/share/Steam
rm -f $HOME/.local/share/Steam/steam_dev.cfg
bash -c 'printf "@nClientDownloadEnableHTTP2PlatformLinux 0\n@fDownloadRateImprovementToAddAnotherConnection 1.0\n" > $HOME/.local/share/Steam/steam_dev.cfg'
# Restore the default Terminal
restore-original-terminal:
#!/usr/bin/bash
@ -28,156 +22,58 @@ install-gamemode-video:
rm -f $HOME/.local/share/Steam/config/uioverrides/movies/deck_startup.webm
ln -s /usr/share/ublue-os/bazzite/bazzite.webm $HOME/.local/share/Steam/config/uioverrides/movies/deck_startup.webm
# Remove all waydroid-related files in your user folders
reset-waydroid:
bash -c 'sudo rm -rf /var/lib/waydroid /home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid'
# Quickly initialize a waydroid image
init-waydroid:
#!/usr/bin/bash
sudo waydroid init -c 'https://ota.waydro.id/system' -v 'https://ota.waydro.id/vendor'
# Launch Waydroid configuration helper
configure-waydroid:
#!/usr/bin/bash
git clone https://github.com/ublue-os/waydroid_script.git --depth 1 /tmp/waydroid_script
python -m venv /tmp/waydroid_script/venv
source /tmp/waydroid_script/venv/bin/activate
sudo pip install -r /tmp/waydroid_script/requirements.txt
sudo /tmp/waydroid_script/main.py
deactivate
sudo rm -rf /tmp/waydroid_script
# Install Sunshine
install-sunshine:
#!/usr/bin/bash
systemctl enable sunshine-workaround.service
ublue-update --wait
rpm-ostree install --apply-live -y sunshine
echo "Sunshine is installed!"
# Remove Sunshine
remove-sunshine:
#!/usr/bin/bash
systemctl disable sunshine-workaround.service
ublue-update --wait
rpm-ostree remove -y sunshine
echo "Sunshine has been uninstalled."
# Autostart Sunshine
autostart-sunshine:
#!/usr/bin/bash
systemctl enable --user --now sunshine.service
# Install LACT for overclocking & undervolting AMD GPUs
install-lact:
#!/usr/bin/bash
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
ublue-update --wait
if [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then
echo 'Installing LACT Libadwaita...'
wget \
$(curl -s https://api.github.com/repos/ilya-zlobintsev/LACT/releases/latest | \
jq -r ".assets[] | select(.name | test(\"lact-libadwaita.*fedora-$(rpm -E %fedora)\")) | .browser_download_url") \
-O /tmp/lact.rpm
else
echo 'Installing LACT...'
wget \
$(curl -s https://api.github.com/repos/ilya-zlobintsev/LACT/releases/latest | \
jq -r ".assets[] | select(.name | test(\"lact-[0-9].*fedora-$(rpm -E %fedora)\")) | .browser_download_url") \
-O /tmp/lact.rpm
fi
rpm-ostree install --apply-live -y /tmp/lact.rpm
sudo systemctl enable --now lactd
rm /tmp/lact.rpm
echo 'Complete.'
# Install SteamCMD (https://developer.valvesoftware.com/wiki/SteamCMD)
get-steamcmd:
echo 'Installing SteamCMD...'
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz -O /tmp/steamcmd.tar.gz
mkdir -p ~/.steam
tar -xvzf /tmp/steamcmd.tar.gz -C ~/.steam
rm /tmp/steamcmd.tar.gz
# Install OpenRazer for Razer gaming hardware
install-openrazer:
sudo wget https://download.opensuse.org/repositories/hardware:/razer/Fedora_$(rpm -E %fedora)/hardware:razer.repo -O /etc/yum.repos.d/hardware:razer.repo && \
ublue-update --wait && \
rpm-ostree install -y openrazer-meta razergenie && \
if ! grep -q "plugdev" /etc/group; then \
sudo bash -c 'grep "plugdev" /lib/group >> /etc/group' \
; fi && \
sudo usermod -a -G plugdev $USER && \
echo "Please reboot to apply needed changes."
# Install Wootility for configuring Wooting Keyboards
get-wootility:
#!/usr/bin/bash
if grep -q 'it.mijorus.gearlever' <<< $(flatpak list); then
wget "https://api.wooting.io/public/wootility/download?os=linux&branch=lekker" -O $HOME/Downloads/wootility.AppImage
flatpak run it.mijorus.gearlever $HOME/Downloads/wootility.AppImage
else
wget "https://api.wooting.io/public/wootility/download?os=linux&branch=lekker" -O $HOME/Desktop/wootility.AppImage
chmod +x $HOME/Desktop/wootility.AppImage
fi
# Patch a bug in some 32-bit Source 1.x titles that causes them to crash at startup
patch-source1-tcmalloc:
#!/usr/bin/bash
echo 'Add the following as a launch option in Steam:'
echo 'LD_PRELOAD=/usr/lib/libtcmalloc_and_profiler.so.4 %command%'
echo "Delete libtcmalloc_minimal.so.x in the game's bin folder if present."
# Patch GMod's 64-bit beta to work properly on Linux (https://github.com/solsticegamestudios/GModCEFCodecFix)
patch-gmod:
#!/usr/bin/bash
mkdir -p /tmp/patch-gmod
wget \
$(curl -s https://api.github.com/repos/solsticegamestudios/GModCEFCodecFix/releases/latest | \
jq -r ".assets[] | select(.name | test(\"GModCEFCodecFix-Linux\")) | .browser_download_url") \
-P /tmp/patch-gmod
chmod +x /tmp/patch-gmod/GModCEFCodecFix-Linux
/tmp/patch-gmod/GModCEFCodecFix-Linux
rm -rf /tmp/patch-gmod
# Install Adwaita-for-Steam theme for CSS Loader (https://github.com/tkashkin/Adwaita-for-Steam)
install-adwaita-for-steam:
#!/usr/bin/bash
if [ -d "$HOME/homebrew/themes" ]; then
rm -rf "$HOME/homebrew/themes/Adwaita-for-Steam"
git clone https://github.com/tkashkin/Adwaita-for-Steam.git --single-branch "$HOME/homebrew/themes/Adwaita-for-Steam"
else
echo 'Please install Decky Loader & CSS Loader first'
fi
# Force-enable AMD pstate
pstate-force-enable:
rpm-ostree kargs --append-if-missing=amd_pstate=active
# Set system to boot without showing the grub screen with options
hide-grub:
#!/usr/bin/bash
sudo sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /etc/default/grub
echo 'GRUB_TIMEOUT_STYLE=hidden' | sudo tee -a /etc/default/grub 1>/dev/null
echo 'GRUB_HIDDEN_TIMEOUT=1' | sudo tee -a /etc/default/grub 1>/dev/null
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
# Configure grub bootmenu visibility and fix duplicate entries
configure-grub ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
GRUB_STATE="$(grep -P "^GRUB_TIMEOUT_STYLE=hidden" /etc/default/grub)"
OPTION={{ ACTION }}
if [ "$GRUB_STATE" == "GRUB_TIMEOUT_STYLE=hidden" ]; then
GRUB_STATE="${b}Hidden${n}"
else
sudo grub2-mkconfig -o /etc/grub2.cfg
GRUB_STATE="${b}Not Hidden${n}"
fi
# Set system to boot with the grub screen showing options (Default)
unhide-grub:
#!/usr/bin/bash
sudo sed -i '/GRUB_HIDDEN_TIMEOUT=1/d' /etc/default/grub
sudo sed -i '/GRUB_TIMEOUT_STYLE=hidden/d' /etc/default/grub
sudo sed -i 's/GRUB_TIMEOUT=0/GRUB_TIMEOUT=5/g' /etc/default/grub
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
else
sudo grub2-mkconfig -o /etc/grub2.cfg
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-grub <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'hide' to select Hide Grub"
echo " Use 'unhide' to select Unhide Grub"
echo " Use 'fix' to select Fix double ostree entry"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Grub menu configuration${normal}"
echo "Grub menu is set to: $GRUB_STATE"
OPTION=$(Choose "Hide Grub" "Unhide Grub" "Fix double ostree entry")
fi
if [[ "${OPTION,,}" =~ ^hide ]]; then
sudo sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /etc/default/grub
echo 'GRUB_TIMEOUT_STYLE=hidden' | sudo tee -a /etc/default/grub 1>/dev/null
echo 'GRUB_HIDDEN_TIMEOUT=1' | sudo tee -a /etc/default/grub 1>/dev/null
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
else
sudo grub2-mkconfig -o /etc/grub2.cfg
fi
elif [[ "${OPTION,,}" =~ ^unhide ]]; then
sudo sed -i '/GRUB_HIDDEN_TIMEOUT=1/d' /etc/default/grub
sudo sed -i '/GRUB_TIMEOUT_STYLE=hidden/d' /etc/default/grub
sudo sed -i 's/GRUB_TIMEOUT=0/GRUB_TIMEOUT=5/g' /etc/default/grub
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
else
sudo grub2-mkconfig -o /etc/grub2.cfg
fi
elif [[ "${OPTION,,}" =~ ^fix ]]; then
sudo grub2-switch-to-blscfg
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
else
sudo grub2-mkconfig -o /etc/grub2.cfg
fi
fi
# Add user to "input" group required by certain controller drivers
@ -188,329 +84,83 @@ add-user-to-input-group:
fi
sudo usermod -a -G input $USER
# Enable Virtualization and add workaround for a specific windows VM crash
enable-virtualization:
#!/usr/bin/bash
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
if [[ -z ${virt_test} ]]; then
echo "Installing QEMU and virt-manager..."
rpm-ostree install -y virt-manager edk2-ovmf qemu
rpm-ostree kargs \
--append-if-missing="kvm.ignore_msrs=1" \
--append-if-missing="kvm.report_ignored_msrs=0"
echo 'Please re-run "ujust enable-virtualization" after the reboot to finish setup'
else
echo "Enabling libvirtd service"
sudo systemctl enable --now libvirtd
echo "libvirtd enabled! If virt-manager says libvirtd.sock is not available after a big update, re-run this command."
fi
# Enable VFIO on the system if virtualization is enabled
enable-vfio:
#!/usr/bin/bash
echo "Enabling VFIO..."
VIRT_TEST=$(rpm-ostree kargs)
CPU_VENDOR=$(grep "vendor_id" "/proc/cpuinfo" | uniq | awk -F": " '{ print $2 }')
VENDOR_KARG="unset"
if [[ ${VIRT_TEST} == *kvm.report_ignored_msrs* ]]; then
echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf
sudo touch /etc/bazzite/initramfs/rebuild
if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then
VENDOR_KARG="amd_iommu=on"
elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then
VENDOR_KARG="intel_iommu=on"
fi
if [[ ${VENDOR_KARG} == "unset" ]]; then
echo "Failed to get CPU vendor, exiting..."
exit 1
else
rpm-ostree kargs \
--append-if-missing="${VENDOR_KARG}" \
--append-if-missing="iommu=pt" \
--append-if-missing="rd.driver.pre=vfio_pci" \
--append-if-missing="vfio_pci.disable_vga=1"
echo "VFIO will be enabled on next boot, make sure you enable IOMMU, VT-d or AMD-v in your BIOS!"
echo "Please understand that since this is such a niche use case, support will be very limited!"
echo "To add your unused/second GPU device ids to the vfio driver by running"
echo 'rpm-ostree kargs --append-if-missing="vfio-pci.ids=xxxx:yyyy,xxxx:yyzz"'
echo "NOTE: Your second GPU will not be usable by the host after you do this!"
fi
else
echo "Enable virtualization with ujust enable-virtualization before running ujust enable-vfio."
fi
# Enable watchdog (default, recovers the system in the event of a malfunction, possible impact to performance due to interrupts)
enable-watchdog:
#!/usr/bin/bash
CPU_MODEL=$(lscpu --json | jq -r '."lscpu"[7]."data"')
WATCHDOG_KARGS="--delete-if-present=nowatchdog"
if [[ "$CPU_MODEL" =~ "Intel" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --delete-if-present=modprobe.blacklist=iTCO_wdt"
elif [[ "$CPU_MODEL" =~ "AMD" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --delete-if-present=modprobe.blacklist=sp5100_tco"
fi
rpm-ostree kargs $WATCHDOG_KARGS
# Disable watchdog (potential performance improvement due to fewer interrupts)
disable-watchdog:
#!/usr/bin/bash
CPU_MODEL=$(lscpu --json | jq -r '."lscpu"[7]."data"')
WATCHDOG_KARGS="--append-if-missing=nowatchdog"
if [[ "$CPU_MODEL" =~ "Intel" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --append-if-missing=modprobe.blacklist=iTCO_wdt"
elif [[ "$CPU_MODEL" =~ "AMD" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --append-if-missing=modprobe.blacklist=sp5100_tco"
fi
rpm-ostree kargs $WATCHDOG_KARGS
# Install Oversteer for Logitech steering wheels
install-oversteer: distrobox-check-fedora
distrobox enter -n fedora -- bash -c 'sudo dnf copr enable -y kylegospo/oversteer && \
sudo dnf install -y oversteer && \
distrobox-export --app oversteer'
# Install Solaar for Logitech Mice, Keyboards, and Trackpads
install-solaar: distrobox-check-fedora
distrobox-enter -n fedora -- bash -c 'sudo dnf install -y \
solaar && \
distrobox-export --app solaar' && \
mkdir -p ~/.config/autostart && \
rm -f ~/.config/autostart/fedora-solaar.desktop && \
cp ~/.local/share/applications/fedora-solaar.desktop ~/.config/autostart/fedora-solaar.desktop
# Install Resilio Sync, a file synchronization utility powered by BitTorrent
install-resilio-sync: distrobox-check-fedora
distrobox-enter -n fedora -- 'sudo rpm --import https://linux-packages.resilio.com/resilio-sync/key.asc' && \
distrobox-enter -n fedora -- 'sudo wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/resilio-sync.repo -O /etc/yum.repos.d/resilio-sync.repo' && \
distrobox-enter -n fedora -- 'sudo dnf install -y resilio-sync' && \
mkdir -p ~/.config/systemd/user/ && \
rm -f ~/.config/systemd/user/fedora-resilio-sync.service && \
wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/fedora-resilio-sync.service -O ~/.config/systemd/user/fedora-resilio-sync.service && \
systemctl --user daemon-reload && \
systemctl enable --user --now fedora-resilio-sync.service
# Install scrcpy, a utility that mirrors Android devices (video and audio) connected via USB or over TCP/IP
install-scrcpy: distrobox-check-fedora
distrobox enter -n fedora -- bash -c 'sudo dnf copr enable -y zeno/scrcpy && \
sudo dnf install -y scrcpy && \
distrobox-export --app scrcpy'
# Install OpenTabletDriver, an open source, cross-platform, user-mode tablet driver
install-opentabletdriver:
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
if grep -qvz "arch" <<< $(distrobox list); then \
Assemble noconfirmcreate "" "arch"; \
fi && \
distrobox enter -n arch -- ' paru -S opentabletdriver --noconfirm' && \
mkdir -p ~/.config/systemd/user/ && \
rm -f ~/.config/systemd/user/arch-opentabletdriver.service && \
wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/OpenTabletDriver/opentabletdriver.service -O ~/.config/systemd/user/arch-opentabletdriver.service && \
systemctl --user daemon-reload && \
systemctl enable --user --now arch-opentabletdriver.service && \
distrobox enter -n arch -- 'distrobox-export --app otd-gui'
# Add virtual audio channels/sinks named Game, Voice, Browser and Music which you can split audio to using qpwgraph, helvum, carla or other pipewire patchbays for use in OBS and other use cases
setup-virtual-channels:
# Configure watchdog (default: enabled, recovers the system in the event of a malfunction)
configure-watchdog ACTION="":
#!/bin/bash
mkdir -p ~/.config/pipewire/pipewire.conf.d
cat << 'EOL' > ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
context.modules = [
{ name = libpipewire-module-loopback
args = {
node.description = "Game"
capture.props = {
node.name = "game_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
node.name = "playback.game_output"
audio.position = [ FL FR ]
node.passive = true
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Voice"
capture.props = {
node.name = "voice_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
node.name = "playback.voice_output"
audio.position = [ FL FR ]
node.passive = true
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Browser"
capture.props = {
node.name = "browser_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
node.name = "playback.browser_output"
audio.position = [ FL FR ]
node.passive = true
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Music"
capture.props = {
node.name = "music_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
node.name = "playback.music_output"
audio.position = [ FL FR ]
node.passive = true
}
}
}
]
EOL
echo "Next time you log in, you will have audio channels for Game, Voice, Browser, Music that you can route game audio to"
echo "using programs like qpwgraph, helvum or carla."
echo "You can also add these channels to OBS audio mixer for separate audio control for yourself and your viewers."
echo "NOTE: It is recommended to mute the virtual channels so you do not have to listen to them twice if you are not exclusively routing the audio through said channel instead of splitting audio to them."
# Remove the virtual audio sinks
remove-virtual-channels:
rm ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
echo "Virtual audio channels config removed, the channels will be removed next time you login."
# Setup a simple Virtual Surround 7.1 sink using the ASH Control Room 1 convolver file (you can change this yourself after setup)
setup-virtual-surround-71:
#!/bin/bash
mkdir -p ~/.config/pipewire/pipewire.conf.d
mkdir -p ~/.config/pipewire/hrir_hesuvi
echo "Downloading HeSuVi convolver profile Control Room 1 from https://github.com/ShanonPearce/ASH-Listening-Set"
wget -O ~/.config/pipewire/hrir_hesuvi/Control_Room_1.wav https://github.com/ShanonPearce/ASH-Listening-Set/raw/main/HeSuVi/hrir/_Control_Room_1.wav
cat << HESUVI > ~/.config/pipewire/pipewire.conf.d/virtual-surround-71.conf
context.modules = [
{ name = libpipewire-module-filter-chain
flags = [ nofail ]
args = {
node.description = "Virtual Surround 7.1"
media.name = "Virtual Surround 7.1"
filter.graph = {
nodes = [
# Duplicate inputs
{ type = builtin label = copy name = copyFL }
{ type = builtin label = copy name = copyFR }
{ type = builtin label = copy name = copyFC }
{ type = builtin label = copy name = copyRL }
{ type = builtin label = copy name = copyRR }
{ type = builtin label = copy name = copySL }
{ type = builtin label = copy name = copySR }
{ type = builtin label = copy name = copyLFE }
# Apply hrir - HeSuVi 14-channel WAV (not the *-.wav variants) (note: */44/* in HeSuVi are the same, but resampled to 44100)
# The file paths HAS to be absolute paths
{ type = builtin label = convolver name = convFL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 0 } }
{ type = builtin label = convolver name = convFL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 1 } }
{ type = builtin label = convolver name = convSL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 2 } }
{ type = builtin label = convolver name = convSL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 3 } }
{ type = builtin label = convolver name = convRL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 4 } }
{ type = builtin label = convolver name = convRL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 5 } }
{ type = builtin label = convolver name = convFC_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 6 } }
{ type = builtin label = convolver name = convFR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 7 } }
{ type = builtin label = convolver name = convFR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 8 } }
{ type = builtin label = convolver name = convSR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 9 } }
{ type = builtin label = convolver name = convSR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 10 } }
{ type = builtin label = convolver name = convRR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 11 } }
{ type = builtin label = convolver name = convRR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 12 } }
{ type = builtin label = convolver name = convFC_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 13 } }
# Treat LFE as FC
{ type = builtin label = convolver name = convLFE_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 6 } }
{ type = builtin label = convolver name = convLFE_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 13 } }
# Stereo output
{ type = builtin label = mixer name = mixL }
{ type = builtin label = mixer name = mixR }
]
links = [
# Input
{ output = "copyFL:Out" input="convFL_L:In" }
{ output = "copyFL:Out" input="convFL_R:In" }
{ output = "copySL:Out" input="convSL_L:In" }
{ output = "copySL:Out" input="convSL_R:In" }
{ output = "copyRL:Out" input="convRL_L:In" }
{ output = "copyRL:Out" input="convRL_R:In" }
{ output = "copyFC:Out" input="convFC_L:In" }
{ output = "copyFR:Out" input="convFR_R:In" }
{ output = "copyFR:Out" input="convFR_L:In" }
{ output = "copySR:Out" input="convSR_R:In" }
{ output = "copySR:Out" input="convSR_L:In" }
{ output = "copyRR:Out" input="convRR_R:In" }
{ output = "copyRR:Out" input="convRR_L:In" }
{ output = "copyFC:Out" input="convFC_R:In" }
{ output = "copyLFE:Out" input="convLFE_L:In" }
{ output = "copyLFE:Out" input="convLFE_R:In" }
# Output
{ output = "convFL_L:Out" input="mixL:In 1" }
{ output = "convFL_R:Out" input="mixR:In 1" }
{ output = "convSL_L:Out" input="mixL:In 2" }
{ output = "convSL_R:Out" input="mixR:In 2" }
{ output = "convRL_L:Out" input="mixL:In 3" }
{ output = "convRL_R:Out" input="mixR:In 3" }
{ output = "convFC_L:Out" input="mixL:In 4" }
{ output = "convFC_R:Out" input="mixR:In 4" }
{ output = "convFR_R:Out" input="mixR:In 5" }
{ output = "convFR_L:Out" input="mixL:In 5" }
{ output = "convSR_R:Out" input="mixR:In 6" }
{ output = "convSR_L:Out" input="mixL:In 6" }
{ output = "convRR_R:Out" input="mixR:In 7" }
{ output = "convRR_L:Out" input="mixL:In 7" }
{ output = "convLFE_R:Out" input="mixR:In 8" }
{ output = "convLFE_L:Out" input="mixL:In 8" }
]
inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In", "copySL:In", "copySR:In" ]
outputs = [ "mixL:Out" "mixR:Out" ]
}
capture.props = {
node.name = "effect_input.virtual-surround-7.1-hesuvi"
media.class = Audio/Sink
audio.channels = 8
audio.position = [ FL FR FC LFE RL RR SL SR ]
}
playback.props = {
node.name = "effect_output.virtual-surround-7.1-hesuvi"
node.passive = true
audio.channels = 2
audio.position = [ FL FR ]
}
}
}
]
HESUVI
echo "Virtual Surround 7.1 has now been set up with a basic convolver file, either restart pipewire or reboot for it to take effect."
echo "Then select the Virtual Surround 7.1 audio output as your default audio output."
echo "If you want something like DTS, Atmos or OpenAL, you will have to acquire those convolver wav files yourself and edit ~/.config/pipewire/pipewire.conf.d/virtual-surround.conf to point to the one you want to use."
# Remove Virtual Surround 7.1 sink
remove-virtual-surround-71:
rm ~/.config/pipewire/pipewire.conf.d/virtual-surround-71.conf
rm ~/.config/pipewire/hrir_hesuvi/Control_Room_1.wav
echo "Virtual Surround 7.1 removed, please reboot or restart pipewire for it to take effect."
# Create fedora distrobox if it doesn't exist
[private]
distrobox-check-fedora:
#!/bin/env bash
source /usr/lib/ujust/ujust.sh
if grep -qvz "fedora" <<< $(distrobox list); then
echo "Setting up Fedora distrobox"
Assemble noconfirmcreate "" "fedora"
WATCHDOG_STATE="$(rpm-ostree kargs)"
CPU_MODEL=$(lscpu --json | jq -r '."lscpu"[7]."data"')
OPTION={{ ACTION }}
if [[ "$WATCHDOG_STATE" =~ (nowatchdog|modprobe\.blacklist=(iTCO_wdt|sp5100_tco)) ]]; then
WATCHDOG_STATE="${red}${b}Disabled${n}"
else
WATCHDOG_STATE="${green}${b}Enabled${n}"
fi
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-watchdog <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'enable' to select Enable Watchdog"
echo " Use 'disable' to select Disable Watchdog"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Watchdog configuration${normal}"
echo "Having the watchdog enabled will let it recover the system in the event of a malfunction, however"
echo "disabling the watchdog can give a potential performance improvement due to fewer interrupts"
echo "Watchdog is $WATCHDOG_STATE"
OPTION=$(Choose "Enable Watchdog" "Disable Watchdog")
fi
if [[ "$OPTION" =~ ^enable ]]; then
WATCHDOG_KARGS="--delete-if-present=nowatchdog"
if [[ "$CPU_MODEL" =~ "Intel" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --delete-if-present=modprobe.blacklist=iTCO_wdt"
elif [[ "$CPU_MODEL" =~ "AMD" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --delete-if-present=modprobe.blacklist=sp5100_tco"
fi
rpm-ostree kargs $WATCHDOG_KARGS
elif [[ "$OPTION" =~ ^disable ]]; then
WATCHDOG_KARGS="--append-if-missing=nowatchdog"
if [[ "$CPU_MODEL" =~ "Intel" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --append-if-missing=modprobe.blacklist=iTCO_wdt"
elif [[ "$CPU_MODEL" =~ "AMD" ]]; then
WATCHDOG_KARGS="$WATCHDOG_KARGS --append-if-missing=modprobe.blacklist=sp5100_tco"
fi
rpm-ostree kargs $WATCHDOG_KARGS
fi
configure-powerprofile ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-powerprofile <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'powersave' to select Powersave"
echo " Use 'balanced' to select Balanced"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Power profile configuration${normal}"
echo "This lets you set the default power profile for when the desktop loads."
echo "We do not recommend changing this from ${b}Balanced${n} if you use this device primarily for gaming!"
echo "If you have any performance or audio related issues..."
echo "${invert}${b}Please test with the default power profile set to Balanced${n} before reporting!"
echo ""
echo "Which power profile do you want to use when the desktop loads?"
OPTION=$(Choose "Powersave" "Balanced")
fi
if [[ "${OPTION,,}" =~ powersave ]]; then
echo "Setting default powerprofile to ${b}Powersave${n}"
bash -c 'cat << PPD > ~/.config/autostart/bazzite-powersave.desktop
[Desktop Entry]
Exec=/usr/bin/bazzite-powersave
Icon=dialog-scripts
Name=bazzite-powersave
Type=Application
PPD'
bazzite-powersave
elif [[ "${OPTION,,}" =~ balanced ]]; then
echo "Setting default powerprofile to ${b}Balanced${n}"
if [ -f "~/.config/autostart/bazzite-powersave.desktop" ]; then
rm ~/.config/autostart/bazzite-powersave.desktop
fi
bazzite-powersave 0
fi

View File

@ -0,0 +1,26 @@
# vim: set ft=make :
# Fix the default Steam config to improve download speeds
fix-steam-download-speed:
mkdir -p $HOME/.local/share/Steam
rm -f $HOME/.local/share/Steam/steam_dev.cfg
bash -c 'printf "@nClientDownloadEnableHTTP2PlatformLinux 0\n@fDownloadRateImprovementToAddAnotherConnection 1.0\n" > $HOME/.local/share/Steam/steam_dev.cfg'
# Patch a bug in some 32-bit Source 1.x titles that causes them to crash at startup
fix-source1-tcmalloc:
#!/usr/bin/bash
echo 'Add the following as a launch option in Steam:'
echo 'LD_PRELOAD=/usr/lib/libtcmalloc_and_profiler.so.4 %command%'
echo "Delete libtcmalloc_minimal.so.x in the game's bin folder if present."
# Patch GMod's 64-bit beta to work properly on Linux (https://github.com/solsticegamestudios/GModCEFCodecFix)
fix-gmod:
#!/usr/bin/bash
mkdir -p /tmp/patch-gmod
wget \
$(curl -s https://api.github.com/repos/solsticegamestudios/GModCEFCodecFix/releases/latest | \
jq -r ".assets[] | select(.name | test(\"GModCEFCodecFix-Linux\")) | .browser_download_url") \
-P /tmp/patch-gmod
chmod +x /tmp/patch-gmod/GModCEFCodecFix-Linux
/tmp/patch-gmod/GModCEFCodecFix-Linux
rm -rf /tmp/patch-gmod

View File

@ -0,0 +1,126 @@
# vim: set ft=make :
# Install LACT for overclocking & undervolting AMD GPUs
install-lact:
#!/usr/bin/bash
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
ublue-update --wait
if [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then
echo 'Installing LACT Libadwaita...'
wget \
$(curl -s https://api.github.com/repos/ilya-zlobintsev/LACT/releases/latest | \
jq -r ".assets[] | select(.name | test(\"lact-libadwaita.*fedora-$(rpm -E %fedora)\")) | .browser_download_url") \
-O /tmp/lact.rpm
else
echo 'Installing LACT...'
wget \
$(curl -s https://api.github.com/repos/ilya-zlobintsev/LACT/releases/latest | \
jq -r ".assets[] | select(.name | test(\"lact-[0-9].*fedora-$(rpm -E %fedora)\")) | .browser_download_url") \
-O /tmp/lact.rpm
fi
rpm-ostree install --apply-live -y /tmp/lact.rpm
sudo systemctl enable --now lactd
rm /tmp/lact.rpm
echo 'Complete.'
alias get-steamcmd := install-steamcmd
# Install SteamCMD (https://developer.valvesoftware.com/wiki/SteamCMD)
install-steamcmd:
echo 'Installing SteamCMD...'
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz -O /tmp/steamcmd.tar.gz
mkdir -p ~/.steam
tar -xvzf /tmp/steamcmd.tar.gz -C ~/.steam
rm /tmp/steamcmd.tar.gz
# Install OpenRazer for Razer gaming hardware
install-openrazer:
sudo wget https://download.opensuse.org/repositories/hardware:/razer/Fedora_$(rpm -E %fedora)/hardware:razer.repo -O /etc/yum.repos.d/hardware:razer.repo && \
ublue-update --wait && \
rpm-ostree install -y openrazer-meta razergenie && \
if ! grep -q "plugdev" /etc/group; then \
sudo bash -c 'grep "plugdev" /lib/group >> /etc/group' \
; fi && \
sudo usermod -a -G plugdev $USER && \
echo "Please reboot to apply needed changes."
alias get-wootility := install-wootility
# Install Wootility for configuring Wooting Keyboards
install-wootility:
#!/usr/bin/bash
if grep -q 'it.mijorus.gearlever' <<< $(flatpak list); then
wget "https://api.wooting.io/public/wootility/download?os=linux&branch=lekker" -O $HOME/Downloads/wootility.AppImage
flatpak run it.mijorus.gearlever $HOME/Downloads/wootility.AppImage
else
wget "https://api.wooting.io/public/wootility/download?os=linux&branch=lekker" -O $HOME/Desktop/wootility.AppImage
chmod +x $HOME/Desktop/wootility.AppImage
fi
# Install Adwaita-for-Steam theme for CSS Loader (https://github.com/tkashkin/Adwaita-for-Steam)
install-adwaita-for-steam:
#!/usr/bin/bash
if [ -d "$HOME/homebrew/themes" ]; then
rm -rf "$HOME/homebrew/themes/Adwaita-for-Steam"
git clone https://github.com/tkashkin/Adwaita-for-Steam.git --single-branch "$HOME/homebrew/themes/Adwaita-for-Steam"
else
echo 'Please install Decky Loader & CSS Loader first'
fi
# Install Oversteer for Logitech steering wheels
install-oversteer: distrobox-check-fedora
distrobox enter -n fedora -- bash -c 'sudo dnf copr enable -y kylegospo/oversteer && \
sudo dnf install -y oversteer && \
distrobox-export --app oversteer'
# Install Solaar for Logitech Mice, Keyboards, and Trackpads
install-solaar: distrobox-check-fedora
distrobox-enter -n fedora -- bash -c 'sudo dnf install -y \
solaar && \
distrobox-export --app solaar' && \
mkdir -p ~/.config/autostart && \
rm -f ~/.config/autostart/fedora-solaar.desktop && \
cp ~/.local/share/applications/fedora-solaar.desktop ~/.config/autostart/fedora-solaar.desktop
# Install Resilio Sync, a file synchronization utility powered by BitTorrent
install-resilio-sync: distrobox-check-fedora
distrobox-enter -n fedora -- 'sudo rpm --import https://linux-packages.resilio.com/resilio-sync/key.asc' && \
distrobox-enter -n fedora -- 'sudo wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/resilio-sync.repo -O /etc/yum.repos.d/resilio-sync.repo' && \
distrobox-enter -n fedora -- 'sudo dnf install -y resilio-sync' && \
mkdir -p ~/.config/systemd/user/ && \
rm -f ~/.config/systemd/user/fedora-resilio-sync.service && \
wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/fedora-resilio-sync.service -O ~/.config/systemd/user/fedora-resilio-sync.service && \
systemctl --user daemon-reload && \
systemctl enable --user --now fedora-resilio-sync.service
# Install scrcpy, a utility that mirrors Android devices (video and audio) connected via USB or over TCP/IP
install-scrcpy: distrobox-check-fedora
distrobox enter -n fedora -- bash -c 'sudo dnf copr enable -y zeno/scrcpy && \
sudo dnf install -y scrcpy && \
distrobox-export --app scrcpy'
# Install OpenTabletDriver, an open source, cross-platform, user-mode tablet driver
install-opentabletdriver:
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
if grep -qvz "arch" <<< $(distrobox list); then \
Assemble noconfirmcreate "" "arch"; \
fi && \
distrobox enter -n arch -- ' paru -S opentabletdriver --noconfirm' && \
mkdir -p ~/.config/systemd/user/ && \
rm -f ~/.config/systemd/user/arch-opentabletdriver.service && \
wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/OpenTabletDriver/opentabletdriver.service -O ~/.config/systemd/user/arch-opentabletdriver.service && \
systemctl --user daemon-reload && \
systemctl enable --user --now arch-opentabletdriver.service && \
distrobox enter -n arch -- 'distrobox-export --app otd-gui'
# Create fedora distrobox if it doesn't exist
[private]
distrobox-check-fedora:
#!/bin/env bash
source /usr/lib/ujust/ujust.sh
if grep -qvz "fedora" <<< $(distrobox list); then
echo "Setting up Fedora distrobox"
Assemble noconfirmcreate "" "fedora"
fi

View File

@ -0,0 +1,49 @@
# vim: set ft=make :
# Setup and configure Sunshine Game Streaming host
setup-sunshine ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
SUNSHINE_STATE="$(rpm -qa sunshine)"
SERVICE_STATE="$(systemctl is-enabled --user sunshine.service)"
OPTION={{ ACTION }}
if [ "$SUNSHINE_STATE" == "" ]; then
SUNSHINE_STATE="${red}${b}Not Installed${n}"
else
SUNSHINE_STATE="${green}${b}Installed${n}"
fi
if [ "$SERVICE_STATE" == "enabled" ]; then
SERVICE_STATE="${green}${b}Enabled${n}"
else
SERVICE_STATE="${red}${b}Disabled${n}"
fi
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust setup-sunshine <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'install' to select Install Sunshine"
echo " Use 'remove' to select Remove Sunshine"
echo " Use 'autostart' to select Toggle Autostart"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Sunshine setup and configuration${normal}"
echo "Sunshine is $SUNSHINE_STATE"
echo "Service is $SERVICE_STATE"
OPTION=$(Choose "Install Sunshine" "Remove Sunshine" "Toggle Autostart")
fi
if [[ "${OPTION,,}" =~ ^install ]]; then
systemctl enable sunshine-workaround.service
ublue-update --wait
rpm-ostree install --apply-live -y sunshine
echo "Sunshine is installed!"
elif [[ "${OPTION,,}" =~ ^(remove|uninstall) ]]; then
systemctl disable sunshine-workaround.service
ublue-update --wait
rpm-ostree remove -y sunshine
echo "Sunshine has been uninstalled."
elif [[ "${OPTION,,}" =~ autostart ]]; then
if [[ "${SERVICE_STATE,,}" =~ disabled ]]; then
systemctl enable --user --now sunshine.service
else
systemctl disable --user --now sunshine.service
fi
fi

View File

@ -0,0 +1,40 @@
# vim: set ft=make :
alias configure-waydroid := setup-waydroid
# Launch Waydroid configuration helper
setup-waydroid ACTION="":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-waydroid <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'init' to select Initialize Waydroid"
echo " Use 'configure' to select Configure Waydroid"
echo " Use 'gpu' to choose Select GPU for Waydroid"
echo " Use 'reset' to select Configure Waydroid"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Waydroid Setup${normal}"
echo "Please read the $(Urllink "https://universal-blue.discourse.group/docs?topic=32" "Waydroid setup documentation") before continuing"
OPTION=$(Choose "Initialize Waydroid" "Configure Waydroid" "Select GPU for Waydroid" "Reset Waydroid (also removes waydroid-related files from user folder)")
fi
if [[ "${OPTION,,}" =~ ^init ]]; then
sudo waydroid init -c 'https://ota.waydro.id/system' -v 'https://ota.waydro.id/vendor'
echo "Waydroid has been initialized, please run waydroid once before you Configure Waydroid"
elif [[ "${OPTION,,}" =~ ^configure ]]; then
git clone https://github.com/ublue-os/waydroid_script.git --depth 1 /tmp/waydroid_script
python -m venv /tmp/waydroid_script/venv
source /tmp/waydroid_script/venv/bin/activate
sudo pip install -r /tmp/waydroid_script/requirements.txt
sudo /tmp/waydroid_script/main.py
deactivate
sudo rm -rf /tmp/waydroid_script
elif [[ "${OPTION,,}" =~ gpu ]]; then
/usr/bin/waydroid-choose-gpu
elif [[ "${OPTION,,}" =~ ^reset ]]; then
echo "Resetting Waydroid"
bash -c 'sudo rm -rf /var/lib/waydroid /home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid'
echo "Waydroid has been reset"
fi

View File

@ -0,0 +1,229 @@
# vim: set ft=make :
# Add virtual audio channels/sinks named Game, Voice, Browser and Music which you can split audio to using qpwgraph, helvum, carla or other pipewire patchbays for use in OBS and other use cases
setup-virtual-channels ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
# Set default props, for deck images make sure default output is valves virtual-sink
PROPS='node.name = "playback.game_output"
audio.position = [ FL FR ]
node.passive = true'
if [[ "$IMAGE_NAME" =~ deck ]]; then
PROPS='node.name = "playback.game_output"
audio.position = [ FL FR ]
node.passive = true
target.object = "input.virtual-sink"'
fi
mkdir -p ~/.config/pipewire/pipewire.conf.d
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust setup-virtual-channels <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'create' to select Create Virtual Audio Channels"
echo " Use 'remove' to select Remove Virtual Audio Channels"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Virtual Audio Channels configuration${normal}"
OPTION=$(Choose "Create Virtual Audio Channels" "Remove Virtual Audio Channels")
fi
if [[ "${OPTION,,}" =~ ^create ]]; then
PLAYBACK_PROPS=$PROPS bash -c 'cat << EOL > ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
context.modules = [
{ name = libpipewire-module-loopback
args = {
node.description = "Game"
capture.props = {
node.name = "game_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
$PLAYBACK_PROPS
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Voice"
capture.props = {
node.name = "voice_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
$PLAYBACK_PROPS
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Browser"
capture.props = {
node.name = "browser_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
$PLAYBACK_PROPS
}
}
}
{ name = libpipewire-module-loopback
args = {
node.description = "Music"
capture.props = {
node.name = "music_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
$PLAYBACK_PROPS
}
}
}
]
EOL'
echo "Next time you log in, you will have audio channels for Game, Voice, Browser, Music that you can route game audio to"
echo "using programs like Pulseaudio volume control, coppwr, qpwgraph, helvum or carla."
echo "You can also add these channels to OBS audio mixer for separate audio control for yourself and your viewers."
echo "NOTE: It is recommended to mute the virtual channels so you do not have to listen to them twice if you are not exclusively routing the audio through said channel instead of splitting audio to them."
elif [[ "${OPTION,,}" =~ ^remove ]]; then
rm ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
echo "Virtual audio channels config removed, the channels will be removed next time you login."
fi
# Setup a simple Virtual Surround 7.1 sink using the ASH Control Room 1 convolver file (you can change this yourself after setup)
setup-virtual-surround ACTION="":
#!/bin/bash
source /usr/lib/ujust/ujust.sh
mkdir -p ~/.config/pipewire/pipewire.conf.d
mkdir -p ~/.config/pipewire/hrir_hesuvi
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust setup-virtual-surround <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'enable' to select Enable Virtual Surround"
echo " Use 'disable' to select Disable Virtual Surround"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Virtual Surround configuration${normal}"
OPTION=$(Choose "Enable Virtual Surround" "Disable Virtual Surround")
fi
if [[ "${OPTION,,}" =~ ^enable ]]; then
echo "Downloading HeSuVi convolver profile Control Room 1 from https://github.com/ShanonPearce/ASH-Listening-Set"
wget -O ~/.config/pipewire/hrir_hesuvi/Control_Room_1.wav https://github.com/ShanonPearce/ASH-Listening-Set/raw/main/HeSuVi/hrir/_Control_Room_1.wav
bash -c 'cat << HESUVI > ~/.config/pipewire/pipewire.conf.d/virtual-surround-71.conf
context.modules = [
{ name = libpipewire-module-filter-chain
flags = [ nofail ]
args = {
node.description = "Virtual Surround 7.1"
media.name = "Virtual Surround 7.1"
filter.graph = {
nodes = [
# Duplicate inputs
{ type = builtin label = copy name = copyFL }
{ type = builtin label = copy name = copyFR }
{ type = builtin label = copy name = copyFC }
{ type = builtin label = copy name = copyRL }
{ type = builtin label = copy name = copyRR }
{ type = builtin label = copy name = copySL }
{ type = builtin label = copy name = copySR }
{ type = builtin label = copy name = copyLFE }
# Apply hrir - HeSuVi 14-channel WAV (not the *-.wav variants) (note: */44/* in HeSuVi are the same, but resampled to 44100)
# The file paths HAS to be absolute paths
{ type = builtin label = convolver name = convFL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 0 } }
{ type = builtin label = convolver name = convFL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 1 } }
{ type = builtin label = convolver name = convSL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 2 } }
{ type = builtin label = convolver name = convSL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 3 } }
{ type = builtin label = convolver name = convRL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 4 } }
{ type = builtin label = convolver name = convRL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 5 } }
{ type = builtin label = convolver name = convFC_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 6 } }
{ type = builtin label = convolver name = convFR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 7 } }
{ type = builtin label = convolver name = convFR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 8 } }
{ type = builtin label = convolver name = convSR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 9 } }
{ type = builtin label = convolver name = convSR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 10 } }
{ type = builtin label = convolver name = convRR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 11 } }
{ type = builtin label = convolver name = convRR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 12 } }
{ type = builtin label = convolver name = convFC_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 13 } }
# Treat LFE as FC
{ type = builtin label = convolver name = convLFE_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 6 } }
{ type = builtin label = convolver name = convLFE_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 13 } }
# Stereo output
{ type = builtin label = mixer name = mixL }
{ type = builtin label = mixer name = mixR }
]
links = [
# Input
{ output = "copyFL:Out" input="convFL_L:In" }
{ output = "copyFL:Out" input="convFL_R:In" }
{ output = "copySL:Out" input="convSL_L:In" }
{ output = "copySL:Out" input="convSL_R:In" }
{ output = "copyRL:Out" input="convRL_L:In" }
{ output = "copyRL:Out" input="convRL_R:In" }
{ output = "copyFC:Out" input="convFC_L:In" }
{ output = "copyFR:Out" input="convFR_R:In" }
{ output = "copyFR:Out" input="convFR_L:In" }
{ output = "copySR:Out" input="convSR_R:In" }
{ output = "copySR:Out" input="convSR_L:In" }
{ output = "copyRR:Out" input="convRR_R:In" }
{ output = "copyRR:Out" input="convRR_L:In" }
{ output = "copyFC:Out" input="convFC_R:In" }
{ output = "copyLFE:Out" input="convLFE_L:In" }
{ output = "copyLFE:Out" input="convLFE_R:In" }
# Output
{ output = "convFL_L:Out" input="mixL:In 1" }
{ output = "convFL_R:Out" input="mixR:In 1" }
{ output = "convSL_L:Out" input="mixL:In 2" }
{ output = "convSL_R:Out" input="mixR:In 2" }
{ output = "convRL_L:Out" input="mixL:In 3" }
{ output = "convRL_R:Out" input="mixR:In 3" }
{ output = "convFC_L:Out" input="mixL:In 4" }
{ output = "convFC_R:Out" input="mixR:In 4" }
{ output = "convFR_R:Out" input="mixR:In 5" }
{ output = "convFR_L:Out" input="mixL:In 5" }
{ output = "convSR_R:Out" input="mixR:In 6" }
{ output = "convSR_L:Out" input="mixL:In 6" }
{ output = "convRR_R:Out" input="mixR:In 7" }
{ output = "convRR_L:Out" input="mixL:In 7" }
{ output = "convLFE_R:Out" input="mixR:In 8" }
{ output = "convLFE_L:Out" input="mixL:In 8" }
]
inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In", "copySL:In", "copySR:In" ]
outputs = [ "mixL:Out" "mixR:Out" ]
}
capture.props = {
node.name = "effect_input.virtual-surround-7.1-hesuvi"
media.class = Audio/Sink
audio.channels = 8
audio.position = [ FL FR FC LFE RL RR SL SR ]
}
playback.props = {
node.name = "effect_output.virtual-surround-7.1-hesuvi"
node.passive = true
audio.channels = 2
audio.position = [ FL FR ]
}
}
}
]
HESUVI'
echo "Virtual Surround 7.1 has now been set up with a basic convolver file, either restart pipewire or reboot for it to take effect."
echo "Then select the Virtual Surround 7.1 audio output as your default audio output."
echo "If you want something like DTS, Atmos or OpenAL, you will have to acquire those convolver wav files yourself and edit ~/.config/pipewire/pipewire.conf.d/virtual-surround-71.conf to point to the one you want to use."
elif [[ "${OPTION,,}" =~ ^disable ]]; then
rm ~/.config/pipewire/pipewire.conf.d/virtual-surround-71.conf
rm ~/.config/pipewire/hrir_hesuvi/Control_Room_1.wav
echo "Virtual Surround 7.1 removed, please reboot or restart pipewire for it to take effect."
fi
# Restart pipewire
restart-pipewire:
echo "Restarting pipewire..."
systemctl --user restart pipewire.service

View File

@ -0,0 +1,96 @@
# vim: set ft=make :
# Setup and configure virtualization and vfio
setup-virtualization ACTION="":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
# Check if we are running on a Steam Deck
if /usr/libexec/hardware/valve-hardware; then
echo "Virtualization is not supported on Steam Deck"
exit 0
else
if [ "$(systemctl is-enabled libvirtd.service)" == "disabled" ]; then
echo "${b}libvirtd${n} service is ${red}disabled${n}!"
echo "${green}enabling${n} and starting libvirtd"
echo "If virt-manager says libvirtd.sock is not available after a big update, re-run this command."
sudo systemctl enable --now libvirtd 2> /dev/null
echo "Press ESC if you want to exit and do not need to do anything"
fi
fi
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-grub <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'enable' to select Enable Virtualization"
echo " Use 'disable' to select Disable Virtualization"
echo " Use 'vfio' to select Enable VFIO drivers"
echo " Use 'shm' to select Autocreate Looking-Glass shm"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}Virtualization Setup${normal}"
echo "NOTE: Enabling Virtualization will layer virt-manager and qemu"
echo " this will slow down system updates by a lot."
OPTION=$(Choose "Enable Virtualization" "Disable Virtualization" "Enable VFIO drivers" "Autocreate Looking-Glass shm")
fi
if [[ "${OPTION,,}" =~ ^enable[[:space:]]virt ]]; then
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
if [[ -z ${virt_test} ]]; then
echo "Installing QEMU and virt-manager..."
rpm-ostree install -y virt-manager edk2-ovmf qemu
rpm-ostree kargs \
--append-if-missing="kvm.ignore_msrs=1" \
--append-if-missing="kvm.report_ignored_msrs=0"
echo 'Please re-run "ujust setup-virtualization" after the reboot to enable libvirtd service'
fi
elif [[ "${OPTION,,}" =~ ^disable ]]; then
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
if [[ ${virt_test} ]]; then
if [ "$(systemctl is-enabled libvirtd.service)" == "enabled" ]; then
echo "${red}Disabling${n} libvirtd before removal"
sudo systemctl disable --now libvirtd 2> /dev/null
fi
echo "Removing QEMU and virt-manager..."
rpm-ostree remove -y virt-manager edk2-ovmf qemu
rpm-ostree kargs \
--delete-if-present="kvm.ignore_msrs=1" \
--delete-if-present="kvm.report_ignored_msrs=0"
echo 'Please re-run "ujust enable-virtualization" after the reboot to finish setup'
fi
elif [[ "${OPTION,,}" =~ vfio ]]; then
echo "Enabling VFIO..."
VIRT_TEST=$(rpm-ostree kargs)
CPU_VENDOR=$(grep "vendor_id" "/proc/cpuinfo" | uniq | awk -F": " '{ print $2 }')
VENDOR_KARG="unset"
if [[ ${VIRT_TEST} == *kvm.report_ignored_msrs* ]]; then
echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf
sudo touch /etc/bazzite/initramfs/rebuild
if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then
VENDOR_KARG="amd_iommu=on"
elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then
VENDOR_KARG="intel_iommu=on"
fi
if [[ ${VENDOR_KARG} == "unset" ]]; then
echo "Failed to get CPU vendor, exiting..."
exit 1
else
rpm-ostree kargs \
--append-if-missing="${VENDOR_KARG}" \
--append-if-missing="iommu=pt" \
--append-if-missing="rd.driver.pre=vfio_pci" \
--append-if-missing="vfio_pci.disable_vga=1"
echo "VFIO will be enabled on next boot, make sure you enable IOMMU, VT-d or AMD-v in your BIOS!"
echo "Please understand that since this is such a niche use case, support will be very limited!"
echo "To add your unused/second GPU device ids to the vfio driver by running"
echo 'rpm-ostree kargs --append-if-missing="vfio-pci.ids=xxxx:yyyy,xxxx:yyzz"'
echo "NOTE: Your second GPU will not be usable by the host after you do this!"
fi
fi
elif [[ "${OPTION,,}" =~ shm ]]; then
echo "Creating tmpfile definition for shm file in /etc/tmpfiles.d/"
sudo bash -c "tee << LOOKING_GLASS_TMP > /etc/tmpfiles.d/10-looking-glass.conf
# Type Path Mode UID GID Age Argument
f /dev/shm/looking-glass 0660 1000 qemu -
LOOKING_GLASS_TMP"
echo "Adding SELinux context record for /dev/shm/looking-glass"
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
fi

View File

@ -1,60 +1,2 @@
# vim: set ft=make :
# Enable Virtualization and add workaround for a specific windows VM crash
enable-virtualization:
#!/usr/bin/bash
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
if [[ -z ${virt_test} ]]; then
echo "Installing QEMU and virt-manager..."
rpm-ostree install -y virt-manager edk2-ovmf qemu
rpm-ostree kargs \
--append-if-missing="kvm.ignore_msrs=1" \
--append-if-missing="kvm.report_ignored_msrs=0"
echo 'Please re-run "ujust enable-virtualization" after the reboot to finish setup'
else
echo "Enabling libvirtd service"
sudo systemctl enable --now libvirtd
echo "libvirtd enabled! If virt-manager says libvirtd.sock is not available after a big update, re-run this command."
fi
# Enable VFIO on the system if virtualization is enabled
enable-vfio:
#!/usr/bin/bash
echo "Enabling VFIO..."
VIRT_TEST=$(rpm-ostree kargs)
CPU_VENDOR=$(grep "vendor_id" "/proc/cpuinfo" | uniq | awk -F": " '{ print $2 }')
VENDOR_KARG="unset"
if [[ ${VIRT_TEST} == *kvm.report_ignored_msrs* ]]; then
echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf
sudo touch /etc/bazzite/initramfs/rebuild
if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then
VENDOR_KARG="amd_iommu=on"
elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then
VENDOR_KARG="intel_iommu=on"
fi
if [[ ${VENDOR_KARG} == "unset" ]]; then
echo "Failed to get CPU vendor, exiting..."
exit 1
else
rpm-ostree kargs \
--append-if-missing="${VENDOR_KARG}" \
--append-if-missing="iommu=pt" \
--append-if-missing="rd.driver.pre=vfio_pci" \
--append-if-missing="vfio_pci.disable_vga=1"
echo "VFIO will be enabled on next boot, make sure you enable IOMMU, VT-d or AMD-v in your BIOS!"
echo "Please understand that since this is such a niche use case, support will be very limited!"
echo "To add your unused/second GPU device ids to the vfio driver by running"
echo 'rpm-ostree kargs --append-if-missing="vfio-pci.ids=xxxx:yyyy,xxxx:yyzz"'
echo "NOTE: Your second GPU will not be usable by the host after you do this!"
fi
else
echo "Enable virtualization with ujust enable-virtualization before running ujust enable-vfio."
fi
# Add SELinux file context for default looking-glass shm file so that libvirt can create it when needed
selinux-looking-glass:
sudo tee << 'LOOKING_GLASS_TMP' > /etc/tmpfiles.d/10-looking-glass.conf
# Type Path Mode UID GID Age Argument
f /dev/shm/looking-glass 0660 1000 qemu -
LOOKING_GLASS_TMP
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
# Placeholder if empty