#How to create an applet with an icon that can be changed from a script?

29 messages · Page 1 of 1 (latest)

quaint yoke
#

I want to have an applet that displays a different icon depending on whether a certain bash script of mine is running. Is this possible?

LM 22 Cinnamon

deft basin
#

@quaint yoke Can you maybe share an example of how you would imagine this running or being performed and what you would like the outcome to be?

Do you have an Icon you want to see, are you dev'ing an application perhaps?

quaint yoke
deft basin
#

does your bash script file have the permissions to traverse to that path and use that icon and the ability to administratively update that path?

quaint yoke
#

What do you mean by "administratively update that path"

#

Do you mean like to create a symlink there? Sorry, I dont understand

deft basin
#

yeah like does the script use a user that has write/read/execute permissions. Sorry administrator is windows talk 🤭

quaint yoke
#

No it runs with user perms

deft basin
#

okay so it's not a user permissions issue.....the issue is the script icon is just not updating in realtime when the script is running and changing the icon svg file image as that'what you want it to do right?

quaint yoke
#

Well that directory is read only for my user, so the script doesnt have write permissions there.
Also, I don't even have an applet in the panel to change the icon of (though im thinking of hijacking an existing one of the official ones)

#

I havent yet tried to update any icon with the script

deft basin
#

I think if you were to hijack anything it would just get reverted with system updates and it could pose security risks if sudo were anywhere in there using other system icons

quaint yoke
#

About the updates, I think i can install an applet as a development applet as shown here. https://github.com/linuxmint/cinnamon-spices-applets?tab=readme-ov-file#development

Maybe it gets removed by major mint updates, but the applet itself shouldnt be overriten by applet updates (i think)

For the permissions, would the applet's icon be able to just be a symlink that the script has write privilages to? For example, a symlink in my home directory that points to one of the icon files I mentioned above. And the script changes the symlink when it starts/stops

GitHub

Applets for the Cinnamon desktop. Contribute to linuxmint/cinnamon-spices-applets development by creating an account on GitHub.

deft basin
#

Maybe that could work...but to be honest, I wouldn't trust it because I fear that would cause instability and be picked up as a threat such as by AV software if users had that on Linux Systems. What tools are you using to build this app? Are you using Yad?

quaint yoke
#

Uhh its just a bash script that runs in the terminal

#

I havent heard of yad until now. There's no interface for the script, except that it sends some notifcations

#

Btw this applet thing is for personal use only. I'm gonna release a more basic version of the script on github that has less dependencies and it wont have this feature

deft basin
quaint yoke
#

It records my screen using ffmpeg. I tried many screen recording applications and didnt like any of them. I couldnt find any ffmpeg scripts that were good enough for me, so I made my own. It is already nearly done and working

#

Not very clean code, i admit

#

I'm looking into YAD rn. Looks promising blanket

deft basin
#

cool cool. I'm no Dev but I've read that's useful.

quaint yoke
#

Wait I think YAD is absolutely perfect!

#

I'll try to implement it properly later this week, but im very excited

#

Marking as solved, for now at least

#

Thank you @deft basin
I think YAD is my new favorite utility hehecat

deft basin
#

NIce to hear it's resolved 🙂