I am trying to set the display brightness through udev so that I can have different brightness levels on battery and mains power. The following gdbus call works from the command line:-gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Set org.gnome.SettingsDaemon.Power.Screen Brightness '<int32 65>'However, if I have the same thing in a udev rules file:-SUBSYSTEM==power_supply, ENV{POWER_SUPPLY_ONLINE}==0, RUN+=gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Set org.gnome.SettingsDaemon.Power.Screen Brightness '<int32 65>'SUBSYSTEM==power_supply, ENV{POWER_SUPPLY_ONLINE}==1, RUN+=gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Set org.gnome.SettingsDaemon.Power.Screen Brightness '<int32 100>'then triggering the udev rule with udevadm trigger --subsystem-match=power_supply does nothing. How can I make this gdbus call work through udev?
How do I make a gdbus call from udev?
udev;d bus;brightness