You are not logged in.
I want to run a script everytime I connect to a specific network, some applications in script can't be run with root privilege. How to achieve this ?
I am close to pulling my hairs on this one xd
Here's my script
#!/bin/bash
DISPLAY=:0
XDG_RUNTIME_DIR="/run/user/1000"
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
interface=$1 status=$2
if [[ "$CONNECTION_UUID" == "connection_name" ]];then
runuser -l *username* *program executable path*
fihow I'm supposed to make this work ?
removing ` runuser -l *username*` dont have any effect either. I'm on sway(wayland)
edit : nvm after a bit of digging, adding `sudo -u user_name DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus` before bash command worked well
Last edited by jerryDaBaaws (2021-07-30 17:06:47)
Offline