diff --git a/config/common/shared/packages.yml b/config/common/shared/packages.yml index 17a9f78..a16bbda 100644 --- a/config/common/shared/packages.yml +++ b/config/common/shared/packages.yml @@ -15,3 +15,4 @@ install: - realtime-setup - realtime-tests - pulseaudio-utils + - pipx diff --git a/config/files/shared/libexec/atomic-studio-cli/add.nu b/config/files/shared/libexec/atomic-studio-cli/add.nu index bbe7856..630e28b 100755 --- a/config/files/shared/libexec/atomic-studio-cli/add.nu +++ b/config/files/shared/libexec/atomic-studio-cli/add.nu @@ -3,7 +3,7 @@ use lib/distrobox.nu [gen_export_string, DISTROBOX_DOWNLOAD_URL] use lib/std.nu [fancy_prompt_message, user_prompt] -const valid_package_managers = ["apt", "brew", "nix", "dnf", "yum", "paru", "pacman"] +const valid_package_managers = ["apt", "brew", "nix", "dnf", "yum", "paru", "pacman", "pipx"] const distroboxes = [ ["aliases","name", "image", "description"]; ["ubuntu", "ubuntubox", "ghcr.io/ublue-os/ubuntu-toolbox:latest", "Ubuntu based distrobox"] @@ -69,6 +69,7 @@ export def "main add" [ match $package_manager { nix => { nix_install $yes $packages }, brew => { brew_install $yes $packages }, + pipx => { pipx_install $yes $packages } apt | paru | pacman | dnf | yum => { distrobox_installer_wrapper $package_data (match $package_manager { apt => { box_distro: "ubuntu", installer_command: "sudo apt install -y" }, @@ -110,6 +111,12 @@ def distrobox_installer_wrapper [ distrobox enter $box_name -- sh -c $"($manager.installer_command) ($package_data.packages | str join ' ') && ($packages_export) 2> /dev/null" err> /dev/null } +def pipx_install [yes: bool, packages: list] { + for $package in $packages { + run-external pipx install $package + } +} + def brew_install [yes: bool, packages: list] { let brew_path = "/home/linuxbrew/.linuxbrew/bin/brew" if (which brew | length) == 0) or (not ($brew_path | path exists)) { diff --git a/config/files/shared/libexec/atomic-studio-cli/lib/std.nu b/config/files/shared/libexec/atomic-studio-cli/lib/std.nu index ddf64f0..12e8975 100644 --- a/config/files/shared/libexec/atomic-studio-cli/lib/std.nu +++ b/config/files/shared/libexec/atomic-studio-cli/lib/std.nu @@ -2,7 +2,7 @@ export def user_prompt [yes: bool] { if $yes { return true } - let user_response = input "[Y/n]> " + let user_response = input "[y/n]> " return (($user_response =~ "(?i)yes") or ($user_response =~ "(?i)y")) } diff --git a/config/files/shared/libexec/atomic-studio-cli/pw.nu b/config/files/shared/libexec/atomic-studio-cli/pw.nu index 30cfe40..3ec594f 100755 --- a/config/files/shared/libexec/atomic-studio-cli/pw.nu +++ b/config/files/shared/libexec/atomic-studio-cli/pw.nu @@ -2,6 +2,7 @@ const TARGET_CONFIG_PATH = "/etc/profile.d/atomic-pwjack.sh" const VALID_BFSIZES = [8,16,32,64,128,256,512,1024,2048,4096] +const REALTIME_GROUPS = ["realtime", "pipewire"] # Set specific buffersize for PIPEWIRE_QUANTUM variable (fixes ardour and carla crashes) export def "main pw set quantum-buffersize" [--buffersize (-b): int] { @@ -29,14 +30,63 @@ export def "main pw set quantum-buffersize" [--buffersize (-b): int] { exit 0 } +# Edit your own custom configuration for pipewire +export def "main pw edit" [ + --system (-s) # Select system configurations to override + --user (-u) # Select user configs +] { + let pipewire_config_path = $"($env.HOME)/.config/pipewire" + const pipewire_sys_path = "/usr/share/pipewire" + + mkdir $pipewire_config_path + + mut target_fpath = "" + if $system != null { + $target_fpath = $pipewire_sys_path + } + if $user != null { + $target_fpath = $pipewire_config_path + } + + let selected_config_file = (gum file $target_fpath) + + if $system != null { + cp $selected_config_file $pipewire_config_path + } + mut editor = "nano" + if $env.EDITOR != null { + $editor = $env.EDITOR + } + run-external $editor $"($selected_config_file)" +} + +# Installs RTCQS in the host system for checking realtime perms +export def "main pw rtcqs" [] { + pipx install rtcqs + pipx ensurepath + echo "Restart your shell and run rtcqs_gui" +} + # Enables realtime in linux kernel arguments export def "main pw enable realtime" [] { rpm-ostree kargs --append-if-missing="preempt=full" + rpm-ostree kargs --append-if-missing="threadirqs" + + for $group in $REALTIME_GROUPS { + usermod -a -G $group $env.USER + } + echo "Reboot for changes to take effect." } # Disables realtime from linux kernel arguments export def "main pw disable realtime" [] { rpm-ostree kargs --delete-if-present="preempt=full" + rpm-ostree kargs --delete-if-present="threadirqs" + + for $group in $REALTIME_GROUPS { + usermod -R $group $env.USER + } + echo "Reboot for changes to take effect." } # Manage pipewire configurations diff --git a/config/files/shared/share/ublue-os/firstboot/yafti.yml b/config/files/shared/share/ublue-os/firstboot/yafti.yml index 71c2f63..8ec3cda 100644 --- a/config/files/shared/share/ublue-os/firstboot/yafti.yml +++ b/config/files/shared/share/ublue-os/firstboot/yafti.yml @@ -21,17 +21,16 @@ screens: default: false packages: - Change to Nushell: pkexec usermod $USER --shell /usr/bin/nu - - Add Nushell to Shells: pkexec sh -c "[ grep '/usr/bin/nu' /etc/shells ] || echo /usr/bin/nu /etc/shells" Fish Shell: description: Change your user shell to the Fish shell default: true packages: - Change to Fish shell: pkexec usermod $USER --shell /usr/bin/fish - Realtime User Groups: - description: Add certain user groups for your user in order to use realtime applications properly + Realtime: + description: Add certain user groups and kernel arguments for your user in order to use realtime applications properly default: false packages: - - Add realtime group: pkexec sh -c "for GROUP in realtime pipewire ; do usermod -a -G $GROUP $USER ; done" + - Add realtime group: pkexec studio pw enable realtime Davinci Box: description: Reproducible and descartable environment for installing Davinci Resolve - Make sure to install Davinci Resolve inside of davincibox. default: false