Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Enable open in terminal option for elementaryOS file manager

This is how to add an "Open terminal here" entry to the eOS file manager.

Create /usr/share/contractors/openinterminal.contract with these contents:

[Contractor Entry]
Name=Open terminal here
Icon=terminal
Description=Open terminal here
MimeType=inode;application/x-sh;application/x-executable;
Exec=io.elementary.terminal -w %U
Gettext-Domain=io.elementary.terminal

Restart the terminal, and voilla!




Missing depedencies when installing rofi from source on Ubuntu

When installing rofi 1.6.1 from source on Ubuntu, there are some missing dependencies. To install those, enter this command:


sudo apt install libxcb-xkb-dev libxcb-ewmh-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-xinerama0-dev libxcb-xrm-dev build-essential cmake extra-cmake-modules xcb

The check version in the default repos is also outdated, so you need to compile that from source too.


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



Assign Rofi to super key in Pantheon

I'm used to use the super key to search, because I used Windows for a long time, so I like to assign Rofi to the super key.

gsettings set org.gnome.mutter overlay-key "'Super_L'"
gsettings set org.pantheon.desktop.gala.behavior overlay-action "rofi -show drun"
You can use any launcher. In this example I'm using Albert:
gsettings set org.gnome.mutter overlay-key "'Super_L'"
gsettings set org.pantheon.desktop.gala.behavior overlay-action "albert"

Enable tray indicators in Pantheon

Some apps use the old system tray. To view them in the elementaryOS tray edit /etc/xdg/autostart/indicator-application.desktop and change this line:

OnlyShowIn=Unity;GNOME;
to
OnlyShowIn=Unity;GNOME;Pantheon;

Now install the old panel indicator from launchpad.net:
http://ppa.launchpad.net/elementary-os/stable/ubuntu/pool/main/w/wingpanel-indicator-ayatana

After relog you should be able to see the icons in wingpanel.





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;
}