Showing posts with label gala. Show all posts
Showing posts with label gala. Show all posts

Alternative to Gala taskswitcher using Rofi

I kinda hate the default Alt+Tab switcher in Pantheon, so I use Rofi to fix that. This is how to use rofi as Alt+Tab switcher. Make sure you have rofi version 1.6.1 installed for this to work propperly.

Create a new scriptfile called alttab.sh with this content:

#!/usr/bin/env bash
xdotool mousemove 960 540 && rofi -no-config -theme alttab -kb-cancel "Alt+Escape,Escape" -kb-accept-entry '!Alt-Tab,!Alt+Down,!Alt+ISO_Left_Tab,!Alt+Up,Return,!Alt+Alt_L' -kb-row-down 'Alt-Tab,Alt+Down,Down,ISO_Left_Tab' -kb-row-up 'Alt+ISO_Left_Tab,Alt+Up,Up' -show window -selected-row 1 
exit

Now make it executable:

sudo chmod +x ./alttab.sh

Delete default Alt+Tab shortcut in Switchboard -> Keyboard -> Shortcuts -> Windows
Now link to the file you created earlier and assign it to Alt+Tab.

This looks the best using this custom rofi theme I made: https://github.com/RobinBoers/dotfiles/blob/master/.config/rofi/alttab.rasi


Smaller GTK headerbars on non-CSD windows

This is how to make the titlebars on non-CSD windows in Metacity, Marco, Mutter and Gala smaller using gtk.css

This is mostly for themes like Ambiance that were not designed for these window managers.

Put this in ~/.config/gtk-3.0/gtk.css. This makes the headerbars on non-CSD windows smaller to make them look better.

/*
 Decrease the size of head bars for non-CSD applications
 Gnome 20 (Fedora 24) compatible version
 https://unix.stackexchange.com/questions/276951/how-to-change-the-titlebar-height-in-standard-gtk-apps-and-those-with-headerbars
*/

/* x11 and xwayland windows */
window.ssd headerbar.titlebar {
    padding: 4px; 
    padding-right: 5px;
    min-height: 0;
    /* remove border between titlebar and window */
    border: none;
}

window.ssd headerbar.titlebar button.titlebutton {
    padding: 2px;
    min-height: 0;
    min-width: 0;
}


/* native wayland ssd windows */
.default-decoration {
    padding: 4px;
    padding-right: 5px;
    min-height: 0;
    /* remove border between titlebar and window */
    border: none;
}

.default-decoration .titlebutton {
    padding: 2px;
    min-height: 0;
    min-width: 0;
}