Configurable Button Original

Plasma 5 Applets kde5 plasmoid switch

Source (link to git-repo or to original if based on someone elses unmodified work): https://github.com/pmarki/plasmoid-button

6
7.9
Available as/for: -
Description:

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

*Configuration*

The plasmoid can by configured in the settings menu:
- Plasmoid Label will be visible next to plasmoid (can be useful to distinguish couple of them). Leave empty to show only icon (feature by renn0xtek9)
- 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 example.com

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

*Notes*
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:
https://github.com/neicker/on-off-switch
https://github.com/MakG10/plasma-applet-server-status
for ideas. I also noticed https://github.com/Intika-Linux-Plasmoid/plasmoid-on-off-switch-commands when my plasmoid was almost done.
10

rajeshdrao

4 days ago

10 10 the best: Exactly what I was looking for. I used it to switch Bluetooth device provide from a2dp to headset and vice-versa

Report

9

abrac

16 days ago

9 Perfect! Does what it says on the tin. Nice and configurable!

My only gripe is that you have to have good aim with your mouse. When I press slightly left or right of the button, a pop-up appears instead. Don't know if others are experiencing this too.

Report

10

selplacei

19 days ago

10 Great button, works as advertised. I used it to turn BOINC on or off:
On-script = boinccmd --set_run_mode auto
Off-script = boinccmd --set_run_mode never
Status = ! { boinccmd --get_cc_status | grep -q 'current mode: never' }

Report

10

HessiJames

24 days ago

10 I use it start/stop openvpn.

Report

9

mrpabllo

6 months ago

9 Good! It wouldbe better if the info box don't show.
Any idea how to write a script for check if music is playing?

Report

jcake

1 month ago

Yes, I'm just working on this now. you can use a tool called playerctl to check and control music players.

Report

10

heimdall

7 months ago

10 10 the best

Report

9

tnilzon

7 months ago

9 9 excellent
Like this, it's very useful. Really waiting for the "tooltip with custom name" though.

Report

heqro

7 months ago

If you press out of the icons' drawings you will get a useless pop-up

Report

heqro

7 months ago

5

Report

heqro

7 months ago

https://imgur.com/a/yykDLcO

Report

9

abrac

16 days ago

I also have this issue! Did you find a solution?

Report

heqro

16 days ago

Best I can tell you is a workaround - try creating a desktop entry in your KDE Menu Editor so as to disguise it as if it were some .desktop file's launcher. It renders the Configurable Button completely useless, but it's a workaround.

Report

9

abrac

15 days ago

Thanks. I did what you said, and it worked perfectly!

Report

4

sdhsako

8 months ago

4 no font size and font chooser

Report

wiert

9 months ago

Perfect

Report

10

MichaelTunnell

10 months ago

10 This is a great plasmoid! It allowed me to activate custom functions which I am super happy with. I am using it to activate a Kwin Script called Parachute to really modernize the Plasma desktop. This also allows Plasma to emulate other desktop environments better like Unity's specific launcher buttons. Thanks! The only issue I found thus far is that when I disable the Off Script it would only work once because it would rotate to the Off from the On and then no longer work. I solved this but making the On & Off function the same and making the icons for both the same.

Report

10

katp00p

1 year ago

10 10 the best

Report

10

katp00p

1 year ago

Not sure why, but a reboot fixed my issue. Perfect plasmoid! Thank you.

Report

10

katp00p

1 year ago

This is perfect for what i need, which is a gui for connecting to NordVPN. However the status script doesn't seem to be working. I'm exiting my script with a 0 (to show im still connected) using "exit 0", confirming with "echo $?" that is it returning a value of 0, so the button should stay on, but it always turns off. Is there something I'm missing?

Report

10

Phobeus

1 year ago

10 Exactly how a plasmoid should be... flexible ;)

Report

9

frag

1 year ago

9 +Good

Report

12345678910
147
product-maker rajeshdrao Feb 21 2021 10 the best
10 the best: Exactly what I was looking for. I used it to switch Bluetooth device provide from a2dp to headset and vice-versa
product-maker abrac Feb 10 2021 9 excellent
Perfect! Does what it says on the tin. Nice and configurable! My only gripe is that you have to have good aim with your mouse. When I press slightly left or right of the button, a pop-up appears instead. Don't know if others are experiencing this too.
product-maker selplacei Feb 06 2021 10 the best
Great button, works as advertised. I used it to turn BOINC on or off: On-script = boinccmd --set_run_mode auto Off-script = boinccmd --set_run_mode never Status = ! { boinccmd --get_cc_status | grep -q 'current mode: never' }
product-maker HessiJames Feb 02 2021 10 the best
I use it start/stop openvpn.
product-maker mrpabllo Aug 07 2020 9 excellent
Good! It wouldbe better if the info box don't show. Any idea how to write a script for check if music is playing?
product-maker heimdall Jul 25 2020 10 the best
10 the best
product-maker tnilzon Jul 07 2020 9 excellent
9 excellent Like this, it's very useful. Really waiting for the "tooltip with custom name" though.
product-maker sdhsako Jun 15 2020 4 soso
no font size and font chooser
product-maker MichaelTunnell Apr 14 2020 10 the best
This is a great plasmoid! It allowed me to activate custom functions which I am super happy with. I am using it to activate a Kwin Script called Parachute to really modernize the Plasma desktop. This also allows Plasma to emulate other desktop environments better like Unity's specific launcher buttons. Thanks! The only issue I found thus far is that when I disable the Off Script it would only work once because it would rotate to the Off from the On and then no longer work. I solved this but making the On & Off function the same and making the icons for both the same.
product-maker katp00p Sep 21 2019 10 the best
10 the best
product-maker Phobeus Jul 11 2019 10 the best
Exactly how a plasmoid should be... flexible ;)
product-maker frag Apr 03 2019 9 excellent
+Good
Be the first to comment
m0ji
Oct 05 2020
alihakkidemiral
Jun 23 2020
alex123
May 16 2020
slm33
Mar 05 2020
Phobeus
Jul 11 2019
Murz
Jun 03 2019
File (click to download) Version Description Devices Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
GPLv2 or later
version
0.2.0
updated Mar 05 2020
added Apr 01 2019
downloads 24h
8
mediaviews 24h 0
pageviews 24h 13