mirror of
https://github.com/debloper/xiosk.git
synced 2026-04-27 05:45:54 +03:00
[GH-ISSUE #52] Wayfire Replaced - Do we know how the new environment works with the script now? #50
Labels
No labels
bug
bug
documentation
enhancement
enhancement
feature request
good first issue
good first issue
help wanted
invalid
priority: high
priority: low
priority: medium
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/xiosk#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @andiohn on GitHub (Oct 29, 2024).
Original GitHub issue: https://github.com/debloper/xiosk/issues/52
I'm going to test it, but I was curious if we have some changes to make.
@gjobin commented on GitHub (Oct 29, 2024):
Of course they will replace it just in time for my first setup! First time messing with a RPi and been struggling to understand why it was not working. Now I know. Watching this issue. TY.
@gjobin commented on GitHub (Oct 29, 2024):
I was able to make it launch at startup with this :
sudo echo "~/piosk/scripts/browser.sh" > ~/.config/labwc/autostart@debloper commented on GitHub (Oct 30, 2024):
No changes would be needed if you stick with wayfire. But, that's swimming against the tide, and not a long term strategy.
We're better off changing the approach of how the browser & keyboard toggle is autostarted. Here's my proposal (feel free to share alternative ideas): #53
@kwetiaw-goreng commented on GitHub (Nov 20, 2024):
the above command didnt work for me. what worked for me though,
sudo raspi-config > select option 6 > A6 > W2 Wayfire > Ok and reboot
After reboot, it launched great!
However, the webui to change the URL is not working, not sure what i can do to fix that though. For now I can manually update the config file.
Hope that helps anyone
@tismofied commented on GitHub (Nov 28, 2024):
same exact issue here. the gui worked first boot then broke after reboot.
what's the location of the config file to add sites manually?
@debloper commented on GitHub (Nov 28, 2024):
~/piosk/config.jsonSeems like instead of starting
nodejswithrc.localscript, we should use systemd service unit. That's what breaking nodejs apparently. A lot of people complained aboutrc.localbreaking after updates.@timb33 commented on GitHub (Dec 2, 2024):
what's the last known working rpi OS, that will work as described on the main page? latest 24-11-19 32/64 bit versions don't work. thanks
@timb33 commented on GitHub (Dec 3, 2024):
this worked for me too (thanks). To get the portal working again, I reran the curl script, which starts the portal. I have to do that every time I change config, but this is workable for me.
actually, every time the script is run, a new entry is added to the startup file. So, the script's not idempotent, and you end up with multiple instances started?
@SpiraMirabilis commented on GitHub (Dec 15, 2024):
The piosk needs to use systemd to manage its three scripts that are running.
I'm not really interested in actually submitting a PR but this is how you would do it:
Here is an example of a systemd service that should be used instead of the way piosk currently sets itself up to be autorun:
install in /etc/systemd/system/ and then run sudo systemctl daemon-reload, sudo systemctl enable piosk-browser and sudo systemctl start piosk-browser (repeat for other two)
piosk-browser.service
[Unit]
Description=Run piosk 'browser.sh' to launch chromium
After=default.target
[Service]
Type=simple
ExecStartPre=/usr/bin/sleep 5
ExecStart=/bin/bash /home/pi/piosk/scripts/browser.sh
WorkingDirectory=/home/pi
User=pi
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
Environment=XDG_RUNTIME_DIR=/run/user/1000
Restart=on-failure
[Install]
WantedBy=graphical.target
Note that it has a small sleep delay before the service fires, and it depends on graphical.target so it will launch (with a delay) after the GUI comes up, and it hijacks the pi user's environmental variables for the X display adapter. Note that this will only work if the user is named "pi".
If you configured the raspberry pi user with a different username then you'd have to adjust this. The savvy developer could include these three files as a template in the install script and then use sed to add in the actual user name so that it would always work.
You'd need a seperate version of this for the switcher.sh and also one to run the index.js if you wanted it to switch tabs and have the webserver running, here are the ones I used:
piosk-switcher.service
[Unit]
Description=Run piosk 'switcher.sh' to switch tabs
#After=piosk-browser.service
#Requires=piosk-browser.service
[Service]
Type=simple
ExecStartPre=/usr/bin/sleep 30
ExecStart=/bin/bash /home/pi/piosk/scripts/switcher.sh
WorkingDirectory=/home/pi
User=pi
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
Environment=XDG_RUNTIME_DIR=/run/user/1000
Restart=on-failure
RestartSec=5
[Install]
WantedBy=graphical.target
piosk-webserver.service
[Unit]
Description=Run piosk webserver
[Service]
Type=simple
ExecStartPre=/usr/bin/sleep 5
ExecStart=/usr/bin/node /home/pi/piosk/index.js
WorkingDirectory=/home/pi/piosk
User=root
Restart=on-failure
[Install]
WantedBy=graphical.target
Ideally you should have three of these, including one to run your index.js. Putting things in rc.local is ugly, there is no functionality to restart it if it fails and a bunch of other things.
This will solve the "after X hours the piosk stops switching tabs" issue which is undoubtedly the switcher.sh script failing for some random reason or another, but systemd will automatically restart it as long as "browser.sh" is running.
Edit: I removed the After/Requires section in piosk-switcher.service as this seems to get hung up on boot often and just replaced it with a 30 second delay and hoping for the best, which seems to work well!
@debloper commented on GitHub (Dec 18, 2024):
@SpiraMirabilis you've already done the hard work, just go ahead and send a PR... That'd be great!
As I've said in some other issue... I will only get time by the last week of December (or early January), to clear my GitHub backlogs, depending on how many issues has Santa piled up for me.
@SpiraMirabilis commented on GitHub (Dec 19, 2024):
@debloper I went ahead and did so. I had to re-write the setup.sh and cleanup.sh completely. In this new version the piosk package installs itself in and runs from /opt/piosk rather than ~/piosk. if you want to change that, feel free.
@alexjv89 commented on GitHub (Dec 31, 2024):
Just a thought: these scripts can also be run via pm2. I feel this is simpler, as nodejs is already installed.
as part of setup:
running
pm2 startupwill give you instructions to setup pm2 on boot specific to your system.copy paste execute that and you are good to go.
pm2 unstartup systemd- use this to cancel pm2 from running on boot.@SpiraMirabilis commented on GitHub (Dec 31, 2024):
Since pm2 uses systemd itself, this is just using systemd with extra steps and extra points of failure, though?
@alexjv89 commented on GitHub (Dec 31, 2024):
hmmm, I guess it's a familiarity thing then - "What library are you more familiar with?". I am sure there are equivalents to
pm2 logs switcher&pm2 monitvia systemd. I dont have strong opinions about this.