You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to make changes with gsettings or dconf you shoul have "DBUS_SESSION_BUS_ADDRESS" variable of current user. Since scripts are called from root they don't have any dbus session address, and variable in gsettings can't be changed.
PID=$(pgrep -u $LOGNAME gnome-session) # instead of 'gnome-session' it can be also used 'nautilus' or 'compiz' or the name of a process of a graphical program about that you are sure that is running after you log in the X session
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
The text was updated successfully, but these errors were encountered:
In order to make changes with gsettings or dconf you shoul have "DBUS_SESSION_BUS_ADDRESS" variable of current user. Since scripts are called from root they don't have any dbus session address, and variable in gsettings can't be changed.
You can read about this here: http://stackoverflow.com/questions/10374520/gsettings-with-cron/10390963#10390963 or here: www.unix.com/shell-programming-scripting/203631-dbus_session_bus_address-script-called-crontab.html for example.
I used this lines in my hooks:
The text was updated successfully, but these errors were encountered: