Hot answers tagged

58

With gtk+ ≥ 3.12 you can load a specific theme and its variant (dark, light) on a per-application1 basis via the environment variable GTK_THEME=theme:variant. As per the gtk+ reference manual: GTK_THEME. If set, makes GTK+ use the named theme instead of the theme that is specified by the gtk-theme-name setting [...] It is also possible to specify a theme ...


52

Unfortunately, GTK libraries (used in particular by GNOME) tend to emit a lot of scary-looking messages. Sometimes these messages indicate potential bugs, sometimes they're totally spurious, and it's impossible to tell which is which without delving deep into the code. As an end user, you can't do anything about it. You can report those as bugs (even if the ...


45

Replacing the main theme with the dark one in /usr/share/themes is not an ideal solution as each time gnome-themes is updated your theme will revert to default. It's preferable to properly configure your user account to use the dark theme, that way your settings will be preserved between updates. You can do that: Manually: create (open if already present) ...


40

In general, the difference from a user perspective should be purely cosmetic. Qt and GTK set themes independently (via, e.g., qtconfig or gtk-chtheme) but this is harmonized by some desktop environments. GNU/Linux tends to be more GTK oriented than Qt in the sense that the former is more commonly used, so you may want to prefer it when given the choice; an ...


20

For GTK+-3 applications, you can enforce the dark theme variant using GtkSettings' settings.ini: $ mkdir -p $HOME/.config/gnome-terminal/gtk-3.0 # the path before gtk-3.0 is arbitrary $ cat >> $HOME/.config/gnome-terminal/gtk-3.0/settings.ini << EOF [Settings] gtk-application-prefer-dark-theme=true EOF $ echo 'alias gnome-terminal="...


19

No, there is no difference in the internal structure of such programs. GTK and Qt are user interface toolkits and frameworks. They are libraries that the developers use to design graphical interfaces. When a graphical (GUI) program is written, first its core internals are developed. This is what makes the program run. You never see the core, they simply ...


18

You can do this by creating or editing a file called user-dirs.dirs in ~/.config. Mine has the following: XDG_DESKTOP_DIR="$HOME/" XDG_DOCUMENTS_DIR="/srv/documents/" XDG_DOWNLOAD_DIR="$HOME/downloads/" XDG_MUSIC_DIR="/srv/music/" XDG_PICTURES_DIR="/srv/pictures/" XDG_VIDEOS_DIR="$HOME" Firefox follows whatever you have for XDG_DESKTOP_DIR.


17

The default GNOME3 themes are a disaster for tiny screens. However, the Gnome3 crowd seems to be pretty unwilling to listen to their users. They only think of how stuff looks, in particular on a tablet PC or mobile device, it seems. Soon, Gnome3 will require a 4k screen. Anyway, the best solution I have found is to switch the theme to the XFCE themes. On ...


16

I had the same issue on Firefox 48, and this answer worked for me: Create ~/.config/gtk-3.0/settings.ini and add [Settings] gtk-primary-button-warps-slider = false I'm using XFCE, but Firefox is reading that setting for some reason. It also worked with other Gnome 3 applications, such as gnome-todo. After creating that file, I only had to restart ...


15

I can think of at least 2 options you can choose from: Change ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini directly (the former for icons in GTK2 applications, the latter for GTK3 applications) - the setting you're looking for is gtk-icon-theme-name in both cases. For GTK2, you can just add a line like gtk-icon-theme-name="Faenza-Ambiance"` to the ...


14

Thunar doesn't actually have a keybinding for changing to the next/previous tab, but instead the underlying GTK control, in this case GtkNotebook, has some key bindings. GtkNotebook defines previous tab as both Ctrl+PageUp and Ctrl+Alt+PageUp (and similarly for next tab/page down); however, in Thunar's case, the Ctrl+PageUp/Ctrl+PageDown keybinding is ...


12

There's only a single line in that particular .css file because the default theme (Adwaita) comes as a binary: Adwaita is a complex theme, so to keep it maintainable it's written and processed in SASS, the generated CSS is then transformed into a gresource file during gtk build and used at runtime in a non-legible or editable form. Since the code has been ...


11

You get the old page-up/down behavior via right-clicking on the scroll bar.


10

The string in Xresources usually looks like this: name.Class.resource: value Looks like you use * in place of name and class: *color0: black Which means you apply color to everything. If you want apply colors to urxvt only: URxvt*color0: black


10

