You are not logged in.

#1 2021-07-30 15:57:27

jerryDaBaaws
Member
Registered: 2020-06-08
Posts: 115

[SOLVED] Running dispatcher script in wayland

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*
fi

how 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

Board footer

Powered by FluxBB