Coder Social home page Coder Social logo

gbaptista / magic-status Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 13 KB

A KDE Plasma Widget to display custom status messages on Panels.

License: MIT License

QML 100.00%
kde kde-desktop kde-plasma kde-plasma-5 plasma-applet plasma5 kde-plasma-desktop plasma-desktop

magic-status's Introduction

Magic Status

A KDE Plasma Widget to display custom status messages on Panels.

A screenshot of a panel with two widgets, the current time and the current song playing.

Installing

git clone https://github.com/gbaptista/magic-status.git \
  /usr/share/plasma/plasmoids/com.github.gbaptista.magic-status

Right-click on a panel, "Add Widgets..." and search for "Magic Status".

I don't remember, but you may need to restart Plasma Shell by rebooting the computer, logoff/login, or the following command:

plasmashell --replace

Configuring

The core idea of Magic Status is to be easily connectable to a data source. So, you just need to provide an endpoint that responds to a GET request rendering the following expected JSON:

{
  "messages": [
    "11:40:20",
    "11:40"
  ]
}

In the above example, the widget will display the current time. We are providing two possible messages, and to switch between them, you can click on the currently displayed message.

You can configure it by right-clicking and "Configure Magic Status...":

A screenshot of the configuration screen.

As you can display any message that you want, anything is possible. I have two endpoints on my local API, http://localhost:5000/time and http://localhost:5000/music.

The /music displays the current song playing:

{
  "messages": [
    "Rival Sons - Do Your Worst"
  ]
}

So, with two instances of the widget in my panel, I have the following result:

A screenshot of a panel with two widgets, the current time and the current song playing.

For a concrete example, check my personal local API. I chose Ruby, but you can build your own API with any language you want.

Customizing

You can customize your messages by providing more information. To change the text color and add a progress bar:

{
  "messages": [
    {
      "label": {
        "text": "Carol Biazin - Inveja (Ao Vivo)",
        "color": "#34d8eb"
      },
      "progress": {
        "value": 0.63
      }
    }
  ]
}
A screenshot of a panel with the widget displaying the current song playing in a different color and a progress bar.

Development

git clone https://github.com/gbaptista/magic-status.git \
  /usr/share/plasma/plasmoids/com.github.gbaptista.magic-status

cd /usr/share/plasma/plasmoids/com.github.gbaptista.magic-status

plasmoidviewer -a .

plasmashell --replace

magic-status's People

Contributors

gbaptista avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

ethmth

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.