pdf / kdeconnect-chrome-extension

A browser extension to send pages and content from your browser to connected KDE Connect devices.
https://chrome.google.com/webstore/detail/kde-connect/ofmplbbfigookafjahpeepbggpofdhbo
MIT License
234 stars 30 forks source link

What does -install do? I want to script this via bash... #16

Closed Gibbz closed 6 years ago

Gibbz commented 6 years ago

Hey guys,

I just found this plugin and it works a treat. But id like to include it in my bash script which sets up a new linux install. I found the sniped of info bellow from the source. Im just wondering if this data is saved somewhere to allow kde connect access to firefox? What file is this stored in so that I can do the same thing via my bash script?

manifestFirefoxTemplate = template.Must(template.New(manifest).Parse(`{ "name": "com.0xc0dedbad.kdeconnect_chrome", "description": "KDE Connect", "path": "{{.Path}}", "type": "stdio", "allowed_extensions": [ "kde-connect@0xc0dedbad.com" ]

pdf commented 6 years ago

-install copies the binary and outputs the JSON config to the correct native host directory(s) for the chosen browser(s). I'm not near a computer right now, but the paths are in the source too, otherwise a web search should provide the correct location if you want to make a copy

pdf commented 6 years ago

Now that I have access to a computer, the native host paths are listed here in the source:

https://github.com/pdf/kdeconnect-chrome-extension/blob/b62bf578379c365a88e1c598e855b1eaae0264e2/install.go#L142

There are two paths for each browser (chrome is the default (def) entry in the map, others are labelled with the browser name), one path for regular users, and one for system-wide install. Inside you will find the binary and associated config - all the install does is write them to this location, so reinstalling the native host just requires those two files to be at the same path.

I'm going to close this issue off for now, but by all means feel free to ask additional questions if this does not answer your question adequately.