Note: This answer is for GTK3; all other answers only work for GTK2. To disable the recent files list, add the following to ~/.config/gtk-3.0/settings.ini (create it and its directory if needed): [Settings] gtk-recent-files-enabled=0 To pre-select the current working directory, run dconf write /org/gtk/settings/file-chooser/startup-mode \"cwd\" or use a ...


10

For historical reasons, there are two selections¹, with different usage conventions: The PRIMARY selection automatically changes when you highlight some text with the mouse. There is no “copy” command, it's automatic. The CLIPBOARD selection changes only when you issue a “copy” command (keyboard shortcut or icon or menu entry). Classic X11 applications ...


9

Give xdotool (Ubuntu man page) a look. It's extremely powerful and should be able to do whatever you need. http://www.semicomplete.com/projects/xdotool/xdotool.xhtml


9

At least from Meld 3.16.4 support different color schemes. See Meld > Preferences: (possibly this change was introduced in earlier versions) Note: It is also possible to force a specific theme for Meld by CLI: GTK_THEME=Adwaita:dark meld


9

I found the solution after reading https://wiki.archlinux.org/index.php/Uniform_Look_for_Qt_and_GTK_Applications: Qt5 decides the style to use based on what desktop environment is used. If it doesn't recognize the desktop environment, it falls back to a generic style. To force a specific style, you can set the QT_STYLE_OVERRIDE environment variable. ...


8

.gtkrc is the configuration file for Gtk, the GUI library used by GNOME applications and others. Gtk 1.x programs read ~/.gtkrc; Gtk 2.x programs read ~/.gtkrc-2.0. The Gnome settings program may have created one of these files for you. If it hasn't, you can create one yourself. There is some documentation of the syntax and options in the Gtk developer ...


8

@MartinVegter There is a file ~/.config/gtk-2.0/gtkfilechooser.ini. It should look like Stefano wrote: [Filechooser settings] LocationMode=path-bar ShowHidden=false ShowSizeColumn=true GeometryX=377 GeometryY=132 GeometryWidth=612 GeometryHeight=528 SortColumn=name SortOrder=ascending StartupMode=recent There was no DefaultFolder variable in this file, ...


7

Ok the implementation has changed and details can be found in the documentation for the GtkCssProvider class. To use plain default settings, one can now use following: GTK_DATA_PREFIX= gtk3-app


7

I know this is a rather old question, but I wanted to add a more recent answer as I got directed here by Google and had to search for a while to find the answer. As of Firefox 57, you can run in headless mode simply by installing Firefox and running: firefox -headless http://test.com/ See the Firefox dev docs here.


7

Found a solution which works for GTK apps (but not Qt). One needs to set XMODIFIERS="@im=none" to let X11 handle dead keys. Thanks to @PabloSaratxaga for his answer.


7

Unless you are on very old/low spec hardware, running gnome/gtk apps in KDE (or kde/qt apps in GNOME) should not have any noticeable impact on performance. When you're on KDE, qt/kde libs are already loaded in memory, gtk/gnome libs are not. It's only when you fire-up a gtk/gnome app that gtk/gnome libs are loaded, the side effect being a higher memory usage ...


7

VLC media player has been using Qt interface for quite long time. VLC however, has an option to override window style, which will also change the file dialog as well. In VLC media player, do the following steps: Go to Tools > Preferences (or press Ctrl+P) In the first tab, under Interface Settings - Look and feel, look for "Force window style:" with the ...


7

They've added the + when they redesigned the original GTK (the Gimp ToolKit based on Motif) to be object oriented (meaning something like GTK on steriods I guess...) See also wikipedia page on GIMP version history.


6

Here is a bash script I have used to launch a application with a different theme. Haven't used it in years though, so I don't know if it will work with the current GTK. #!/bin/bash # lauch a gtk application with a different theme # set GTKRCFILE variable to your favourite theme GTKRCFILE=Clearlooks GTK2_RC_FILES=/usr/share/themes/"$GTKRCFILE"/gtk-2.0/gtkrc "...


6

You can look at which packages the package manager knows to be dependent on this by using: apt-get remove -s libgtk-3-0 The -s option makes sure this is a simulation so nothing is actually removed.


6

Adding the appropriate directory to your include path is exactly what you're supposed to do in this case, only you're supposed to do it by pkg-config. Accessing the files directly using full pathnames is unsupported. Add something like this to your Makefile: CFLAGS += `pkg-config --cflags gtk+-3.0` LIBS += `pkg-config --libs gtk+-3.0` This will ...


Only top voted, non community-wiki answers of a minimum length are eligible