From f795b538a698ea64332c291eb063919a736954f2 Mon Sep 17 00:00:00 2001 From: Andy Rusiecki Date: Sat, 20 Jan 2024 22:16:18 -0500 Subject: [PATCH] cleaning up config file --- Containerfile | 49 ++++++++++----- scripts/add-packages.sh | 6 -- scripts/base-gnome-settings.ini | 37 ----------- scripts/config.json | 87 -------------------------- scripts/framework-gnome-settings.ini | 8 --- scripts/install-fonts.sh | 36 +++++++++++ scripts/install-google-fonts.sh | 17 ----- scripts/install-nerd-fonts.sh | 17 ----- scripts/post-install.sh | 92 +++++++++++++++++++++++++--- scripts/remove-packages.sh | 6 -- 10 files changed, 152 insertions(+), 203 deletions(-) delete mode 100755 scripts/add-packages.sh delete mode 100644 scripts/base-gnome-settings.ini delete mode 100644 scripts/config.json delete mode 100644 scripts/framework-gnome-settings.ini create mode 100755 scripts/install-fonts.sh delete mode 100755 scripts/install-google-fonts.sh delete mode 100755 scripts/install-nerd-fonts.sh delete mode 100755 scripts/remove-packages.sh diff --git a/Containerfile b/Containerfile index 418b671..4d64a37 100644 --- a/Containerfile +++ b/Containerfile @@ -2,18 +2,33 @@ ARG FEDORA_VERSION="39" FROM quay.io/fedora-ostree-desktops/silverblue:${FEDORA_VERSION} as silverblue-base -RUN mkdir /tmp/build -COPY scripts/ /tmp/build/ COPY etc/ /etc/ - -RUN /tmp/build/remove-packages.sh base && \ -/tmp/build/add-packages.sh base && \ -sed -i 's/#AutomaticUpdatePolicy.*/AutomaticUpdatePolicy=stage/' /etc/rpm-ostreed.conf && \ -systemctl enable rpm-ostreed-automatic.timer && \ +COPY scripts/install-fonts.sh /tmp/ +RUN mkdir -p /usr/share/andyrusiecki +COPY scripts/post-install.sh /usr/share/andyrusiecki + +RUN rpm-ostree install \ + https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VERSION}.noarch.rpm \ + https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VERSION}.noarch.rpm + +RUN rpm-ostree override remove \ +firefox \ +firefox-langpacks + +RUN rpm-ostree install \ +adw-gtk3-theme \ +distrobox \ +fish \ +gnome-tweaks \ +starship \ +steam-devices \ +tailscale + +RUN systemctl enable rpm-ostreed-automatic.timer && \ systemctl enable tailscaled -RUN /tmp/build/install-google-fonts.sh base && \ -/tmp/build/install-nerd-fonts.sh base +RUN /tmp/install-google-fonts.sh base && \ +/tmp/install-nerd-fonts.sh base RUN rpm-ostree cleanup -m && \ rm -rf /tmp/* && \ @@ -22,17 +37,21 @@ ostree container commit FROM silverblue-base as silverblue-framework -RUN mkdir /tmp/build -COPY scripts/ /tmp/build/ COPY framework/etc/ /etc/ -RUN /tmp/build/remove-packages.sh framework && \ -/tmp/build/add-packages.sh framework && \ -systemctl enable fprintd && \ +RUN rpm-ostree override remove \ +power-profiles-daemon + +RUN rpm-ostree install \ +fprintd \ +tlp \ +tlp-rdw \ +powertop + +RUN systemctl enable fprintd && \ systemctl enable tlp RUN rpm-ostree cleanup -m && \ -rm -rf /tmp/* && \ ostree container commit FROM registry.fedoraproject.org/fedora-toolbox:${FEDORA_VERSION} as dev-toolbox diff --git a/scripts/add-packages.sh b/scripts/add-packages.sh deleted file mode 100755 index 2ee2b98..0000000 --- a/scripts/add-packages.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -image="$1" -dir=$(dirname $(realpath $0)) -pkgs="$(jq -r '.'$1'.packages.add[]' $dir/config.json | tr '\n' ' ')" - -rpm-ostree install $pkgs diff --git a/scripts/base-gnome-settings.ini b/scripts/base-gnome-settings.ini deleted file mode 100644 index 60de7ba..0000000 --- a/scripts/base-gnome-settings.ini +++ /dev/null @@ -1,37 +0,0 @@ -[org/gnome/desktop/datetime] -automatic-timezone=true - -[org/gnome/desktop/interface] -clock-format='12h' -clock-show-weekday=true -font-antialiasing='rgba' -font-hinting='slight' -gtk-theme='adw-gtk3' -color-scheme='default' - -[org/gnome/desktop/wm/keybindings] -move-to-workspace-1=['1'] -move-to-workspace-2=['2'] -move-to-workspace-3=['3'] -move-to-workspace-4=['4'] -move-to-workspace-5=['5'] -move-to-workspace-6=['6'] -move-to-workspace-7=['7'] -move-to-workspace-8=['8'] -switch-to-workspace-1=['1'] -switch-to-workspace-2=['2'] -switch-to-workspace-3=['3'] -switch-to-workspace-4=['4'] -switch-to-workspace-5=['5'] -switch-to-workspace-6=['6'] -switch-to-workspace-7=['7'] -switch-to-workspace-8=['8'] - -[org/gnome/settings-daemon/plugins/color] -night-light-enabled=true - -[org/gnome/system/location] -enabled=true - -[org.gnome.shell] -favorite-apps=['org.gnome.Nautilus.desktop', 'org.mozilla.firefox.desktop', 'com.google.Chrome.desktop', 'com.spotify.Client.desktop', 'com.valvesoftware.Steam.desktop', 'com.slack.Slack.desktop', 'md.obsidian.Obsidian.desktop', 'com.visualstudio.code.desktop', 'org.gnome.Terminal.desktop'] diff --git a/scripts/config.json b/scripts/config.json deleted file mode 100644 index 134b3ce..0000000 --- a/scripts/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "base": { - "flatpaks": [ - "com.discordapp.Discord", - "com.getpostman.Postman", - "com.github.GradienceTeam.Gradience", - "com.github.marhkb.Pods", - "com.github.tchx84.Flatseal", - "com.github.zocker_160.SyncThingy", - "com.google.Chrome", - "com.mattjakeman.ExtensionManager", - "com.slack.Slack", - "com.spotify.Client", - "com.valvesoftware.Steam", - "com.visualstudio.code", - "io.github.celluloid_player.Celluloid", - "io.github.realmazharhussain.GdmSettings", - "md.obsidian.Obsidian", - "org.Gnome.Boxes", - "org.gnome.World.PikaBackup", - "org.gtk.Gtk3theme.adw-gtk3", - "org.gtk.Gtk3theme.adw-gtk3-ark", - "org.libreoffice.LibreOffice", - "org.mozilla.firefox", - "runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08", - "org.signal.Signal", - "us.zoom.Zoom" - ], - "fonts": { - "google": [], - "nerd": [ - "FireCode", - "FireMono", - "JetBrainsMono", - "Meslo", - "Noto", - "RobotoMono", - "SourceCodePro", - "Ubuntu", - "UbuntuMono" - ] - }, - "gnome-extensions": [ - "AlphabeticalAppGrid@stuarthayhurst", - "appindicatorsupport@rgcjonas.gmail.com", - "blur-my-shell@aunetx", - "caffeine@patapon.info", - "mediacontrols@cliffniff.github.com", - "nightthemeswitcher@romainvigier.fr", - "no-overview@fthx", - "notification-banner-reloaded@marcinjakubowski.github.com", - "pip-on-top@rafostar.github.com", - "user-theme@gnome-shell-extensions.gcampax.github.com", - "Vitals@CoreCoding.com" - ], - "packages": { - "add": [ - "adw-gtk3-theme", - "distrobox", - "fish", - "gnome-tweaks", - "starship", - "tailscale" - ], - "remove": [ - "firefox", - "firefox-langpacks" - ] - } - }, - "framework": { - "flatpaks": [ - "com.github.d4nj1.tlpui" - ], - "packages": { - "add": [ - "fprintd", - "tlp", - "tlp-rdw", - "powertop" - ], - "remove": [ - "power-profiles-daemon" - ] - } - } -} diff --git a/scripts/framework-gnome-settings.ini b/scripts/framework-gnome-settings.ini deleted file mode 100644 index bb8c713..0000000 --- a/scripts/framework-gnome-settings.ini +++ /dev/null @@ -1,8 +0,0 @@ -[org/gnome/desktop/interface] -text-scaling-factor=1.25 - -[org/gnome/desktop/peripherals/touchpad] -tap-to-click=true - -[org/gnome/mutter] -experimental-features=['scale-monitor-framebuffer'] diff --git a/scripts/install-fonts.sh b/scripts/install-fonts.sh new file mode 100755 index 0000000..750a883 --- /dev/null +++ b/scripts/install-fonts.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +google_fonts=() +nerd_fonts=( + FireCode + FireMono + JetBrainsMono + Meslo + Noto + RobotoMono + SourceCodePro + Ubuntu + UbuntuMono +) + + +mkdir -p /usr/share/fonts/google +mkdir -p /usr/share/fonts/nerd + +google_tmp=$(mktemp -d) +for font in ${google_fonts[@]} +do + curl -L https://fonts.google.com/download?family=${font// /%20}.zip --output $google_tmp/$font.zip + unzip $google_tmp/$font.zip -d /usr/share/fonts/google/$font/ +done + +rm -rf $google_tmp + +nerd_tmp=$(mktemp -d) +for font in ${nerd_fonts[@]} +do + curl -L https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font.zip --output $nerd_tmp/$font.zip + unzip $nerd_tmp/$font.zip -d /usr/share/fonts/nerd/$font/ +done + +rm -rf $nerd_tmp diff --git a/scripts/install-google-fonts.sh b/scripts/install-google-fonts.sh deleted file mode 100755 index b375f90..0000000 --- a/scripts/install-google-fonts.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -image="$1" -dir=$(dirname $(realpath $0)) -fonts="$(jq -r '.'$1'.fonts.google[]' $dir/config.json | tr '\n' ' ')" - -tmp_dir=$(mktemp -d) - -mkdir -p /usr/share/fonts/google - -for font in $fonts -do - curl -L https://fonts.google.com/download?family=${font// /%20}.zip --output $tmp_dir/$font.zip - unzip $tmp_dir/$font.zip -d /usr/share/fonts/google/$font/ -done - -rm -rf $tmp_dir diff --git a/scripts/install-nerd-fonts.sh b/scripts/install-nerd-fonts.sh deleted file mode 100755 index a026276..0000000 --- a/scripts/install-nerd-fonts.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -image="$1" -dir=$(dirname $(realpath $0)) -fonts="$(jq -r '.'$1'.fonts.nerd[]' $dir/config.json | tr '\n' ' ')" - -tmp_dir=$(mktemp -d) - -mkdir -p /usr/share/fonts/nerd - -for font in $fonts -do - curl -L https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font.zip --output $tmp_dir/$font.zip - unzip $tmp_dir/$font.zip -d /usr/share/fonts/nerd/$font/ -done - -rm -rf $tmp_dir diff --git a/scripts/post-install.sh b/scripts/post-install.sh index 2156a43..339530b 100755 --- a/scripts/post-install.sh +++ b/scripts/post-install.sh @@ -19,14 +19,52 @@ function getFlatpakExtension() { echo "runtime/$app/$(arch)/$version" } -flatpak_apps="$(jq -r '.base.flatpaks[]' $dir/config.json | tr '\n' ' ')" - -flatpak install --noninteractive $flatpak_apps +flatpak_apps=( + com.discordapp.Discord + com.getpostman.Postman + com.github.GradienceTeam.Gradience + com.github.marhkb.Pods + com.github.tchx84.Flatseal + com.github.zocker_160.SyncThingy + com.google.Chrome + com.mattjakeman.ExtensionManager + com.slack.Slack + com.spotify.Client + com.valvesoftware.Steam + com.visualstudio.code + io.github.celluloid_player.Celluloid + io.github.realmazharhussain.GdmSettings + md.obsidian.Obsidian + org.Gnome.Boxes + org.gnome.World.PikaBackup + org.gtk.Gtk3theme.adw-gtk3 + org.gtk.Gtk3theme.adw-gtk3-ark + org.libreoffice.LibreOffice + org.mozilla.firefox + runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08 + org.signal.Signal + us.zoom.Zoom +) + +flatpak install --noninteractive ${flatpak_apps[@]} # Gnome Extensions # TODO: replace some with Just Perfection with donf settings -extensions="$(jq -r '.base.gnome-extensions[]' $dir/config.json | tr '\n' ' ')" -for uuid in $extensions +extensions=( + AlphabeticalAppGrid@stuarthayhurst + appindicatorsupport@rgcjonas.gmail.com + blur-my-shell@aunetx + caffeine@patapon.info + mediacontrols@cliffniff.github.com + nightthemeswitcher@romainvigier.fr + no-overview@fthx + notification-banner-reloaded@marcinjakubowski.github.com + pip-on-top@rafostar.github.com + user-theme@gnome-shell-extensions.gcampax.github.com + Vitals@CoreCoding.com +) + +for uuid in ${extensions[@]} do info_json=$(curl -sS "https://extensions.gnome.org/extension-info/?uuid=$uuid&shell_version=$shell_version") download_url=$(echo $info_json | jq ".download_url" --raw-output) @@ -35,8 +73,39 @@ do gnome-extensions enable $uuid done -# Gnome dconf settings -cat $dir/base-gnome-settings.ini | dconf load / +# Gnome settings +gsettings set org.gnome.desktop.datetime automatic-timezone true + +gsettings set org.gnome.desktop.interface clock-format "12h" +gsettings set org.gnome.desktop.interface clock-show-weekday true +gsettings set org.gnome.desktop.interface font-antialiasing "rgba" +gsettings set org.gnome.desktop.interface font-hinting "slight" +gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3" +gsettings set org.gnome.desktop.interface color-scheme 'default' + +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['1']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['2']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['3']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['4']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['5']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-6 "['6']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-7 "['7']" +gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-8 "['8']" + +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['1']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['2']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['3']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['4']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['5']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['6']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['7']" +gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['8']" + +gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true + +gsettings set org.gnome.system.location enabled true + +gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop', 'org.mozilla.firefox.desktop', 'com.google.Chrome.desktop', 'com.spotify.Client.desktop', 'com.valvesoftware.Steam.desktop', 'com.slack.Slack.desktop', 'md.obsidian.Obsidian.desktop', 'com.visualstudio.code.desktop', 'org.gnome.Terminal.desktop']" # Enable podman socket for user systemctl --user enable --now podman.socket @@ -51,11 +120,14 @@ if [[ "$image" = "framework" ]]; then # gnome fractional scaling gsettings set org.gnome.desktop.interface text-scaling-factor 1.25 - gsettings set org.gnome.mutter experimental-features "[]'scale-monitor-framebuffer']" + gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']" # install framework specific flatpaks - flatpak_apps="$(jq -r '.framework.flatpaks[]' $dir/config.json | tr '\n' ' ')" - flatpak install $flatpak_apps + flatpak_apps=( + com.github.d4nj1.tlpui + ) + + flatpak install --noninteractive ${flatpak_apps[@]} # enable birghtness keys sudo rpm-ostree kargs --append="module_blacklist=hid_sensor_hub" diff --git a/scripts/remove-packages.sh b/scripts/remove-packages.sh deleted file mode 100755 index cdabac1..0000000 --- a/scripts/remove-packages.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -image="$1" -dir=$(dirname $(realpath $0)) -pkgs="$(jq -r '.'$1'.packages.remove[]' $dir/config.json | tr '\n' ' ')" - -rpm-ostree override remove $pkgs