28

Back in the days of 20.04, we managed to get the Yaru designers to improve the contrast of the ALT+TAB task switcher's selected app just in time for the release.

22.04 is out now and it looks like this has regressed, again...

ALT+TAB on Ubuntu 22.04 - can you tell which app is selected (without reading the caption)?

I admit I'm lucky to work in a bright office but the current contrast (dark gray on black) makes me squint every time I use the thing (and I use a good quality "productivity" monitor).

Hopefully there is a way to improve the contrast by editing some .css file? If this is too hard (really?) I'd be happy to install an extension but don't feel I need to replace the whole UI as suggested here.

sxc731
  • 1,244

4 Answers4

8

I have found the following issue 6907 on gitlab.gnome.org:

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6907

The following code by Chris Heywood does change the dark-gray by the color white:

Prerequisite, the Gnome extension "User Themes" has to be installed.

(open a shell and you don't have to be 'root')

Activation in white:

# Create a theme which only modifies the app switcher CSS
mkdir -p ~/.themes/TempAppSwitcherContrastCludge/gnome-shell
echo ".switcher-list .item-box:selected { background: #f6f5f4; color: #241f31; }" > ~/.themes/TempAppSwitcherContrastCludge/gnome-shell/gnome-shell.css
# Enable user themes shell extension
gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com
# Select the theme
gsettings set org.gnome.shell.extensions.user-theme name TempAppSwitcherContrastCludge

Deactivation:

# Clear theme setting
gsettings set org.gnome.shell.extensions.user-theme name ""
# Disable user themes extension
gnome-extensions disable user-theme@gnome-shell-extensions.gcampax.github.com
# Remove theme
rm -r ~/.themes/TempAppSwitcherContrastCludge

It was tested/activated on 23.10 and it works perfectly! I have also tested the deactivation working correctly.

Chris, if you read me, thanks a lot!

2

Another alternative that doesn't require any "code tweaking" (and works also on Ubuntu 24.04):

Install the gnome shell extension AATWS (Advanced Alt-Tab Window Switcher) and select the AATWS Light mode in the Common -> Appearance and Content -> Color Style settings menu.

Yuvalem
  • 732
1

You can edit the CSS file for your Gnome Shell theme to change the appearance of the alt+taB task switcher. The CSS file can be found in the /usr/share/gnome-shell/theme as well as in your home directory.

  1. Open the file with a text editor:

    nano ~/.config/gtk-3.0/gtk.css
    
  2. Find the lines which resemble with:

    .alt-tab-app-switcher {
        background-color: #333;
    }
    

    .alt-tab-app-switcher .selected { background-color: #555; }

  3. Change the background colour for .alt-tab-app-switcher .selected with a lighter color. For example:

    .alt-tab-app-switcher .selected {
        background-color: #ccc;
    }
    
  4. You can use any CSS color code to set the background color. After making the changes, save the file and restart Gnome Shell (Alt +F2) for the changes to show effect.

    Note: Keep in mind that this is just an example and the actual styles in your CSS file may be different. It's would be a good idea to back up the original CSS file before making any changes.

Note that different Gnome Shell themes might have different styles for the alt+tab task switcher, so you may need to modify the CSS styles accordingly.

Good luck

Error404
  • 8,278
  • 3
  • 35
  • 60
1

I am on Ubuntu 23.04 pretty much vanilla I think, and I couldn't find the token alt-tab-app-switcher either in ~/.themes or in /usr/share/themes.

I'm not sure what's changed, there, but I did find another route. Following this page (not as arduous as it looks, 5-10 minutes work):

  • Installed GNOME shell browser integration
  • Installed User-Themes Extension
  • Download & install Dracula theme under ~/.themes
  • sudo apt-get install gnome-tweaks
  • Log off/in to notice the new themes, I think, may not be necessary
  • Open gnome-tweaks from console of Menu/search/tweaks
  • Go to Appearance, and change 'Shell' (which probably says Default) to Dracula.
  • This theme is now live, and looks similar to the default theme, similar enough that I can't see what's changed.
  • Edit ~/.themes/Dracula*/gnome-shell/gnome-shell.css.

Adjust that file as follows to turn the offending grey box red:

.switcher-list .item-box:selected {
    background-color: red; /*rgba(189, 147, 249, 0.5)*/
    color: #f8f8f2; }

[EDIT] Oh, PS, either switch the theme back and forth in gnome-tweaks or log out/in to effect the color change.