From 0704f197a46bc929962c6c5c67cb19cc902027f3 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Tue, 8 Aug 2023 13:53:26 -0700 Subject: [PATCH] chore: Start working on first-run script for users, clean up Yafti/Just --- Containerfile | 5 +- .../usr/share/ublue-os/firstboot/yafti.yml | 8 ---- .../usr/share/ublue-os/just/custom.just | 47 ------------------- .../desktop/shared/usr/bin/bazzite-user-setup | 45 ++++++++++++++++++ .../usr/share/ublue-os/firstboot/yafti.yml | 8 ---- .../usr/share/ublue-os/just/custom.just | 38 --------------- 6 files changed, 49 insertions(+), 102 deletions(-) create mode 100755 system_files/desktop/shared/usr/bin/bazzite-user-setup diff --git a/Containerfile b/Containerfile index 3e488b1d..39b2ae1a 100644 --- a/Containerfile +++ b/Containerfile @@ -84,7 +84,10 @@ RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \ rpm-ostree override replace \ --experimental \ --from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr \ - xorg-x11-server-Xwayland \ + xorg-x11-server-Xwayland && \ + git clone https://github.com/maxiberta/kwin-system76-scheduler-integration.git --depth 1 /tmp/kwin-system76-scheduler-integration && \ + kpackagetool5 --type=KWin/Script --global --install /tmp/kwin-system76-scheduler-integration && \ + rm -rf /tmp/kwin-system76-scheduler-integration \ ; else \ rpm-ostree override replace \ --experimental \ diff --git a/system_files/deck/shared/usr/share/ublue-os/firstboot/yafti.yml b/system_files/deck/shared/usr/share/ublue-os/firstboot/yafti.yml index 43dc7a4a..9d5f2dd0 100644 --- a/system_files/deck/shared/usr/share/ublue-os/firstboot/yafti.yml +++ b/system_files/deck/shared/usr/share/ublue-os/firstboot/yafti.yml @@ -221,14 +221,6 @@ screens: - qBittorrent: org.qbittorrent.qBittorrent - Syncthing: com.github.zocker_160.SyncThingy - VLC: org.videolan.VLC - setup-desktop-environment: - source: yafti.screen.consent - values: - title: Setting up your Desktop Environment - description: | - Configures your desktop environment, including needed plugins/extensions. - actions: - - run: just --unstable setup-desktop-environment theme: source: yafti.screen.title values: diff --git a/system_files/deck/shared/usr/share/ublue-os/just/custom.just b/system_files/deck/shared/usr/share/ublue-os/just/custom.just index a10599c5..06e98d3c 100644 --- a/system_files/deck/shared/usr/share/ublue-os/just/custom.just +++ b/system_files/deck/shared/usr/share/ublue-os/just/custom.just @@ -36,20 +36,6 @@ get-steamcmd: tar -xvzf /tmp/steamcmd.tar.gz -C ~/.steam rm /tmp/steamcmd.tar.gz -enable-system76-scheduler: - #!/usr/bin/env bash - source /etc/default/bazzite - if [[ ${BASE_IMAGE_NAME} == 'kinoite' ]]; then - echo 'Installing System76-Scheduler plugin for KDE...' - git clone https://github.com/maxiberta/kwin-system76-scheduler-integration.git --depth 1 /tmp/kwin-system76-scheduler-integration - kpackagetool5 --type=KWin/Script -i /tmp/kwin-system76-scheduler-integration - kcmshell5 kcm_kwin_scripts - rm -rf /tmp/kwin-system76-scheduler-integration - elif [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then - echo 'Enabling System76-Scheduler GNOME extension...' - gnome-shell-extension-cl -e s76-scheduler@mattjakeman.com - fi - install-nix: curl -s https://raw.githubusercontent.com/dnkmmr69420/nix-installer-scripts/main/installer-scripts/silverblue-nix-installer.sh | bash @@ -68,30 +54,6 @@ get-boilr: -O ~/Desktop/BoilR chmod +x ~/Desktop/BoilR -setup-desktop-environment: - #!/usr/bin/env bash - source /etc/default/bazzite - if [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then - echo 'Configuring GNOME extensions...' - gnome-shell-extension-cl -d background-logo@fedorahosted.org - gnome-shell-extension-cl -e gsconnect@andyholmes.github.io - gnome-shell-extension-cl -e tofumenu@tofu - gsettings set org.gnome.shell.extensions.fedora-menu menu-button-icon-size 20 - gsettings set org.gnome.mutter experimental-features "['variable-refresh-rate']" - mkdir -p $HOME/.config/presets/user/ - gradience-cli import -p /usr/share/ublue-os/bazzite/themes/vapor.json - gradience-cli import -p /usr/share/ublue-os/bazzite/themes/vgui2.json - elif [[ ${BASE_IMAGE_NAME} == 'kinoite' ]]; then - echo 'Installing Wallpaper Engine Plugin for KDE...' - git clone https://github.com/catsout/wallpaper-engine-kde-plugin.git --depth 1 /tmp/wallpaper-engine-kde-plugin - plasmapkg2 -i /tmp/wallpaper-engine-kde-plugin/plugin - rm -rf /tmp/wallpaper-engine-kde-plugin - echo 'Creating Steam shortcuts..' - cp /usr/share/applications/steam.desktop ~/Desktop - sed -i 's@Steam (Runtime)@Steam@g' ~/Desktop/steam.desktop - cp /etc/skel.d/Desktop/Return.desktop ~/Desktop - fi - enable-vapor-theme: #!/usr/bin/env bash source /etc/default/bazzite @@ -170,15 +132,6 @@ enable-duperemove: systemctl enable --now duperemove-weekly@$(systemd-escape $HOME).timer systemctl enable --now duperemove-weekly@$(systemd-escape /run/media/mmcblk0p1).timer -set-btrfs-flags: - #!/usr/bin/env bash - echo 'Configuring drive mount parameters...' - sudo sed -i 's/compress=zstd:1/noatime,lazytime,commit=120,compress-force=zstd:1,space_cache=v2,discard=async/g' /etc/fstab - if grep -q '64GB' <<< $(lsblk -o MODEL); then - echo 'Increasing compression for detected 64GB eMMC' - sudo sed -i 's/compress-force=zstd:1/compress-force=zstd:3/g' /etc/fstab - fi - switch-to-ext4: sudo sed -i 's@STEAMOS_BTRFS_SDCARD_FORMAT_FS="btrfs"@STEAMOS_BTRFS_SDCARD_FORMAT_FS="ext4"@g' /etc/default/steamos-btrfs diff --git a/system_files/desktop/shared/usr/bin/bazzite-user-setup b/system_files/desktop/shared/usr/bin/bazzite-user-setup new file mode 100755 index 00000000..f015c9d9 --- /dev/null +++ b/system_files/desktop/shared/usr/bin/bazzite-user-setup @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +source /etc/default/bazzite + +if [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then + echo 'Running setup for Kinoite' + + echo 'Enabling System76-Scheduler plugin' + kcmshell5 kcm_kwin_scripts + + echo 'Installing Wallpaper Engine Plugin' + git clone https://github.com/catsout/wallpaper-engine-kde-plugin.git --depth 1 /tmp/wallpaper-engine-kde-plugin + plasmapkg2 -i /tmp/wallpaper-engine-kde-plugin/plugin + rm -rf /tmp/wallpaper-engine-kde-plugin + + if [[ $IMAGE_NAME =~ "deck" ]]; then + echo 'Creating Desktop shortcuts' + cp /usr/share/applications/steam.desktop ~/Desktop + sed -i 's@Steam (Runtime)@Steam@g' ~/Desktop/steam.desktop + cp /etc/skel.d/Desktop/Return.desktop ~/Desktop + cp /usr/share/applications/lutris.desktop ~/Desktop + fi +else + echo 'Running setup for Silverblue' + + echo 'Enabling GNOME extensions' + gnome-shell-extension-cl -e s76-scheduler@mattjakeman.com + gnome-shell-extension-cl -d background-logo@fedorahosted.org + gnome-shell-extension-cl -e gsconnect@andyholmes.github.io + + echo 'Enabling VRR' + gsettings set org.gnome.mutter experimental-features "['variable-refresh-rate']" + + echo 'Installing Gradience presets' + mkdir -p $HOME/.config/presets/user/ + gradience-cli import -p /usr/share/ublue-os/bazzite/themes/vapor.json + gradience-cli import -p /usr/share/ublue-os/bazzite/themes/vgui2.json + + if [[ $IMAGE_NAME =~ "deck" ]]; then + echo 'Running setup for Silverblue on Steam Deck' + + echo 'Enabling tofumenu fork' + gsettings set org.gnome.shell.extensions.fedora-menu menu-button-icon-size 20 + gnome-shell-extension-cl -e tofumenu@tofu + fi +fi \ No newline at end of file diff --git a/system_files/desktop/shared/usr/share/ublue-os/firstboot/yafti.yml b/system_files/desktop/shared/usr/share/ublue-os/firstboot/yafti.yml index 106f1f51..f3df7056 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/firstboot/yafti.yml +++ b/system_files/desktop/shared/usr/share/ublue-os/firstboot/yafti.yml @@ -243,14 +243,6 @@ screens: - qBittorrent: org.qbittorrent.qBittorrent - Syncthing: com.github.zocker_160.SyncThingy - VLC: org.videolan.VLC - setup-desktop-environment: - source: yafti.screen.consent - values: - title: Setting up your Desktop Environment - description: | - Configures your desktop environment, including needed plugins/extensions. - actions: - - run: just --unstable setup-desktop-environment theme: source: yafti.screen.title values: diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/custom.just b/system_files/desktop/shared/usr/share/ublue-os/just/custom.just index f444961f..d5b1081b 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/just/custom.just +++ b/system_files/desktop/shared/usr/share/ublue-os/just/custom.just @@ -9,12 +9,6 @@ install-bazzite-arch: distrobox assemble create --file /usr/share/ublue-os/distrobox/bazzite-arch fi -export-steamcmd: - echo 'Installing SteamCMD...' - mkdir -p ~/.steam - distrobox-enter -n bazzite-arch -- ' distrobox-export --bin steamcmd --export-path ~/.steam' - ln -s ~/.steam/steamcmd ~/.steam/steamcmd.sh - install-corectrl: echo 'Installing CoreCtrl...'' rpm-ostree install corectrl @@ -43,20 +37,6 @@ get-greenlight: wget https://github.com/unknownskl/greenlight/releases/download/v2.0.0-beta8/Greenlight-2.0.0-beta8.AppImage -O ~/Desktop/Greenlight.AppImage chmod +x ~/Desktop/Greenlight.AppImage -enable-system76-scheduler: - #!/usr/bin/env bash - source /etc/default/bazzite - if [[ ${BASE_IMAGE_NAME} == 'kinoite' ]]; then - echo 'Installing System76-Scheduler plugin for KDE...' - git clone https://github.com/maxiberta/kwin-system76-scheduler-integration.git --depth 1 /tmp/kwin-system76-scheduler-integration - kpackagetool5 --type=KWin/Script -i /tmp/kwin-system76-scheduler-integration - kcmshell5 kcm_kwin_scripts - rm -rf /tmp/kwin-system76-scheduler-integration - elif [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then - echo 'Enabling System76-Scheduler GNOME extension...' - gnome-shell-extension-cl -e s76-scheduler@mattjakeman.com - fi - enable-supergfxctl: #!/usr/bin/env bash source /etc/default/bazzite @@ -66,24 +46,6 @@ enable-supergfxctl: echo "This requires an Nvidia image." fi -setup-desktop-environment: - #!/usr/bin/env bash - source /etc/default/bazzite - if [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then - echo 'Configuring GNOME extensions...' - gnome-shell-extension-cl -d background-logo@fedorahosted.org - gnome-shell-extension-cl -e gsconnect@andyholmes.github.io - gsettings set org.gnome.mutter experimental-features "['variable-refresh-rate']" - mkdir -p $HOME/.config/presets/user/ - gradience-cli import -p /usr/share/ublue-os/bazzite/themes/vapor.json - gradience-cli import -p /usr/share/ublue-os/bazzite/themes/vgui2.json - elif [[ ${BASE_IMAGE_NAME} == 'kinoite' ]]; then - echo 'Installing Wallpaper Engine Plugin for KDE...' - git clone https://github.com/catsout/wallpaper-engine-kde-plugin.git --depth 1 /tmp/wallpaper-engine-kde-plugin - plasmapkg2 -i /tmp/wallpaper-engine-kde-plugin/plugin - rm -rf /tmp/wallpaper-engine-kde-plugin - fi - enable-vapor-theme: #!/usr/bin/env bash source /etc/default/bazzite