diff options
author | Robin Schneider <45321827+robinschneider@users.noreply.github.com> | 2021-10-07 00:15:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 00:15:26 +0200 |
commit | 270e522e0ee2bb9bef795251796abbfc74efbef3 (patch) | |
tree | c8a22126b6393b48b6c3bd0365befd6fd695faaf /docs/tips-and-tricks.md | |
parent | 584f2b4b32e69865d9561f1537142791710f676d (diff) | |
parent | 220c60cba04e86e782e9610aa8ef0d77e221072c (diff) | |
download | homer-270e522e0ee2bb9bef795251796abbfc74efbef3.tar.gz homer-270e522e0ee2bb9bef795251796abbfc74efbef3.tar.zst homer-270e522e0ee2bb9bef795251796abbfc74efbef3.zip |
Merge branch 'bastienwirtz:main' into hotkey
Diffstat (limited to 'docs/tips-and-tricks.md')
-rw-r--r-- | docs/tips-and-tricks.md | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md index 94167fb..17bba9a 100644 --- a/docs/tips-and-tricks.md +++ b/docs/tips-and-tricks.md | |||
@@ -3,6 +3,7 @@ | |||
3 | Here is a collection of neat tips and tricks that Homer users have come up with! | 3 | Here is a collection of neat tips and tricks that Homer users have come up with! |
4 | 4 | ||
5 | ## Use Homer as a custom "new tab" page | 5 | ## Use Homer as a custom "new tab" page |
6 | |||
6 | #### `by @vosdev` | 7 | #### `by @vosdev` |
7 | 8 | ||
8 | These extensions for [Firefox](https://addons.mozilla.org/firefox/addon/custom-new-tab-page) and [Chrome & Friends](https://chrome.google.com/webstore/detail/new-tab-changer/occbjkhimchkolibngmcefpjlbknggfh) allow you to have your homer dashboard in your new tab page, while leaving focus on the address bar meaning you can still type right away if you want to search or go to a page that is not on your homer dash. | 9 | These extensions for [Firefox](https://addons.mozilla.org/firefox/addon/custom-new-tab-page) and [Chrome & Friends](https://chrome.google.com/webstore/detail/new-tab-changer/occbjkhimchkolibngmcefpjlbknggfh) allow you to have your homer dashboard in your new tab page, while leaving focus on the address bar meaning you can still type right away if you want to search or go to a page that is not on your homer dash. |
@@ -22,11 +23,12 @@ The Firefox extension loads Homer in an iframe on your new tab page, meaning you | |||
22 | ``` | 23 | ``` |
23 | 24 | ||
24 | ## YAML Anchors | 25 | ## YAML Anchors |
26 | |||
25 | #### `by @JamiePhonic` | 27 | #### `by @JamiePhonic` |
26 | 28 | ||
27 | Since Homer is configured using YAML, it supports all of YAML's helpful features, such as anchoring! | 29 | Since Homer is configured using YAML, it supports all of YAML's helpful features, such as anchoring! |
28 | 30 | ||
29 | For example, you can define tags and tag styles for each "item" in a service. | 31 | For example, you can define tags and tag styles for each "item" in a service. |
30 | Using Anchoring, you can define all your tags and their styles once like this: (for example) | 32 | Using Anchoring, you can define all your tags and their styles once like this: (for example) |
31 | 33 | ||
32 | ```yaml | 34 | ```yaml |
@@ -70,6 +72,7 @@ The end result is that if you want to update the name or style of any particular | |||
70 | Great if you have a lot of services or a lot of tags! | 72 | Great if you have a lot of services or a lot of tags! |
71 | 73 | ||
72 | ## Remotely edit your config with Code Server | 74 | ## Remotely edit your config with Code Server |
75 | |||
73 | #### `by @JamiePhonic` | 76 | #### `by @JamiePhonic` |
74 | 77 | ||
75 | Homer doesn't yet provide a way to edit your configuration from inside Homer itself, but that doesn't mean it can't be done! | 78 | Homer doesn't yet provide a way to edit your configuration from inside Homer itself, but that doesn't mean it can't be done! |
@@ -78,14 +81,17 @@ You can setup and use [Code-Server](https://github.com/cdr/code-server) to edit | |||
78 | 81 | ||
79 | If you're running Homer in docker, you can setup a Code-Server container and pass your homer config directory into it. | 82 | If you're running Homer in docker, you can setup a Code-Server container and pass your homer config directory into it. |
80 | Simply pass your homer config directory as an extra -v parameter to your code-server container: | 83 | Simply pass your homer config directory as an extra -v parameter to your code-server container: |
81 | ``` | 84 | |
85 | ```sh | ||
82 | -v '/your/local/homer/config-dir/':'/config/homer':'rw' | 86 | -v '/your/local/homer/config-dir/':'/config/homer':'rw' |
83 | ``` | 87 | ``` |
88 | |||
84 | This will map your homer config directory (For example, /docker/appdata/homer/) into code-server's `/config/` directory, in a sub folder called `homer` | 89 | This will map your homer config directory (For example, /docker/appdata/homer/) into code-server's `/config/` directory, in a sub folder called `homer` |
85 | 90 | ||
86 | As a bonus, Code-Server puts the "current folder" as a parameter in the URL bar, so you could add a `links:` entry in Homer that points to your code-server instance with the directory pre-filled for essentially 1 click editing! | 91 | As a bonus, Code-Server puts the "current folder" as a parameter in the URL bar, so you could add a `links:` entry in Homer that points to your code-server instance with the directory pre-filled for essentially 1 click editing! |
87 | 92 | ||
88 | For example: | 93 | For example: |
94 | |||
89 | ```yml | 95 | ```yml |
90 | links: | 96 | links: |
91 | - name: Edit config | 97 | - name: Edit config |
@@ -93,9 +99,11 @@ links: | |||
93 | url: https://vscode.example.net/?folder=/config/homer | 99 | url: https://vscode.example.net/?folder=/config/homer |
94 | target: "_blank" # optional html tag target attribute | 100 | target: "_blank" # optional html tag target attribute |
95 | ``` | 101 | ``` |
102 | |||
96 | where the path after `?folder=` is the path to the folder where you mounted your homer config INSIDE the Code-Server container. | 103 | where the path after `?folder=` is the path to the folder where you mounted your homer config INSIDE the Code-Server container. |
97 | 104 | ||
98 | ### Example Code-Server docker create command | 105 | ### Example Code-Server docker create command |
106 | |||
99 | ```sh | 107 | ```sh |
100 | docker create \ | 108 | docker create \ |
101 | --name=code-server \ | 109 | --name=code-server \ |
@@ -111,13 +119,13 @@ docker create \ | |||
111 | linuxserver/code-server | 119 | linuxserver/code-server |
112 | ``` | 120 | ``` |
113 | 121 | ||
114 | |||
115 | ## Get the news headlines in Homer | 122 | ## Get the news headlines in Homer |
116 | 123 | ||
117 | ### Mapping Fields | 124 | ### Mapping Fields |
125 | |||
118 | Most times, the url you're getting headlines from follows a different schema than the one expected by Homer. | 126 | Most times, the url you're getting headlines from follows a different schema than the one expected by Homer. |
119 | 127 | ||
120 | For example, if you would like to show jokes from ChuckNorris.io, you'll find that the url https://api.chucknorris.io/jokes/random is giving you info like this: | 128 | For example, if you would like to show jokes from ChuckNorris.io, you'll find that the url <https://api.chucknorris.io/jokes/random> is giving you info like this: |
121 | 129 | ||
122 | ```json | 130 | ```json |
123 | { | 131 | { |
@@ -179,6 +187,6 @@ If the URL you specified returns a JSON object that defines a `title` and `conte | |||
179 | 187 | ||
180 | So, using [Node-Red](https://nodered.org/docs/getting-started/) and a quick flow, you can process an RSS feed to replace the message with a news item! | 188 | So, using [Node-Red](https://nodered.org/docs/getting-started/) and a quick flow, you can process an RSS feed to replace the message with a news item! |
181 | 189 | ||
182 | To get started, simply import [this flow](https://flows.nodered.org/flow/4b6406c9a684c26ace0430dd1826e95d) into your Node-Red instance and change the RSS feed in the "Get News RSS Feed" node to one of your choosing! | 190 | To get started, simply import [this flow](https://flows.nodered.org/flow/4b6406c9a684c26ace0430dd1826e95d) into your Node-Red instance and change the RSS feed in the "Get News RSS Feed" node to one of your choosing! |
183 | 191 | ||
184 | So far, the flow has been tested with BBC News and Sky News, however it should be easy to modify the flow to work with other RSS feeds if they don't work out of the box! | 192 | So far, the flow has been tested with BBC News and Sky News, however it should be easy to modify the flow to work with other RSS feeds if they don't work out of the box! |