Giter Club home page Giter Club logo

executor's Introduction

Maintenance GitHub release (latest by date) GitHub Release Date GitHub commits since latest release (by date) GitHub last commit GitHub Repo stars

Executor - Gnome Shell Extension

result

Execute multiple shell commands periodically with separate intervals and display the output in gnome top bar.

result



Installation

One click installation

Get it on GNOME Extensions

Manual installation

With both options you have to restart gnome shell afterwards (Alt + F2 and then enter r).



Configuration

Basic

The commands and the interval for each command can be set for each location (left, center, right) separately in the settings view.

settings



Use of custom css

It is possible to use custom css to style the output of your commands dynamically. There are two ways to do this:

  • 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:

    mkdir /home/$USER/.config/[email protected]
    
    touch /home/$USER/.config/[email protected]/custom.css
  • 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.

Example custom.css file:

.red {
    color: red;
}

.yellow {
    color: yellow
}

.green {
    color: rgb(107, 179, 0);
}

.huge-font {
    font: 20px "Comic Sans";
}

.italic {
    font: 17px "Arial";
    font-style: italic;
}

Note: After making changes in your css you have to restart your shell (Alt + F2 and then enter r).

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.

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.

date +%s | awk '{if ($1 % 2 == 0) {print $1"<executor.css.red>"} else { print $1"<executor.css.green>"} }'

The output is either one of the following depending on the timestamp:

settings

settings

You can also combine multiple css classes:

settings



Use of markup

Usage: To use markup there's another setting <executor.markup.true> which has to be included somewhere in the output to activate markup.

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.

echo "<executor.markup.true> <span foreground='blue'>Blue text</span> is <i>cool</i>! <span foreground='red'>Red text</span> is cool too"

This produces the following output:

settings

Note: Due to a bug in ClutterText there is an empty space in front of the first <span> tag required



Combine css and markup

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:

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"

This produces the following output:

settings



More complex scripts

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.

Here 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.



Export and import settings

If you want to export and import all settings at once you can use dconf.

Export: dconf dump /org/gnome/shell/extensions/executor/ > executor-settings.dconf

Import: dconf load /org/gnome/shell/extensions/executor/ < executor-settings.dconf



Use cases

Let me know what your use cases are and I will add them here.

I for example use this extension for hardware monitoring: settings



Debugging

If you have no output or other issues you can have a look into the log:

journalctl /usr/bin/gnome-shell -f



Development

Please feel free to contribute and suggest ideas or report bugs!



Translations

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.

executor's People

Contributors

g-dh avatar raujonas avatar snax44 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.