Programmatically enable media sharing

Hi,

I was wondering if someone knows hot to programmatically (via command line) enable media sharing (Settings → Sharing → Media sharing)

Thanks!

1 Like

You can set this in dconf (screenshot from dconf-editor):

To edit this by command line:

dconf write /org/gnome/rhythmbox/sharing/enable-sharing true

Thanks @vwbusguy !

I don’t think this is the correct option. It is from rhytmbox and is set to False even when sharing is enabled

Interesting - I wonder if the config has since changed somehow. Did you test it with that value set to true?

Update - You’re right. This doesn’t seem to be the right setting. My apologies. There seems to be three settings here - enabling sharing at all (which needs to be true), enabling media sharing, and then specifying which folders on which network devices to share.

It looks like enabling/disabling it affects /org/gnome/settings-daemon/plugins/sharing/rygel/enabled-connections, but the value doesn’t seem to make sense to me (an array with a string identifier). I see the locations specified when I do a grep -a on the dconf file, so I’m guessing there’s more to it, but this seems to be part of the equation.

The array contains list of connections UUID from NetworkManager (nmcli con show). Looks like this array is responsible for both Media sharing and Sharing itself! Setting it to the correct value enables sharing and setting it to [] disables it!

1 Like