Customisation with chromium-autostart Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
xihepa8923
Posts: 6
Joined: Wed Aug 12, 2020 2:06 pm

Customisation with chromium-autostart

Post by xihepa8923 »

Hi,
I'm using DietPi v6.31.2 on RPi 3B+ with LXDE installed. From the diet-autostart, I have enabled Chromium. Now there are two issues.
  1. If I select the dietpi user, chromium fails to start. Mostly a permission error, I've tried to remove .XAuthority file, but no success. How do I add appropriate permission to my user.
  2. I don't want the user to press ALT+F4 and exit the chromium. For that I've create a script that uses xmodmap to remove the KeyBindings. I'm unable to start this script with chromium autostart. I've tried the following:
    1. Create a systemd service that runs on startup, but the service fails with error unable to open display '', meaning it runs before xserver starts.
    2. Edit .profile and add the script to execute, the script doesn't run.
    3. Edit custom startup script, then chromium doesn't run.
Please help.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Customisation with chromium-autostart

Post by Joulinar »

Hi,

did you tried to create your own custom start script and call the Chromium start script put of it?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
xihepa8923
Posts: 6
Joined: Wed Aug 12, 2020 2:06 pm

Re: Customisation with chromium-autostart

Post by xihepa8923 »

Yes, I did. I called the chromium autostart script inside that and then called my script. All times, my custom script doesn't seem to be running or throwing error of
unable to find display ''
I modified chromium-autostart to run my script from there by modifying the last lines as follows:

Code: Select all

echo "hello"
xinit $FP_CHROMIUM $CHROMIUM_OPTS &
/root/rpi-backend/OS_files/disable-keys.sh
My disable-keys.sh file:

Code: Select all

#!/bin/bash
sleep 30

xmodmap -e "keycode 37 = "
xmodmap -e "keycode 64 = "
xmodmap -e "keycode 70 = "
xmodmap -e "keycode 105 = "
xmodmap -e "keycode 133 = "
xmodmap -e "keycode 134 = "
xmodmap -e "keycode 204 = "
xmodmap -e "keycode 206 = "
If I use the custom.sh, the OS doesn't boot to desktop.

Code: Select all

#!/bin/bash
#---Examples---


# Desktop
# startx

# Chromium
/root/rpi-backend/OS_files/chromium-autostart.sh &

# Print Hello
#echo "Hello"

#---Put your code below this line---
/root/rpi-backend/OS_files/disable-keys.sh
I have tried all the scripts with and without &, but no success so far.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Customisation with chromium-autostart

Post by Joulinar »

just for my understanding. Are you trying to launch a LXDE desktop, a Chromium browser or both?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
xihepa8923
Posts: 6
Joined: Wed Aug 12, 2020 2:06 pm

Re: Customisation with chromium-autostart

Post by xihepa8923 »

I am trying to launch a chromium browser and disable certain keys like ALT, CTRL etc.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Customisation with chromium-autostart

Post by Joulinar »

ok I was a little bit confused as you have LXDE installed and you meant that the desktop doesn't start

Let me try to replicate the issue
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
xihepa8923
Posts: 6
Joined: Wed Aug 12, 2020 2:06 pm

Re: Customisation with chromium-autostart

Post by xihepa8923 »

Thanks. Let me know if any more information is required.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Customisation with chromium-autostart

Post by Joulinar »

ok that's a tricky one. I'm able to manipulate the keyboard bindings if I first start a xsession and manually launch chromium out of it. But this has nothing to do with an automated start of chromium right after booting the system as it require user intervention.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
xihepa8923
Posts: 6
Joined: Wed Aug 12, 2020 2:06 pm

Re: Customisation with chromium-autostart

Post by xihepa8923 »

Yeah, exactly. Then I think it is not possible to directly open the chromium-browser. What can be tried is log in to desktop and then open chromium using bash script in kiosk mode and disable the keys as well. I'll try that then and post the results.

Thanks.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Customisation with chromium-autostart

Post by Joulinar »

basically I just installed Chromium from dietpi-software catalogue. Once finished I used startx to create a xsession command line. There I was able to used xmodmap and launched chromium-browser once keybindings manipulated. I did not install a real desktop.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply