#How to create an applet with an icon that can be changed from a script?
29 messages · Page 1 of 1 (latest)
@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?
Hey. It is for a bash script that records my screen. So when the recording starts I want the icon to become a camera icon (such as /usr/share/icons/Papirus-Dark/24x24/panel/kazam-recording.svg) and when I end the recording I want the icon to become something like /usr/share/icons/Papirus-Dark/24x24/panel/kazam-stopped.svg. The icon change would be triggered from the bash script.
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?
What do you mean by "administratively update that path"
Do you mean like to create a symlink there? Sorry, I dont understand
yeah like does the script use a user that has write/read/execute permissions. Sorry administrator is windows talk 🤭
No it runs with user perms
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?
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
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
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
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?
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
What is your app for and is there someone who already made one you could install that does similar functions? Just trying to save you time unless you're trying to learn
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 
cool cool. I'm no Dev but I've read that's useful.

