Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add 2x2 Workspaces and Unity tiling keyboard shortcuts (i.e. Alt-Ctrl Numpad Direction)
#!/usr/bin/env bash
# gnomeversion=latest force=1 ./gnome-to-more-like-unity.sh
set -e
restart=0
if [ ! -f /usr/local/bin/gnomeshell-extension-manage ]; then
echo Downloading gnomeshell-extension-manage
sudo wget -O /usr/local/bin/gnomeshell-extension-manage "https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/ubuntugnome/gnomeshell-extension-manage"
sudo chmod +x /usr/local/bin/gnomeshell-extension-manage
fi
# gTile
if [ ! -d ~/.local/share/gnome-shell/extensions/gTile@vibou/ ] || [ -n "$force" ]; then
echo Installing gTile
gnomeshell-extension-manage --install --extension-id 28 ${gnomeversion:+--version ${gnomeversion}}
[ -d ~/.local/share/gnome-shell/extensions/gTile@vibou/ ] || exit 1
# configure gTile
dconf write /org/gnome/shell/extensions/gtile/preset-resize-1 "['<Primary><Alt>KP_1']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-2 "['<Primary><Alt>KP_2']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-3 "['<Primary><Alt>KP_3']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-4 "['<Primary><Alt>KP_4']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-5 "['<Primary><Alt>KP_5']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-6 "['<Primary><Alt>KP_6']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-7 "['<Primary><Alt>KP_7']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-8 "['<Primary><Alt>KP_8']"
dconf write /org/gnome/shell/extensions/gtile/preset-resize-9 "['<Primary><Alt>KP_9']"
dconf write /org/gnome/shell/extensions/gtile/resize4 "'2x2 0:0 0:1'"
dconf write /org/gnome/shell/extensions/gtile/resize5 "'2x2 0:0 1:1'"
dconf write /org/gnome/shell/extensions/gtile/resize6 "'2x2 1:0 1:1'"
# turn off edge-tiling (optional)
dconf write /org/gnome/mutter/edge-tiling false
restart=1
fi
# Dash to Dock
# no longer installing Dash to Dock, as Ubuntu 20.04 has a built in version. But we'll still configure it
if [[ $(dconf read /org/gnome/shell/extensions/dash-to-dock/click-action) != "'previews'" ]]; then
# configure Dash to Dock
echo Configuring Dash to Dock
dconf write /org/gnome/shell/extensions/dash-to-dock/click-action "'previews'"
dconf write /org/gnome/shell/extensions/dash-to-dock/dock-fixed true
dconf write /org/gnome/shell/extensions/dash-to-dock/extend-height true
dconf write /org/gnome/shell/extensions/dash-to-dock/isolate-workspaces true
dconf write /org/gnome/shell/extensions/dash-to-dock/running-indicator-style "'DOTS'"
dconf write /org/gnome/shell/extensions/dash-to-dock/show-trash false
dconf write /org/gnome/shell/extensions/dash-to-dock/show-mounts false
restart=1
fi
# Sound Input & Output Device Chooser
if [ ! -d ~/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ ] || [ -n "$force" ]; then
echo Installing Sound Output Device Chooser
gnomeshell-extension-manage --install --extension-id 906 ${gnomeversion:+--version ${gnomeversion}}
[ -d ~/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ ] || exit 1
fi
# Desktop Icons
dconf write /org/gnome/shell/extensions/desktop-icons/show-home false
dconf write /org/gnome/shell/extensions/desktop-icons/show-trash false
dconf write /org/gnome/shell/extensions/desktop-icons/show-mount false
if [ $restart -eq 1 ]; then
echo Restarting gnome-shell
killall -HUP gnome-shell &
fi
@redmcg

This comment has been minimized.

Copy link
Owner Author

@redmcg redmcg commented Apr 29, 2018

Ubuntu 18.04 uses Gnome version 3.28. These extensions don't currently have a "candidate extension" for 3.28 - so the workaround is to manually request the extension for gnome version 3.26. Example:
gnomeversion=3.26 ./gnome-to-more-like-unity.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment