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

fix remapper $HOME path #81

Closed
wants to merge 2 commits into from
Closed

fix remapper $HOME path #81

wants to merge 2 commits into from

Conversation

maxexcloo
Copy link

Added a replace to fix remapper.service on different users

@@ -40,6 +40,8 @@ sudo cp $HOME/bthidhub/install/on_rpi/sdp_record.xml /etc/bluetooth/sdp_record.x
sudo cp $HOME/bthidhub/install/on_rpi/input.conf /etc/bluetooth/input.conf
sudo cp $HOME/bthidhub/install/on_rpi/main.conf /etc/bluetooth/main.conf

sudo sed -i "s/\/home\/pi/\/home\/$(basename $HOME)/g" $HOME/bthidhub/install/on_rpi/remapper.service
Copy link
Collaborator

@Dreamsorcerer Dreamsorcerer Jan 24, 2024

Choose a reason for hiding this comment

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

Perhaps it'd be a little safer to just put {PI_USER} in the service file and replace that?
Also, I'd rather edit the copied file than end up with uncommitted changes in the repo (i.e. regular UI improvements can be upgraded with git pull if the repo contents are not modified).

@@ -40,6 +40,8 @@ sudo cp $HOME/bthidhub/install/on_rpi/sdp_record.xml /etc/bluetooth/sdp_record.x
sudo cp $HOME/bthidhub/install/on_rpi/input.conf /etc/bluetooth/input.conf
sudo cp $HOME/bthidhub/install/on_rpi/main.conf /etc/bluetooth/main.conf

sudo sed -i "s/\/home\/pi/\/home\/$(basename $HOME)/g" $HOME/bthidhub/install/on_rpi/remapper.service
sudo sed -i "s/PI_USER = 'pi'/PI_USER = '$(basename $HOME)'/g" $HOME/bthidhub/web.py
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same with uncommitted change in this file. At worst, we could write a new file and have the code read the user from that file. Maybe a better approach would be to pass the user in the service file to the application?

@Dreamsorcerer
Copy link
Collaborator

Feel free to separate the revised changes into 2 PRs, in order to get them merged quicker.

@maxexcloo maxexcloo closed this by deleting the head repository Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants