Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Profiles #10

Merged
merged 9 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions 02-workarounds.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
# Workarounds
# Stuff that works but probably needs a cleaner way to install

echo "Add VSCode as an overlay"
# vscode via a flatpak that can access system/toolbox environments isn't a good UX yet, so we compromise here:

sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
rpm-ostree --idempotent install code

# If you need Docker in addition to podman
#rpm-ostree install moby-engine docker-compose

# Theme
# Theme infra is always changing so I just use the Fedora theme, uncomment
# this if you want the Ubuntu theme, default to light theme, but you can
# choose the dark theme
#
echo "Adding the Ubuntu yaru theme"
rpm-ostree --idempotent install yaru-theme
gsettings set org.gnome.desktop.wm.preferences theme "Yaru"
#gsettings set org.gnome.desktop.wm.preferences theme "Yaru-dark"
gsettings set org.gnome.desktop.interface gtk-theme "Yaru"
gsettings set org.gnome.desktop.interface icon-theme "Yaru"
gsettings set org.gnome.desktop.sound theme-name "Yaru"

# Wallpaper
#
# Set a community wallpaper
Expand All @@ -45,6 +26,3 @@ current_profile=$(dconf list /org/gnome/terminal/legacy/profiles:/ | head -n1)
# TODO(mc): We /could/ prompt the user if they want to keep the current font, use Ubuntu Mono, or Ubuntu Mono Nerd Font?
dconf write /org/gnome/terminal/legacy/profiles:/${current_profile}use-system-font false
dconf write /org/gnome/terminal/legacy/profiles:/${current_profile}font "'UbuntuMono Nerd Font 12'"

echo "You need to reboot!"

11 changes: 11 additions & 0 deletions profiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Profiles

Profiles are a collection of scripts that will configure layered packages to enable certain functionality or configure your desktop/environment in specific ways.


| Profile | Description |
| ------- | ----------- |
| tailscale | Install the Tailscale VPN (https://tailscale.com/) |
| vscode | Instal Visual Studio Code |
| yaru | Install the Yaru theme |
| yaru-dark | Install the Yaru-dark theme |
24 changes: 24 additions & 0 deletions profiles/tailscale
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Install tailscale

set -eu

if [ ! -e /etc/yum.repos.d/tailscale.repo ]; then
echo "Installing repo..."
sudo curl -s https://pkgs.tailscale.com/stable/fedora/tailscale.repo -o /etc/yum.repos.d/tailscale.repo > /dev/null
fi

# Check if tailscale is already installed
rpm -q tailscale > /dev/null
if [ $? -eq 1 ]; then
echo "Installing tailscale package..."
rpm-ostree install tailscale
echo "Please reboot to finish installation of the layered package and re-run this script to enable tailscale."
exit 0
fi

echo "Enabling tailscale (systemd)..."
sudo systemctl enable --now tailscaled > /dev/null

echo "Starting tailscale..."
sudo tailscale up
29 changes: 29 additions & 0 deletions profiles/vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# Install vscode as an overlay so it can access the host terminal
# This is hopefully a temporary workaround until the flatpak can
# access the system/toolbox environments without ugly hacks.
set -eu

# Disclaimer
echo "This profile will remove the VSCode flatpak in favor of an overlayed package, in order to enable access to the host terminal. This is a temporary workaround until the flatpak can access the system/toolbox environment without ugly hacks."
echo ""
echo "Press any key to continue, or control-c to exit"
read -n1 -s


# if the flatpak is installed, remove it
if grep -q "com.visualstudio.code" <<< `flatpak list --app --columns=application`; then
echo "Removing Visual Studio Code flatpak..."
flatpak uninstall -y com.visualstudio.code
fi

rpm -q code > /dev/null
if [ $? -eq 1 ]; then
echo "Installing Visual Studio Code as an overlay package..."
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
rpm-ostree install code
echo "Please reboot to finish installation of the layered package."
exit 0
else
echo "Visual Studio Code overlay is already installed."
fi
17 changes: 17 additions & 0 deletions profiles/yaru
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Install the Yaru theme
set -eu


# Check if yaru-theme is already installed
rpm -q yaru-theme > /dev/null
if [ $? -eq 1 ]; then
echo "Installing yaru theme package..."
rpm-ostree install yaru-theme
echo "Please reboot to finish installation of the layered package and re-run this script to enable Yaru."
exit 0
fi

gsettings set org.gnome.desktop.interface gtk-theme "Yaru"
gsettings set org.gnome.desktop.interface icon-theme "Yaru"
gsettings set org.gnome.desktop.sound theme-name "Yaru"
15 changes: 15 additions & 0 deletions profiles/yaru-dark
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Install the Yaru (dark) theme
set -eu

rpm -q yaru-theme > /dev/null
if [ $? -eq 1 ]; then
echo "Installing yaru theme package..."
rpm-ostree install yaru-theme
echo "Please reboot to finish installation of the layered package and re-run this script to enable Yaru-dark."
exit 0
fi

gsettings set org.gnome.desktop.interface gtk-theme "Yaru-dark"
gsettings set org.gnome.desktop.interface icon-theme "Yaru"
gsettings set org.gnome.desktop.sound theme-name "Yaru"