12

I want to see the applications like when running on Gnome 3 (with the buttons in the title bar):

Gnome

Instead of how I see them normally:

Unity

I can achieve what I want by running these commands before starting any application:

export GTK_CSD=1
export XDG_CURRENT_DESKTOP=GNOME

I've tried to edit this file to make the changes permanent:

/usr/share/xsessions/ubuntu.desktop

In that file I change this:

DesktopNames=Unity

By this:

DesktopNames=GNOME

But then Unity will not start.

I'm finding a way of using the GTK3 header bars by default. Is this possible?

0x2b3bfa0
  • 9,110
  • 7
  • 38
  • 55

3 Answers3

4
  1. You can enable that by creating new file

    sudo nano /etc/profile.d/csd.sh
    
  2. That contains

    export GTK_CSD=1
    export XDG_CURRENT_DESKTOP=Unity:GNOME
    
    #export GTK_THEME=Ambiance
    #export GTK_THEME=Adwaita:dark
    
  3. Logout/Login

Reference: for the new colon format Unity:GNOME. https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1554878

Related question: What is the default GTK 3 Theme Engine in Ubuntu Unity?

Related page: A Fix For Black Corners Around CSD Windows in Ubuntu?

Tests:

  • Bharadwaj Raju's solution is the best for now

    Using /etc/profile..

    export XDG_CURRENT_DESKTOP=GNOME
    

    gnome-software OK, gnome-calculator OK, nautilus OK (black sharp corners, get smaller if killed then launched again), unity-control-center FAIL (No components, should run with XDG_CURRENT_DESKTOP=Unity)

  • Mine (See above):

    gnome-software NO, gnome-calculator NO, nautilus OK (black sharp corners, get smaller if killed then launched again they go), unity-control-center NO.

  • Another try with export XDG_CURRENT_DESKTOP=""

    gnome-software OK, gnome-calculator OK, nautilus FAIL, unity-control-center FAIL.

user.dz
  • 49,176
3

For specific GTK3 apps

Edit their .desktop file (Nautilus' is located at /usr/share/applications/nautilus.desktop)

And add env XDG_CURRENT_DESKTOP=GNOME just after each Exec= line. For example, nautilus.desktop's Exec= line(s) (It has two, one for opening a new window) will change from...

Exec=nautilus --new-window %U
[… Some other lines, skipping …]
Exec=nautilus --new-window

to

Exec=env XDG_CURRENT_DESKTOP=GNOME nautilus --new-window %U
[… Some other lines, skipping …]
Exec=env XDG_CURRENT_DESKTOP=GNOME nautilus --new-window

NOTE: If you use Unity, do the same to /usr/share/applications/nautilus-autostart.desktop and/or /etc/xdg/autostart/nautilus-autostart.desktop.

(You may have to logout/login.)

For all GTK3 apps

Word of warning: Telling all apps that the DE is GNOME may result in side effects.

Edit: Unity fails to start with this.

Edit ~/.profile and add a line:

export XDG_CURRENT_DESKTOP=GNOME

then all apps will obey this.

0

Building off of user.dz, run

sudo nano /etc/profile.d/csd.sh

fill that with

export XDG_CURRENT_DESKTOP=GNOME

and then

cd /usr/share/applications
sudo sed -i 's/Exec=/Exec=env XDG_CURRENT_DESKTOP=Unity:Unity7 /g' unity*

login out and back in

Alternatively, change only the currently installed apps to run in CSD mode,

sudo sed -i 's/Exec=/Exec=env XDG_CURRENT_DESKTOP=GNOME /g' ^(?!unity).*$
Aaahh
  • 143