This forum has been archived. All content is frozen. Please use KDE Discuss instead.

changing panel icons by script

Tags: None
(comma "," separated)
com2
Registered Member
Posts
10
Karma
0
OS

changing panel icons by script

Thu Oct 23, 2014 2:34 pm
I would like to use bash script to change the icon in a panel. I want an icon to function as an on-off or open-close toggle with different icons showing the present status. How can this be done?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: changing panel icons by script

Tue Dec 09, 2014 7:13 am
I'm afraid this isn't possible - you could write your own (Javascript based) applet and integrate the functionality from there.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
noerdlwoerdl
Registered Member
Posts
1
Karma
0

Re: changing panel icons by script

Wed Jan 07, 2015 9:44 am
I'm working on the exact same problem, it’s no big deal to change the corresponding .desktop file, e. g. with sed:
Code: Select all
sed -i -e 's/ONE.svg/TWO.svg/g' /PATH/TO/FILE.desktop


The only problem is: To apply the icon in the panel there's some kind of refresh of the panel (or just the starter, if possible) needed. The same refresh takes place when you right-click the icon, change something in it's settings (or have something changed in the .desktop file before) and click OK. It's just the process of re-reading the .desktop file, is it really that big a deal to make it doing this via the shell?

A brutal and time-consuming, yet possible way to force reloading is the restart of the whole desktop environment:
Code: Select all
killall plasma-desktop && plasma-desktop

But this can't be the only way, or is it?


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]