|
| 1 | +# **Executor - Gnome Shell Extension** |
1 | 2 | 
|
2 | 3 | 
|
3 | 4 | 
|
4 |
| - |
5 |
| - |
6 | 5 | 
|
7 | 6 |
|
8 |
| -# **Executor - Gnome Shell Extension** |
9 |
| -<img src="resources/icons/icon.png" alt="result" width="70"> |
10 |
| - |
11 | 7 | Execute multiple shell commands periodically with separate intervals and display the output in gnome top bar.
|
12 | 8 |
|
13 |
| -<img src="docs/result.png" alt="result" width="967"> |
14 |
| - |
15 |
| -<br/><br/> |
16 |
| - |
17 |
| -# **Installation** |
18 |
| - |
19 |
| -## **One click installation** |
| 9 | +<img src="resources/icons/icon.png" alt="result" width="70"> |
20 | 10 |
|
21 | 11 | [<img src="https://raw.githubusercontent.com/andyholmes/gnome-shell-extensions-badge/master/get-it-on-ego.svg?sanitize=true" alt="Get it on GNOME Extensions" height="100" width="220">](https://extensions.gnome.org/extension/2932/executor/)
|
22 | 12 |
|
| 13 | +<img src="docs/result.png" alt="result" width="967"> |
23 | 14 |
|
24 |
| - |
25 |
| -## **Manual installation** |
26 |
| - |
27 |
| -- Download the file `[email protected]` < a href= "https://github.com/raujonas/executor/releases/latest">from the latest release</ a> and extract the content to `~/.local/share/gnome-shell/extensions/[email protected]`. |
28 |
| - |
29 |
| -- OR checkout the repo to `~/.local/share/gnome-shell/extensions/[email protected]`. |
30 |
| - ``` |
31 |
| - git clone https://github.com/raujonas/executor.git ~/.local/share/gnome-shell/extensions/[email protected]/ |
32 |
| - ``` |
33 |
| -With both options you have to restart gnome shell afterwards (`Alt + F2` and then enter `r`). |
34 |
| -
|
35 |
| -<br/><br/> |
36 |
| -
|
37 |
| -# **Configuration** |
38 |
| -
|
39 |
| -## **Basic** |
40 |
| -
|
41 |
| -The commands and the interval for each command can be set for each location (left, center, right) separately in the settings view. |
42 |
| -
|
43 |
| -<img src="docs/settings.png" alt="settings" width="500"> |
44 |
| -
|
45 |
| -<br/><br/> |
46 |
| -
|
47 |
| -## **Use of custom css** |
48 |
| -
|
49 |
| -It is possible to use custom css to style the output of your commands dynamically. There are two ways to do this: |
50 |
| -- **Preferred option**: Create the file `~/.config/[email protected]/custom.css` and add your custom css there. This file will be imported into the extension. **This way your custom css will NOT be overwritten by extension updates**. You can use the following commands to create the file: |
51 |
| -
|
52 |
| - ```console |
53 |
| - mkdir /home/$USER/.config/[email protected] |
54 |
| -
|
55 |
| - touch /home/$USER/.config/[email protected]/custom.css |
56 |
| - ``` |
57 |
| -- **Non durable option**: You can add your custom css in `~/.local/share/gnome-shell/extensions/[email protected]/custom.css`. **Your custom css will be overwritten by extension updates in this case**. Make sure to save it somewhere before updating. |
58 |
| -
|
59 |
| -Example `custom.css` file: |
60 |
| -
|
61 |
| -```css |
62 |
| -.red { |
63 |
| - color: red; |
64 |
| -} |
65 |
| -
|
66 |
| -.yellow { |
67 |
| - color: yellow |
68 |
| -} |
69 |
| -
|
70 |
| -.green { |
71 |
| - color: rgb(107, 179, 0); |
72 |
| -} |
73 |
| -
|
74 |
| -.huge-font { |
75 |
| - font: 20px "Comic Sans"; |
76 |
| -} |
77 |
| -
|
78 |
| -.italic { |
79 |
| - font: 17px "Arial"; |
80 |
| - font-style: italic; |
81 |
| -} |
82 |
| -``` |
83 |
| - |
84 |
| -**Note**: After making changes in your css you have to restart your shell (`Alt + F2` and then enter `r`). |
85 |
| - |
86 |
| -**Usage**: To use the css classes dynamically in your commands, you can add it with the following syntax to your output: **`<executor.css.red>`**. This will add the specified css class to your output, in this case `red`. |
87 |
| - |
88 |
| -**Example**: The following command queries the current timestamp. If the output is a round number it should have the color red, if not then green. |
89 |
| - |
90 |
| -```console |
91 |
| -date +%s | awk '{if ($1 % 2 == 0) {print $1"<executor.css.red>"} else { print $1"<executor.css.green>"} }' |
92 |
| -``` |
93 |
| - |
94 |
| -The output is either one of the following depending on the timestamp: |
95 |
| - |
96 |
| -<img src="docs/custom-css-red.png" alt="settings"> |
97 |
| - |
98 |
| -<img src="docs/custom-css-green.png" alt="settings"> |
99 |
| - |
100 |
| -You can also combine multiple css classes: |
101 |
| - |
102 |
| -<img src="docs/custom-css-multiple.png" alt="settings" width="700"> |
103 |
| - |
104 |
| -<br/><br/> |
105 |
| - |
106 |
| -## **Use of markup** |
107 |
| - |
108 |
| -**Usage**: To use markup there's another setting **`<executor.markup.true>`** which has to be included somewhere in the output to activate markup. |
109 |
| - |
110 |
| -**Example**: The following command is an example for using markup with different colors and some italic text, all inside one command. You can find other attributes like `font_family` or `size` [here](https://developer.gnome.org/pygtk/stable/pango-markup-language.html). |
111 |
| - |
112 |
| -``` |
113 |
| -echo "<executor.markup.true> <span foreground='blue'>Blue text</span> is <i>cool</i>! <span foreground='red'>Red text</span> is cool too" |
114 |
| -``` |
115 |
| -This produces the following output: |
116 |
| - |
117 |
| -<img src="docs/markup.png" alt="settings"> |
118 |
| - |
119 |
| -**Note**: Due to a [bug](https://gitlab.gnome.org/GNOME/mutter/-/issues/1324) in ClutterText there is an empty space in front of the first `<span>` tag required |
120 |
| - |
121 |
| -<br/><br/> |
122 |
| - |
123 |
| -## **Combine css and markup** |
124 |
| - |
125 |
| -Combination of css and markup is also possible. In this case the setting for markup **`<executor.markup.true>`** must be located after all css settings. Here is an example: |
126 |
| - |
127 |
| -``` |
128 |
| -echo " <span font_family='monospace' foreground='blue'>Blue text</span> is <i>cool</i>! <span foreground='red'>Red text</span><executor.css.green><executor.markup.true> is cool too" |
129 |
| -``` |
130 |
| - |
131 |
| -This produces the following output: |
132 |
| - |
133 |
| -<img src="docs/css-and-markup.png" alt="settings"> |
134 |
| - |
135 |
| -<br/><br/> |
136 |
| - |
137 |
| -## **More complex scripts** |
138 |
| - |
139 |
| -If you want to execute more complex scripts it might be helpful to store them outside of the extension and create the final output there. |
140 |
| - |
141 |
| -[Here](https://github.com/raujonas/executor/issues/31#issue-902528380) is a very good example of how you can achieve this. With this solution it is also possible to create a rotating output of multiple different commands. |
142 |
| - |
143 |
| -<br/><br/> |
144 |
| - |
145 |
| -# **Export and import settings** |
146 |
| - |
147 |
| -If you want to export and import all settings at once you can use dconf. |
148 |
| - |
149 |
| -Export: `dconf dump /org/gnome/shell/extensions/executor/ > executor-settings.dconf` |
150 |
| - |
151 |
| -Import: `dconf load /org/gnome/shell/extensions/executor/ < executor-settings.dconf` |
152 |
| - |
153 |
| -<br/><br/> |
154 |
| - |
155 |
| -# **Use cases** |
156 |
| -Let me know what your use cases are and I will add them here. |
157 |
| - |
158 |
| -I for example use this extension for hardware monitoring: |
159 |
| -<img src="docs/use-case-1.png" alt="settings" width="500"> |
160 |
| - |
161 |
| -<br/><br/> |
162 |
| - |
163 |
| -# **Debugging** |
164 |
| - |
165 |
| -If you have no output or other issues you can have a look into the log: |
166 |
| -```console |
167 |
| -journalctl /usr/bin/gnome-shell -f |
168 |
| -``` |
169 |
| - |
170 |
| -<br/><br/> |
171 |
| - |
172 |
| -# **Development** |
173 |
| - |
174 |
| -Please feel free to contribute and suggest ideas or report bugs! |
175 |
| - |
176 |
| -<br/><br/> |
177 |
| - |
178 |
| -### **Compile settings schema** |
179 |
| -`glib-compile-schemas ./schemas` |
180 |
| -### **Update example.pot** |
181 |
| -`xgettext --from-code=UTF-8 --output=po/example.pot *.js` |
182 |
| - |
183 |
| -<br/><br/> |
184 |
| - |
185 |
| -# **Translations** |
186 |
| - |
187 |
| -You can add translation for the language of your choice by editing the example.pot with a program like Poedit. Then you can submit your *.po and *.mo file inside the po/ folder. |
| 15 | +## Documentation: [here](https://raujonas.github.io/executor/) |
0 commit comments