Skip to content

Instantly share code, notes, and snippets.

@redmcg
Last active July 3, 2022 22:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redmcg/016bd715a96053aef35c739b931efb89 to your computer and use it in GitHub Desktop.
Save redmcg/016bd715a96053aef35c739b931efb89 to your computer and use it in GitHub Desktop.
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/resize5 "'8x8 1:1 8:8, 2:2 7:7,3:3 6:6,16x16 6:6 10:10'"
# 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
gnome-extensions disable ding@rastersoft.com
if [ $restart -eq 1 ]; then
echo Restarting gnome-shell
killall -HUP gnome-shell &
fi
@redmcg
Copy link
Author

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