What files to edit to change title bar and border width of Ubuntu 18.04 LTS

5,115

I was able to add border to windows in Ubuntu 18.04 by doing the following:

nano ~/.config/gtk-3.0/gtk.css

Then add the following:

decoration {
    border: 3px solid gray;
    background: gray;
}

After saving the file, remember refresh gnome using this command:

setsid gnome-shell --replace

I found it works well for Ambiance. I like the border slightly thicker (3px) to make it a little easier to see in laptop running in 1920x1080 resolution.

EDIT:

To customize the active title bar background colors. (use :backdrop for inactive windows)

.titlebar {
    background: #0759EB;
}

.titlebar:backdrop  {
    background: #829EDF;
    color:white;
} 
Share:
5,115

Related videos on Youtube

Apologician
Author by

Apologician

I'm an IT professional. An Internet pioneer where I was one of the first provider of ISP services (Apollo III Communications). People often ask about my signature. I sign my messages so that any question I ask or participate in can easily be found. Back in the 80's when I was starting out I hoped to never ask the same question twice. So I use text in my signature to find past discussions to give support to users. My email address is the oldest one on the Internet. -- L. James -- L. D. James [email protected] www.apollo3.com/~ljames

Updated on September 18, 2022

Comments

  • Apologician
    Apologician over 1 year

    Since the upgrade to Ubuntu 18.04 LTS from 16.04 LTS, none of my custom themes work. In fact, they distort my display so much that it becomes unusable.

    Luckily I can change it back to something workable with this cli:

    $ gsettings set org.gnome.desktop.interface gtk-theme "Breeze"
    

    The problem with all the available Themes is I usually have over 10 terminal screens loaded while working, and without borders, I can't tell where one terminal ends and the next terminal begins.

    Also It' hard to tell which application window is active because there isn't enough difference between the colors.

    I'm trying to manually edit the Adwaita theme. It has an empty gtk-3.0 folder and a gtk-2.0 folder which has a main.rc file which I'm sure is the control file. I can't figure out what to change to affect the Title bar and the border width.

    I'm trying to do the same thing with Ubuntu 18.04 that is done here with Ubuntu 16.04 in this answer:
    How to edit the color of the title bar and border width of a gtk3 theme?

    Ubuntu 18.04 themes configuration appears to be totally different.

  • Apologician
    Apologician almost 6 years
    If I could upvote 10 times, I would. It works for the border. I'm able to see where my terminals begin and end. I'm wondering how you figured this out or what resource you used for reference? I'm leaving the question currently unanswered in hope for an active/inactive title bar - color resolution. By the way, you don't have to logout and login for the change. You can refresh gnome with setsid gnome-shell --replace. Thanks a million!
  • Wonko the Sane
    Wonko the Sane almost 6 years
    You're welcome! :) Also found how to change the titlebar for active/inactive windows. The GTK documentation was too hard for me to follow, but after a lot of Googling I came across this stackoverflow.com/questions/19787276/… which mentioned ":backdrop". A few more experiments and problem solved. Enjoy! Thanks for the gnome refresh tip too!
  • Apologician
    Apologician almost 6 years
    By the way, you might consider replacing remember to logout and back in with this command: setsid gnome-shell --replace It takes a lot of work for some people (like me) to log out and back in, when there are 10's of windows needing to be closed.
  • Wonko the Sane
    Wonko the Sane almost 6 years
    Done, thanks again. That has been a huge time saver for me.
  • Robert Oschler
    Robert Oschler about 5 years
    I agree with the others here, great answer.
  • Kevin Buchs
    Kevin Buchs over 4 years
    For me, the setsid command caused a full restart of my session.