Configurable Button Original

Plasma 5 Add-Ons kde5 plasmoid switch

Source (link to git-repo or to original if based on someone elses unmodified work):


*A Configurable Button Plasmoid (yet another on-off switch)*
This is a button that allows to run script when toggled (on and off scripts) and to monitor status by status script. The new thing is an option to configure icons.


The plasmoid can by configured in the settings menu:
- On Script will execute a script (can be a full path to a script or bash snippet) when toggling from off state to on. The icon will be changed to "On" icon.
- Off Script will execute a script (can be a full path to a script or bash snippet) when toggling from on state to off. The icon will be changed to "Off" icon.
- Status Script can be used to monitor application (or the Internet connection). The script should return 0 on success (to show "On" state), something else on error (to show "Off" state)
- Check status on startup: Run once "Status script" on system startup
- Run periodically: Run "Status Script" in defined interval

*Example usage*
1. Configuration to monitor internet connection (or server status)
- Disable On and Off scripts
- Enable Status Script on startup and to run periodically
set interval to your needs
- Add status script ping -c 2 -q

2. Configuration to start a service
- Enable On script
- Add On script eg: sudo systemctl start docker (assuimg this command can be run without password)
- disable Off and Status scripts
When button will be pressed the script will be launched, if a service was started successfully the icon will stay green, otherwise the icon will go back to red.

3. Configuration to start, stop and monitor service
- Enable everything :)

On script should exit with 0, otherwise icon be change to red (test it by adding On script sleep 5; exit 1)
Off script exit code is not taken into account
By default plasmoid shows red (Off) icon when started, this can be easly changed: set Status script exit 0 to run once on startup

*Maybe in a future*
tooltip with custom name
tooltip or dialog with output from scripts

Credits for:
for ideas. I also noticed when my plasmoid was almost done.


1 month ago

8 +Good


product-maker frag Apr 03 2019 8 great
product-maker Count: 2 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
*Needs ocs-url or ocs-store to install things
GPLv2 or later
updated Apr 01 2019
added Apr 01 2019
downloads today
page views today 13