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

feat: openrazer-daemon #44

Merged
merged 5 commits into from
Jan 10, 2025
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
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.repo https://openrazer.github.io/hardware:razer.repo
2 changes: 2 additions & 0 deletions build_files/base/17-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ systemctl enable ublue-guest-user.service
systemctl enable brew-setup.service
systemctl enable brew-upgrade.timer
systemctl enable brew-update.timer
systemctl enable aurora-groups.service
systemctl --global enable ublue-user-setup.service
systemctl --global enable podman-auto-update.timer
systemctl enable check-sb-key.service
Expand All @@ -33,6 +34,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.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
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should have been aurora-groups.sh.

I have the following error now:

systemctl status aurora-groups.service
....
    Process: 3407 ExecStart=/usr/libexec/aurora-groups (code=exited, status=203/EXEC)
   Main PID: 3407 (code=exited, status=203/EXEC)

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

Check warning on line 24 in system_files/shared/usr/libexec/aurora-groups.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

system_files/shared/usr/libexec/aurora-groups.sh#L24

Double quote to prevent globbing and word splitting.
done
# Prevent future executions
echo "Writing state file"
echo "$GROUP_SETUP_VER" > "$GROUP_SETUP_VER_FILE"
Loading