szwsck / budgie-script-applet

Budgie applet that displays script's output on the panel
MIT License
4 stars 0 forks source link

budgie-script-applet

A simple, but very versatile Budgie applet that periodically runs a script and displays its output. It makes it very easy to implement your own indicator-style applets with your favorite language. Inspired by Polybar's script module.

Note: for most purposes, this applet's functionality is a subset of indicator-sysmonitor. It has, however, some advantages:

Installation

Install PyGObject for your platform

Then run:

mkdir -p ~/.local/share/budgie-desktop/plugins
cd ~/.local/share/budgie-desktop/plugins
git clone https://github.com/shymmq/budgie-script-applet.git

Usage

After you add the widget to the panel, you should configure it inside Budgie Desktop Settings. Make sure your script is executable(chmod +x script.sh).

Only the first line of the output will be displayed. In the following lines, you can pass any CSS properties supported by GTK. You can also set tooltip text with tooltip: <tooltip>

For example, this script:

$ python ~/events.py
No events
color: green
font-style: italic
tooltip: Next event: Meeting tomorrow at 9:00

will result in:

image

You can run budgie-panel with budgie-panel --replace --gtk-debug=interactive & to preview your CSS props in a live editor.

If you want to set a global theme, you can do so in ~/.config/gtk-3.0/gtk.css. You can find the CSS selector for the given widget in settings. Note that this doesn't support tooltips. Use nohup budgie-panel --replace & to reset the panel after making changes.

For simple monochrome icons, you can use an icon font such as MaterialDesign-Font

Warning: This applet naively runs whatever command you set, without any constraints, timeouts or caching. Don't execute any expensive operations; if you make network calls, it's probably a good idea to cache the result inside your script.

Ideas

image