Skip to content

Commit

Permalink
feat: openrazer-daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamyukii committed Dec 18, 2024
1 parent a9dc18b commit 3e5d0be
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build_files/base/02-install-copr-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ curl --retry 3 -Lo /etc/yum.repos.d/_copr_sentry-switcheroo-control_discrete.rep

# Add Nerd Fonts Repo
curl --retry 3 -Lo /etc/yum.repos.d/_copr_che-nerd-fonts-"$(rpm -E %fedora)".repo https://copr.fedorainfracloud.org/coprs/che/nerd-fonts/repo/fedora-"$(rpm -E %fedora)"/che-nerd-fonts-fedora-"$(rpm -E %fedora)".repo

# Add openrazer repo
curl -Lo /etc/yum.repos.d/hardware:razer-"${FEDORA_MAJOR_VERSION}".repo https://download.opensuse.org/repositories/hardware:/razer/Fedora_"${FEDORA_MAJOR_VERSION}"/hardware:razer.repo
1 change: 1 addition & 0 deletions build_files/base/17-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/ublue-os-staging-fedora-"${FED
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_che-nerd-fonts-"${FEDORA_MAJOR_VERSION}".repo
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-cisco-openh264.repo
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/hardware:razer-"${FEDORA_MAJOR_VERSION}".repo
for i in /etc/yum.repos.d/rpmfusion-*; do
sed -i 's@enabled=1@enabled=0@g' "$i"
done
Expand Down
1 change: 1 addition & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"nerd-fonts",
"oddjob-mkhomedir",
"opendyslexic-fonts",
"openrazer-daemon",
"printer-driver-brlaser",
"pulseaudio-utils",
"python3-pip",
Expand Down
10 changes: 10 additions & 0 deletions system_files/shared/usr/lib/systemd/system/aurora-groups.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Add plugdev groups
[Service]
Type=oneshot
ExecStart=/usr/libexec/aurora-groups
Restart=on-failure
RestartSec=30
StartLimitInterval=0
[Install]
WantedBy=default.target
28 changes: 28 additions & 0 deletions system_files/shared/usr/libexec/aurora-groups.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# SCRIPT VERSION
GROUP_SETUP_VER=1
GROUP_SETUP_VER_FILE="/etc/ublue/aurora-groups"
GROUP_SETUP_VER_RAN=$(cat "$GROUP_SETUP_VER_FILE")
# Run script if updated
if [[ -f $GROUP_SETUP_VER_FILE && "$GROUP_SETUP_VER" = "$GROUP_SETUP_VER_RAN" ]]; then
echo "Group setup has already run. Exiting..."
exit 0
fi
# Function to append a group entry to /etc/group
append_group() {
local group_name="$1"
if ! grep -q "^$group_name:" /etc/group; then
echo "Appending $group_name to /etc/group"
grep "^$group_name:" /usr/lib/group | tee -a /etc/group > /dev/null
fi
}
# Setup Groups
append_group plugdev
wheelarray=($(getent group wheel | cut -d ":" -f 4 | tr ',' '\n'))
for user in $wheelarray
do
usermod -aG plugdev $user
done
# Prevent future executions
echo "Writing state file"
echo "$GROUP_SETUP_VER" > "$GROUP_SETUP_VER_FILE"

0 comments on commit 3e5d0be

Please sign in to comment.