diff --git a/.github/graphics/angry_lunk.png b/.github/graphics/angry_lunk.png new file mode 100644 index 0000000..2116fe5 Binary files /dev/null and b/.github/graphics/angry_lunk.png differ diff --git a/.github/graphics/happy_lunk.png b/.github/graphics/happy_lunk.png new file mode 100644 index 0000000..29bcf71 Binary files /dev/null and b/.github/graphics/happy_lunk.png differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..19b9347 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Lunk + +Chrome extension that can open specified links with terminal commands + +<div align="center"> + <table> + <tr> + <td><img src=".github/graphics/angry_lunk.png" alt="Image of Lunk without lunk"/></td> + <td><img src=".github/graphics/happy_lunk.png" alt="Image of Lunk while using lunk"/></td> + </tr> + <tr> + <td><p align="center">Image of Lunk without lunk</p></td> + <td><p align="center">Image of Lunk while using lunk</p></td> + </tr> + </table> +</div> + +<div align="right">Source: <a href="https://cyanide-and-happiness-show.fandom.com/wiki/Lunk">Cyanide and Happiness</a></div> + +## Details + +The extension consists of two parts. + +There's the Chrome extension, that can be installed through the chrome web store (work in progress), or locally by installing the extension manually. + +Then there's the daemon running in the background. The reason this is not integrated into the chrome extension itself (which would be much more convenient) is missing security permissions. + +## Supported websites + +### Youtube +(work in progress) \ No newline at end of file diff --git a/chrome-plugin/background.js b/chrome-extension/background.js similarity index 91% rename from chrome-plugin/background.js rename to chrome-extension/background.js index 12a5ed9..4844312 100644 --- a/chrome-plugin/background.js +++ b/chrome-extension/background.js @@ -1,6 +1,10 @@ let EXT_SWITCH = true; +chrome.storage.sync.get('globalOnOffSwitch', ({globalOnOffSwitch}) => { + EXT_SWITCH = globalOnOffSwitch ?? true; +}); + chrome.storage.onChanged.addListener((changes, _) => { for (let [key, { oldValue, newValue }] of Object.entries(changes)) { if (key === 'globalOnOffSwitch') { diff --git a/chrome-plugin/graphics/icon.png b/chrome-extension/graphics/icon.png similarity index 100% rename from chrome-plugin/graphics/icon.png rename to chrome-extension/graphics/icon.png diff --git a/chrome-plugin/graphics/icon.svg b/chrome-extension/graphics/icon.svg similarity index 100% rename from chrome-plugin/graphics/icon.svg rename to chrome-extension/graphics/icon.svg diff --git a/chrome-plugin/icon.svg b/chrome-extension/icon.svg similarity index 98% rename from chrome-plugin/icon.svg rename to chrome-extension/icon.svg index ff3a6f4..ed7c971 100644 --- a/chrome-plugin/icon.svg +++ b/chrome-extension/icon.svg @@ -9,7 +9,6 @@ id="svg5" inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)" sodipodi:docname="icon.svg" - inkscape:export-filename="/home/h7x4/git/link-opener/chrome-plugin/icon.png" inkscape:export-xdpi="81.279999" inkscape:export-ydpi="81.279999" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" @@ -130,7 +129,6 @@ id="g47566" mask="url(#mask-powermask-path-effect48049)" inkscape:path-effect="#path-effect48049" - inkscape:export-filename="/home/h7x4/git/link-opener/chrome-plugin/g47566.png" inkscape:export-xdpi="108.05971" inkscape:export-ydpi="108.05971" transform="translate(1.656465,1.6518004)"> diff --git a/chrome-plugin/manifest.json b/chrome-extension/manifest.json similarity index 78% rename from chrome-plugin/manifest.json rename to chrome-extension/manifest.json index b7837a6..44a4a17 100644 --- a/chrome-plugin/manifest.json +++ b/chrome-extension/manifest.json @@ -1,9 +1,9 @@ { "manifest_version": 2, - "name": "Link Opener", + "name": "Lunk", "version": "1.0.0", - "description": "An extension to open certain links in local programs", + "description": "An extension to open specified links in local programs", "icons": {}, "permissions": [ diff --git a/chrome-plugin/popup/index.js b/chrome-extension/popup/index.js similarity index 100% rename from chrome-plugin/popup/index.js rename to chrome-extension/popup/index.js diff --git a/chrome-plugin/popup/popup.html b/chrome-extension/popup/popup.html similarity index 88% rename from chrome-plugin/popup/popup.html rename to chrome-extension/popup/popup.html index 4657486..5a03393 100644 --- a/chrome-plugin/popup/popup.html +++ b/chrome-extension/popup/popup.html @@ -10,13 +10,13 @@ </head> <body> - <h1>Link Opener</h1> + <h1>Lunk</h1> <div> <div class="setting"> <h2>On/Off:</h2> <label class="switch"> - <input type="checkbox" id="onOffSwitch"> + <input type="checkbox" id="onOffSwitch" checked> <span class="slider round"></span> </label> </span> diff --git a/chrome-plugin/popup/stylesheets/style.css b/chrome-extension/popup/stylesheets/style.css similarity index 100% rename from chrome-plugin/popup/stylesheets/style.css rename to chrome-extension/popup/stylesheets/style.css diff --git a/chrome-plugin/popup/stylesheets/toggle_button.css b/chrome-extension/popup/stylesheets/toggle_button.css similarity index 100% rename from chrome-plugin/popup/stylesheets/toggle_button.css rename to chrome-extension/popup/stylesheets/toggle_button.css diff --git a/chrome-plugin/site-workers/youtube.js b/chrome-extension/site-workers/youtube.js similarity index 100% rename from chrome-plugin/site-workers/youtube.js rename to chrome-extension/site-workers/youtube.js diff --git a/link-openerd.py b/lunkd.py similarity index 100% rename from link-openerd.py rename to lunkd.py