Can I make conditional panel background color?

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
juliannr

Can I make conditional panel background color?

Post by juliannr »

Hi, firstly I want to say sorry for my bad english.
I'm new on Linux, but I like to edit my cinnamon theme, especially on color customization. Now I want to ask you how to make panel background color conditionaly. I want to make my panel can change color automatically when I open program or application, and then back to normal when I close that application. Can I do that? If can, please tell me how to.

Thanks for all your answer, sorry again for my bad english.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can I make conditional panel background color?

Post by smurphos »

Not without an ugly 'hack' which would be specific to the theme and program in question and would need a bit of bash scripting expertise.

How I would approach this is

1) Make a copy of the chosen theme in ~/.themes/ and give it a unique name.
2) Edit the cinnamon.css file of the copied theme to change the background colour of the .panel class as per your preference.
3) Make a bash script to launch the program in question and which uses the gsettings command to switch cinnamon theme to the edited version.
4) Make another bash script to kill the program which also uses the gsettings command to switch cinnamon theme back to the original.
5) Make launchers that reference your bash scripts in the menu and/or desktop and/or panel.

There probably is a very clever way to have an always running background running bash script that polls running processes to see if your program is running or not but I'd class that as very advanced bash scripting and a definite project :)
Last edited by smurphos on Tue Feb 20, 2018 6:18 am, edited 1 time in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
juliannr

Re: Can I make conditional panel background color?

Post by juliannr »

smurphos wrote: Tue Feb 20, 2018 6:12 am Not without an ugly 'hack' which would be specific to the theme and program in question and would need a bit of bash scripting expertise.

How I would approach this is

1) Make a copy of the chosen theme in ~/.themes/ and give it a unique name.
2) Edit the cinnamon.css file of the copied theme to change the background colour of the .panel class as per your preference.
3) Make a bash script to launch the program in question and which uses the gsettings command to switch cinnamon theme to the edited version.
4) Make another bash script to kill the program which also uses the gsettings command to switch cinnamon theme back to the original.
5) Make launchers that reference your bash scripts in the menu and/or desktop and/or panel.
I get it, but that I want is all program have a same settings, not per program. I know in elementary can use .panel.maximized (css) but it can't use in cinnamon.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can I make conditional panel background color?

Post by smurphos »

Do you just want to hide the panel for maximised programs? There are settings for than in panel settings.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
juliannr

Re: Can I make conditional panel background color?

Post by juliannr »

smurphos wrote: Tue Feb 20, 2018 6:31 am Do you just want to hide the panel for maximised programs? There are settings for than in panel settings.
No, I not want to hide panel, but change the color.
juliannr

Re: Can I make conditional panel background color?

Post by juliannr »

I have got the solution, there is a extension with name Transparent panels.. Thankyou for the answer.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can I make conditional panel background color?

Post by smurphos »

If you'd said you wanted them transparent..... :)
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Cinnamon”