Can I make conditional panel background color?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
juliannr
Level 1
Level 1
Posts: 4
Joined: Tue Feb 20, 2018 2:55 am

Can I make conditional panel background color?

Post by juliannr » Tue Feb 20, 2018 3:05 am

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.

User avatar
smurphos
Level 5
Level 5
Posts: 697
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Can I make conditional panel background color?

Post by smurphos » 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.

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.

juliannr
Level 1
Level 1
Posts: 4
Joined: Tue Feb 20, 2018 2:55 am

Re: Can I make conditional panel background color?

Post by juliannr » Tue Feb 20, 2018 6:17 am

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 5
Level 5
Posts: 697
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Can I make conditional panel background color?

Post by smurphos » 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.

juliannr
Level 1
Level 1
Posts: 4
Joined: Tue Feb 20, 2018 2:55 am

Re: Can I make conditional panel background color?

Post by juliannr » Wed Feb 21, 2018 3:14 am

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
Level 1
Level 1
Posts: 4
Joined: Tue Feb 20, 2018 2:55 am

Re: Can I make conditional panel background color?

Post by juliannr » Thu Feb 22, 2018 12:41 am

I have got the solution, there is a extension with name Transparent panels.. Thankyou for the answer.

User avatar
smurphos
Level 5
Level 5
Posts: 697
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Can I make conditional panel background color?

Post by smurphos » Thu Feb 22, 2018 12:52 am

If you'd said you wanted them transparent..... :)

Post Reply

Return to “Cinnamon”